platform/upstream/gstreamer.git
4 years agojpegdec: Don't dereference NULL input state if we have no caps in TIME segments
Sebastian Dröge [Thu, 25 Jul 2019 12:08:54 +0000 (15:08 +0300)]
jpegdec: Don't dereference NULL input state if we have no caps in TIME segments

Simply assume that the JPEG frame is not going to be interlaced instead
of crashing.

4 years agortp: opuspay: fix memory leak in gst_rtp_opus_pay_setcaps.
Knut Andre Tidemann [Mon, 22 Jul 2019 08:28:50 +0000 (10:28 +0200)]
rtp: opuspay: fix memory leak in gst_rtp_opus_pay_setcaps.

The src caps were never dereferenced, causing a memory leak.

5 years agoqtdemux: implement support for trickmode interval
Mathieu Duponchelle [Fri, 12 Jul 2019 18:51:44 +0000 (20:51 +0200)]
qtdemux: implement support for trickmode interval

When the seek event contains a (newly-added) trickmode interval,
and TRICKMODE_KEY_UNITS was requested, only let through keyframes
separated with the required interval

5 years agomeson: Don't generate doc cache when no plugins are enabled
Nirbheek Chauhan [Wed, 17 Jul 2019 13:42:19 +0000 (19:12 +0530)]
meson: Don't generate doc cache when no plugins are enabled

Fixes gst-build with -Dauto-features=disabled

5 years agomatroska: Port to color_{primaries,transfer,matrix}_to_iso
Seungha Yang [Mon, 15 Jul 2019 14:24:05 +0000 (23:24 +0900)]
matroska: Port to color_{primaries,transfer,matrix}_to_iso

... and remove duplicated code.

5 years agosplitmuxsink: add the ability to mux auxilliary video streams
Jan Schmidt [Sat, 25 May 2019 12:08:05 +0000 (22:08 +1000)]
splitmuxsink: add the ability to mux auxilliary video streams

The primary video stream is used to select fragment cut points
at keyframe boundaries. Auxilliary video streams may be
broken up at any packet - so fragments may not start with a keyframe
for those streams.

5 years agosplitmuxsrc: Add video_%d pad template.
Jan Schmidt [Tue, 11 Jun 2019 13:17:30 +0000 (23:17 +1000)]
splitmuxsrc: Add video_%d pad template.

splitmuxsrc actually supports multiple video pads. Make that clear,
especially since it was already creating pads named "video_0" etc.

5 years agoqtdemux: fix conditions for end of segment in reverse playback
Mathieu Duponchelle [Tue, 9 Jul 2019 21:12:45 +0000 (23:12 +0200)]
qtdemux: fix conditions for end of segment in reverse playback

The time_position field of the stream is offset by the media_start
of its QtDemuxSegment compared to the start of the GstSegment of
the demuxer, take it into account when making comparisons.

5 years agomatroskademux: Fix mismatched transfer characteristic
Seungha Yang [Tue, 9 Jul 2019 14:06:12 +0000 (23:06 +0900)]
matroskademux: Fix mismatched transfer characteristic

TransferCharacteristics(18) should be ARIB STD-B67 (HLG)
See https://www.webmproject.org/docs/container/#TransferCharacteristics

Also map more color primaries indexes which have been handled by matroska-mux.

5 years agov4l2: Remove misleading comments
Seungha Yang [Tue, 9 Jul 2019 10:49:57 +0000 (19:49 +0900)]
v4l2: Remove misleading comments

gst_pad_template_new() does not take ownership of the caps

5 years agortp session: Add test for collision loopback detection
Olivier Crête [Wed, 23 Jan 2019 23:27:06 +0000 (18:27 -0500)]
rtp session: Add test for collision loopback detection

Ignore further collisions if the remote SSRC change with ours, it's
probably because someone is sending us back the packets we send out.

5 years agortpsession tests: Add test for third-party collision detection
Olivier Crête [Wed, 23 Jan 2019 23:14:23 +0000 (18:14 -0500)]
rtpsession tests: Add test for third-party collision detection

Add tests to validate the code that ignores the same packets coming
from 2 different sources (an third-party collision).

5 years agortpsession: Add test for collision on incoming packets
Olivier Crête [Wed, 23 Jan 2019 22:19:15 +0000 (17:19 -0500)]
rtpsession: Add test for collision on incoming packets

Make sure that the collision is properly detected on incoming packets.

5 years agortpsession test: Verify that on-ssrc-collision message is emitted
Olivier Crête [Wed, 23 Jan 2019 22:09:27 +0000 (17:09 -0500)]
rtpsession test: Verify that on-ssrc-collision message is emitted

5 years agortpsession: Also send conflict event when sending packet
Olivier Crête [Wed, 23 Jan 2019 21:58:22 +0000 (16:58 -0500)]
rtpsession: Also send conflict event when sending packet

If the conflict is detected when sending a packet, then also send an
upstream event to tell the source to reconfigure itself.

Also ignore the collision if we see more than one collision from the same
remote source to avoid problems on loops.

5 years agov4l2transform: set right buffer count.
Song Bing [Mon, 15 Apr 2019 23:32:03 +0000 (16:32 -0700)]
v4l2transform: set right buffer count.

Set right buffer count to avoid one buffer.

5 years agortph265pay: Also immediately send packet if it is a suffix NAL
Olivier Crête [Thu, 27 Jun 2019 23:47:41 +0000 (19:47 -0400)]
rtph265pay: Also immediately send packet if it is a suffix NAL

Immediately send packet if it contains any suffix NAL, this is required
in case they come after the VCL nal to not have to wait until the next frame.

5 years agortph265pay: Don't drop second byte of NAL header
Olivier Crête [Thu, 27 Jun 2019 23:46:01 +0000 (19:46 -0400)]
rtph265pay: Don't drop second byte of NAL header

At least keep 2 bytes per NAL even if the second one is 0, the
second byte of the NAL header could very well be 0.

5 years agortph26xpay: Avoid print when there is no bundle at end of packet
Olivier Crête [Wed, 26 Jun 2019 20:42:44 +0000 (16:42 -0400)]
rtph26xpay: Avoid print when there is no bundle at end of packet

5 years agortph26xpay: Wait until there is a VCL or suffix NAL to send
Olivier Crête [Wed, 26 Jun 2019 20:25:01 +0000 (16:25 -0400)]
rtph26xpay: Wait until there is a VCL or suffix NAL to send

With unit tests.

5 years agortph265pay test: Add unit tests for aggregation
Olivier Crête [Wed, 19 Jun 2019 21:16:03 +0000 (17:16 -0400)]
rtph265pay test: Add unit tests for aggregation

5 years agortph265pay: Implement Aggregation packets
Olivier Crête [Tue, 18 Jun 2019 23:07:38 +0000 (19:07 -0400)]
rtph265pay: Implement Aggregation packets

Align with rtph264pay

5 years agortph264pay test: Add unit tests for aggregation
Olivier Crête [Tue, 18 Jun 2019 19:03:09 +0000 (15:03 -0400)]
rtph264pay test: Add unit tests for aggregation

5 years agortph264pay: Report latency when in maximal aggregation mode
Olivier Crête [Tue, 18 Jun 2019 17:45:15 +0000 (13:45 -0400)]
rtph264pay: Report latency when in maximal aggregation mode

5 years agortph264pay: Default to not adding latency when aggregating
Olivier Crête [Mon, 17 Jun 2019 15:31:53 +0000 (11:31 -0400)]
rtph264pay: Default to not adding latency when aggregating

Send the bundle as soon as there is one VCL unit in the packet at
the end of an incoming buffer.

The DELTA_UNIT flag is not reliable, so ignore it.

5 years agortp-payloading test: Fix working to 1.0 buffers instead of groups
Olivier Crête [Fri, 14 Jun 2019 20:54:23 +0000 (16:54 -0400)]
rtp-payloading test: Fix working to 1.0 buffers instead of groups

5 years agortph265pay: Replace fragmentation while-loop with for-loop
Olivier Crête [Thu, 13 Jun 2019 22:07:35 +0000 (18:07 -0400)]
rtph265pay: Replace fragmentation while-loop with for-loop

Align with rtph264pay

5 years agortph265pay: Rename payload_len to max_fragment_size
Olivier Crête [Thu, 13 Jun 2019 21:42:05 +0000 (17:42 -0400)]
rtph265pay: Rename payload_len to max_fragment_size

Align to rtph264pay

5 years agortph265pay: Clean up _payload_nal
Olivier Crête [Thu, 13 Jun 2019 21:30:08 +0000 (17:30 -0400)]
rtph265pay: Clean up _payload_nal

Move determining whether we need to fragment at all into the
fragmenter.

Align with rtph264pay

5 years agortph265pay: Extract sending fragments into _payload_nal_fragment
Olivier Crête [Thu, 13 Jun 2019 21:23:26 +0000 (17:23 -0400)]
rtph265pay: Extract sending fragments into _payload_nal_fragment

Align with rtph264pay

5 years agortph265pay: Extract sending a single packet into _payload_nal_single
Olivier Crête [Thu, 13 Jun 2019 20:22:57 +0000 (16:22 -0400)]
rtph265pay: Extract sending a single packet into _payload_nal_single

Align with rtph264pay

5 years agortph265pay: Define and use FU_A_TYPE_ID
Olivier Crête [Thu, 13 Jun 2019 20:14:31 +0000 (16:14 -0400)]
rtph265pay: Define and use FU_A_TYPE_ID

Align with rtph264pay

5 years agortph265pay: Use snake_case variables
Olivier Crête [Thu, 13 Jun 2019 20:08:37 +0000 (16:08 -0400)]
rtph265pay: Use snake_case variables

Align with rtph264pay

5 years agortph265pay: Clean up whitespace and syntax
Olivier Crête [Thu, 13 Jun 2019 20:04:39 +0000 (16:04 -0400)]
rtph265pay: Clean up whitespace and syntax

Align with rtph264pay

5 years agortph264pay: Support STAP-A bundling
Jan Alexander Steffens (heftig) [Tue, 3 Jul 2018 17:39:25 +0000 (19:39 +0200)]
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

5 years agortph264pay: Fix delta-unit/discont handling when injecting SPS/PPS
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:15:39 +0000 (17:15 +0100)]
rtph264pay: Fix delta-unit/discont handling when injecting SPS/PPS

Apply the wanted delta-unit and discont to the first packet; following
packets for this frame are always delta units and not discont.

5 years agortph264pay: Replace fragmentation while-loop with for-loop
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 18:03:45 +0000 (19:03 +0100)]
rtph264pay: Replace fragmentation while-loop with for-loop

5 years agortph264pay: Calculate the right max_fragments
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:57:38 +0000 (18:57 +0100)]
rtph264pay: Calculate the right max_fragments

5 years agortph264pay: Rename payload_len to max_fragment_size
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:36:35 +0000 (18:36 +0100)]
rtph264pay: Rename payload_len to max_fragment_size

5 years agortph264pay: Clean up _payload_nal_fragment
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:34:40 +0000 (18:34 +0100)]
rtph264pay: Clean up _payload_nal_fragment

5 years agortph264pay: Clean up _payload_nal
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:06:19 +0000 (18:06 +0100)]
rtph264pay: Clean up _payload_nal

Move determining whether we need to fragment at all into the fragmenter.

5 years agortph264pay: Clean up _payload_nal_single
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:04:13 +0000 (18:04 +0100)]
rtph264pay: Clean up _payload_nal_single

5 years agortph264pay: Extract sending fragments into _payload_nal_fragment
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:55:23 +0000 (17:55 +0100)]
rtph264pay: Extract sending fragments into _payload_nal_fragment

5 years agortph264pay: Extract sending a single packet into _payload_nal_single
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:49:52 +0000 (17:49 +0100)]
rtph264pay: Extract sending a single packet into _payload_nal_single

5 years agortph264pay: Define and use FU_A_TYPE_ID
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:10:03 +0000 (17:10 +0100)]
rtph264pay: Define and use FU_A_TYPE_ID

5 years agortph264pay: Use snake_case variables
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:07:06 +0000 (17:07 +0100)]
rtph264pay: Use snake_case variables

5 years agortph264pay: Clean up whitespace and syntax
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:04:14 +0000 (17:04 +0100)]
rtph264pay: Clean up whitespace and syntax

5 years agortpjitterbuffer: Unlock output if the queue is full
Olivier Crête [Thu, 6 Jun 2019 20:05:31 +0000 (16:05 -0400)]
rtpjitterbuffer: Unlock output if the queue is full

5 years agortpjitterbuffer: Ignore unsolicited rtx packets.
Thomas Bluemel [Sun, 30 Jun 2019 05:17:28 +0000 (23:17 -0600)]
rtpjitterbuffer: Ignore unsolicited rtx packets.

If an rtx packet arrives that hasn't been requested (it might
have been requested from prior to a reset), ignore it so that
it doesn't inadvertently trigger a clock skew.

5 years agortpjitterbuffer: Add unit test for unsolicited rtx affecting skew
Havard Graff [Sun, 30 Jun 2019 05:16:44 +0000 (23:16 -0600)]
rtpjitterbuffer: Add unit test for unsolicited rtx affecting skew

5 years agortpjitterbuffer: Only calculate skew or reset if no gap.
Thomas Bluemel [Thu, 13 Jun 2019 21:45:28 +0000 (15:45 -0600)]
rtpjitterbuffer: Only calculate skew or reset if no gap.

In the case of reordered packets, calculating skew would cause
pts values to be off. Only calculate skew when packets come
in as expected. Also, late RTX packets should not trigger
clock skew adjustments.

Fixes #612

5 years agoqtdemux: Provide a 30 frames lead-in for MP3
Mart Raudsepp [Tue, 2 Jul 2019 18:21:05 +0000 (21:21 +0300)]
qtdemux: Provide a 30 frames lead-in for MP3

mpegaudioparse suggests MP3 needs 10 or 30 frames of lead-in (depending on
mpegaudioversion, which we don't know here), thus provide at least 30 frames
lead-in for such cases as a followup to commit cbfa4531ee5ef.

5 years agortpjitterbuffer: max-dropout-time gets cast to int32
Olivier Crête [Fri, 24 May 2019 14:31:39 +0000 (10:31 -0400)]
rtpjitterbuffer: max-dropout-time gets cast to int32

So any value over MAXINT32 gets considered as negative and is silently ignored.

5 years agoqtdemux: do_seek can never be called with a NULL event
Mathieu Duponchelle [Tue, 2 Jul 2019 11:00:32 +0000 (13:00 +0200)]
qtdemux: do_seek can never be called with a NULL event

5 years agoqtdemux: only adjust segment time when adjusting segment start
Mathieu Duponchelle [Mon, 1 Jul 2019 20:38:41 +0000 (22:38 +0200)]
qtdemux: only adjust segment time when adjusting segment start

We ended up setting segment.time to segment.position when doing
reverse playback, which is obviously wrong.

5 years agortspsrc: unref the event in element seek handler
Mathieu Duponchelle [Mon, 1 Jul 2019 11:54:13 +0000 (13:54 +0200)]
rtspsrc: unref the event in element seek handler

5 years agortspsrc: handle seek event on the element
Mathieu Duponchelle [Fri, 28 Jun 2019 22:25:26 +0000 (00:25 +0200)]
rtspsrc: handle seek event on the element

Without this, the user has to wait for rtspsrc to have sent a PLAY
request and exposed its pads before seeking it.

5 years agomultiudpsink: Add missing socket.h include
Nicolas Dufresne [Wed, 26 Jun 2019 22:03:29 +0000 (18:03 -0400)]
multiudpsink: Add missing socket.h include

Without this include, macro like SO_BINDTODEVICE is not visible and
associated feature gets out-compiled. This also affects the support for
SO_SNDBUF.

5 years agoflvmux: Clear new_tags if sending metadata in header
Jan Alexander Steffens (heftig) [Mon, 24 Jun 2019 15:35:15 +0000 (17:35 +0200)]
flvmux: Clear new_tags if sending metadata in header

This avoids sending an additional metadata object right after the
headers.

5 years agov4l2videodec: Fix drain() function return type
Song Bing [Wed, 13 Jun 2018 21:55:29 +0000 (14:55 -0700)]
v4l2videodec: Fix drain() function return type

Return right type for drain() function.

5 years agoaudioparsers: add back segment clipping to parsers that have lost it
Mart Raudsepp [Mon, 24 Jun 2019 11:28:39 +0000 (14:28 +0300)]
audioparsers: add back segment clipping to parsers that have lost it

The pre_push_frame default clipping behaviour was introduced in 2010
with commit 30be03004e82 and modified with commit 4163969a2422 in 2011,
when most parsers didn't implement a pre_push_frame yet. Not having it
meant that clipping was done by default. Those that did implement a
pre_push_frame (flacparse and mpegaudioparse) at the time, had the flag
adjusted as part of the 2011 refactor work.

All other parsers got a pre_push_frame vfunc implementation only in
2013, but seem to have forgot to keep the clipping behaviour, as
was done automatically when a pre_push_frame implementation doesn't
exist for the parser. aacparse lost it with commit 91d4abcea in
July 2013; the others in Dec 2013 as part of AUDIO_CODEC tag posting
in commits 6f89b430ed2ab5199b29f2cae12753d3c23a and 292780574.

5 years agov4l2: fix compiler warning due to c99-ism
Tim-Philipp Müller [Mon, 24 Jun 2019 09:42:31 +0000 (09:42 +0000)]
v4l2: fix compiler warning due to c99-ism

5 years agotest: flvmux: Test changing caps with one sinkpad
Jan Alexander Steffens (heftig) [Wed, 19 Jun 2019 12:28:28 +0000 (14:28 +0200)]
test: flvmux: Test changing caps with one sinkpad

These tests segfault without the preceding crash fix.

5 years agotest: flvmux: Use gst_harness_sink_push_many
Jan Alexander Steffens (heftig) [Wed, 19 Jun 2019 12:08:06 +0000 (14:08 +0200)]
test: flvmux: Use gst_harness_sink_push_many

And check its return value.

5 years agoflvmux: Simplify an if-else chain
Jan Alexander Steffens (heftig) [Wed, 19 Jun 2019 10:31:46 +0000 (12:31 +0200)]
flvmux: Simplify an if-else chain

Merge the identical branches and turn the condition around to make it
easier to read.

5 years agoflvmux: Avoid crash when changing caps without both streams
Jan Alexander Steffens (heftig) [Wed, 19 Jun 2019 10:28:22 +0000 (12:28 +0200)]
flvmux: Avoid crash when changing caps without both streams

mux->video_pad and mux->audio_pad can be NULL if the corresponding pad
has not been requested.

5 years agortpgstpay: Send caps anyway if caps are pending in the adapter but are different...
Sebastian Dröge [Wed, 12 Jun 2019 12:57:48 +0000 (15:57 +0300)]
rtpgstpay: Send caps anyway if caps are pending in the adapter but are different from the new ones

Otherwise it can happen that we receive a caps event, then another caps
event and only then buffers. We would then send out the first caps event
in the stream but mark buffers with the caps version of the second caps
event.

5 years agortpgstdepay: Only store the current caps and drop old caps immediately
Sebastian Dröge [Wed, 12 Jun 2019 11:57:24 +0000 (14:57 +0300)]
rtpgstdepay: Only store the current caps and drop old caps immediately

Otherwise it can happen that we already collected 7 caps, miss the 8th
caps packet (packet loss) and then re-use the 1st caps for the following
buffers instead of the 8th caps which will likely cause errors further
downstream unless both caps are accidentally the same.

Keeping old caps around does not seem to have any value other than
potentially causing errors. We would always receive new caps whenever
they change (even if they were previous ones) and it's very unlikely
that they happen to be exactly the same as the previous ones.

Also after having received new caps or a buffer with a next caps
version, no buffers with old caps version will arrive anymore.

5 years agortpjitterbuffer: Clear clock master before unreffing
Jan Schmidt [Fri, 14 Jun 2019 16:00:43 +0000 (02:00 +1000)]
rtpjitterbuffer: Clear clock master before unreffing

Make sure to clear any master clock on the media_clock
before unreffing it to release the timer callback that's
updating the clock and keeping it reffed.

5 years agomatroska: Initialise a video_context field to satisfy valgrind
Jan Schmidt [Sun, 16 Jun 2019 01:07:31 +0000 (11:07 +1000)]
matroska: Initialise a video_context field to satisfy valgrind

Clear the mastering_display_info_present field explicitly
after reallocating the track context into a video context
to avoid uninitialised warnings in valgrind

5 years agodocs: Fix link to strings
Thibault Saunier [Fri, 14 Jun 2019 21:34:31 +0000 (17:34 -0400)]
docs: Fix link to strings

We can't link to #gchar* this way.

5 years agojitterbuffer: unset DTS on output buffers
Mathieu Duponchelle [Thu, 13 Jun 2019 22:17:22 +0000 (00:17 +0200)]
jitterbuffer: unset DTS on output buffers

5 years agosplitmuxsink: set the same seqnum on flush_start / flush_stop
Mathieu Duponchelle [Wed, 22 May 2019 19:40:52 +0000 (21:40 +0200)]
splitmuxsink: set the same seqnum on flush_start / flush_stop

It's currently not made mandatory by aggregator, but it might
eventually be, and is more consistent behaviour

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/977

5 years agortpjitterbuffer: late packets shouldn't affect PTS of the following packet
Mikhail Fludkov [Thu, 13 Jun 2019 09:55:04 +0000 (11:55 +0200)]
rtpjitterbuffer: late packets shouldn't affect PTS of the following packet

If, say, a rtx-packet arrives really late, this can have a dramatic
effect on the jitterbuffer clock-skew logic, having it being reset
and losing track of the current dts-to-pts calculations, directly affecting
the packets that arrive later.

This is demonstrated in the test, where a RTX packet is pushed in really
late, and without this patch the last packet will have its PTS affected
by this, where as a late RTX packet should be redundant information, and
not affect anything.

5 years agortpjitterbuffer: fix rtx delay calulation when large packet spacing
Mikhail Fludkov [Wed, 12 Jun 2019 08:47:39 +0000 (10:47 +0200)]
rtpjitterbuffer: fix rtx delay calulation when large packet spacing

5 years agortpjitterbuffer: Fix delay for EXPECTED timers added by gaps
Stian Selnes [Thu, 24 Nov 2016 17:18:01 +0000 (18:18 +0100)]
rtpjitterbuffer: Fix delay for EXPECTED timers added by gaps

This patch corrects the delay set on EXPECTED timers that are added when
processing gaps. Previously the delay could be too small so that
'timout + delay' was much less than 'now', causing the following retries
to be scheduled too early. (They were sent earlier than
rtx-retry-timeout after the previous timeout.)

5 years agortpjitterbuffer: don't try and calculate packet-rate if seqnum are jumping
Havard Graff [Tue, 20 Nov 2018 15:11:12 +0000 (16:11 +0100)]
rtpjitterbuffer: don't try and calculate packet-rate if seqnum are jumping

Turns out that the "big-gap"-logic of the jitterbuffer has been horribly
broken.

For people using lost-events, an RTP-stream with a gap in sequencenumbers,
would produce exactly that many lost-events immediately.
So if your sequence-numbers jumped 20000, you would get 20000 lost-events
in your pipeline...

The test that looks after this logic "test_push_big_gap", basically
incremented the DTS of the buffer equal to the gap that was introduced,
so that in fact this would be more of a "large pause" test, than an
actual gap/discontinuity in the sequencenumbers.

Once the test was modified to not increment DTS (buffer arrival time) with
a similar gap, all sorts of crazy started happening, including adding
thousands of timers, and the logic that should have kicked in, the
"handle_big_gap_buffer"-logic, was not called at all, why?

Because the number max_dropout is calculated using the packet-rate, and
the packet-rate logic would, in this particular test, report that
the new packet rate was over 400000 packets per second!!!

I believe the right fix is to don't try and update the packet-rate if
there is any jumps in the sequence-numbers, and only do these calculations
for nice, sequential streams.

5 years agortpjitterbuffer: fix unused variables
Havard Graff [Wed, 12 Jun 2019 09:16:22 +0000 (11:16 +0200)]
rtpjitterbuffer: fix unused variables

5 years agosplitmuxsrc: Protect initial pad configuration with the object lock
Jan Schmidt [Tue, 11 Jun 2019 16:42:42 +0000 (02:42 +1000)]
splitmuxsrc: Protect initial pad configuration with the object lock

gst_splitmux_src_activate_part() configures the pad information
before starting the pad task, but occasionally the changes it makes
to the pad are not seen in the pad task because they're not
protected by the right locking. Use the pad's object lock to
protect those variables.

5 years agosplitmuxsrc: Restart pad task on a reconfigure
Jan Schmidt [Tue, 11 Jun 2019 15:42:20 +0000 (01:42 +1000)]
splitmuxsrc: Restart pad task on a reconfigure

On a reconfigure event, restart streaming on the pad so
that switching tracks in playbin works cleanly

5 years agosplitmuxsrc: Use an RW lock instead of a mutex to protect the pad list
Jan Schmidt [Tue, 11 Jun 2019 08:40:09 +0000 (18:40 +1000)]
splitmuxsrc: Use an RW lock instead of a mutex to protect the pad list

Fix a deadlock around the pads list by using an RW lock to
allow simultaneous readers. The pad list doesn't really changes
except at startup and shutdown.

5 years agosplitmuxsrc: Ignore duplicate seeks
Jan Schmidt [Tue, 11 Jun 2019 13:18:24 +0000 (23:18 +1000)]
splitmuxsrc: Ignore duplicate seeks

Use the seqnum to ignore duplicated seek events.

5 years agosplitmuxsink: Improve debug output
Jan Schmidt [Tue, 28 May 2019 23:20:07 +0000 (09:20 +1000)]
splitmuxsink: Improve debug output

Make the debug output less confusing by not mentioning a src
pad when doing calculations on the sink pad side.

Improve debug around why a GOP is considered overflowing a fragment

5 years agosplitmuxsink: Give internal queues useful names
Jan Schmidt [Tue, 28 May 2019 23:20:07 +0000 (09:20 +1000)]
splitmuxsink: Give internal queues useful names

Makes debug output more useful

5 years agoqtdemux: Provide a 2 frames lead-in for audio decoders
Mart Raudsepp [Wed, 5 Jun 2019 20:13:33 +0000 (23:13 +0300)]
qtdemux: Provide a 2 frames lead-in for audio decoders

AAC and various other audio codecs need a couple frames of lead-in to
decode it properly. The parser elements like aacparse take care of it
via gst_base_parse_set_frame_rate, but when inside a container, the
demuxer is doing the seek segment handling and never gives lead-in
data downstream.
Handle this similar to going back to a keyframe with video, in the
same place. Without a lead-in, the start of the segment is silence,
when it shouldn't, which becomes especially evident in NLE use cases.

5 years agoqtdemux: remove indent exception and reindent
Mart Raudsepp [Tue, 28 May 2019 17:14:49 +0000 (20:14 +0300)]
qtdemux: remove indent exception and reindent

As the indent disabling isn't playing along for a following fix,
remove the indent disabling and reindent in a way that doesn't
look too stupid.

5 years agov4l2: Fix H.264 level 3 string representation
Philippe Normand [Fri, 8 Mar 2019 14:43:20 +0000 (14:43 +0000)]
v4l2: Fix H.264 level 3 string representation

The string_to_level function handles "3" so the level_to_string function should
do the same, to prevent caps negotiation issues.

5 years agov4l2: Profile and level probing support for encoders and decoders
Philippe Normand [Mon, 4 Mar 2019 11:05:29 +0000 (11:05 +0000)]
v4l2: Profile and level probing support for encoders and decoders

There used to be some profile/level support in encoders. This code was moved to
GstV4l2Codecs and is now also used for decoders. The caps templates for the
H.264, H.265, MPEG4, VP8 and VP9 encoders and decoders should now reflect the
profiles and levels advertised by the kernel.

5 years agomatroskamux: fix typo in property description
Aaron Boxer [Mon, 3 Jun 2019 20:21:12 +0000 (16:21 -0400)]
matroskamux: fix typo in property description

5 years agosupp: Ignore leaks caused by shout/sethostent
Nicolas Dufresne [Tue, 4 Jun 2019 17:39:00 +0000 (13:39 -0400)]
supp: Ignore leaks caused by shout/sethostent

sethostent() seems to be using a global state and we endup with leaks from
that API when called through shout_init(). We had the option to only
ignore the shout case, but the impression is that if we have shout and
another sethostend user, as it's a global state, we may endup with a
different stack trace for the same leak. So in the end, we just ignore
memory allocated by sethostent in general.

5 years agopulse-device: Hide the alsa device provider if we provide alsa devices
Thibault Saunier [Tue, 30 Apr 2019 21:28:25 +0000 (17:28 -0400)]
pulse-device: Hide the alsa device provider if we provide alsa devices

5 years agortpssrcdemux: Avoid taking streamlock out-of-band
Nicolas Dufresne [Tue, 21 May 2019 19:25:03 +0000 (15:25 -0400)]
rtpssrcdemux: Avoid taking streamlock out-of-band

In this change we now protect the internal srcpads list using the
stream lock and limit usage of the internal stream lock to
preventing data flowing on the other src pad type while creating
and signalling the new pad.

This fixes a deadlock with RTPBin shutdown lock. These two locks would
end up being taken in two different order, which caused a deadlock. More
generally, we should not rely on a streamlock when handling out-of-band
data, so as a side effect, we should not take a stream lock when
iterating internal links.

5 years agov4l2object: Orphan buffer pool on object_stop if supported
Damian Hobson-Garcia [Mon, 27 May 2019 09:08:54 +0000 (18:08 +0900)]
v4l2object: Orphan buffer pool on object_stop if supported

Use V4L2 buffer orphaning, on recent kernels so that
the device can be restarted immediately with
a new buffer pool during renogatiation.

5 years agov4l2bufferpool: Free orphaned allocator resources when buffers are released
Damian Hobson-Garcia [Thu, 30 May 2019 04:12:31 +0000 (13:12 +0900)]
v4l2bufferpool: Free orphaned allocator resources when buffers are released

Allocator resources cannot be freed when a buffer pool is orphaned
while its buffers are in use. They should, however, be freed once those
buffers are no longer needed. This patch disposes of any buffers
belonging to an orphaned pool as they are released, and makes sure
that the allocator is cleaned up when the last buffer is returned.

5 years agov4l2bufferpool: return TRUE when buffer pool orphaning succeeds
Damian Hobson-Garcia [Thu, 30 May 2019 02:13:07 +0000 (11:13 +0900)]
v4l2bufferpool: return TRUE when buffer pool orphaning succeeds

When trying to orphan a buffer pool, successfully return and unref
the pool when the pool is either successfully stopped or orphaned.
Indicate failure and leave the pool untouched otherwise.

5 years agomeson: Bump minimal GLib version to 2.44
Niels De Graef [Fri, 31 May 2019 21:04:11 +0000 (23:04 +0200)]
meson: Bump minimal GLib version to 2.44

This means we can use some newer features and get rid of some
boilerplate code using the G_DECLARE_* macros.

As discussed on IRC, 2.44 is old enough by now to start depending on it.

5 years agoqtmux: Use size of first closed caption buffer in prefill mode
Sebastian Dröge [Wed, 5 Sep 2018 18:10:51 +0000 (21:10 +0300)]
qtmux: Use size of first closed caption buffer in prefill mode

It must be accurate for all samples to work in Final Cut properly, so
the best we can do is to assume that all samples are the same as the
first. Bigger samples are truncated, smaller samples are padded.

5 years agodoc: remove xml from comments
Mathieu Duponchelle [Wed, 29 May 2019 20:06:58 +0000 (22:06 +0200)]
doc: remove xml from comments

5 years agodocs: update plugins cache
Tim-Philipp Müller [Wed, 29 May 2019 10:02:26 +0000 (11:02 +0100)]
docs: update plugins cache

And add gtk+ and qt plugins

5 years agodv, gtk, qt, osxaudio, osxvideo, waveform: add to plugins list
Tim-Philipp Müller [Wed, 29 May 2019 09:58:40 +0000 (10:58 +0100)]
dv, gtk, qt, osxaudio, osxvideo, waveform: add to plugins list

Makes sure the paths for these plugins are included in the
uninstalled plugin paths list. And also for the docs.

Fixes #604