Commit graph

16 commits

Author SHA1 Message Date
Sebastian Dröge
2a2e48fd9e onviftimestamp: Add missing break in set_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1257>
2020-05-10 11:17:19 +03:00
Mathieu Duponchelle
aea20f207d rtponviftimestamp: add opt-out "drop-out-of-segment" property
The default behaviour of rtponviftimestamp is to drop buffers
outside the segment. This creates obvious problems for reverse
playback.

The ONVIF specification unfortunately doesn't describe how to handle
that specific use case, but we can expose a property to let the
user disable the dropping behaviour, and forward these buffers with
a G_MAXUINT64 ONVIF timestamp.

Also modify rtponvifparse to handle such timestamps appropriately.
2019-08-06 22:49:25 +00:00
Mathieu Duponchelle
f65c8fff50 rtponviftimestamp: fix setting of the discontinuity flag
The D bit is meant to be set whenever there is a discontinuity
in transmission, and directly maps to the DISCONT flag.

The E bit is not meant to be set on every buffer preceding a
discontinuity, but only on the last buffer of a contiguous section
of recording. This has to be signaled through the unfortunately-named
"discont" field of the custom NtpOffset event.
2019-07-18 23:07:57 +00:00
Mathieu Duponchelle
f11ce297f4 rtponviftimestamp: prioritize PTS over DTS for NTP timestamp
NTP timestamps are supposed to match the expected presentation
time, prefering the DTS to compute them was incorrect.

<https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf>

Section 6.3.1: NTP Timestamps
2019-04-05 00:28:48 +00:00
Mathieu Duponchelle
62b240eb4e rtponviftimestamp: buffer without PTS or DTS is not an error.
For example, when plugged after rtpgstpay, serialized events will
have neither.
2019-04-05 00:28:48 +00:00
Mathieu Duponchelle
9c3816830c rtponviftimestamp: implement support for the T flag
https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf

6.3 RTP header extension
2019-04-05 00:28:48 +00:00
Tim-Philipp Müller
4d76070f4e rtponviftimestamp: fix state change function init/reset
When starting up we need to initialise things *before*
streaming starts, so before we chain up to the parent
class in the state change function. And when we shut
down the element, we need to reset things after streaming
has stopped, so after we chain up to the parent class
in the state change function.

Possibly related to memory leak in:
https://bugzilla.gnome.org/show_bug.cgi?id=794353
2018-03-27 16:51:30 +01:00
Joakim Johansson
2837ca997f rtponviftimestamp: Change default value of D-bit
The default value of D-bit is changed to TRUE so discontinuity
is set for initial request and seek request as well.

Only set the e_bit flag for the CUSTOM_DOWNSTREAM event if
a cached buffer exists.

https://bugzilla.gnome.org/show_bug.cgi?id=770221
2016-09-19 11:24:47 -04:00
Vineeth TM
8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Tim-Philipp Müller
734d5a79c5 Fix code indentation 2015-11-06 19:29:49 +00:00
Branko Subasic
4c482befbd rtponviftimestamp: use stream time for timestamp
The Onvif Streaming Specification specifies that the NTP timestamps
in the Onvif extension header indicaes the absolute UTC time associated
with the access unit. But by using running time we can not achieve that,
since a frame's running time depends on the played interval, whether a
non-flushing is done, etc. Instead we have to use the stream time.

https://bugzilla.gnome.org/show_bug.cgi?id=757688
2015-11-06 12:55:25 -05:00
Linus Svensson
6f6fe37ed9 rtponviftimestamp: Update ntp-offset and d/e-bits with a GstEvent
It is now possible to update the currently used ntp-offset with a
custom serialized downstream event. The element will read the ntp-offset
property when doing the state transition from READY to PAUSED and
use that offset until it receives a "GstNtpOffset" event, which also
has a "ntp-offset" attribute in that it's structure. In case the
property is not set and no event has been received, the element will
guess the npt-offset with help of the clock. If no clock can be
retrieved, the element will error out and stop the data flow.

The same event is also used for updating the D/E-bits in the RTP
extension header. The discont flag in a buffer can be set whenver a
live/network source looses a frame, but that is not the type of
discontinuity that the onvif extension header should reflect. The
header is mainly used for playback of a track concept, in which
gaps can be present, and it's those kind of gaps that should be
highlighted with the D- and E-bits.

https://bugzilla.gnome.org/show_bug.cgi?id=757688
2015-11-06 12:55:25 -05:00
Linus Svensson
a58826292e rtponviftimestamp: Do not rearange order of data
If a buffer or a buffer list is cached, no events serialized with the
data stream should get through. The cached buffers and events should
be purged when we stop flushing.

https://bugzilla.gnome.org/show_bug.cgi?id=757688
2015-11-06 12:55:25 -05:00
Luis de Bethencourt
925b65b02e Rename property enums from ARG_ to PROP_
Property enum items should be named PROP_ for consistency and readability.
2015-04-27 10:55:18 +01:00
Olivier Crête
8cddfe6477 rtponviftimestamp: Automatically discover the ntp-offset by default.
This only works if no packets are pushed in before the pipeline goes
to playing. So it helps to have a live source.

https://bugzilla.gnome.org/show_bug.cgi?id=731769
2014-12-11 16:28:43 -05:00
Guillaume Desmottes
b424b72df1 add rtponviftimestamp element
https://bugzilla.gnome.org/show_bug.cgi?id=731769
2014-12-11 14:00:59 -05:00