rtpjitterbuffer: add type to the item

So that the upper layer can know what data is contained in the item.
This commit is contained in:
Wim Taymans 2013-09-23 11:14:01 +02:00
parent 479c7642fd
commit 28641e3145
2 changed files with 21 additions and 10 deletions

View file

@ -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

View file

@ -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;