Commit graph

59 commits

Author SHA1 Message Date
Tim-Philipp Müller
bf56fd97b6 Use g_memdup2() where available and add fallback for older GLib versions
- png: alloc size variable is a png type that's always 32-bit
- vpx: alloc size based on existing allocation
- wavpack: alloc size based on existing allocation
- icles: gdkpixbufoverlay: trusted and hard-coded input data
- rtp tests: rtp-payloading, vp8, vp9, h264, h265: trusted and/or static input data

g_memdup() is deprecated since GLib 2.68 and we want to avoid
deprecation warnings with recent versions of GLib.

Also use gst_buffer_new_memdup() instead of _wrapped(g_memdup(),..)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/993>
2021-06-02 17:34:38 +01:00
Guillaume Desmottes
5fa3325335 rtpopuspay: set MARKER flag
Set MARKER flag on first buffer after DTX.

According to RFC 3551 section 4.1 the marker bit needs to be set on
"the first packet after a silence period during which packets have
not been transmitted contiguously".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/967>
2021-04-26 15:25:56 +02:00
Guillaume Desmottes
41ba8c1b00 rtpopuspay: add DTX support
If enabled, the payloader won't transmit empty frames.

Can be tested using:
  opusenc dtx=true bitrate-type=vbr ! rtpopuspay dtx=true

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/967>
2021-04-26 15:25:56 +02:00
Marijn Suijten
030b1b3fa5 tests/rtp-payloading: Use new AudioFormatInfo::fill_silence function
The function is renamed to be properly associated with AudioFormatInfo
(its instance) instead of AudioFormat (an unrelated enum), see [1] for
the rename itself.

[1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/940
2020-11-26 10:06:25 +02:00
Sebastian Dröge
e9a0307b94 rtph26[45]pay: Change default aggregate-mode to "none" for backwards compatibility
We didn't aggregate at all in previous versions and there are apparently
various RTP implementations that don't handle aggregation well at all.

As part of this also document that for RTSP it is recommended to keep it
set to "none" while for WebRTC it should be set to "zero-latency".

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/692>
2020-08-08 10:08:31 +03:00
Tim-Philipp Müller
66296fcae3 tests: rtp-payloading: add minimal vp8/vp9 rtp payloading/depayloading test 2020-03-12 16:55:44 +00:00
Aaron Boxer
46989dca96 documentation: fix a number of typos 2019-10-05 22:38:11 +00:00
Olivier Crête
97f2fb4cc8 rtph26xpay: Wait until there is a VCL or suffix NAL to send
With unit tests.
2019-07-03 19:05:29 +00:00
Olivier Crête
1b32cb1eae rtph265pay: Implement Aggregation packets
Align with rtph264pay
2019-07-03 19:05:29 +00:00
Olivier Crête
0c094612be rtp-payloading test: Fix working to 1.0 buffers instead of groups 2019-07-03 19:05:29 +00:00
Jan Alexander Steffens (heftig)
b46dab13d2 rtph264pay: Support STAP-A bundling
Add a new property "do-aggregate"* to the H.264 RTP payloader which
enables STAP-A aggregation as per [RFC-6184][1]. With aggregation enabled,
packets are bundled instead of sent immediately, up until the MTU size.
Bundles also end at access unit boundaries or when packets have to be
fragmented.

*: The property-name is kept generic since it might apply more widely,
   e.g. STAP-B or MTAP.
[1]: https://tools.ietf.org/html/rfc6184#section-5.7

Closes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/434
2019-07-03 19:05:29 +00:00
Victor Toso
4a33b083f1 tests: rtp-payloading avoid -Wmaybe-uninitialized
More false positives as both of them are initialized in the line
before they are used, wrapped with fail_unless() check.
2019-01-18 13:53:18 +00:00
Seungha Yang
cc5ee5f673 tests: Remove pointless unistd.h include 2018-12-30 21:54:44 +09:00
Tim-Philipp Müller
bca8ac2cf0 tests: rtp-payloading: add unit test for rtph264pay codec_data
Make sure no trailing zero bytes sneak into our SPS or PPS.

https://bugzilla.gnome.org/show_bug.cgi?id=732758
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
4df3669c0c tests: rtp-payloading: add test for rtph264depay avc/byte-stream output
Make sure avc output doesn't contain SPS/PPS inline, but
byte-stream output does.
2017-04-24 17:31:04 +01:00
Sebastian Dröge
eefcdc9ee1 rtp-payloading: Add new test for Vorbis renegotiation
Check if encoding, payloading, depayloading and decoding works if the
stream configuration (and thus the headers) change.
2017-02-27 19:25:35 +02:00
Josep Torra
ccc7d7e5a3 tests: remove a wrong 'const' specifier
Fixes "error: duplicate 'const' declaration specifier"
2016-08-26 21:14:47 +02:00
Guillaume Desmottes
94232da665 tests: fix bus leaks
gst_bus_add_signal_watch() takes a ref on the bus which should be
released using gst_bus_remove_signal_watch().

https://bugzilla.gnome.org/show_bug.cgi?id=768739
2016-07-18 10:53:19 +01:00
Jonas Holmberg
833c530553 rtph265pay: Accept array_completeness=1
When parsing NAL unit type in codec_data, check the 6bits of
NAL_unit_type only and do not require the array_completeness bit to be
0, since the default and mandatory value of array_completeness is 1 for
hvc1.

https://bugzilla.gnome.org/show_bug.cgi?id=768653
2016-07-11 11:49:41 +03:00
Jonas Holmberg
a06152c40a rtph265pay/depay: Sync against RFC 7798
Handle sprop-vps, sprop-sps and sprop-pps in caps instead of
sprop-parameter-sets.

rtph265pay works with byte-stream and hvc1 formats but not hev1 yet. It
handles profile-id, tier-flag and level-id in caps query.

https://bugzilla.gnome.org/show_bug.cgi?id=753760
2016-07-07 14:59:50 +03:00
Tim-Philipp Müller
03e2655f70 tests: add unit test for jpeg depayloader packet loss handling
Make sure it always outputs something that looks like a valid
JPEG frame, ie. starts with an SOI marker and ends with an EOI
marker.
2016-04-04 17:42:03 +01:00
Tim-Philipp Müller
3026d1094b rtph264pay: change config-interval property type from uint to int
This way we can use -1 as special value, which is nicer than MAXUINT.
This is backwards compatible even with the GValue API, as shown by
a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=757892
2015-11-27 12:48:09 +00:00
Josep Torra
f8b9360dad tests: rtp-payloading: Test for handling of custom events in rtpgst
Add a simple test that checks proper serialization/deserialization
of custom events with rtpgstpay and rtpgstdepay.
2015-11-17 17:24:28 -08:00
Tim-Philipp Müller
4ed4d0b84c tests: rtp-payloading: add basic unit test for KLV payloading
Also make it so that the mtu is always set if specified, not
only in case of the rather weird bufferlist test code path.
This allows us to easily make the payloader fragment a payload
across multiple output packets by setting a small MTU on it.
2015-07-07 20:11:28 +01:00
Stian Selnes
ef8d630a59 rtp: add H.261 RTP payloader and depayloader
Implementation according to RFC 4587.

Payloader create fragments on MB boundaries in order to match MTU size
the best it can. Some decoders/depayloaders in the wild are very strict
about receiving a continuous bit-stream (e.g. no no-op bits between
frames), so the payloader will shift the compressed bit-stream of a
frame to align with the last significant bit of the previous frame.

Depayloader does not try to be fancy in case of packet loss. It simply
drops all packets for a frame if there is a loss, keeping it simple.

https://bugzilla.gnome.org/show_bug.cgi?id=751886
2015-07-03 11:48:41 +01:00
Sebastian Rasmussen
cf54d4cc67 rtph263pay/-depay: add framesize SDP attribute
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726416
2015-04-02 19:38:21 -04:00
Mark Nauwelaerts
6ea83d97c5 tests: rtp-payloading: adjust test data to avoid NAL chopping
... and correspondingly unexpected buffer sizes.
2014-08-10 12:32:38 +02:00
Tim-Philipp Müller
c7c72c00b1 rtph264pay: push single buffer directly, no need to wrap it in a bufferlist
No point in a buffer list if we just have one single
buffer to push. Fix up unit test to handle that case
as well.
2014-06-18 14:54:58 +01:00
David Holroyd
a956a6ceb2 rtp: add L24 pay and depayloader
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=707734
2013-09-09 15:13:46 +02:00
Sebastian Dröge
1a11a9be0c rtp: Fail payloading unit test if an error message is received 2013-07-08 14:15:34 +02:00
Wim Taymans
1516c14881 Revert "rtph264pay/depay: Add frame dimensions a payloaded caps"
This reverts commit 3dca756a5d.

The H264 RTP spec has no attributes for width and height.
2013-05-31 15:11:12 +02:00
Wim Taymans
f870cef8bc Revert "rtpjpegpay/depay: Replace framerate caps field with fraction"
This reverts commit 9fd25a810b.

We deal with sdp attributes in application/sdp, which are always strings.
2013-05-31 15:05:51 +02:00
Sebastian Rasmussen
9fd25a810b rtpjpegpay/depay: Replace framerate caps field with fraction
The previous implementation had the formatting of SDP attributes happen
in each RTP payloader, now instead the constituent values are propagated
as caps fields. This allows for applications to do SDP offer/answer
based on caps negotiation.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700748
2013-05-23 21:05:49 +02:00
Sebastian Rasmussen
3dca756a5d rtph264pay/depay: Add frame dimensions a payloaded caps
This allows for applications to format SDP attributes and still do SDP
offer/answer based on caps negotiation.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700749
2013-05-23 21:04:11 +02:00
Sebastian Dröge
a7ddbc03fe rtp-payloading: Fix unit test caps and AMR depayloader sink template caps
Fields were missing from the actual caps, or too many fields
existed in the template caps.
2013-02-13 12:02:46 +01:00
Jonas Holmberg
60fa4536e2 tests: add jpegpay unit test
See also https://bugzilla.gnome.org/show_bug.cgi?id=684955
2012-12-20 16:15:13 +01:00
Tim-Philipp Müller
230cf41cc9 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:07:18 +00:00
Patricia Muscalu
7a863e4d8d rtph264pay: do not push unmapped data
Also do not use a GstBuffer after it has been pushed into the adapter.

https://bugzilla.gnome.org/show_bug.cgi?id=685213
2012-10-04 09:22:50 +01:00
Mark Nauwelaerts
7940a29c74 tests: rtp-payloading: adjust to modified bufferlist semantics
... now implemented by buffer memory blocks.
2012-09-07 15:25:53 +02:00
Olivier Crête
264bcf7d6f rtph264pay: Make it actually work after cleanups 2012-08-08 19:49:05 -07:00
Tim-Philipp Müller
48706beb70 rtph263ppay: accept any h263 input unless downstream forces specific requirements
rtph263ppay should accept any input compatible with its sink template
caps if it just outputs to e.g. udpsink or fakesink.

rtph263ppay ! rtph263pdepay should also work with any compatible input.
This would fail before with not-negotiated errors because the get_caps
function would see the encoding-name in the depayloader's template caps
and default to baseline H.263 because there's no profile/level information
in those caps, which is the right thing to do if downstream has filtercaps
from an SDP, but not if those fields are absent because they can be
anything like with the depayloader's template caps. Makes

  videotestsrc ! avenc_h263p ! rtph263ppay ! rtph263pdepay ! fakesink

work.
2012-07-06 11:57:38 +01:00
Tim-Philipp Müller
76625d20d7 tests: fix h263p payload ! depayload unit test
Need to add h263version field to input caps since the
payloader sink get_caps function will contain it in the
the caps, and the stricter caps subset check requires
this to be present in the input caps as well then.
2012-07-06 11:57:38 +01:00
Mark Nauwelaerts
85bf98fe1a tests: rtp: misc compatibiliy fixes
... such as always setting pad caps and providing needed caps fields.
2012-03-26 18:38:34 +02:00
Wim Taymans
3e8ae7603c tests: update for memory api changes 2012-03-21 13:22:43 +01:00
Wim Taymans
225e98d623 Merge branch 'master' into 0.11
Conflicts:
	ext/flac/gstflacenc.c
	ext/jack/gstjackaudioclient.c
	ext/jack/gstjackaudiosink.c
	ext/jack/gstjackaudiosrc.c
	ext/pulse/plugin.c
	ext/shout2/gstshout2.c
	gst/matroska/matroska-mux.c
	gst/rtp/gstrtph264pay.c
2012-02-10 16:23:14 +01:00
Tim-Philipp Müller
dca42d4767 tests: clean up rtp-payloading test a little
Feed data into the pipeline using appsrc instead of fdsrc and
a pipe. Store unsigned byte values in guint8 instead of char.
Getting rid of the capsfilter also helps to avoid 'format is
not fully specified' warnings when pushing "video/x-h264" data
into rtph264pay with fully specified h264 caps in the sink template.
2012-02-10 14:07:45 +00:00
Wim Taymans
8e39d52bbb tests: make more tests compile 2012-01-03 14:16:28 +01:00
Wim Taymans
77ad0a1363 port more elements to new audio caps and API 2011-08-19 14:01:45 +02:00
Robert Swain
4893678fd1 tests: Address unused but set variables
GCC 4.6.x spits warnings about such usage of variables.
2011-04-16 13:10:58 +01:00
Wim Taymans
5a5c0d6911 tests: fix rtpjpegpay test
Make the data we send to the jpeg payloader be a valid jpeg file because the
payloader now expects this.
2010-09-09 18:48:54 +02:00