Commit graph

4952 commits

Author SHA1 Message Date
Edward Hervey
b087415757 uridecodebin: Dont link random pads
When linking source pads to decodebin, make sure we use the *specified* new
source pad and not some random one.

This avoids ending up with source pads being unlinked.

Main cause of random timeouts with rtsp change_state_intensive validate tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/687>
2020-06-05 09:06:05 +00:00
Mathieu Duponchelle
e666c9ec04 plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 22:44:23 -04:00
Thibault Saunier
0c75ea0858 videorate: Update QoS events taking into account our rate
Otherwise there is a mismatch between the QoS values and what upstream
would expect, leading to too much buffer dropping in video decoders in
case rate < 1.0 or not enough buffer dropping in case rate > 1.0

Adding validate tests with and without decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/679>
2020-06-01 07:07:31 +00:00
Thibault Saunier
6499e2afa5 videorate: Fix changing rate property during playback
We need to take into account the base_ts to compute next_ts and it needs
to be updated on rate change.

This introduces `pending_rate` so that change rate is properly handled
in the streaming thread in a safe way.

Added tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/679>
2020-06-01 07:07:31 +00:00
Michael Gruner
9a94b4cbc1 videoscale: reorder code to avoid indent missmatches
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/548>
2020-05-29 00:44:07 +00:00
Michael Gruner
c0ca12a3fb videoscale: transform size sensitive metas
Currently, videoscale just drops all metas that have other tags
besides video. However videoscale wont change the colorspace or
the orientation of the video so metas tagged as such may be
copied safely. Additionaly, given that videoscale will change
the frame size, we invoke the meta transform implementation
to give it the opportunity to scale accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/548>
2020-05-29 00:44:07 +00:00
uno20001
e945b3706c decodebin: only emit 'drained' signal when top chain is drained
Without this, decodebin emits 'drained' multiple times which then
causes (uri)playbin to emit 'about-to-finish' multiple times for
for file types.

Fixes #751

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/673>
2020-05-27 18:51:31 +00:00
Sebastian Dröge
44cd1c7a65 audioresample: Drain resampler on discontinuities
Otherwise we would lose the last few samples when resetting the
resampler.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/670>
2020-05-27 17:06:08 +00:00
Sebastian Dröge
bf0cffc474 audioresample: Drain resampler and reset timestamp tracking on stream-start event too
And also reset timestamp tracking on EOS events as more data might come
afterwards with a new stream-start event. This keeps the code the same.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/670>
2020-05-27 17:06:08 +00:00
Sebastian Dröge
6d423cbba2 audioresample: Drain the resampler and reset timestamp tracking on caps changes
Especially when changing the sample rate our timestamp tracking will be
completely off, but even otherwise we would usually lose the last few
samples if we don't drain here as the resampler gets reset if anything
but the sample rate changes.

This is usually not a problem as the first buffer after a caps event
usually has the discont flag set, but can cause problems if
 - the caps event is followed by a segment event, which then causes
   draining according to the new sample rate
 - the caps were changed because of rengotiation due to a reconfigure
   event and there is not discontinuity from upstream

In both cases we would output buffers with completely wrong timestamps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/670>
2020-05-27 17:06:08 +00:00
Thibault Saunier
97fe599c0f videorate: Fix buffer selection logic in reverse playback
Stop comparing all timestamps from buffers that are before the segment
with the segment.stop and compare with the actual end times.

Comparing to segment.stop for all the buffers that where before
the segment.stop was incorrect and leading to consuming wrong buffers
and not respecting segment.stop, this is now properly tested.

Expectations for `reverse.10_to_1fps.validatetest` have been fixed to
take that into account and comparing the checksums of the sinkpad and
srcpad expectations makes pretty clear how wrong that was.

(we can see in the expectations that videotestsrc outputs an extra
buffer with pts == segment.stop and this one is now properly dropped
by videorate as bec7f4ad5e aimed at
doing)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/668>
2020-05-26 15:35:00 -04:00
Thibault Saunier
6e82eb28f3 videorate: Factor out a method for themax-duplication-time property
Sensibly simplifying gst_video_rate_transform_ip

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/668>
2020-05-26 15:35:00 -04:00
Thibault Saunier
39c321835b videorate: Use CLOCK_TIME_IS_VALID instead of checking CLOCK_TIME_NONE
Making it more consistency with the rest of the code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/668>
2020-05-26 15:35:00 -04:00
Thibault Saunier
086f3c05b9 videorate: Factor out a method to reset mode
Working on simplifying gst_video_rate_transform_ip

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/668>
2020-05-26 15:35:00 -04:00
Thibault Saunier
dc47232d0d videorate: Do not push an extra buffer on EOS when we are done pushing already
There is no reason that when we have already pushed all the buffers in
a segment we push a new one on EOS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/668>
2020-05-26 15:35:00 -04:00
Thibault Saunier
b46718b1a0 audiotestsrc: Fix the way we compute EOS in reverse playback
In reverse playback we were not taking into account the current buffer
samples to check if we had reached EOS which was leading to a buffer
with PTS = CLOCK_TIME_NONE containing too many frames followed by a
useless buffer with pts=0 duration=0, and a g_critical issue in
gst_object_sync_values.

Also add a validate based test case.
Without that patch this is how the expectation fails:

``` diff
--- log-asink-sink-expected       2020-05-22 23:22:42.654384579 -0400
+++ log-asink-sink-actual  2020-05-22 23:29:35.671586380 -0400
@@ -27,5 +27,6 @@
 buffer: pts=0:00:00.058820861, due=0:00:00.023219955, flags=discont
 buffer: pts=0:00:00.035600907, due=0:00:00.023219954, flags=discont
 buffer: pts=0:00:00.012380952, due=0:00:00.023219955, flags=discont
-buffer: pts=0:00:00.000000000, due=0:00:00.012380952, flags=discont
+buffer: due=0:00:00.012380953, flags=discont
+buffer: pts=0:00:00.000000000, flags=discont
 event eos: (no structure)
 ```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/667>
2020-05-25 08:19:02 +00:00
Thibault Saunier
fc2810bada videorate: Fix buffer timestamp underflow in reverse playback
And fix reverse playback buffer duration computation as in reverse
playback, buffer duration is prev_buffer.pts - buffer.pts not pts -
next_pts (buffers are displayed from buffer.pts + buffer.duration for
a duration of buffers.duration).

This is now tested with the `validate.test.clock_sync.videorate.*`
tests in the default integration testsuite where we check the exact
data flow and the synchronization on the clock behaviour with a
TestClock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/646>
2020-05-06 16:50:01 +00:00
Thibault Saunier
9ce93abb29 videotestsrc: Fix buffer duration in reverse playback
In reverse playback, buffers have to be displayed at buffer.stop running
time, meaning:

    buffer.pts + buffer.duration = prev_buffer.pts
    =>
    buffer.duration = prev_buffer.pts - buffer.pts

We were setting buffer.duration = next_buffer.pts - buffer.pts which
is not correct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/646>
2020-05-06 16:50:01 +00:00
Vivia Nikolaidou
e56b784171 tcpserversrc: Add stats property
Like in tcpclientsrc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/651>
2020-05-06 15:25:44 +03:00
Jan Schmidt
7e5368627e typefind: Consider MPEG-PS PSM to be a PES type
Include the Program Stream Map packet type 0xBC in the
set of packets we treat as PES. This fixes typefinding
on MPEG-PS streams with PSM, where the PSM would previously
be considered a loss-of-sync and cause the typefind
to require more data.
2020-04-10 22:47:04 +10:00
Philippe Normand
e38070d157 uridecodebin3: Activate suburi playback item
The suburi playback item has to be activated after the main playback item so
that playsink can properly enable text rendering.

Fixes #451
2020-04-10 07:26:49 +00:00
Sebastian Dröge
6ea225ccb4 typefindfunctions: Fix otio typefinder to actually detect otio files
The string "\"OTIO_SCHEMA\":" is 14 characters and not 15. Checking for
15 characters would also check for the final '\0', which does not exist
in any otio file as the string is the key of a JSON map.
2020-04-06 15:23:27 +03:00
Sebastian Dröge
fa91783833 typefindfunctions: Fix otio typefinder detecting anything with curly braces at the start
memcmp() returns 0 (aka FALSE) on match and a difference otherwise.

Previously the typefinder was matching on anything but otio files that
happened to have some curly braces in the beginning of the file.

Fixes a false positive with a MOV file.
2020-04-06 15:20:22 +03:00
Mathieu Duponchelle
caca46e0e6 subparse: convert from pango-markup to utf8 ..
when downstream requires it
2020-03-27 15:27:06 +00:00
Seungha Yang
bb8515671e videorate: Signalling reconfigure to upstream whenever updating downstream caps
Previously configured bufferpool can be expired/inactivate by the
updated caps. Therefore new reconfigure event should be signalled in order to
do allocation query dancing between upstream and downstream again.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/730
2020-03-23 18:50:10 +09:00
Niels De Graef
1c08a6088d volume: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
e5cc81a128 videotestsrc: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
1dd63e44b9 videoscale: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
761bb9b9ff videorate: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
f57be9dcc3 videoconvert: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
7a36730fb4 subparse: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
2daf748b61 rawparse: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
2917f9fb2d overlaycomposition: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
29b8a64b7e gio: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
d297c4447d encoding: Use G_DECLARE_FINAL_TYPE
Note that we didn't do it for encodebin, as it has a class struct. We
_could_ techincally use `G_DECLARE_DERIVABLE_TYPE()` for that one, but
that would mean also using a private struct, which is even more work for
no gain.
2020-03-16 15:47:58 +00:00
Niels De Graef
b7d123f1bd adder: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
2b67ce5b5a audioconvert: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
1b683d5a76 audiomixer: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
a42f4be0eb audiorate: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
a1ef6a1179 audioresample: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
f91659ba92 audiotestsrc: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Niels De Graef
1b6a6cabf2 compositor: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Mathieu Duponchelle
0739fafd62 subparse: accept WebVTT timestamps without an hour component
https://www.w3.org/TR/webvtt1/#webvtt-timestamp

mm:ss,000 is a valid WebVTT timestamp
2020-03-11 05:44:23 +00:00
Sebastian Dröge
d5ee11fb36 compositor: Create a square checkerboard for UYVY/YUY2/YVYU too
Previously the "squares" were twice as wide.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/732
2020-03-09 21:51:32 +00:00
Sebastian Dröge
0227d0ca60 compositor: Define a separate checker fill function for BGRx/RGBx than for xBGR/xRGB
Otherwise we'll create a cyan or yellow checkerboard.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/736
2020-03-09 21:51:32 +00:00
Vivia Nikolaidou
d1c9972e94 tcpclientsrc: Fix compilation on FreeBSD
The members of the tcp_info struct are prefixed with a double
underscore, as reported in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/584#note_423487
2020-03-08 10:45:57 +00:00
Vivia Nikolaidou
ea930a4bf8 tcpclientsrc: Expose connection stats as property
Unfortunately the OS takes care of bad connections for us, so we can't
get the stats in a platform-independent way. Count total bytes received
as well, platform-independently.
2020-02-28 14:17:34 +02:00
Dimitrios Katsaros
e0a195b7bf decodebin3: Reset main group id on PAUSED->READY state change
The main_input stream-id would not get reset when going to READY state.
This would cause warnings when trying to reuse the same decodebin3, since
you would get a new STREAM_START event with a new stream-id, which would
collide with the now stale stream-id
2020-01-27 09:33:37 +00:00
Dimitrios Katsaros
36cada4542 decodebin3: Reduced logging level of messages
The logging is set to warning for a drain event, which is part of the
normal functionality of the parsebin.
2020-01-27 09:33:37 +00:00
Dimitrios Katsaros
19b7b248cc uridecodebin3: Fixed defauts not being set on initialization
The default values were not being set on element initialization. This
was a problem for buffer_duration and buffer_size since they would be
zero initialized, rather then being set to -1. This would cause the
underlaying queue2 element to have no limits and depending on the
streamed file, could cause queue2 to allocate massive amounts of memory.
2020-01-17 13:34:27 +01:00