mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:46:13 +00:00
Changed the C++ comments to C comments.
Original commit message from CVS: Changed the C++ comments to C comments.
This commit is contained in:
parent
ac29f18f79
commit
4417686358
3 changed files with 71 additions and 54 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2005-10-26 Zeeshan Ali <zeenix@gmail.com>
|
||||||
|
* gst-libs/gst/rtp/gstbasertpdepayload.c:
|
||||||
|
(gst_base_rtp_depayload_base_init), (gst_base_rtp_depayload_init),
|
||||||
|
(gst_base_rtp_depayload_finalize),
|
||||||
|
(gst_base_rtp_depayload_setcaps),
|
||||||
|
(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),
|
||||||
|
(gst_base_rtp_depayload_thread),
|
||||||
|
(gst_base_rtp_depayload_change_state):
|
||||||
|
* gst-libs/gst/rtp/gstbasertpdepayload.h:
|
||||||
|
Changed the C++ comments to C comments
|
||||||
|
|
||||||
2005-10-26 Tim-Philipp Müller <tim at centricular dot net>
|
2005-10-26 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_init):
|
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_init):
|
||||||
|
|
|
@ -70,7 +70,6 @@ gst_base_rtp_depayload_get_type (void)
|
||||||
return plugin_type;
|
return plugin_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement * element, GstStateChange transition);
|
|
||||||
static void gst_base_rtp_depayload_finalize (GObject * object);
|
static void gst_base_rtp_depayload_finalize (GObject * object);
|
||||||
static void gst_base_rtp_depayload_set_property (GObject * object,
|
static void gst_base_rtp_depayload_set_property (GObject * object,
|
||||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||||
|
@ -94,7 +93,7 @@ static void gst_base_rtp_depayload_set_gst_timestamp
|
||||||
static void
|
static void
|
||||||
gst_base_rtp_depayload_base_init (GstBaseRTPDepayloadClass * klass)
|
gst_base_rtp_depayload_base_init (GstBaseRTPDepayloadClass * klass)
|
||||||
{
|
{
|
||||||
//GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
/*GstElementClass *element_class = GST_ELEMENT_CLASS (klass); */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -150,22 +149,22 @@ gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter, gpointer g_class)
|
||||||
filter->srcpad = gst_pad_new_from_template (pad_template, "src");
|
filter->srcpad = gst_pad_new_from_template (pad_template, "src");
|
||||||
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
||||||
|
|
||||||
// create out queue
|
/* create out queue */
|
||||||
filter->queue = g_queue_new ();
|
filter->queue = g_queue_new ();
|
||||||
|
|
||||||
filter->queue_delay = RTP_QUEUEDELAY;
|
filter->queue_delay = RTP_QUEUEDELAY;
|
||||||
|
|
||||||
// init queue mutex
|
/* init queue mutex */
|
||||||
QUEUE_LOCK_INIT (filter);
|
QUEUE_LOCK_INIT (filter);
|
||||||
|
|
||||||
// this one needs to be overwritten by child
|
/* this one needs to be overwritten by child */
|
||||||
filter->clock_rate = 0;
|
filter->clock_rate = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_base_rtp_depayload_finalize (GObject * object)
|
gst_base_rtp_depayload_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
// free our queue
|
/* free our queue */
|
||||||
g_queue_free (GST_BASE_RTP_DEPAYLOAD (object)->queue);
|
g_queue_free (GST_BASE_RTP_DEPAYLOAD (object)->queue);
|
||||||
|
|
||||||
if (G_OBJECT_CLASS (parent_class)->finalize)
|
if (G_OBJECT_CLASS (parent_class)->finalize)
|
||||||
|
@ -177,8 +176,8 @@ gst_base_rtp_depayload_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstBaseRTPDepayload *filter;
|
GstBaseRTPDepayload *filter;
|
||||||
|
|
||||||
// GstStructure *structure;
|
/* GstStructure *structure;
|
||||||
// int ret;
|
int ret;*/
|
||||||
|
|
||||||
filter = GST_BASE_RTP_DEPAYLOAD (gst_pad_get_parent (pad));
|
filter = GST_BASE_RTP_DEPAYLOAD (gst_pad_get_parent (pad));
|
||||||
g_return_val_if_fail (filter != NULL, FALSE);
|
g_return_val_if_fail (filter != NULL, FALSE);
|
||||||
|
@ -229,7 +228,7 @@ gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter,
|
||||||
{
|
{
|
||||||
GQueue *queue = filter->queue;
|
GQueue *queue = filter->queue;
|
||||||
|
|
||||||
// our first packet, just push it
|
/* our first packet, just push it */
|
||||||
QUEUE_LOCK (filter);
|
QUEUE_LOCK (filter);
|
||||||
if (g_queue_is_empty (queue)) {
|
if (g_queue_is_empty (queue)) {
|
||||||
g_queue_push_tail (queue, in);
|
g_queue_push_tail (queue, in);
|
||||||
|
@ -242,12 +241,12 @@ gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter,
|
||||||
seqnum = gst_rtpbuffer_get_seq (in);
|
seqnum = gst_rtpbuffer_get_seq (in);
|
||||||
queueseq = gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_head (queue)));
|
queueseq = gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_head (queue)));
|
||||||
|
|
||||||
// not our first packet
|
/* not our first packet
|
||||||
// let us make sure it is not very late
|
* let us make sure it is not very late */
|
||||||
if (seqnum < queueseq)
|
if (seqnum < queueseq)
|
||||||
goto too_late;
|
goto too_late;
|
||||||
|
|
||||||
// look for right place to insert it
|
/* look for right place to insert it */
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (seqnum < queueseq) {
|
while (seqnum < queueseq) {
|
||||||
|
@ -256,7 +255,7 @@ gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter,
|
||||||
gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_nth (queue, i)));
|
gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_nth (queue, i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// now insert it at that place
|
/* now insert it at that place */
|
||||||
QUEUE_LOCK (filter);
|
QUEUE_LOCK (filter);
|
||||||
g_queue_push_nth (queue, in, i);
|
g_queue_push_nth (queue, in, i);
|
||||||
QUEUE_UNLOCK (filter);
|
QUEUE_UNLOCK (filter);
|
||||||
|
@ -271,7 +270,7 @@ gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter,
|
||||||
too_late:
|
too_late:
|
||||||
{
|
{
|
||||||
QUEUE_UNLOCK (filter);
|
QUEUE_UNLOCK (filter);
|
||||||
// we need to drop this one
|
/* we need to drop this one */
|
||||||
GST_DEBUG ("Packet arrived to late, dropping");
|
GST_DEBUG ("Packet arrived to late, dropping");
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
@ -283,20 +282,21 @@ gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * rtp_buf)
|
||||||
GstBaseRTPDepayloadClass *bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
GstBaseRTPDepayloadClass *bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
||||||
GstBuffer *out_buf;
|
GstBuffer *out_buf;
|
||||||
|
|
||||||
// let's send it out to processing
|
/* let's send it out to processing */
|
||||||
out_buf = bclass->process (filter, rtp_buf);
|
out_buf = bclass->process (filter, rtp_buf);
|
||||||
if (out_buf) {
|
if (out_buf) {
|
||||||
// set the caps
|
/* set the caps */
|
||||||
gst_buffer_set_caps (GST_BUFFER (out_buf),
|
gst_buffer_set_caps (GST_BUFFER (out_buf),
|
||||||
gst_pad_get_caps (filter->srcpad));
|
gst_pad_get_caps (filter->srcpad));
|
||||||
// set the timestamp
|
/* set the timestamp
|
||||||
// I am assuming here that the timestamp of the last RTP buffer
|
* I am assuming here that the timestamp of the last RTP buffer
|
||||||
// is the same as the timestamp wanted on the collector
|
* is the same as the timestamp wanted on the collector
|
||||||
// maybe i should add a way to override this timestamp from the
|
* maybe i should add a way to override this timestamp from the
|
||||||
// depayloader child class
|
* depayloader child class
|
||||||
|
*/
|
||||||
bclass->set_gst_timestamp (filter, gst_rtpbuffer_get_timestamp (rtp_buf),
|
bclass->set_gst_timestamp (filter, gst_rtpbuffer_get_timestamp (rtp_buf),
|
||||||
out_buf);
|
out_buf);
|
||||||
// push it
|
/* push it */
|
||||||
GST_DEBUG ("Pushing buffer size %d, timestamp %u",
|
GST_DEBUG ("Pushing buffer size %d, timestamp %u",
|
||||||
GST_BUFFER_SIZE (out_buf), GST_BUFFER_TIMESTAMP (out_buf));
|
GST_BUFFER_SIZE (out_buf), GST_BUFFER_TIMESTAMP (out_buf));
|
||||||
gst_pad_push (filter->srcpad, GST_BUFFER (out_buf));
|
gst_pad_push (filter->srcpad, GST_BUFFER (out_buf));
|
||||||
|
@ -311,20 +311,21 @@ gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter,
|
||||||
{
|
{
|
||||||
static gboolean first = TRUE;
|
static gboolean first = TRUE;
|
||||||
|
|
||||||
// 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);
|
|
||||||
guint64 ts = ((timestamp * GST_SECOND) / filter->clock_rate);
|
guint64 ts = ((timestamp * GST_SECOND) / filter->clock_rate);
|
||||||
|
|
||||||
|
/* 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);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (buf) = ts;
|
GST_BUFFER_TIMESTAMP (buf) = ts;
|
||||||
//GST_BUFFER_TIMESTAMP (buf) =
|
|
||||||
// (guint64)(((timestamp * GST_SECOND) / filter->clock_rate));
|
|
||||||
GST_DEBUG ("calculated ts %"
|
GST_DEBUG ("calculated ts %"
|
||||||
GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
||||||
|
|
||||||
// if this is the first buf send a discont
|
/* if this is the first buf send a discont */
|
||||||
if (first) {
|
if (first) {
|
||||||
// send discont
|
/* send discont */
|
||||||
GstEvent *event = gst_event_new_newsegment (FALSE, 1.0, GST_FORMAT_TIME,
|
GstEvent *event = gst_event_new_newsegment (FALSE, 1.0, GST_FORMAT_TIME,
|
||||||
ts, GST_CLOCK_TIME_NONE, 0);
|
ts, GST_CLOCK_TIME_NONE, 0);
|
||||||
|
|
||||||
|
@ -332,7 +333,7 @@ gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter,
|
||||||
first = FALSE;
|
first = FALSE;
|
||||||
GST_DEBUG ("Pushed discont on this first buffer");
|
GST_DEBUG ("Pushed discont on this first buffer");
|
||||||
}
|
}
|
||||||
// add delay to timestamp
|
/* add delay to timestamp */
|
||||||
GST_BUFFER_TIMESTAMP (buf) =
|
GST_BUFFER_TIMESTAMP (buf) =
|
||||||
GST_BUFFER_TIMESTAMP (buf) + (filter->queue_delay * GST_MSECOND);
|
GST_BUFFER_TIMESTAMP (buf) + (filter->queue_delay * GST_MSECOND);
|
||||||
}
|
}
|
||||||
|
@ -347,9 +348,11 @@ gst_base_rtp_depayload_queue_release (GstBaseRTPDepayload * filter)
|
||||||
if (g_queue_is_empty (queue))
|
if (g_queue_is_empty (queue))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// if our queue is getting to big (more than RTP_QUEUEDELAY ms of data)
|
/* if our queue is getting to big (more than RTP_QUEUEDELAY ms of data)
|
||||||
// release heading buffers
|
* release heading buffers
|
||||||
//GST_DEBUG("clockrate %d, queu_delay %d", filter->clock_rate, filter->queue_delay);
|
*/
|
||||||
|
GST_DEBUG ("clockrate %d, queu_delay %d", filter->clock_rate,
|
||||||
|
filter->queue_delay);
|
||||||
gfloat q_size_secs = (gfloat) filter->queue_delay / 1000;
|
gfloat q_size_secs = (gfloat) filter->queue_delay / 1000;
|
||||||
guint maxtsunits = (gfloat) filter->clock_rate * q_size_secs;
|
guint maxtsunits = (gfloat) filter->clock_rate * q_size_secs;
|
||||||
|
|
||||||
|
@ -359,7 +362,7 @@ gst_base_rtp_depayload_queue_release (GstBaseRTPDepayload * filter)
|
||||||
|
|
||||||
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
|
||||||
|
|
||||||
//GST_DEBUG("maxtsunit is %u %u %u %u", maxtsunits, headts, tailts, headts - tailts);
|
/*GST_DEBUG("maxtsunit is %u %u %u %u", maxtsunits, headts, tailts, headts - tailts); */
|
||||||
while (headts - tailts > maxtsunits) {
|
while (headts - tailts > maxtsunits) {
|
||||||
GST_DEBUG ("Poping packet from queue");
|
GST_DEBUG ("Poping packet from queue");
|
||||||
if (bclass->process) {
|
if (bclass->process) {
|
||||||
|
@ -379,9 +382,9 @@ gst_base_rtp_depayload_thread (GstBaseRTPDepayload * filter)
|
||||||
{
|
{
|
||||||
while (filter->thread_running) {
|
while (filter->thread_running) {
|
||||||
gst_base_rtp_depayload_queue_release (filter);
|
gst_base_rtp_depayload_queue_release (filter);
|
||||||
// i want to run this thread clock_rate times per second
|
/* i want to run this thread clock_rate times per second */
|
||||||
g_usleep (1000000 / filter->clock_rate);
|
g_usleep (1000000 / filter->clock_rate);
|
||||||
//g_usleep (1000000);
|
/* g_usleep (1000000); */
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -416,8 +419,6 @@ gst_base_rtp_depayload_change_state (GstElement * element,
|
||||||
{
|
{
|
||||||
GstBaseRTPDepayload *filter;
|
GstBaseRTPDepayload *filter;
|
||||||
|
|
||||||
// GstStateChangeReturn ret;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (element),
|
g_return_val_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (element),
|
||||||
GST_STATE_CHANGE_FAILURE);
|
GST_STATE_CHANGE_FAILURE);
|
||||||
filter = GST_BASE_RTP_DEPAYLOAD (element);
|
filter = GST_BASE_RTP_DEPAYLOAD (element);
|
||||||
|
@ -440,8 +441,6 @@ gst_base_rtp_depayload_change_state (GstElement * element,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -41,7 +41,7 @@ G_BEGIN_DECLS
|
||||||
#define GST_BASE_RTP_DEPAYLOAD_SINKPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->sinkpad)
|
#define GST_BASE_RTP_DEPAYLOAD_SINKPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->sinkpad)
|
||||||
#define GST_BASE_RTP_DEPAYLOAD_SRCPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->srcpad)
|
#define GST_BASE_RTP_DEPAYLOAD_SRCPAD(depayload) (GST_BASE_RTP_DEPAYLOAD (depayload)->srcpad)
|
||||||
|
|
||||||
// in milliseconds
|
/* in milliseconds */
|
||||||
#define RTP_QUEUEDELAY 100;
|
#define RTP_QUEUEDELAY 100;
|
||||||
|
|
||||||
#define QUEUE_LOCK_INIT(base) (g_static_rec_mutex_init(&base->queuelock))
|
#define QUEUE_LOCK_INIT(base) (g_static_rec_mutex_init(&base->queuelock))
|
||||||
|
@ -65,18 +65,19 @@ struct _GstBaseRTPDepayload
|
||||||
/* the releaser thread */
|
/* the releaser thread */
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
|
|
||||||
// this attribute must be set by the child
|
/* this attribute must be set by the child */
|
||||||
guint clock_rate;
|
guint clock_rate;
|
||||||
|
|
||||||
// this value can be modified by the child if needed
|
/* this value can be modified by the child if needed */
|
||||||
guint queue_delay;
|
guint queue_delay;
|
||||||
|
|
||||||
gboolean process_only;
|
gboolean process_only;
|
||||||
|
|
||||||
// we will queue up to RTP_QUEUEDELAY ms of packets,
|
/* we will queue up to RTP_QUEUEDELAY ms of packets,
|
||||||
// reordering them if necessary
|
* reordering them if necessary
|
||||||
// dropping any packets that are more than
|
* dropping any packets that are more than
|
||||||
// RTP_QUEUEDELAY ms late
|
* RTP_QUEUEDELAY ms late
|
||||||
|
*/
|
||||||
GQueue *queue;
|
GQueue *queue;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
@ -87,19 +88,22 @@ struct _GstBaseRTPDepayloadClass
|
||||||
{
|
{
|
||||||
GstElementClass parent_class;
|
GstElementClass parent_class;
|
||||||
|
|
||||||
// virtuals
|
/* virtuals */
|
||||||
gboolean (*set_caps) (GstBaseRTPDepayload *filter, GstCaps *caps);
|
gboolean (*set_caps) (GstBaseRTPDepayload *filter, GstCaps *caps);
|
||||||
|
|
||||||
// non-pure function, default implementation in base class
|
/* non-pure function, default implementation in base class
|
||||||
// this does buffering, reordering and dropping
|
* this does buffering, reordering and dropping
|
||||||
|
*/
|
||||||
GstFlowReturn (*add_to_queue) (GstBaseRTPDepayload *filter, GstBuffer *in);
|
GstFlowReturn (*add_to_queue) (GstBaseRTPDepayload *filter, GstBuffer *in);
|
||||||
|
|
||||||
// pure virtual function, child must use this to process incoming
|
/* pure virtual function, child must use this to process incoming
|
||||||
// rtp packets
|
* rtp packets
|
||||||
|
*/
|
||||||
GstBuffer * (*process) (GstBaseRTPDepayload *base, GstBuffer *in);
|
GstBuffer * (*process) (GstBaseRTPDepayload *base, GstBuffer *in);
|
||||||
|
|
||||||
// non-pure function used to convert from RTP timestamp to GST timestamp
|
/* non-pure function used to convert from RTP timestamp to GST timestamp
|
||||||
// this function is used by the child class before gst_pad_pushing
|
* this function is used by the child class before gst_pad_pushing
|
||||||
|
*/
|
||||||
void (*set_gst_timestamp) (GstBaseRTPDepayload *filter, guint32 timestamp, GstBuffer *buf);
|
void (*set_gst_timestamp) (GstBaseRTPDepayload *filter, guint32 timestamp, GstBuffer *buf);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
|
Loading…
Reference in a new issue