Commit graph

4985 commits

Author SHA1 Message Date
Thibault Saunier 8d645e1a69 encodebin: Be less restrictive on muxer caps when preset name is specified
This way the user can simply define its caps by only providing the
structure name which is what we do in the encoding profile
deserialization function for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/811>
2020-09-09 04:26:41 +00:00
Thibault Saunier 15fd339203 encodebin: Add vp8 and vp9 smart encoding support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/770>
2020-09-09 01:24:14 +00:00
Thibault Saunier da160c57c8 encodebin: Fix refcount mishandling
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/770>
2020-09-09 01:24:14 +00:00
Sebastian Dröge 91ec4e06d7 video: Rename gst_video_color_transfer_*() to gst_video_transfer_function_*() in new API
The type is called GstVideoTransferFunction so the function names should
match, otherwise gobject-introspection is keeping the functions as
global functions instead of methods on the type.

The same mistake was also made in lots of other APIs over the years, but
here we can at least fix it for 1.18 still.

Thanks to Marijn Suijten for noticing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/807>
2020-09-07 13:04:20 +03:00
Tim-Philipp Müller 4f12ce6213 videoscale: make local quark vars static
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/802>
2020-08-28 12:30:43 +01:00
Jan Schmidt 8cacd54e8f compositor: fix off-by-1 error in blending ARGB
Use a more naive blend formulation that avoids off-by-one errors
at the 0x00 and 0xff alpha endpoints.

    Fixes #810

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/796>
2020-08-26 13:10:09 +00:00
Sebastian Dröge 3edf390b4c videorate/videoscale/audioresample: Ensure that the caps returned from fixate_caps() are actually fixated
If there is some other field than the ones we care about left and not
fixated yet then basetransform will just error out. So instead just pass
the result through gst_caps_fixate() in the very end.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/799>
2020-08-26 09:10:29 +00:00
Sebastian Dröge 39dbbf1369 videoscale: Don't call NULL GstMeta transform function
It's optional and if it does not exist then no transformation is
possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/790>
2020-08-18 10:26:48 +03:00
Thibault Saunier 5ad727f9ee compositor: Frames where we introduce alpha can't obscure anything
When a pad has alpha != 1.0 it means that the resulting frames will
contain alpha and thus can't fully obscure with a lower zorder.

Also simplifies the other checks as blending with an OVER or on a
transparent is not a no-op as previously assumed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/764>
2020-07-31 15:52:14 -04:00
Thibault Saunier 1cead20777 encodebin: Fix and refactor smart encoding
It was not working properly and the implementation of the smartencoder
element was weird. This introduce a number of changes (which are all
in one single commit because they basically all work together and lead
to basically reimplementing the element):

* Make smartencoder a bin so that the reencoding chain of elements are
  inside of it instead of not having any parent. Those elements were not
  be visible when dumping the pipeline which was very confusing.
* Make encodebin create the right encoder with a capsfilter (and parser)
  to properly enforce the format specified by the user, and so that the
  encoder properties specified in the encoding profile are respected.
* Use `decodebin` to do the decoding instead of selecting a decoder
  ourself and not plug any parser etc...
* Ensure that negotiated format in the sinkpad of smart encoder is fixed
  through time when the user requested a non dynamic output
* Add a parser at the beginning of the smart encoder
* Handle errors when reencoding

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/751>
2020-07-22 16:01:25 +00:00
Thibault Saunier d10929da7c streamsplitter: Forward STREAM_START to all branchs
Otherwise the branch that get selected later won't receive it ever.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/751>
2020-07-22 16:01:25 +00:00
Thibault Saunier 871fa29639 streamsplitter/combiner: Drain encoder before switching branch
Otherwise we miht have frames queued in the encoder from the old branch
that do not get encoded/muxed when they should.

The implementation is a bit 'weird' but the rational and solution
is documented in the code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/751>
2020-07-22 16:01:25 +00:00
Thibault Saunier a31158012b encodebin: Rebuilt internal state when swicthing to avoid-reencoding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/751>
2020-07-22 16:01:25 +00:00
Olivier Crête cb6edaf6f8 videorate: Error out on streams with no way to guess framerate
This is better than going into an infinite loop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/761>
2020-07-20 22:05:57 +00:00
Olivier Crête 90ff086a43 videorate: Assert on invalid result from internal code
Letting this through instead results in an infinite loop where
the exact same buffer gets pushed out ad infinitum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/761>
2020-07-20 22:05:57 +00:00
Nicolas Dufresne 02c10e5bab rawvideoparse: Fix tiling support
When using tile format, the stride has a different meaning. It used
the MSB and LSB 16bits to encode respectively the width and height in
number of tiles.

This issue was introduce with commit e5b70d384c which was fixing
missing size recalculation when strides and offset is updated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/753>
2020-07-14 17:33:31 +00:00
Edward Hervey 50be315a1a playback: Clarify flag usage for playbin3
Forcing software-decoder has no effect on playbin3 now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/738>
2020-07-07 15:53:23 +02:00
Edward Hervey 1e596cb33f Revert "playbin3: handle GST_PLAY_FLAG_FORCE_SW_DECODERS"
This reverts commit f4bcf8290b.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/738>
2020-07-07 15:53:23 +02:00
Edward Hervey c9c93339fb decodebin3: Only override the selection if needed
Whenever a new collection is calculated, the internal `select_streams_seqnum`
variable is reset. This ensures that we reliably know whether a select-streams
event has been received for that new collection.

Use that to decide whether we should add previously un-selected streams or new
streams in the current selection

Fixes #784

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/733>
2020-07-07 10:45:41 +02:00
Tim-Philipp Müller d5a677683e Update disted generated orc backup files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/734>
2020-07-04 14:01:56 +01:00
Tim-Philipp Müller 6bb3e01918 meson: add update-orc-dist target
Add target to update backup orc -dist.[ch] files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/734>
2020-07-04 14:01:56 +01:00
Vivia Nikolaidou ad55d3ce9d video-converter: Make fast path work for equivalent transfer functions
For example, BT709, BT601, and BT2020_10 all have theoretically
different transfer functions, but the same function in practice. In
these cases, we should use the fast path for negotiating. Also,
BT2020_12 is essentially the same as the other three, just with one more
decimal point, so it gives the same result for fewer bits. This is now
also aliased to the former three.

Also make videoconvert do passthrough if the caps have equivalent
transfer functions but are otherwise matching.

As of the previous commit, we write the correct transfer function for
BT601, instead of the (functionally identical but different ISO code)
transfer function for BT709. Files created using GStreamer prior to that
commit write the wrong transfer function for BT601 and are, strictly
speaking, 2:4:5:4 instead. However, this commit takes care of
negotiation, so that conversions from/to the same transfer function are
done using the fast path.

Fixes #783

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724>
2020-07-03 11:57:49 +03:00
Havard Graff 0826fb95b7 audio: video: Optimize by using cached quark for meta tag
Avoid taking the global quark lock for every single buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/295>
2020-06-27 09:23:10 +00:00
Thibault Saunier e9d3e4d7ea doc: Fix link in tcp multi*sinks. 2020-06-23 14:52:21 -04:00
Mathieu Duponchelle 69d5428bfc docs: mark more types as plugin API 2020-06-23 14:52:20 -04:00
Sebastian Dröge fddd7df2d3 Don't call gst_ghost_pad_construct() anymore
It's deprecated, unneeded and doesn't do anything anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/717>
2020-06-22 16:11:28 +00:00
Hosang Lee 5726a66fdb subparse: lower text buffer threshold
It is possible for subtitle files to have a string length less than 30.
WebVTT for example may contain only the 'WEBVTT' string in the file
without any cues.
As an example in hls streams, since WEBVTT files can be segmented
like video/audio, some subtitle segments may only contain just the
header string.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/708>
2020-06-22 05:46:13 +00:00
Thibault Saunier 75065ab244 videotestsrc: Do not try to answer the duration query before negotiation
We have no idea at that moment and this code was trying to divide by 0!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/705>
2020-06-15 17:24:17 +00:00
Thibault Saunier 3354b3ebbb decodebin3: Lower error message to debug
Debugging leftover

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/699>
2020-06-11 16:39:23 -04:00
Thibault Saunier 7edbc3fd7d uridecodebin3: Let decodebin do its stream selection if no one answers
If no one answers our `select-stream` signal, uridecodebin3 should
behave the same way as `decodebin3` and let decodebin do its own stream
selection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/666>
2020-06-08 12:54:05 -04:00
Thibault Saunier b41b87522f decodebin3: Avoid overriding explicit user selection
In case the user set a list of streams to select or answer explicitly
to all 'select-stream' event, we should respect his choice and not
try to add a stream per type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/666>
2020-06-08 12:54:05 -04:00
Seungha Yang 9c3cff287e playbin: Fix wrong AV element pair selection when rank is very large value
If user set very high rank to an element (e.g., integer max),
integer overflow can happen while multiplication operation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/690>
2020-06-06 20:22:28 +09:00
Mathieu Duponchelle cc516695b0 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:41:17 +02:00
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