summaryrefslogtreecommitdiffstats
path: root/gst/rtp/gstrtpamrdepay.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-09-26 14:44:49 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-09-26 14:44:49 +0000
commitb17599a297fcb5d15a7f871e4ef3230d12b9f024 (patch)
tree845ca5c65e78f9eb238a5034aeb0ef556e0d4c46 /gst/rtp/gstrtpamrdepay.c
parentc77bfaacb42b785cd1ac1b5c9e4af8bfb9f1691a (diff)
gst/rtp/gstrtpamrdepay.c: Mark DISCONT on output buffers when the marker bit signals a new talk spurt.
Original commit message from CVS: * gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_class_init), (gst_rtp_amr_depay_process): Mark DISCONT on output buffers when the marker bit signals a new talk spurt. * gst/rtp/gstrtpamrpay.c: (gst_rtp_amr_pay_handle_buffer): Set the marker bit for buffers with a DISCONT flag to signal a talk spurt.
Diffstat (limited to 'gst/rtp/gstrtpamrdepay.c')
-rw-r--r--gst/rtp/gstrtpamrdepay.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gst/rtp/gstrtpamrdepay.c b/gst/rtp/gstrtpamrdepay.c
index 1694b168..94291163 100644
--- a/gst/rtp/gstrtpamrdepay.c
+++ b/gst/rtp/gstrtpamrdepay.c
@@ -27,6 +27,9 @@
#include <string.h>
#include "gstrtpamrdepay.h"
+GST_DEBUG_CATEGORY_STATIC (rtpamrdepay_debug);
+#define GST_CAT_DEFAULT (rtpamrdepay_debug)
+
/* references:
*
* RFC 3267 - Real-Time Transport Protocol (RTP) Payload Format and File
@@ -146,6 +149,9 @@ gst_rtp_amr_depay_class_init (GstRtpAMRDepayClass * klass)
gstbasertpdepayload_class->process = gst_rtp_amr_depay_process;
gstbasertpdepayload_class->set_caps = gst_rtp_amr_depay_setcaps;
+
+ GST_DEBUG_CATEGORY_INIT (rtpamrdepay_debug, "rtpamrdepay", 0,
+ "AMR/AMR-WB RTP Depayloader");
}
static void
@@ -304,7 +310,9 @@ gst_rtp_amr_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
gint i, num_packets, num_nonempty_packets;
gint amr_len;
gint ILL, ILP;
+ gboolean marker;
+ marker = gst_rtp_buffer_get_marker (buf);
payload_len = gst_rtp_buffer_get_payload_len (buf);
/* need at least 2 bytes for the header */
@@ -412,10 +420,17 @@ gst_rtp_amr_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
/* we can set the duration because each packet is 20 milliseconds */
GST_BUFFER_DURATION (outbuf) = num_packets * 20 * GST_MSECOND;
+ if (marker) {
+ /* marker bit marks a discont buffer */
+ GST_DEBUG_OBJECT (depayload, "marker bit was set");
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+ marker = FALSE;
+ }
+
gst_buffer_set_caps (outbuf,
GST_PAD_CAPS (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload)));
- GST_DEBUG ("gst_rtp_amr_depay_chain: pushing buffer of size %d",
+ GST_DEBUG_OBJECT (depayload, "pushing buffer of size %d",
GST_BUFFER_SIZE (outbuf));
}
return outbuf;