Skip to content

Commit

Permalink
make it easier to tweak the appsink settings without doing a rebuild:…
Browse files Browse the repository at this point in the history
… add XPRA_SOURCE_APPSINK env var for that

git-svn-id: https://xpra.org/svn/Xpra/trunk@9529 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 27, 2015
1 parent e373849 commit 21bbd0d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/xpra/sound/src.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.

import os
import sys
import time

Expand All @@ -15,6 +16,8 @@
from xpra.log import Logger
log = Logger("sound")

APPSINK = os.environ.get("XPRA_SOURCE_APPSINK", "appsink name=sink emit-signals=true max-buffers=10 drop=true sync=false async=false qos=false")


class SoundSource(SoundPipeline):

Expand Down Expand Up @@ -56,16 +59,10 @@ def __init__(self, src_type=None, src_options={}, codecs=CODECS, codec_options={
pipeline_els.append("volume name=volume volume=%s" % volume)
pipeline_els += [encoder_str,
fmt,
"appsink name=sink"]
APPSINK]
self.setup_pipeline_and_bus(pipeline_els)
self.volume = self.pipeline.get_by_name("volume")
self.sink = self.pipeline.get_by_name("sink")
self.sink.set_property("emit-signals", True)
self.sink.set_property("max-buffers", 10)
self.sink.set_property("drop", True)
self.sink.set_property("sync", False)
self.sink.set_property("async", False)
self.sink.set_property("qos", False)
try:
#Gst 1.0:
self.sink.connect("new-sample", self.on_new_sample)
Expand Down

0 comments on commit 21bbd0d

Please sign in to comment.