use new style caps
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 5 Mar 2012 11:03:23 +0000 (12:03 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 5 Mar 2012 11:03:23 +0000 (12:03 +0100)
ext/mplex/Makefile.am
ext/mplex/gstmplex.cc
gst/camerabin2/gstviewfinderbin.c

index 741b0d8..84243ff 100644 (file)
@@ -9,7 +9,8 @@ libgstmplex_la_SOURCES = \
 libgstmplex_la_CXXFLAGS = \
        $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) $(MPLEX_CFLAGS)
 libgstmplex_la_LIBADD = \
-       $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(MPLEX_LIBS)
+       $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) \
+       $(GST_LIBS) $(MPLEX_LIBS) 
 libgstmplex_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(MPLEX_LDFLAGS)
 libgstmplex_la_LIBTOOLFLAGS = --tag=disable-static
 
index 2c9328d..ba461e6 100644 (file)
@@ -54,6 +54,8 @@
 #include <string.h>
 
 #include <gst/glib-compat-private.h>
+#include <gst/audio/audio.h>
+
 #include "gstmplex.hh"
 #include "gstmplexoutputstream.hh"
 #include "gstmplexibitstream.hh"
@@ -93,11 +95,8 @@ static GstStaticPadTemplate audio_sink_templ =
         "audio/x-ac3, "
         COMMON_AUDIO_CAPS "; "
         "audio/x-dts; "
-        "audio/x-raw-int, "
-        "endianness = (int) BIG_ENDIAN, "
-        "signed = (boolean) TRUE, "
-        "width = (int) { 16, 20, 24 }, "
-        "depth = (int) { 16, 20, 24 }, "
+        "audio/x-raw, "
+        "format = (string) { S16BE, S20BE, S24BE }, "
         "rate = (int) { 48000, 96000 }, " "channels = (int) [ 1, 6 ]")
     );
 
@@ -324,20 +323,22 @@ gst_mplex_setcaps (GstPad * pad, GstCaps * caps)
       type = AC3_AUDIO;
     } else if (!strcmp (mime, "audio/x-dts")) {
       type = DTS_AUDIO;
-    } else if (!strcmp (mime, "audio/x-raw-int")) {
+    } else if (!strcmp (mime, "audio/x-raw")) {
       LpcmParams *params;
       gint bits, chans, rate;
-      gboolean result = TRUE;
+      GstAudioInfo info;
 
       type = LPCM_AUDIO;
 
-      /* set LPCM params */
-      result &= gst_structure_get_int (structure, "depth", &bits);
-      result &= gst_structure_get_int (structure, "rate", &rate);
-      result &= gst_structure_get_int (structure, "channels", &chans);
-      if (!result)
+      gst_audio_info_init (&info);
+      if (!gst_audio_info_from_caps (&info, caps))
         goto refuse_caps;
 
+      rate = GST_AUDIO_INFO_RATE (&info);
+      chans = GST_AUDIO_INFO_CHANNELS (&info);
+      bits = GST_AUDIO_INFO_DEPTH (&info);
+
+      /* set LPCM params */
       params = LpcmParams::Checked (rate, chans, bits);
 
       mplex->job->lpcm_param.push_back (params);
index 90c78d5..1f87eb9 100644 (file)
@@ -57,7 +57,7 @@ enum
 static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb")
+    GST_STATIC_CAPS ("video/x-raw")
     );
 
 /* class initialization */