Commit graph

776 commits

Author SHA1 Message Date
fengalin
a6702a76d5 matroska: re-activate and update TOC support
TOC support in mastroskamux has been deactivated for a couple of years. This commit updates it to recent GstToc evolutions and introduces toc unit tests for both matroska-mux and matroska-demux.

There are two UIDs for Chapters in Matroska's specifications:
- The ChapterUID is a mandatory unsigned integer which internally refers to a given chapter. Except for title & language which use dedicated fields, this UID can also be used to add tags to the Chapter. The tags come in a separate section of the container.
- The ChapterStringUID is an optional UTF-8 string which also uniquely refers to a chapter but from an external perspective. It can act as a "WebVTT cue identifier" which "can be used to reference a specific cue, for example from script or CSS".

During muxing, the ChapterUID is generated and checked for unicity, while the ChapterStringUID receives the user defined UID. In order to be able to refer to chapters from the tags section, we maintain an internal Toc tree with the generated ChapterUID.

When demuxing, the ChapterStringUIDs (if available) are assigned to the GstTocEntries UIDs and an internal toc mimicking the toc is used to keep track of the ChapterUIDs and match the tags with the appropriate GstTocEntries.

https://bugzilla.gnome.org/show_bug.cgi?id=790686
2017-12-15 16:14:43 +02:00
Tim-Philipp Müller
c6b686624a tests: ignore rtph264 test binary 2017-12-09 16:15:24 +00:00
George Kiagiadakis
33bddfe321 tests: udpsrc: verify the correct amount of bytes is sent to the socket
https://bugzilla.gnome.org/show_bug.cgi?id=786799
2017-12-09 16:08:49 +00:00
George Kiagiadakis
ea7d2a0257 tests: udpsrc: ensure test won't timeout if the buffers are already received
Sometimes all the buffers are received before the time we lock the
check_mutex, in which case g_cond_wait will wait forever for another
one. Just check if this is the case before waiting.

https://bugzilla.gnome.org/attachment.cgi?id=358397
2017-12-09 16:08:38 +00:00
George Kiagiadakis
45c82ee798 tests: udpsrc: fix test_udpsrc to actually run and fix locking
Previously this would silently be skipped because 1600 != 1400
and there is no assertion on this call.

Also unlock check_mutex after use.

https://bugzilla.gnome.org/show_bug.cgi?id=786799
2017-12-09 16:05:28 +00:00
Haakon Sporsheim
3c0d006c03 rtpsession: Handle zero length feedback packets
https://bugzilla.gnome.org/show_bug.cgi?id=791074
2017-12-02 13:58:34 +00:00
Havard Graff
96d837b301 tests: rtpsession: refactor tests to use GstHarness
This patch simplifies the tests (44% less code) and
makes them much more readable.

The provided SessionHarness also makes it much easier
to write new tests for rtpsession.

https://bugzilla.gnome.org/show_bug.cgi?id=791070
2017-12-02 13:05:01 +00:00
Jan Schmidt
76e458a119 splitmuxsink: Use muxer reserved space properties if present.
If the use-robust-muxing property is set, check if the
assigned muxer has reserved-max-duration and
reserved-duration-remaining properties, and if so set
the configured maximum duration to the reserved-max-duration
property, and monitor the remaining space to start
a new file if the reserved header space is about to run out -
even though it never ought to.
2017-11-25 00:56:11 +11:00
Jan Schmidt
3a813a0dcc splitmux: Fix file switch-on-caps-change.
Switching to a new fragment because the input caps have
changed didn't properly end the previous file. Use the normal
EOS sequence to ensure that happens. Add a test that it works.
2017-11-24 16:56:03 +11: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
a9e57f3608 tests: rtph264depay: add test for using downstream memory allocator 2017-11-23 09:36:00 +01:00
Tim-Philipp Müller
5547901a37 mpg123: hook up to build system
https://bugzilla.gnome.org/show_bug.cgi?id=774252
2017-08-20 15:50:22 +01:00
Tim-Philipp Müller
4b1f43ebe3 Moving mpg123 plugin from -ugly 2017-08-20 13:48:48 +01:00
Sebastian Dröge
7e718d6039 Revert "matroskamux: adjust unit test to modified behaviour"
This reverts commit 8fe478c8a7.

We're back to previous behaviour
2017-07-18 10:08:33 +03:00
Olivier Crête
96e71b0286 rtpsession: Send EOS if all internal sources sent bye
The ones which are not internal should not matter, and we should
wait for all sources to have sent their BYEs.

And add unit test

https://bugzilla.gnome.org/show_bug.cgi?id=773218
2017-07-04 21:14:10 -04:00
Jan Alexander Steffens (heftig)
aa8ac28d86 tests: souphttpsrc: Avoid deprecated ssl-ca-file property
SoupSession's ssl-ca-file property is deprecated. Use the recommended
tls-database property.

This is a bit more complex as it requires creating a GTlsFileDatabase
object for an absolute (!) path to the CA certificates file.

https://bugzilla.gnome.org/show_bug.cgi?id=784005
2017-06-29 15:32:30 -04:00
Jan Alexander Steffens (heftig)
9922091f1b tests: souphttpsrc: Avoid deprecated server ssl properties
The ssl-cert-file and ssl-key-file properties are deprecated. Use the
soup_server_set_ssl_cert_file function to load the files.

https://bugzilla.gnome.org/show_bug.cgi?id=784005
2017-06-29 15:32:30 -04:00
Jan Alexander Steffens (heftig)
27a0ea8cf5 tests: souphttpsrc: Make ssl_cert/key_file static
Just a bit of cleanup.

https://bugzilla.gnome.org/show_bug.cgi?id=784005
2017-06-29 15:32:30 -04:00
Tim-Philipp Müller
dd23afb6d4 sys: remove sunaudio plugin
Even though hooked up to the build system, it's clear that no one
has ever built or used this with GStreamer 1.x. It wants to link
against libgstinterfaces, which no longer exists. And uses 0.10-style
raw audio caps. And the last meaningful change was done in 2009.
Let's just remove it.
2017-06-23 20:02:43 +01:00
Tim-Philipp Müller
c35292505b meson: add options to set package name and origin
https://bugzilla.gnome.org/show_bug.cgi?id=782172
2017-05-20 14:53:42 +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
Edward Hervey
7e9b7658e5 tests: Add vp9enc to gitignore 2017-04-12 11:33:05 +02:00
George Kiagiadakis
21f532f1c6 tests/check/rtprtx: add checks for rtprtxqueue's max-size-{time,packets} properties
https://bugzilla.gnome.org/show_bug.cgi?id=780867
2017-04-11 09:44:33 +03:00
Vincent Penquerc'h
d7212dac2e tests: fix leak in splitmux test
https://bugzilla.gnome.org/show_bug.cgi?id=781025
2017-04-09 11:19:56 +03:00
Jan Schmidt
57939fd98a splitmux test: Use passed first/last timestamps
Don't hard-code the expected timestamp range, use the
values the caller is passing in.
2017-03-14 15:48:08 +11:00
Nicolas Dufresne
27303b5904 tests: Add missing LDADD for libm in tests using math.h
Also, remove the math.h include for the one that just prentend to need
it.
2017-03-08 22:55:09 -05:00
Jan Schmidt
4335c4c160 splitmux: Add unit test for reverse playback
Ensure that reverse playback works and generates the range
of timestamps (0-3s) we expect, in monotonically descending order.
2017-03-04 00:35:32 +11: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
George Kiagiadakis
e6bd2a5c18 tests: splitmux: add unit test for content with sparse streams
https://bugzilla.gnome.org/show_bug.cgi?id=761086
2017-02-27 12:58:21 +02:00
Guillaume Desmottes
0f719af307 tests: matroskamux, qtmux: don't add codec_data buffers to template caps
streamheader and codec_data buffers fields are only meant to be
in the negotiated caps, not the template caps.

Fixes false-positive leaks of those buffers detected by the leaks
tracer, as template caps are static, and we decided to not include
code in gstreamer core to handle this unusual case of template caps
having buffers in them.

https://bugzilla.gnome.org/show_bug.cgi?id=768762
2017-02-21 15:47:16 +00:00
Søren Juul
1184429e21 icydemux: reset tags on empty value
Some radio streams uses StreamTitle='' to reset the title after a
track stopped playing, e.g. while the host talks between tracks or
during news segments.
This change forces an empty tag object to be distributed if
StreamTitle or StreamUrl is received with empty value, thus allowing
downstream elements to get notified about this.

https://bugzilla.gnome.org/show_bug.cgi?id=778437
2017-02-14 12:24:13 +02:00
Tim-Philipp Müller
781b5ac781 tests: rtpjitterbuffer: fix compiler warning due to c99-ism
rtpjitterbuffer.c:592:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
2017-01-09 19:04:04 +00:00
Jan Schmidt
f7009eb5d7 splitmuxsink: Add format-location-full signal
Add a new signal for formatting the filename, which receives
a GstSample containing the first buffer from the reference
stream that will be muxed into that file.

Useful for creating filenames that are based on the
running time or other attributes of the buffer.

To make it work, opening of files and setting filenames is
now deferred until there is some data to write to it,
which also requires some changes to how async state changes
and gap events are handled.
2017-01-03 01:34:02 +11:00
Edward Hervey
3a4d4dcd27 check: Remove dead code 2017-01-02 15:06:33 +01:00
Nicola Murino
8fe478c8a7 matroskamux: adjust unit test to modified behaviour
Now matroskamux mark all packets of audio-only streams as keyframes so
in test_block_group after pushing the test audio data 4 buffers are produced
and not more 2. The last buffer is the original data and must match with what
pushed. The remaining ones are matroskamux headers

https://bugzilla.gnome.org/show_bug.cgi?id=754696
2016-12-21 16:58:42 +00:00
Havard Graff
0a81f71df5 tests/jitterbuffer: Major refactoring and cleanups
* Changed PCMU->TEST for common macros
* Changed verify-functions (lost & rtx) into macros.
* Remove option to add marker-bit for test-buffers (not used anywhere)
* Add new push_test_buffer function that makes sure there are correlation
  between dts and the time on the clock. (classic test-mistake)
* Established a generic starting-point for tests with the
  construct_deterministic_initial_state function and use it where
  applicable, which removes lots of "boilerplate" everywhere.
* Add basic lost-event test
* Remove as much "magic constants" as possible.
* Remove 3 tests that no longer are testing anything that others don't,
  and was completely unmaintainable.
* Remove unnecessary use of the testclock
* Verify each test is testing what it actually says it does (and modify
  where it doesn't)

In general, make the tests much smaller, better, more maintainable and
readable.

https://bugzilla.gnome.org/show_bug.cgi?id=774409
2016-12-14 15:00:37 +02:00
Sebastian Dröge
63938ef730 gst: Don't declare variables inside the for loop header
This is a C99 feature.
2016-12-13 22:32:46 +02:00
Philippe Normand
dcd3ce9751 rtpbin: receive bundle support
A new signal named on-bundled-ssrc is provided and can be
used by the application to redirect a stream to a different
GstRtpSession or to keep the RTX stream grouped within the
GstRtpSession of the same media type.

https://bugzilla.gnome.org/show_bug.cgi?id=772740
2016-11-16 08:56:34 +01:00
Havard Graff
1a4393fb4d rtpjitterbuffer: fix timer-reuse bug
When doing rtx, the jitterbuffer will always add an rtx-timer for the next
sequence number.

In the case of the packet corresponding to that sequence number arriving,
that same timer will be reused, and simply moved on to wait for the
following sequence number etc.

Once an rtx-timer expires (after all retries), it will be rescheduled as
a lost-timer instead for the same sequence number.

Now, if this particular sequence-number now arrives (after the timer has
become a lost-timer), the reuse mechanism *should* now set a new
rtx-timer for the next sequence number, but the bug is that it does
not change the timer-type, and hence schedules a lost-timer for that
following sequence number, with the result that you will have a very
early lost-event for a packet that might still arrive, and you will
never be able to send any rtx for this packet.

Found by Erlend Graff - erlend@pexip.com

https://bugzilla.gnome.org/show_bug.cgi?id=773891
2016-11-04 16:56:56 +02:00
Havard Graff
fb9c75db36 rtpjitterbuffer: fix lost-event using dts instead of pts
The lost-event was using a different time-domain (dts) than the outgoing
buffers (pts). Given certain network-conditions these two would become
sufficiently different and the lost-event contained timestamp/duration
that was really wrong. As an example GstAudioDecoder could produce
a stream that jumps back and forth in time after receiving a lost-event.

The previous behavior calculated the pts (based on the rtptime) inside the
rtp_jitter_buffer_insert function, but now this functionality has been
refactored into a new function rtp_jitter_buffer_calculate_pts that is
called much earlier in the _chain function to make pts available to
various calculations that wrongly used dts previously
(like the lost-event).

There are however two calculations where using dts is the right thing to
do: calculating the receive-jitter and the rtx-round-trip-time, where the
arrival time of the buffer from the network is the right metric
(and is what dts in fact is today).

The patch also adds two tests regarding B-frames or the
“rtptime-going-backwards”-scenario, as there were some concerns that this
patch might break this behavior (which the tests shows it does not).
2016-11-04 16:51:20 +02:00
Havard Graff
bea35f97c8 rtpjitterbuffer: fix bug in reschedule_timer
The new timeout is always going to be (timeout + delay), however, the
old behavior compared the current timeout to just (timeout), basically
being (delay) off.

This would happen if rtx-delay == rtx-retry-timeout, with the result that
a second rtx attempt for any buffers would be scheduled immediately instead
of after rtx-delay ms.

Simply calculate (new_timeout = timeout + delay) and then use that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=773905
2016-11-04 16:40:14 +02:00
Tim-Philipp Müller
752dd15c54 tests: wavparse: add test for processing an actual .wav file
https://bugzilla.gnome.org/show_bug.cgi?id=773861
2016-11-03 15:42:29 +02:00
Havard Graff
78ab8cbdcd rtph263ppay: Fix caps leak
Fix leaking caps when downstream has not-fixed caps.

https://bugzilla.gnome.org/show_bug.cgi?id=773515
2016-11-01 20:20:47 +02:00
Tim-Philipp Müller
834339b773 tests: videomixer: disable racy flush_start_flush_stop test
It's been broken for years, and it's unlikely it will ever
be fixed for collectpads/videomixer now that there's compositor
which works fine. So let's disable it, since all it does
is that it creates noise that distracts from other failures.

Also see the corresponding adder bug as it failed in the same way:
 https://bugzilla.gnome.org/show_bug.cgi?id=708891
2016-10-20 22:08:14 +01:00
Jan Alexander Steffens (heftig)
6deab72e10 tests: Fix souphttpsrc tests without CK_FORK=no
It seems that the forked processes all attempt to handle the listening
socket from the server, and only one has to shutdown the socket to break
the server completely.

Create a new server inside each test to avoid this.

https://bugzilla.gnome.org/show_bug.cgi?id=772656
2016-10-20 13:29:07 +03:00
Jan Alexander Steffens (heftig)
22ced681af tests: Fix level test in CK_FORK=no mode
The tests accumulate buffers in GstCheck's buffers list, and the list is
not (consistently) reset between tests. Do that and remove the now
conflicting unrefs for outbuffers.

https://bugzilla.gnome.org/show_bug.cgi?id=772644
2016-10-20 13:23:30 +03:00
Tim-Philipp Müller
e6d188967a tests: fix indentation 2016-09-15 09:53:07 +01:00
Havard Graff
f440b074b1 rtpjitterbuffer: improved rtx-rtt averaging
The basic idea is this:
1. For *larger* rtx-rtt, weigh a new measurement as before
2. For *smaller* rtx-rtt, be a bit more conservative and weigh a bit less
3. For very large measurements, consider them "outliers"
   and count them a lot less

The idea being that reducing the rtx-rtt is much more harmful then
increasing it, since we don't want to be underestimating the rtt of the
network, and when using this number to estimate the latency you need for
you jitterbuffer, you would rather want it to be a bit larger then a bit
smaller, potentially losing rtx-packets. The "outlier-detector" is there
to prevent a single skewed measurement to affect the outcome too much.
On wireless networks, these are surprisingly common.

https://bugzilla.gnome.org/show_bug.cgi?id=769768
2016-09-14 19:37:50 -04:00
Stian Selnes
f8238f0a9f rtpjitterbuffer: Detect whether to assume equidistant spacing when loss
Assuming equidistant packet spacing when that's not true leads to more
loss than necessary in the case of reordering and jitter. Typically this
is true for video where one frame often consists of multiple packets
with the same rtp timestamp. In this case it's better to assume that the
missing packets have the same timestamp as the last received packet, so
that the scheduled lost timer does not time out too early causing the
packets to be considered lost even though they may arrive in time.

https://bugzilla.gnome.org/show_bug.cgi?id=769768
2016-09-14 19:37:50 -04:00
Stian Selnes
2eb7383816 rtpjitterbuffer: Don't request rtx if 'now' is past retry period
There is no need to schedule another EXPECTED timer if we're already
past the retry period. Under normal operation this won't happen, but if
there are more timers than the jitterbuffer is able to process in
real-time, scheduling more timers will just make the situation worse.
Instead, consider this packet as lost and move on. This scenario can
occur with high loss rate, low rtt and high configured latency.

https://bugzilla.gnome.org/show_bug.cgi?id=769768
2016-09-14 19:37:50 -04:00