Commit 28641e31 authored by Wim Taymans's avatar Wim Taymans

rtpjitterbuffer: add type to the item

So that the upper layer can know what data is contained in the item.
parent 479c7642
......@@ -654,10 +654,26 @@ gst_rtp_jitter_buffer_init (GstRtpJitterBuffer * jitterbuffer)
GST_OBJECT_FLAG_SET (jitterbuffer, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
}
#define ITEM_TYPE_BUFFER 0
#define ITEM_TYPE_LOST 1
static RTPJitterBufferItem *
alloc_item (void)
alloc_item (gpointer data, guint type, GstClockTime dts, GstClockTime pts,
guint seqnum, guint rtptime)
{
return g_slice_new (RTPJitterBufferItem);
RTPJitterBufferItem *item;
item = g_slice_new (RTPJitterBufferItem);
item->data = data;
item->next = NULL;
item->prev = NULL;
item->type = type;
item->dts = dts;
item->pts = pts;
item->seqnum = seqnum;
item->rtptime = rtptime;
return item;
}
static void
......@@ -2013,14 +2029,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
}
}
item = alloc_item ();
item->data = buffer;
item->next = NULL;
item->prev = NULL;
item->dts = dts;
item->pts = pts;
item->seqnum = seqnum;
item->rtptime = rtptime;
item = alloc_item (buffer, ITEM_TYPE_BUFFER, dts, pts, seqnum, rtptime);
/* now insert the packet into the queue in sorted order. This function returns
* FALSE if a packet with the same seqnum was already in the queue, meaning we
......
......@@ -105,6 +105,7 @@ struct _RTPJitterBufferClass {
* @data: the data of the item
* @next: pointer to next item
* @prev: pointer to previous item
* @type: the type of @data
* @dts: input DTS
* @pts: output PTS
* @seqnum: seqnum
......@@ -116,6 +117,7 @@ struct _RTPJitterBufferItem {
gpointer data;
GList *next;
GList *prev;
guint type;
GstClockTime dts;
GstClockTime pts;
guint seqnum;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment