Commit graph

4943 commits

Author SHA1 Message Date
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
Víctor Manuel Jáquez Leal
f4bcf8290b playbin3: handle GST_PLAY_FLAG_FORCE_SW_DECODERS
In decodebin3 and uridecodebin3 the `force-sw-decoders` boolean property is
added. In uridecodebin3 it is only a proxy property which will forward
the value to decodebin3.

When decodebin3 has `force-sw-decoders` disabled, it will filter out in its
decoder and decodable factories those elements within the 'Hardware'
class, at reconfiguring output stream.

playbin3 adds by default GST_PLAY_FLAG_FORCE_SW_DECODERS, and sets
`force-sw-decoders` property accordingly to its internal uridecodebin, also
filters out the 'Hardware' class decoder elements when caps
negotiation.
2020-01-09 12:28:32 +00:00
Víctor Manuel Jáquez Leal
f3182a88b1 playbin2: handle GST_PLAY_FLAG_FORCE_SW_DECODERS
Added `force-sw-decoders` boolean property in decodebin2 and
uridecodebin. By default the property is %FALSE and it bypass the new
code. Otherwise the factory list is filtered removing decoders
within 'Hardware' class.

uridecodebin sets the `force-sw-decoders` property in its internal
decodebin, and also filters out Hardware class in the
autoplug-factories default signal handler.

playbin2 adds by default GST_PLAY_FLAG_FORCE_SW_DECODERS it its flags
property, and depending on it playbin2 sets the `force-sw-decoders`
property on its internal uridecodebin, also filters out the Hardware
class decoding decoders at the autoplug-factories signal handler.
2020-01-09 12:28:32 +00:00
Víctor Manuel Jáquez Leal
d50c71708a playback: add GST_PLAY_FLAG_FORCE_SW_DECODERS enum
This flag would be common either for playbin2 and playbin3.
2020-01-09 12:28:32 +00:00
Sebastian Dröge
1c147208cc compositor: memcpy() lines directly for alpha formats with SOURCE operator and alpha=1.0 2020-01-08 16:20:30 +02:00
Randy Li
e85b856d30 rawvideoparse: allow setting the colorimetry
You can neither guess nor parse the colorimetry from the
input stream.

Signed-off-by: Randy Li <ayaka@soulik.info>
2020-01-08 02:34:17 +00:00
Sebastian Dröge
18ee5e57fd compositor: Alpha inputs with the SOURCE operator can be considered opaque
We don't have to look at each pixel's alpha component because we will
directly write it over the background.
2020-01-07 20:03:59 +02:00
Philippe Normand
0a515acfa8 playbin3: Propagate sink context
When the playsink's sink is activated its state is set to READY but it remains
unlinked. So, in order for decodebin3 to potentially reuse the context later on,
the whole playbin3 needs to have it internally stored.
2019-12-31 10:00:20 +00:00
Seungha Yang
539a703b0b playbin: Propagate sink context
Any contexts created by sink during activation need to be propagated
to whole elements of playbin.
2019-12-31 15:51:53 +09:00
Aaron Boxer
0fb2acab5b playbin: remove deprecated raw audio and raw video sink flags
These flags were deprecated in 2011 with commit
105da803ad

Removing these flags will simplify the logic in playbin.
2019-12-22 07:16:11 +00:00