[0.11] gst-plugins-base: vorbisenc: Add samplerate and channels to the srcpad caps

Sebastian Dröge slomo at kemper.freedesktop.org
Thu Jan 26 02:01:27 PST 2012


Module: gst-plugins-base
Branch: 0.11
Commit: 1f37f9f41d1992325649165b9caf00066e14f942
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=1f37f9f41d1992325649165b9caf00066e14f942

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Thu Jan 26 11:01:12 2012 +0100

vorbisenc: Add samplerate and channels to the srcpad caps

---

 ext/vorbis/gstvorbisenc.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ext/vorbis/gstvorbisenc.c b/ext/vorbis/gstvorbisenc.c
index caf249e..0e4156c 100644
--- a/ext/vorbis/gstvorbisenc.c
+++ b/ext/vorbis/gstvorbisenc.c
@@ -72,7 +72,8 @@ static GstStaticPadTemplate vorbis_enc_src_factory =
 GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-vorbis")
+    GST_STATIC_CAPS ("audio/x-vorbis, "
+        "rate = (int) [ 1, 200000 ], " "channels = (int) [ 1, 255 ]")
     );
 
 enum
@@ -724,7 +725,9 @@ gst_vorbis_enc_handle_frame (GstAudioEncoder * enc, GstBuffer * buffer)
     buf3 = gst_vorbis_enc_buffer_from_header_packet (vorbisenc, &header_code);
 
     /* mark and put on caps */
-    caps = gst_caps_new_empty_simple ("audio/x-vorbis");
+    caps = gst_caps_new_simple ("audio/x-vorbis",
+        "rate", G_TYPE_INT, vorbisenc->frequency,
+        "channels", G_TYPE_INT, vorbisenc->channels, NULL);
     caps = _gst_caps_set_buffer_array (caps, "streamheader",
         buf1, buf2, buf3, NULL);
 



More information about the gstreamer-commits mailing list