[0.11] gst-plugins-base: vorbis: Use new audio encoder/ decoder base class API for srcpad caps

Sebastian Dröge slomo at kemper.freedesktop.org
Wed Feb 1 07:27:52 PST 2012


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

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Wed Feb  1 16:04:03 2012 +0100

vorbis: Use new audio encoder/decoder base class API for srcpad caps

---

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

diff --git a/ext/vorbis/gstvorbisdec.c b/ext/vorbis/gstvorbisdec.c
index 8c5a328..48f318b 100644
--- a/ext/vorbis/gstvorbisdec.c
+++ b/ext/vorbis/gstvorbisdec.c
@@ -226,7 +226,6 @@ convert_error:
 static GstFlowReturn
 vorbis_handle_identification_packet (GstVorbisDec * vd)
 {
-  GstCaps *caps;
   GstAudioInfo info;
 
   switch (vd->vi.channels) {
@@ -260,9 +259,7 @@ vorbis_handle_identification_packet (GstVorbisDec * vd)
     }
   }
 
-  caps = gst_audio_info_to_caps (&info);
-  gst_audio_decoder_set_outcaps (GST_AUDIO_DECODER (vd), caps);
-  gst_caps_unref (caps);
+  gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (vd), &info);
 
   vd->info = info;
   /* select a copy_samples function, this way we can have specialized versions
diff --git a/ext/vorbis/gstvorbisenc.c b/ext/vorbis/gstvorbisenc.c
index 91ace3b..5162b92 100644
--- a/ext/vorbis/gstvorbisenc.c
+++ b/ext/vorbis/gstvorbisenc.c
@@ -733,7 +733,7 @@ gst_vorbis_enc_handle_frame (GstAudioEncoder * enc, GstBuffer * buffer)
 
     /* negotiate with these caps */
     GST_DEBUG_OBJECT (vorbisenc, "here are the caps: %" GST_PTR_FORMAT, caps);
-    gst_pad_set_caps (GST_AUDIO_ENCODER_SRC_PAD (vorbisenc), caps);
+    gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (vorbisenc), caps);
     gst_caps_unref (caps);
 
     /* store buffers for later pre_push sending */



More information about the gstreamer-commits mailing list