[0.11] gst-plugins-bad: dtmf: Use new-style caps

Olivier Crête tester at kemper.freedesktop.org
Sat Jan 28 08:57:26 PST 2012


Module: gst-plugins-bad
Branch: 0.11
Commit: 83118f5d82f36b030908078fbe9470a90b82204b
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=83118f5d82f36b030908078fbe9470a90b82204b

Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Fri Jan 27 12:07:43 2012 +0100

dtmf: Use new-style caps

---

 gst/dtmf/gstdtmfdetect.c   |   24 +++++++++++++-----------
 gst/dtmf/gstdtmfsrc.c      |   10 +++++-----
 gst/dtmf/gstrtpdtmfdepay.c |   13 ++++++-------
 3 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/gst/dtmf/gstdtmfdetect.c b/gst/dtmf/gstdtmfdetect.c
index 0370285..073959e 100644
--- a/gst/dtmf/gstdtmfdetect.c
+++ b/gst/dtmf/gstdtmfdetect.c
@@ -64,26 +64,27 @@
 
 #include <string.h>
 
+#include <gst/audio/audio.h>
+
 GST_DEBUG_CATEGORY (dtmf_detect_debug);
 #define GST_CAT_DEFAULT (dtmf_detect_debug)
 
 static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-raw-int, "
-        "width = (int) 16, "
-        "depth = (int) 16, "
-        "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", "
-        "signed = (bool) true, rate = (int) 8000, channels = (int) 1"));
+    GST_STATIC_CAPS ("audio/x-raw, "
+        "format = (string) \"" GST_AUDIO_NE (S16) "\", "
+        "rate = (int) 8000, " "channels = (int) 1")
+    );
+
 
 static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-raw-int, "
-        "width = (int) 16, "
-        "depth = (int) 16, "
-        "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", "
-        "signed = (bool) true, rate = (int) 8000, channels = (int) 1"));
+    GST_STATIC_CAPS ("audio/x-raw, "
+        "format = (string) \"" GST_AUDIO_NE (S16) "\", "
+        "rate = (int) 8000, " "channels = (int) 1")
+    );
 
 /* signals and args */
 enum
@@ -266,7 +267,8 @@ gst_dtmf_detect_sink_event (GstBaseTransform * trans, GstEvent * event)
       break;
   }
 
-  return GST_BASE_TRANSFORM_GET_CLASS (trans)->sink_event (trans, event);
+  return GST_BASE_TRANSFORM_CLASS (gst_dtmf_detect_parent_class)->sink_event
+      (trans, event);
 }
 
 
diff --git a/gst/dtmf/gstdtmfsrc.c b/gst/dtmf/gstdtmfsrc.c
index d59fa1c..c7b4945 100644
--- a/gst/dtmf/gstdtmfsrc.c
+++ b/gst/dtmf/gstdtmfsrc.c
@@ -132,6 +132,8 @@
 
 #include "gstdtmfsrc.h"
 
+#include <gst/audio/audio.h>
+
 #define GST_TONE_DTMF_TYPE_EVENT 1
 #define DEFAULT_PACKET_INTERVAL  50     /* ms */
 #define MIN_PACKET_INTERVAL      10     /* ms */
@@ -204,11 +206,9 @@ static GstStaticPadTemplate gst_dtmf_src_template =
 GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-raw-int, "
-        "width = (int) 16, "
-        "depth = (int) 16, "
-        "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", "
-        "signed = (bool) true, rate = (int) [1, MAX], channels = (int) 1")
+    GST_STATIC_CAPS ("audio/x-raw, "
+        "format = (string) \"" GST_AUDIO_NE (S16) "\", "
+        "rate = " GST_AUDIO_RATE_RANGE ", " "channels = (int) 1")
     );
 
 G_DEFINE_TYPE (GstDTMFSrc, gst_dtmf_src, GST_TYPE_BASE_SRC);
diff --git a/gst/dtmf/gstrtpdtmfdepay.c b/gst/dtmf/gstrtpdtmfdepay.c
index 01a1698..db4d6fb 100644
--- a/gst/dtmf/gstrtpdtmfdepay.c
+++ b/gst/dtmf/gstrtpdtmfdepay.c
@@ -84,11 +84,13 @@
 #include "config.h"
 #endif
 
+#include "gstrtpdtmfdepay.h"
+
 #include <string.h>
 #include <math.h>
 
+#include <gst/audio/audio.h>
 #include <gst/rtp/gstrtpbuffer.h>
-#include "gstrtpdtmfdepay.h"
 
 #define DEFAULT_PACKET_INTERVAL  50     /* ms */
 #define MIN_PACKET_INTERVAL      10     /* ms */
@@ -180,12 +182,9 @@ static GstStaticPadTemplate gst_rtp_dtmf_depay_src_template =
 GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-raw-int, "
-        "width = (int) 16, "
-        "depth = (int) 16, "
-        "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", "
-        "signed = (boolean) true, "
-        "rate = (int) [0, MAX], " "channels = (int) 1")
+    GST_STATIC_CAPS ("audio/x-raw, "
+        "format = (string) \"" GST_AUDIO_NE (S16) "\", "
+        "rate = " GST_AUDIO_RATE_RANGE ", " "channels = (int) 1")
     );
 
 static GstStaticPadTemplate gst_rtp_dtmf_depay_sink_template =



More information about the gstreamer-commits mailing list