gstdepay: check for correct fragment offset
[platform/upstream/gstreamer.git] / gst / rtp / gstrtpgsmdepay.c
index 298708a..5702536 100644 (file)
@@ -57,34 +57,34 @@ static GstStaticPadTemplate gst_rtp_gsm_depay_sink_template =
         "clock-rate = (int) 8000")
     );
 
-static GstBuffer *gst_rtp_gsm_depay_process (GstBaseRTPDepayload * _depayload,
+static GstBuffer *gst_rtp_gsm_depay_process (GstRTPBaseDepayload * _depayload,
     GstBuffer * buf);
-static gboolean gst_rtp_gsm_depay_setcaps (GstBaseRTPDepayload * _depayload,
+static gboolean gst_rtp_gsm_depay_setcaps (GstRTPBaseDepayload * _depayload,
     GstCaps * caps);
 
 #define gst_rtp_gsm_depay_parent_class parent_class
-G_DEFINE_TYPE (GstRTPGSMDepay, gst_rtp_gsm_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
+G_DEFINE_TYPE (GstRTPGSMDepay, gst_rtp_gsm_depay, GST_TYPE_RTP_BASE_DEPAYLOAD);
 
 static void
 gst_rtp_gsm_depay_class_init (GstRTPGSMDepayClass * klass)
 {
   GstElementClass *gstelement_class;
-  GstBaseRTPDepayloadClass *gstbasertp_depayload_class;
+  GstRTPBaseDepayloadClass *gstrtpbase_depayload_class;
 
   gstelement_class = (GstElementClass *) klass;
-  gstbasertp_depayload_class = (GstBaseRTPDepayloadClass *) klass;
+  gstrtpbase_depayload_class = (GstRTPBaseDepayloadClass *) klass;
 
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&gst_rtp_gsm_depay_src_template));
   gst_element_class_add_pad_template (gstelement_class,
       gst_static_pad_template_get (&gst_rtp_gsm_depay_sink_template));
 
-  gst_element_class_set_details_simple (gstelement_class, "RTP GSM depayloader",
-      "Codec/Depayloader/Network/RTP",
+  gst_element_class_set_static_metadata (gstelement_class,
+      "RTP GSM depayloader", "Codec/Depayloader/Network/RTP",
       "Extracts GSM audio from RTP packets", "Zeeshan Ali <zeenix@gmail.com>");
 
-  gstbasertp_depayload_class->process = gst_rtp_gsm_depay_process;
-  gstbasertp_depayload_class->set_caps = gst_rtp_gsm_depay_setcaps;
+  gstrtpbase_depayload_class->process = gst_rtp_gsm_depay_process;
+  gstrtpbase_depayload_class->set_caps = gst_rtp_gsm_depay_setcaps;
 
   GST_DEBUG_CATEGORY_INIT (rtpgsmdepay_debug, "rtpgsmdepay", 0,
       "GSM Audio RTP Depayloader");
@@ -96,7 +96,7 @@ gst_rtp_gsm_depay_init (GstRTPGSMDepay * rtpgsmdepay)
 }
 
 static gboolean
-gst_rtp_gsm_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
+gst_rtp_gsm_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
 {
   GstCaps *srccaps;
   gboolean ret;
@@ -111,14 +111,14 @@ gst_rtp_gsm_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
 
   srccaps = gst_caps_new_simple ("audio/x-gsm",
       "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, clock_rate, NULL);
-  ret = gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps);
+  ret = gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (depayload), srccaps);
   gst_caps_unref (srccaps);
 
   return ret;
 }
 
 static GstBuffer *
-gst_rtp_gsm_depay_process (GstBaseRTPDepayload * _depayload, GstBuffer * buf)
+gst_rtp_gsm_depay_process (GstRTPBaseDepayload * _depayload, GstBuffer * buf)
 {
   GstBuffer *outbuf = NULL;
   gboolean marker;
@@ -128,7 +128,7 @@ gst_rtp_gsm_depay_process (GstBaseRTPDepayload * _depayload, GstBuffer * buf)
 
   marker = gst_rtp_buffer_get_marker (&rtp);
 
-  GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
+  GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
       gst_buffer_get_size (buf), marker,
       gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));