Commit graph

532 commits

Author SHA1 Message Date
Guillaume Desmottes a48edc8372 rtpbasedepayload: add auto-header-extension property
Same property as the one I just added on rtpbasepayload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1022>
2021-02-03 11:23:40 +01:00
Guillaume Desmottes bad4b1711d rtpbasepayload: add auto-header-extension property
Using RTP header extensions is currently not convenient. Users have to
handle signals from the RTP payloader and instantiate the extension
element themselves, making it impossible to use with gst-launch.

Adding a property allowing the payloader to automatically try creating
extensions. This should help simple use cases and testing using
gst-launch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1022>
2021-02-03 11:19:04 +01:00
Guillaume Desmottes df9064fdc6 rtpbasedepayload: set attributes on newly requested extensions
Users were supposed to configure the extension themselves but it was
impossible to do so as they didn't have access to the caps.

Fix #864

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes 912cf46b83 rtpbasepayload: set attributes on newly requested extensions
Users were supposed to configure the extension themselves but it was
impossible to do so as they didn't have access to the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes 5acde5568e rtpbasedepayload: fix clear-extensions signal definition
Typo as we were using the wrong enum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes 0896ccb436 rtp: fix clear-extensions signal definition
Typo as we were using the wrong enum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1018>
2021-01-25 14:28:12 +01:00
Guillaume Desmottes d396190b91 rtphdrext: fix typo in doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1018>
2021-01-25 14:28:12 +01:00
Jakub Adam f5d971a19e rtpbasepayload: fix header extension length calculation
Since ternary operator has the lowest precedence in the expressions at
hand, wordlen would always incorrectly yield 0 or 1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1009>
2021-01-12 22:26:19 +01:00
Jakub Adam 6434db5298 rtpbasepayload: pass optional caps fields in a GstStructure
For more flexibility, allow to pass the extra output caps fields as
a GstStructure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/952>
2020-12-05 08:29:31 +00:00
Matthew Waters 7a53fbad68 rtp/basepayload: implement support for rtp header extensions
New signals are added for managing the internal list of rtp header
extension implementations read by a specific depayloader instance.

If the 'extmap-$NUM' field is present in the src caps, then an
extension implementation will be requested but is not required to be able
to negotiate correctly.  An extension will be requested using the
'request-extension' signal if none could be found internally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/748>
2020-12-03 10:19:32 +00:00
Matthew Waters 092ea647bb rtp/basedepayload: implement support for rtp header extensions
New signals are added for managing the internal list of rtp header
extension implementations read by a specific depayloader instance.

If the 'extmap-$NUM' field is present in the sink caps, then an
extension implementation will be requested but is not requited to be
able to negotiate correctly.  An extension will be requested using the
'request-extension' signal if none could be found internally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/748>
2020-12-03 10:19:32 +00:00
Matthew Waters 427c3f4442 rtp: add base object for reading/writing rtp header extensions (RFC5285)
Facilitates the creation of rtp header extension implementations that
can be reused across applications.

Implementations are registered into the GStreamer registry as elements
(idea from GstRTSPExtension) and can be retrieved by URI or filtered
manually.  RTP header extensions must have the classification
"Network/Extension/RTPHeader" to be considered as a RTP Header
extension.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/777
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/748>
2020-12-03 10:19:32 +00:00
Xavier Claessens a28a75652e Meson: Use pkg-config generator 2020-10-23 11:19:11 -04:00
Will Miller ac72a6adaa gstrtpbuffer: fix header extension length validation
We validate the header extensions length of an RTP buffer by comparing
it against the block size. Since we multiply the length in words by 4 to
get the length in bytes, a suitably large length could cause a wrapround
of the uint16, giving a lower length which erroneously passes the check
and allows the buffer to be mapped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/864>
2020-10-12 15:01:22 +01:00
Mikhail Fludkov d6a2569136 rtpbasedepayload: Mark GAP events sent because of packet loss as such
This allows downstream to distinguish packet loss from normal GAP events
that are sent simply because of gaps in the timeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/731>
2020-09-10 16:33:16 +00:00
Mathieu Duponchelle 7563a68ec8 rtpbasepayload: do not forget delayed segment when forwarding gaps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/797>
2020-09-08 23:01:46 +00:00
Matthew Waters a1e9f4e37b rtpbasepayload: place twcc-ext-id behind environment variable
Adding properties for each and every rtp header extension is not
scalable and a new interface will be implemented for the general case
(https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/777).

Set the environment variable "GST_RTP_ENABLE_EXPERIMENTAL_TWCC_PROPERTY"
to any value to reenable the short-lived twcc-ext-id property.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/761

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/756>
2020-07-21 11:57:55 +00:00
Santiago Carot-Nemesio 93cb325fa1 rtcpbuffer: Notify error in case packet can not be added to an RTCP compound packet
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/476>
2020-07-10 14:16:10 +00:00
Havard Graff 0826fb95b7 audio: video: Optimize by using cached quark for meta tag
Avoid taking the global quark lock for every single buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/295>
2020-06-27 09:23:10 +00:00
Havard Graff 5464d420f9 rtpbasedepayload: improve logging around negative gaps
When warning, it is important that the log will contain information to
help debug the problem. Sequence-numbers are crucial here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/725>
2020-06-26 17:16:33 +00:00
Sebastian Dröge f2af205a78 Fix up and add various "Since" markers and other related docs fixes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/713>
2020-06-19 12:17:55 +03:00
Miguel Paris f265e5cbd5 rtpbuffer: add_extension_onebyte_header: fix the proper wordlen
The wordlen ("length") MUST represent the total "number of 32-bit words
in the extension, excluding the four-octet extension header" (rfc3550).
There are cases where already existent padding is reused for adding
the new extension. So the new wordlen should be updated if the new
added extension makes it to increase.
2020-03-19 14:18:20 +01:00
Miguel Paris 2d4d28d662 rtpbuffer: get_onebyte_header_end_offset: allow 0 offset
There are some cases where the full extension data could be padding.
In order to make the GstRtpBuffer robust enough, this change supports
this case.
2020-03-19 14:18:20 +01:00
Tobias Ronge f1b3ed37c6 gstrtpbasepayloader: Add property for scaling RTP timestamp
This patch introduces a property which, if set to FALSE, prevents RTP
basepayloader from scaling the RTP time when a segment's rate is not
equal to 1.0. The specification is ambiguous on this subject and some
clients expect the timestamps not to be scaled.
2020-03-16 10:25:44 +00:00
Håvard Graff 85e201fe30 rtpbasepayload: add property for embedding twcc sequencenumbers
By setting the extension-ID for TWCC (Transport Wide Congestion Control),
the payloader will embed sequencenumbers as a RTP header-extension
according to https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#section-2

The negotiation of this being enabled with downstream elements
is done with caps reflecting the way this is communicated using SDP.
2020-02-14 09:40:59 +00:00
Kristofer Björkström 4152b0c840 rtpbasepayload: timestamp bug, if rate control=no
With commit "basepayload: Expose onvif-no-rate-control property" the rtp
timestamp changed behaviour when rate control is disabled.

When disabling rate control, we must take care of the stream time to
avoid the timestamps to begin from zero again.
2020-02-11 12:30:49 +00:00
Havard Graff 19e4d1a93c rtpbuffer: add gst_rtp_buffer_get_extension_onebyte_header_from_bytes
So that one can parse the GBytes returned by gst_rtp_buffer_get_extension_bytes
2020-02-04 08:44:43 +00:00
Nicolas Dufresne 8b2afcf56a rtpbasepayload: Save and forward the push flow return
Save push/push_list helper flow return and in case of failure, return it
in the process function. This allow forwarding downstream flow return
even if the subclass is using the push/push_list helper.
2020-01-11 19:39:55 -05:00
Havard Graff daea137c9d rtcpbuffer: add RTPFB_TYPE_TWCC for Transport-Wide Congestion Control 2019-11-05 12:42:52 +00:00
Tim-Philipp Müller 289d8e53e2 Remove autotools build system 2019-10-13 14:15:43 +01:00
Thibault Saunier 909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Mathieu Duponchelle c854c270be basedepayload: do not create segment in onvif mode
basedepayload generates its own segment in a pretty unconventional
manner, relying on information in the caps such as npt-start or
npt-stop, usually set by rtspsrc.

In ONVIF mode, rtspsrc will generate the correct segment and this
logic in rtpbasedepayload will not be needed, this commit allows
rtspsrc to signal that through the caps.
2019-07-18 17:54:04 +02:00
Stian Selnes eaade96409 rtpbasedepayload: Add max-reorder property
Add max-reorder property to make the old hard coded reordering limit of
100 configurable. It's particularly useful in some scenarios to set
max-reorder=0 to disable the behavior that the depayloader will drop
packets.

Note that although the default value is 100, the default limit has
increased with one because of the changed if-test. This was done to
allow the max-reorder value to be more intuitive. See tests.
2019-06-13 19:41:11 +03:00
Havard Graff f7408f9418 rtpbasepayload: don't use GINT_TO_POINTER with GType
GType can (and will) be 64bit. GINT_TO_POINTER is not.
This will result in the api-type checked for being a different one than
it actually is...
2019-06-12 12:38:26 +00:00
Havard Graff 2e342a16ce rtpbasedepayload: don't consider existing GstRTPSourceMeta
The meta should always be generated based on what is present in the
rtp-header.
2019-06-12 12:38:26 +00:00
Marc Leeman a83859aaee gstrtppayloads: add vp8/vp9/opus encoding-name
Adding these encoding names allows easy lookup of the caps based on the
encoding-name.
2019-06-12 12:32:33 +00:00
Niels De Graef 93daa1435a Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally
Since we started depending on GLib 2.44, we can be sure this macro is
defined (it will be a no-op on compilers that don't support it). For
plugins we should just start using `G_DECLARE_FINAL_TYPE` which means we
no longer need the macro there, but for most types in base/gst-libs we
don't want to break ABI, which means it's better to just keep it like it
is (and use the `#ifdef` instead).
2019-06-04 20:31:09 -04:00
Thibault Saunier 287897e465 doc: Fix some gtk-doc comments 2019-05-13 11:34:08 -04:00
Thibault Saunier 685731e989 meson: Add variables for gir files
And flatten list of sources for dependencies
2019-05-13 10:19:22 -04:00
Mathieu Duponchelle 3c4bef46b7 basepayload: Expose onvif-no-rate-control property
The ONVIF spec mandates that when Rate-Control=no, the RTP timestamps
match the original sampling times, as opposed to the intended playback
time.
2019-04-05 16:42:55 +00:00
Josep Torra c1a5a36bba rtcpbuffer: test for len instead of type
The function rtcp_packet_min_length() returns a length for each known type
and -1 for unknown types. This change fixes the test accordingly and silences
the following warning.

gstrtcpbuffer.c:567:12: error: comparison of constant -1 with expression of type 'GstRTCPType' is always false
      [-Werror,-Wtautological-constant-out-of-range-compare]
  if (type == -1)
2019-03-21 19:27:28 +01:00
Nicolas Dufresne 3ee89d6e3c Remove some left over 0.10 references 2019-03-21 17:22:24 +00:00
Stian Selnes eadeec791a rtpbasedepayload: Drop gap events before first buffer
Before a gap event is pushed downstream a segment event must be pushed
since the gap event can cause packet concealment downstream and hence
data flow. Since concealment before receiving any data packets usually
doesn't make any sense, the gap event is not sent downstream.

Alternatively one could generate a default caps and segment event, but
no need to complicate things until it's proven necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=773104
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/301
2019-03-20 15:30:50 +00:00
Antonio Ospite 1eb9c5b309 rtpbasepayload: print list size in log output instead of -1
It is weird to see "Preparing to push packet with size 4294967295" in
the logs, so print the list length in case of a buffer list.
2019-03-15 17:38:58 +01:00
Marc Leeman 2e5f5e67ce rtp: add H265 to lookup for media info 2019-03-05 14:33:17 +01:00
Seungha Yang c389dbf332 rtcpbuffer: Remove invalid sanity check
Checking the address distance between given begin/end sequence
doesn't make sense. They are output params.

This is to fix weird failure of libs_rtp on Windows
2018-12-30 23:25:14 +00:00
Tim-Philipp Müller 83806dc4e1 rtcpbuffer: fix typo 2018-12-30 18:06:58 +00:00
Tim-Philipp Müller 44b18ea2b6 rtcpbuffer: fix function guards with side effects
Code in g_return_*() must not have side effects, as it
might be compiled out if -DG_DISABLE_CHECKS is used, in
which case we would read garbage off the stack.
2018-12-30 17:28:38 +00:00
Tim-Philipp Müller aa910c3cb7 rtp: fix g-i warnings
Use same variable name in function declaration as in function
definition and gtk-doc/g-i blurb.
2018-12-16 23:15:57 +00:00
Olivier Crête 01a25d81c1 rtcpbuffer: Validate the length of RTCP packets 2018-12-13 14:01:06 -05:00