summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sltv/Makefile.am3
-rw-r--r--sltv/audioinputbin.py47
2 files changed, 49 insertions, 1 deletions
diff --git a/sltv/Makefile.am b/sltv/Makefile.am
index fbf5812..02f6b14 100644
--- a/sltv/Makefile.am
+++ b/sltv/Makefile.am
@@ -22,7 +22,8 @@ sltvlib_DATA = \
utils.py \
metadata.py \
multeequeue.py \
- outputbin.py
+ outputbin.py \
+ audioinputbin.py
EXTRA_DIST = $(sltvlib_DATA)
diff --git a/sltv/audioinputbin.py b/sltv/audioinputbin.py
new file mode 100644
index 0000000..b1b51ce
--- /dev/null
+++ b/sltv/audioinputbin.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2010 Holoscópio Tecnologia
+# Author: Luciana Fujii Pontello <luciana@holoscopio.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import pygst
+pygst.require("0.10")
+import gst
+
+class AudioInputBin(gst.Bin):
+
+ def __init__(self, audio_input):
+ gst.Bin.__init__(self)
+
+ self.queue = gst.element_factory_make(
+ "queue", "queue_audio"
+ )
+ self.add(self.queue)
+
+ self.audioresample = audio_input.parent.create()
+ self.add(self.audioresample)
+
+ gst.element_link_many(
+ self.queue, self.audioresample
+ )
+
+ self.sink_pad = gst.GhostPad(
+ "sink", self.queue.sink_pads().next()
+ )
+ self.src_pad = gst.GhostPad(
+ "src", self.audioresample.src_pads().next()
+ )
+ self.add_pad(self.src_pad)
+ self.add_pad(self.sink_pad)