mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
rtponvifparse: set ONVIF timestamps as buffer PTS
This commit is contained in:
parent
2305bf272c
commit
0d5db92953
1 changed files with 11 additions and 3 deletions
|
@ -93,12 +93,14 @@ handle_buffer (GstRtpOnvifParse * self, GstBuffer * buf)
|
|||
guint16 bits;
|
||||
guint wordlen;
|
||||
guint8 flags;
|
||||
guint64 timestamp_seconds;
|
||||
guint64 timestamp_fraction;
|
||||
guint64 timestamp_nseconds;
|
||||
/*
|
||||
guint64 timestamp;
|
||||
guint8 cseq;
|
||||
*/
|
||||
|
||||
if (!gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp)) {
|
||||
if (!gst_rtp_buffer_map (buf, GST_MAP_READWRITE, &rtp)) {
|
||||
GST_ELEMENT_ERROR (self, STREAM, FAILED,
|
||||
("Failed to map RTP buffer"), (NULL));
|
||||
return FALSE;
|
||||
|
@ -112,7 +114,13 @@ handle_buffer (GstRtpOnvifParse * self, GstBuffer * buf)
|
|||
if (bits != EXTENSION_ID || wordlen != EXTENSION_SIZE)
|
||||
goto out;
|
||||
|
||||
/* timestamp = GST_READ_UINT64_BE (data); TODO */
|
||||
timestamp_seconds = GST_READ_UINT32_BE (data);
|
||||
timestamp_fraction = GST_READ_UINT32_BE (data + 4);
|
||||
timestamp_nseconds =
|
||||
(timestamp_fraction * G_GINT64_CONSTANT (1000000000)) >> 32;
|
||||
GST_BUFFER_PTS (buf) =
|
||||
timestamp_seconds * GST_SECOND + timestamp_nseconds * GST_NSECOND;
|
||||
|
||||
flags = GST_READ_UINT8 (data + 8);
|
||||
/* cseq = GST_READ_UINT8 (data + 9); TODO */
|
||||
|
||||
|
|
Loading…
Reference in a new issue