Commit graph

26646 commits

Author SHA1 Message Date
Thibault Saunier
f1cf5d0683 hlssink2: Mark as Muxer
The way it is usable by encodebin2. This is what splitmux does already.
2020-11-30 15:16:01 -03:00
Víctor Manuel Jáquez Leal
ef62e6cfa2 va: decoder: Picture dups only holds GstBuffer
Also removes the warning log message at destroying buffers when picture free()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1841>
2020-11-30 17:12:14 +01:00
Víctor Manuel Jáquez Leal
14c28415b9 va: Remove gst_va_decoder_destroy_buffers()
Since GstVaDecodePicture is destroyed completely with its free() function and
it's used as destroy notify by codecs picture, there's no need to call
gst_va_decoder_destroy_buffers() externally, since the codecs base classes
destroy the codec picture when it's required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1841>
2020-11-30 16:53:25 +01:00
He Junyan
f5c7ada98e va: Destroy picture unreleased buffers when finalize.
The current way of GstVaDecodePicture's finalize will leak some
resource such as parameter buffers and slice data.
The current way deliberately leaves these resource releasing logic
to va decoder related function and trigger a warning if we free the
GstVaDecodePicture without releasing these resources.
But in practice, sometimes, you do not have the chance to release
these resource before picture is freed. For example, H264/Mpeg2
support multi slice NALs/Packets for one frame. It is possible that
we already succeed to parse and generate the first several slices
data by _decode_slice(), but then we get a wrong slice NAL/packet
and fail to parse it. We decide to discard the whole frame in the
decoder's base class, it just free the current picture and does not
trigger sub class's function again. In this kind of cases, we do
not have the chance to cleanup the resource, and the resource will
be leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1841>
2020-11-30 13:03:11 +00:00
Thibault Saunier
d608636327 qroverlay: Reuse the same OverlayComposition object when possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1829>
2020-11-26 14:34:34 +00:00
Thibault Saunier
ad5f812c91 qroverlay: Rework basing it on overlaycomposition
The base class is now a bin which wraps the `overlaycomposition`
element and implements the `draw` signal.

This way we support all the video formats the GstVideoOverlayComposition
API supports and the blending code can be reused. It is also possible
to have the blending happen in the sinks now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1829>
2020-11-26 14:34:34 +00:00
Seungha Yang
3e35a6f03f d3d11h264dec: Reconfigure decoder object on DPB size change
Even if resolution and/or bitdepth is not updated, required
DPB size can be changed per SPS update and it could be even
larger than previously configured size of DPB. If so, we need
to reconfigure DPB d3d11 texture pool again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1839>
2020-11-26 08:52:49 +00:00
Marijn Suijten
dc90a3d3cf audio: Use new AudioFormatInfo::fill_silence function
The function is renamed to be properly associated with AudioFormatInfo
(its instance) instead of AudioFormat (an unrelated enum), see [1] for
the rename itself.

[1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/940
2020-11-26 10:06:42 +02:00
Philippe Normand
d4df91cd9b player: Fix get_current_subtitle_track annotation
As the info returned is a new object, the annotation should be transfer-full,
similarly to the get_current_{audio,video}_track() implementations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1775>
2020-11-25 11:30:16 +00:00
Víctor Manuel Jáquez Leal
8e6ad8267f va: allocator: add a memory pool object helper
Since both allocators use a memory pool, with its mutex and cond, this patch
refactors it into a single internal object, implementing a generic GstMemory
pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1815>
2020-11-24 13:00:00 +01:00
Víctor Manuel Jáquez Leal
8c128ead6d va: pool, allocator: honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT
In order to honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT in VA pool, allocators'
wait_for_memory() has to be decoupled from their prepare_buffer() so it could be
called in pools' acquire_buffer() if the flag is not set.

wait_for_memory() functions are blocking so the received memories are assigned
to the fist requested buffer, if multithreaded calls. For this a new mutex were
added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1815>
2020-11-24 12:44:24 +01:00
Víctor Manuel Jáquez Leal
8fc50891b1 va: allocator: broadcast when flushing
This patch handles when the bufferpool request a new buffer while
flushing.

Also fixes the usage of g_cond_wait(), which demands to be used
inside a loop to avoid spurious wakeups.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1815>
2020-11-24 12:44:24 +01:00
Víctor Manuel Jáquez Leal
72ab56c376 va: allocator: free allocator when a mem is held
An application, using for example appsink, can hold buffers from any
va allocator after setting the pipeline to NULL. We need to destroy
the allocator when that memory is unrefed.

This patch juggles a bit with the allocator reference count in
memories in order to achieve this:

1. When memory is created no alloc ref is modified
2. When memory is released, alloc ref is decreased
3. When memory is reassiged to a buffer, alloc ref is increased
4. When memory is flushed, alloc ref is increased becase it is going
   to be decreased in gst_memory_unref()

Also this patch moves the deallocation of member variables to
finalize() rather than dispose()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1815>
2020-11-24 12:44:24 +01:00
Víctor Manuel Jáquez Leal
ba4442a29d va: allocator: dmabuf: initialize cond
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1815>
2020-11-24 12:44:24 +01:00
Olivier Crête
a801018ef1 webrtc: Make ssrc map into separate data structures
They now contain a weak reference and that could be freed later
causing strange crashes as GWeakRef are not movable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
1deb034e3d webrtcstats: Get the remote-inbound stats from the right RTPSource
This also means that we need to get the clock-rate from the codec instead
of from the RTPSource, as the remote one doesn't include a clock rate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
1c1661b54f webrtcbin: Implement getting stats for a specific pad
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
23ea950351 webrtcstats: Also return the raw rtpsource stats for more information
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
b895240241 webrtcstats: Avoid copy of GstStructure
Instead transfer the ownership to the new structure

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
a46c6e3a97 webrtcstats: Remove receiver side when sending
Those are just invalid and just reflect what we sent. We'd need to parse the
RTCP XR packets from the other side to know more about those.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
ba0dfa52d2 webrtcstats: Extract statistics from the rtpjitterbuffer
And expose them as standardised webrtc statistics

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
fc0f6db856 webrtcbin: Store the rtpjitterbuffer instances to extract stats from them
Store them as web refs to avoid having to worry about freeing later and because
the new-jitterbuffer is on a different thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
d9d7814182 webrtcstats: Document all RTP missing fields according to the latest spec
Just document all the missing fields and document which ones will never
be implemented because they depend on the codec or depayloader

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
895ea210c2 webrtcstats: RTCP computed RTT is only available at sender
The receiver doesn't have the information to compute it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
a5c3331197 webrtcstats: Remove redundant lines
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766>
2020-11-24 04:27:52 +00:00
Olivier Crête
52c676546d webrtc: Also remove rtcp_transport from the structure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1765>
2020-11-24 01:59:55 +00:00
Olivier Crête
c5d76d944e webrtc: Remove APIs to set transport on sender/receiver
They're not not used ever.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1765>
2020-11-24 01:59:55 +00:00
Olivier Crête
5d5417f271 webrtc: Remove non rtcp-mux code
RTCP mux is now always required by the WebRTC spec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1765>
2020-11-24 01:59:55 +00:00
Julian Bouzas
64f96facca nvcodec: Assume 25fps if framerate is invalid when calculating latency
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1826>
2020-11-23 18:27:43 +00:00
Víctor Manuel Jáquez Leal
1a5862dd39 codecs: h264decoder: fix memory leak
gst_h264_dbp_get_picture_all() returns a full transfer of the GArray, which
needs be unrefed. But it is not unrefed in
gst_h264_decoder_find_first_field_picture() leaking it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1827>
2020-11-23 15:23:35 +01:00
Edward Hervey
1749dc66c5 mpegts: Documentation fixes
gtk-doc was complaining :)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1825>
2020-11-21 08:58:43 +00:00
Tim-Philipp Müller
470c79be61 qroverlay: unset executable flag on source files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1824>
2020-11-20 13:24:24 +00:00
Tim-Philipp Müller
53947cad29 qroverlay: fix auto detection of json-glib for plugin
Only want to check for json-glib when libqrencode was found,
but also it shouldn't be required but depend on the option.

Fixes #1465

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1824>
2020-11-20 13:22:48 +00:00
Seungha Yang
d1e7290109 d3d11: Add support for packed 4:2:2 and 4:4:4 10bits formats
Add support for Y210 and Y410 formats which are commonly used format
for en/decoders on Windows. Note that those formats cannot be used for
render target (output) of shader.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1821>
2020-11-20 02:28:54 +09:00
Olivier Crête
03d710bd40 openh264dec: Accept constrained-high and progressive-high profiles
They're just subsets of the high profile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1634>
2020-11-18 15:47:36 -05:00
Olivier Crête
f83039531e d3d11h264dec: Accept constrained-high and progressive-high profiles
They're just subsets of the high profile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1634>
2020-11-18 15:47:34 -05:00
Olivier Crête
e17e88e033 msdkh264dec: Accept constrained-high and progressive-high profiles
They're just subsets of the high profile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1634>
2020-11-18 15:46:52 -05:00
Olivier Crête
e53da20938 nvdec: Accept progressive-high and contrained-high profiles
They're subsets of the high profiles with no interlacing and
no B-frames for constrained

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1634>
2020-11-18 15:46:52 -05:00
He Junyan
33fcb0faf0 codecparsers: av1: add the set_operating_point() API.
The av1 can support multi layers when scalability is enabled. We
need an API to set the operating point and filter the OBUs just
belonging to some layers(the layers are specified by the operating
point).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
c4aaeb0509 codecparsers: av1: Add an API to reset the annex_b state only.
In practice, we encounter streams that have one or more temporal units
error. When that kind of error temporal units is in annex b format, the
whole temporal unit should be discarded.
But the temporal units before it are correct and can be used. More
important, because of the error temporal unit, the parser is in a wrong
state and all later temporal unit are also parsed uncorrectly.
We need to add this API to reset the annex_b state only when we meet
some temporal unit error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
a4f459fe21 codecparsers: av1: clean the seen_frame_header in parse_tile_group().
The current seen_frame_header is not cleaned correctly. According
to the spec, it should be cleaned when tiles are parsed completely.
Also delete a verbose seen_frame_header init in reset_state().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
6dedbc30c5 codecparsers: av1: fix a typo in parse_metadata_scalability
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
227d7a9327 codecparsers: av1: Do not assert in identify_one_obu when check annex b size.
Some buggy stream just writes the wrong temporal unit and frame size in
the stream. We should return failure rather than assert to abort.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
b511761f70 codecparsers: av1: Add unknow AV1 profile define for saint check.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
0d4982a3d5 codecparsers: av1: Improve the parse_tile_info.
1. store more tile info when parse tile group.
   The column, row, tile offset and tile data size are all useful for
   decoder process, especially for HW kind decoder such as VAAPI dec.
   Also fix the tile group skip size for each tile data.
2. No min_inner_tile_width requirement in newest spec.
3. Calculate the sbs of each tile for both uniform tile and non-uniformi
   tile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
da0584010c codecparsers: av1: Fix a tile info read typo in frame header.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
26567354b9 codecparsers: av1: Fix a typo when get value of segmentation params.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
2fd1da60ea codecparsers: av1: add valid check for global motion params.
The global motion params and its matrix values need to be verified
before we use them. If it is invalid, we should notify the decoder
that it should not be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
8f55c9d6d2 codecparsers: av1: uint8 range is not enough for av1_bitstreamfn_ns
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00
He Junyan
900bd06939 codecparsers: av1: delete duplicated GST_AV1_GM_ABS_ALPHA_BITS define.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
2020-11-17 19:31:09 +00:00