2005-07-14 10:29:30 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2005> Philippe Khalaf <burger@speedy.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "gstbasertpdepayload.h"
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY (basertpdepayload_debug);
|
|
|
|
#define GST_CAT_DEFAULT (basertpdepayload_debug)
|
|
|
|
|
|
|
|
/* Filter signals and args */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_0,
|
|
|
|
ARG_PROCESS_ONLY,
|
|
|
|
ARG_QUEUEDELAY,
|
|
|
|
};
|
|
|
|
|
|
|
|
static GstElementClass *parent_class = NULL;
|
|
|
|
|
|
|
|
static void gst_base_rtp_depayload_base_init (GstBaseRTPDepayloadClass * klass);
|
|
|
|
static void gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass *
|
|
|
|
klass);
|
|
|
|
static void gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter,
|
|
|
|
gpointer g_class);
|
|
|
|
|
2005-08-10 20:52:37 +00:00
|
|
|
static void gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter,
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GstBuffer * rtp_buf);
|
2005-08-10 20:52:37 +00:00
|
|
|
|
2005-07-14 10:29:30 +00:00
|
|
|
GType
|
|
|
|
gst_base_rtp_depayload_get_type (void)
|
|
|
|
{
|
|
|
|
static GType plugin_type = 0;
|
|
|
|
|
|
|
|
if (!plugin_type) {
|
|
|
|
static const GTypeInfo plugin_info = {
|
|
|
|
sizeof (GstBaseRTPDepayloadClass),
|
|
|
|
(GBaseInitFunc) gst_base_rtp_depayload_base_init,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_base_rtp_depayload_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstBaseRTPDepayload),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_base_rtp_depayload_init,
|
|
|
|
};
|
|
|
|
plugin_type = g_type_register_static (GST_TYPE_ELEMENT,
|
|
|
|
"GstBaseRTPDepayload", &plugin_info, 0);
|
|
|
|
}
|
|
|
|
return plugin_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gst_base_rtp_depayload_finalize (GObject * object);
|
|
|
|
static void gst_base_rtp_depayload_set_property (GObject * object,
|
|
|
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_base_rtp_depayload_get_property (GObject * object,
|
|
|
|
guint prop_id, GValue * value, GParamSpec * pspec);
|
|
|
|
|
|
|
|
static gboolean gst_base_rtp_depayload_setcaps (GstPad * pad, GstCaps * caps);
|
|
|
|
|
|
|
|
static GstFlowReturn gst_base_rtp_depayload_chain (GstPad * pad,
|
|
|
|
GstBuffer * in);
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement *
|
|
|
|
element, GstStateChange transition);
|
2005-08-12 13:34:56 +00:00
|
|
|
static GstFlowReturn gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload *
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
filter, GstBuffer * in);
|
2005-08-10 20:52:37 +00:00
|
|
|
|
|
|
|
static void gst_base_rtp_depayload_set_gst_timestamp
|
|
|
|
(GstBaseRTPDepayload * filter, guint32 timestamp, GstBuffer * buf);
|
2005-07-14 10:29:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_base_init (GstBaseRTPDepayloadClass * klass)
|
|
|
|
{
|
2005-10-26 13:52:42 +00:00
|
|
|
/*GstElementClass *element_class = GST_ELEMENT_CLASS (klass); */
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
2005-08-12 13:34:56 +00:00
|
|
|
GstElementClass *gstelement_class;
|
2005-07-14 10:29:30 +00:00
|
|
|
|
|
|
|
gobject_class = G_OBJECT_CLASS (klass);
|
2005-08-12 13:34:56 +00:00
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2005-07-14 10:29:30 +00:00
|
|
|
|
|
|
|
gobject_class->set_property = gst_base_rtp_depayload_set_property;
|
|
|
|
gobject_class->get_property = gst_base_rtp_depayload_get_property;
|
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class, ARG_QUEUEDELAY,
|
|
|
|
g_param_spec_uint ("queue_delay", "Queue Delay",
|
|
|
|
"Amount of ms to queue/buffer", 0, G_MAXUINT, 0, G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class, ARG_PROCESS_ONLY,
|
|
|
|
g_param_spec_boolean ("process_only", "Process Only",
|
|
|
|
"Directly send packets to processing", FALSE, G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
gobject_class->finalize = gst_base_rtp_depayload_finalize;
|
|
|
|
|
2005-08-12 13:34:56 +00:00
|
|
|
gstelement_class->change_state = gst_base_rtp_depayload_change_state;
|
|
|
|
|
2005-07-14 10:29:30 +00:00
|
|
|
klass->add_to_queue = gst_base_rtp_depayload_add_to_queue;
|
2005-08-10 20:52:37 +00:00
|
|
|
klass->set_gst_timestamp = gst_base_rtp_depayload_set_gst_timestamp;
|
2005-07-14 10:29:30 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (basertpdepayload_debug, "basertpdepayload", 0,
|
|
|
|
"Base class for RTP Depayloaders");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter, gpointer g_class)
|
|
|
|
{
|
|
|
|
GstPadTemplate *pad_template;
|
|
|
|
|
|
|
|
GST_DEBUG ("gst_base_rtp_depayload_init");
|
|
|
|
|
|
|
|
pad_template =
|
|
|
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
|
|
|
|
g_return_if_fail (pad_template != NULL);
|
|
|
|
filter->sinkpad = gst_pad_new_from_template (pad_template, "sink");
|
|
|
|
gst_pad_set_setcaps_function (filter->sinkpad,
|
|
|
|
gst_base_rtp_depayload_setcaps);
|
|
|
|
gst_pad_set_chain_function (filter->sinkpad, gst_base_rtp_depayload_chain);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
|
|
|
|
|
|
|
|
pad_template =
|
|
|
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "src");
|
|
|
|
g_return_if_fail (pad_template != NULL);
|
|
|
|
filter->srcpad = gst_pad_new_from_template (pad_template, "src");
|
|
|
|
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* create out queue */
|
2005-07-14 10:29:30 +00:00
|
|
|
filter->queue = g_queue_new ();
|
|
|
|
|
|
|
|
filter->queue_delay = RTP_QUEUEDELAY;
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* init queue mutex */
|
2005-08-12 13:34:56 +00:00
|
|
|
QUEUE_LOCK_INIT (filter);
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* this one needs to be overwritten by child */
|
2005-07-14 10:29:30 +00:00
|
|
|
filter->clock_rate = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_finalize (GObject * object)
|
|
|
|
{
|
2005-10-26 13:52:42 +00:00
|
|
|
/* free our queue */
|
2005-07-14 10:29:30 +00:00
|
|
|
g_queue_free (GST_BASE_RTP_DEPAYLOAD (object)->queue);
|
2005-10-25 17:20:55 +00:00
|
|
|
|
|
|
|
if (G_OBJECT_CLASS (parent_class)->finalize)
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_base_rtp_depayload_setcaps (GstPad * pad, GstCaps * caps)
|
|
|
|
{
|
|
|
|
GstBaseRTPDepayload *filter;
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* GstStructure *structure;
|
|
|
|
int ret;*/
|
2005-07-14 10:29:30 +00:00
|
|
|
|
|
|
|
filter = GST_BASE_RTP_DEPAYLOAD (gst_pad_get_parent (pad));
|
|
|
|
g_return_val_if_fail (filter != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (filter), FALSE);
|
|
|
|
|
|
|
|
/*
|
|
|
|
structure = gst_caps_get_structure( caps, 0 );
|
|
|
|
ret = gst_structure_get_int( structure, "clock_rate", &filter->clock_rate );
|
|
|
|
if (!ret) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
GstBaseRTPDepayloadClass *bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
|
|
|
|
|
|
|
if (bclass->set_caps)
|
|
|
|
return bclass->set_caps (filter, caps);
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
|
|
|
|
{
|
|
|
|
GstBaseRTPDepayload *filter;
|
check/pipelines/simple_launch_lines.c: Fix for bus API.
Original commit message from CVS:
* check/pipelines/simple_launch_lines.c: (run_pipeline):
Fix for bus API.
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_set_gst_timestamp),
(gst_base_rtp_depayload_queue_release):
Some cleanups.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
Added debugging category.
2005-09-19 11:24:46 +00:00
|
|
|
GstBaseRTPDepayloadClass *bclass;
|
2005-07-14 10:29:30 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
|
|
|
|
|
|
|
filter = GST_BASE_RTP_DEPAYLOAD (GST_OBJECT_PARENT (pad));
|
|
|
|
|
|
|
|
g_return_val_if_fail (filter->clock_rate > 0, GST_FLOW_ERROR);
|
|
|
|
|
check/pipelines/simple_launch_lines.c: Fix for bus API.
Original commit message from CVS:
* check/pipelines/simple_launch_lines.c: (run_pipeline):
Fix for bus API.
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_set_gst_timestamp),
(gst_base_rtp_depayload_queue_release):
Some cleanups.
* gst-libs/gst/rtp/gstbasertppayload.c:
(gst_basertppayload_class_init), (gst_basertppayload_init),
(gst_basertppayload_setcaps), (gst_basertppayload_set_options),
(gst_basertppayload_set_outcaps), (gst_basertppayload_push),
(gst_basertppayload_get_property),
(gst_basertppayload_change_state):
Added debugging category.
2005-09-19 11:24:46 +00:00
|
|
|
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
2005-07-14 10:29:30 +00:00
|
|
|
|
|
|
|
if (filter->process_only) {
|
2005-08-10 20:52:37 +00:00
|
|
|
GST_DEBUG ("Pushing directly!");
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
gst_base_rtp_depayload_push (filter, in);
|
2005-07-14 10:29:30 +00:00
|
|
|
} else {
|
|
|
|
if (bclass->add_to_queue)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
ret = bclass->add_to_queue (filter, in);
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter,
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GstBuffer * in)
|
2005-07-14 10:29:30 +00:00
|
|
|
{
|
|
|
|
GQueue *queue = filter->queue;
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* our first packet, just push it */
|
2005-08-12 13:34:56 +00:00
|
|
|
QUEUE_LOCK (filter);
|
2005-07-14 10:29:30 +00:00
|
|
|
if (g_queue_is_empty (queue)) {
|
|
|
|
g_queue_push_tail (queue, in);
|
2005-10-09 21:32:34 +00:00
|
|
|
QUEUE_UNLOCK (filter);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
} else {
|
2005-10-09 21:32:34 +00:00
|
|
|
QUEUE_UNLOCK (filter);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint16 seqnum, queueseq;
|
|
|
|
guint32 timestamp;
|
|
|
|
|
|
|
|
seqnum = gst_rtpbuffer_get_seq (in);
|
|
|
|
queueseq = gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_head (queue)));
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* not our first packet
|
|
|
|
* let us make sure it is not very late */
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
if (seqnum < queueseq)
|
|
|
|
goto too_late;
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* look for right place to insert it */
|
2005-07-14 10:29:30 +00:00
|
|
|
int i = 0;
|
|
|
|
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
while (seqnum < queueseq) {
|
2005-07-14 10:29:30 +00:00
|
|
|
i++;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
queueseq =
|
|
|
|
gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_nth (queue, i)));
|
|
|
|
}
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* now insert it at that place */
|
2005-10-09 21:32:34 +00:00
|
|
|
QUEUE_LOCK (filter);
|
2005-07-14 10:29:30 +00:00
|
|
|
g_queue_push_nth (queue, in, i);
|
2005-10-09 21:32:34 +00:00
|
|
|
QUEUE_UNLOCK (filter);
|
2005-07-14 10:29:30 +00:00
|
|
|
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
timestamp = gst_rtpbuffer_get_timestamp (in);
|
|
|
|
|
|
|
|
GST_DEBUG ("Packet added to queue %d at pos %d timestamp %u sn %d",
|
|
|
|
g_queue_get_length (queue), i, timestamp, seqnum);
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
return GST_FLOW_OK;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
|
|
|
too_late:
|
|
|
|
{
|
|
|
|
QUEUE_UNLOCK (filter);
|
2005-10-26 13:52:42 +00:00
|
|
|
/* we need to drop this one */
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GST_DEBUG ("Packet arrived to late, dropping");
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
|
2005-08-10 20:52:37 +00:00
|
|
|
static void
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * rtp_buf)
|
2005-08-10 20:52:37 +00:00
|
|
|
{
|
|
|
|
GstBaseRTPDepayloadClass *bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
|
|
|
GstBuffer *out_buf;
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* let's send it out to processing */
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
out_buf = bclass->process (filter, rtp_buf);
|
2005-08-10 20:52:37 +00:00
|
|
|
if (out_buf) {
|
2005-10-26 13:52:42 +00:00
|
|
|
/* set the caps */
|
2005-08-10 20:52:37 +00:00
|
|
|
gst_buffer_set_caps (GST_BUFFER (out_buf),
|
|
|
|
gst_pad_get_caps (filter->srcpad));
|
2005-10-26 13:52:42 +00:00
|
|
|
/* set the timestamp
|
|
|
|
* I am assuming here that the timestamp of the last RTP buffer
|
|
|
|
* is the same as the timestamp wanted on the collector
|
|
|
|
* maybe i should add a way to override this timestamp from the
|
|
|
|
* depayloader child class
|
|
|
|
*/
|
2005-10-09 21:32:34 +00:00
|
|
|
bclass->set_gst_timestamp (filter, gst_rtpbuffer_get_timestamp (rtp_buf),
|
|
|
|
out_buf);
|
2005-10-26 13:52:42 +00:00
|
|
|
/* push it */
|
2005-08-10 20:52:37 +00:00
|
|
|
GST_DEBUG ("Pushing buffer size %d, timestamp %u",
|
|
|
|
GST_BUFFER_SIZE (out_buf), GST_BUFFER_TIMESTAMP (out_buf));
|
|
|
|
gst_pad_push (filter->srcpad, GST_BUFFER (out_buf));
|
2005-10-09 21:32:34 +00:00
|
|
|
gst_buffer_unref (rtp_buf);
|
2005-08-10 20:52:37 +00:00
|
|
|
GST_DEBUG ("Pushed buffer");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter,
|
|
|
|
guint32 timestamp, GstBuffer * buf)
|
2005-07-14 10:29:30 +00:00
|
|
|
{
|
2005-08-10 20:52:37 +00:00
|
|
|
static gboolean first = TRUE;
|
|
|
|
|
|
|
|
guint64 ts = ((timestamp * GST_SECOND) / filter->clock_rate);
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* rtp timestamps are based on the clock_rate
|
|
|
|
* gst timesamps are in nanoseconds
|
|
|
|
*/
|
|
|
|
GST_DEBUG ("calculating ts : timestamp : %u, clockrate : %u", timestamp,
|
|
|
|
filter->clock_rate);
|
|
|
|
|
2005-08-10 20:52:37 +00:00
|
|
|
GST_BUFFER_TIMESTAMP (buf) = ts;
|
|
|
|
GST_DEBUG ("calculated ts %"
|
|
|
|
GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* if this is the first buf send a discont */
|
2005-08-10 20:52:37 +00:00
|
|
|
if (first) {
|
2005-10-26 13:52:42 +00:00
|
|
|
/* send discont */
|
2005-10-11 16:30:55 +00:00
|
|
|
GstEvent *event = gst_event_new_newsegment (FALSE, 1.0, GST_FORMAT_TIME,
|
2005-08-10 20:52:37 +00:00
|
|
|
ts, GST_CLOCK_TIME_NONE, 0);
|
|
|
|
|
|
|
|
gst_pad_push_event (filter->srcpad, event);
|
|
|
|
first = FALSE;
|
|
|
|
GST_DEBUG ("Pushed discont on this first buffer");
|
|
|
|
}
|
2005-10-26 13:52:42 +00:00
|
|
|
/* add delay to timestamp */
|
2005-10-09 21:32:34 +00:00
|
|
|
GST_BUFFER_TIMESTAMP (buf) =
|
|
|
|
GST_BUFFER_TIMESTAMP (buf) + (filter->queue_delay * GST_MSECOND);
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
|
2005-08-12 13:34:56 +00:00
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_queue_release (GstBaseRTPDepayload * filter)
|
|
|
|
{
|
|
|
|
GQueue *queue = filter->queue;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint32 headts, tailts;
|
|
|
|
GstBaseRTPDepayloadClass *bclass;
|
2005-08-12 13:34:56 +00:00
|
|
|
|
|
|
|
if (g_queue_is_empty (queue))
|
|
|
|
return;
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/* if our queue is getting to big (more than RTP_QUEUEDELAY ms of data)
|
|
|
|
* release heading buffers
|
|
|
|
*/
|
|
|
|
GST_DEBUG ("clockrate %d, queu_delay %d", filter->clock_rate,
|
|
|
|
filter->queue_delay);
|
2005-08-12 13:34:56 +00:00
|
|
|
gfloat q_size_secs = (gfloat) filter->queue_delay / 1000;
|
|
|
|
guint maxtsunits = (gfloat) filter->clock_rate * q_size_secs;
|
|
|
|
|
|
|
|
QUEUE_LOCK (filter);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
headts = gst_rtpbuffer_get_timestamp (GST_BUFFER (g_queue_peek_head (queue)));
|
|
|
|
tailts = gst_rtpbuffer_get_timestamp (GST_BUFFER (g_queue_peek_tail (queue)));
|
|
|
|
|
|
|
|
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
|
|
|
|
2005-10-26 13:52:42 +00:00
|
|
|
/*GST_DEBUG("maxtsunit is %u %u %u %u", maxtsunits, headts, tailts, headts - tailts); */
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
while (headts - tailts > maxtsunits) {
|
2005-10-09 21:32:34 +00:00
|
|
|
GST_DEBUG ("Poping packet from queue");
|
2005-08-12 13:34:56 +00:00
|
|
|
if (bclass->process) {
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GstBuffer *in = g_queue_pop_tail (queue);
|
2005-08-12 13:34:56 +00:00
|
|
|
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
gst_base_rtp_depayload_push (filter, in);
|
2005-08-12 13:34:56 +00:00
|
|
|
}
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
tailts =
|
|
|
|
gst_rtpbuffer_get_timestamp (GST_BUFFER (g_queue_peek_tail (queue)));
|
2005-08-12 13:34:56 +00:00
|
|
|
}
|
|
|
|
QUEUE_UNLOCK (filter);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gpointer
|
|
|
|
gst_base_rtp_depayload_thread (GstBaseRTPDepayload * filter)
|
|
|
|
{
|
|
|
|
while (filter->thread_running) {
|
|
|
|
gst_base_rtp_depayload_queue_release (filter);
|
2005-10-26 13:52:42 +00:00
|
|
|
/* i want to run this thread clock_rate times per second */
|
2005-08-12 13:34:56 +00:00
|
|
|
g_usleep (1000000 / filter->clock_rate);
|
2005-10-26 13:52:42 +00:00
|
|
|
/* g_usleep (1000000); */
|
2005-08-12 13:34:56 +00:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_base_rtp_depayload_start_thread (GstBaseRTPDepayload * filter)
|
|
|
|
{
|
|
|
|
GST_DEBUG ("Starting queue release thread");
|
|
|
|
filter->thread_running = TRUE;
|
|
|
|
filter->thread = g_thread_create ((GThreadFunc) gst_base_rtp_depayload_thread,
|
|
|
|
filter, TRUE, NULL);
|
|
|
|
GST_DEBUG ("Started queue release thread");
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_base_rtp_depayload_stop_thread (GstBaseRTPDepayload * filter)
|
|
|
|
{
|
|
|
|
filter->thread_running = FALSE;
|
|
|
|
|
|
|
|
if (filter->thread) {
|
|
|
|
g_thread_join (filter->thread);
|
|
|
|
filter->thread = NULL;
|
|
|
|
}
|
|
|
|
QUEUE_LOCK_FREE (filter);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_base_rtp_depayload_change_state (GstElement * element,
|
|
|
|
GstStateChange transition)
|
2005-08-12 13:34:56 +00:00
|
|
|
{
|
|
|
|
GstBaseRTPDepayload *filter;
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
g_return_val_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (element),
|
|
|
|
GST_STATE_CHANGE_FAILURE);
|
2005-08-12 13:34:56 +00:00
|
|
|
filter = GST_BASE_RTP_DEPAYLOAD (element);
|
|
|
|
|
|
|
|
/* we disallow changing the state from the thread */
|
|
|
|
if (g_thread_self () == filter->thread)
|
2005-09-02 15:43:18 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2005-08-12 13:34:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2005-08-12 13:34:56 +00:00
|
|
|
if (!gst_base_rtp_depayload_start_thread (filter))
|
|
|
|
goto start_failed;
|
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2005-08-12 13:34:56 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
2005-08-12 13:34:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2005-08-12 13:34:56 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
2005-08-12 13:34:56 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2005-08-12 13:34:56 +00:00
|
|
|
gst_base_rtp_depayload_stop_thread (filter);
|
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
default:
|
|
|
|
break;
|
2005-08-12 13:34:56 +00:00
|
|
|
}
|
2005-09-02 15:43:18 +00:00
|
|
|
return GST_STATE_CHANGE_SUCCESS;
|
2005-08-12 13:34:56 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
start_failed:
|
|
|
|
{
|
2005-09-02 15:43:18 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2005-08-12 13:34:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-07-14 10:29:30 +00:00
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstBaseRTPDepayload *filter;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (object));
|
|
|
|
filter = GST_BASE_RTP_DEPAYLOAD (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_QUEUEDELAY:
|
|
|
|
filter->queue_delay = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case ARG_PROCESS_ONLY:
|
|
|
|
filter->process_only = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_base_rtp_depayload_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstBaseRTPDepayload *filter;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (object));
|
|
|
|
filter = GST_BASE_RTP_DEPAYLOAD (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_QUEUEDELAY:
|
|
|
|
g_value_set_uint (value, filter->queue_delay);
|
|
|
|
break;
|
|
|
|
case ARG_PROCESS_ONLY:
|
|
|
|
g_value_set_boolean (value, filter->process_only);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|