Commit graph

397 commits

Author SHA1 Message Date
Nicolas Dufresne 107088a658 v4l2codecs: Unify the src template caps format
Notably NV12_4L4 ended up being applied to only VP9 decoder. This fixes the
situation by using a central define for all static src pad templated formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/965>
2022-01-21 19:32:30 +00:00
Nicolas Dufresne a67e9fb05f v4l2codecs: Sync kernel headers against 5.16.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/965>
2022-01-21 19:32:30 +00:00
Víctor Manuel Jáquez Leal 08aa930fee msdk: Avoid noisy registry when no MSDK device.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1550>
2022-01-21 11:13:55 +01:00
Víctor Manuel Jáquez Leal ccc4dc2d83 va: libs: Avoid noisy registry when no VA device.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1550>
2022-01-21 10:55:55 +01:00
Seungha Yang 77225c79f9 wasapi2: Fix for device open failure on old OS
To open automatic stream routing aware device,
at least Windows10 Anniversary Update is required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1545>
2022-01-20 23:04:46 +09:00
Seungha Yang 009bc15f33 wasapi2ringbuffer: Fix for desynced buffer-size and segsize
GstAudioRingBufferSpec::segsize has been configured by using
device period but GstWasapi2RingBuffer was referencing the
buffer size returned by IAudioClient::GetBufferSize()
which is most likely larger than device period.
Fixing to sync them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1533>
2022-01-18 03:23:17 +09:00
Robert Mader e7c9960783 waylandsink: Ensure correct mapping of area_surface
If the `area_surface` got unmapped when changing to the `READY` or
`NULL` state, we currently don't remap it when playback resumes and
`wp_viewporter` is supported. Without `wp_viewporter` we do remap
it, but rather unintentionally and also when not wanted.

On Weston this has not been a big problem as it so far wrongly maps
subsurfaces of unmapped surfaces anyway - i.e. only the black
background was missing on resume. On other compositors and future
Weston this prevents the `video_surface` to get remapped.

Shuffle things around to ensure `area_surface` is mapped in the
right situations and do some minor cleanup.

See also https://gitlab.freedesktop.org/wayland/weston/-/issues/426

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1483>
2022-01-17 13:17:57 +00:00
Seungha Yang f97ab9edf7 d3d11deinterlace: Do not restrict minimum resolution to 64x64
The value 64 was completely arbitrary one, and this element
will be able to support smaller resolutions

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1528>
2022-01-16 02:23:55 +09:00
Seungha Yang e63a3a7f31 d3d11compositor: Don't try to read empty buffer
The queued buffer may not be readable buffer in case that
upstream sends GAP event or so.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1497>
2022-01-13 20:27:50 +00:00
Robert Mader 7bdb37c01b waylandsink: Fix alpha value for the test pattern in example
The background-color property is in big-endian ARGB, resulting in
a alpha value of `0`. This accidentally used to work on all common
compositors, but on Weston this now correctly results in a black
background.

See also https://gitlab.freedesktop.org/wayland/weston/-/issues/577

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>
2022-01-13 19:39:59 +00:00
Robert Mader f0b04f1ef1 waylandsink: Use wl_surface_damage_buffer() instead of wl_surface_damage()
The later, doing damage in surface coordinates instead of buffer
coordinates, has been deprecated. The reason for that is that it
is more prone to bugs, both on the client and the compositor side,
especially when paired with buffer scale, `wp_viewporter` or
buffer transforms.

Unfortunately, on Weston this risks running into
https://gitlab.freedesktop.org/wayland/weston/-/issues/446
(which causes trouble for several other projects as well). However,
that bug only affects cases where we run in sync mode, i.e. only
during resizes. In practise I haven't been able to observe the
issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>
2022-01-13 19:39:59 +00:00
Robert Mader 1249362f96 waylandsink: Use G_MAXINT32 for surface damage
Each time we call `wl_surface_damage()` we want to do full surface
damage. Like Mesa, just use `G_MAXINT32` to ensure we always do
full damage, reducing the need to track the right dimensions.

`window->video_rectangle` is now unused, but we keep it around for
now as we may need it again in the future.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>
2022-01-13 19:39:59 +00:00
Robert Mader 3bbd091bb4 waylandsink: Only call wl_surface_damage() when buffer content changed
From the spec:
> This request is used to describe the regions where the pending
> buffer is different from the current surface contents

We currently also call `wl_surface_damage()` on surfaces without
new or still compositor-hold buffers, e.g. when resizing the window.
In that case we call it on `area_surface_wrapper`, even though it
gets resized via `wp_viewport_set_destination()`, in which case
the compositor is in charge of repainting the area on screen.

Doing so is currently not forbidden by the spec, however it might
be in the future, see
https://gitlab.freedesktop.org/wayland/wayland/-/issues/267

Thus lets stay close to the spec and only call `wl_surface_damage()`
when we just attached a buffer.

Right now this prevents runtime assertions in Mutter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>
2022-01-13 19:39:59 +00:00
Robert Mader b03c7edfcf waylandsink: Simplify input region handling
We only need to unset the input region for the area surface when
we don't have our own toplevel surface. By default, the input region
covers the whole surface, thus no need to change it on resize.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>
2022-01-13 19:39:59 +00:00
Robert Mader 1e2bc68171 waylandsink: Use G_MAXINT32 for opaque regions
`gst_wl_window_set_opaque` does not get called on window resizes,
potentially leaving opaque regions too small.
According to the spec opaque regions can be bigger than the surface
size - parts that fall outside of the surface will get ignored.
Thus we can can simply use `G_MAXINT32` and be sure that the whole
surfaces will always be covered.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>
2022-01-13 19:39:59 +00:00
Dave Piché 574cbbf0b5 webrtc: fix log error message in function gst_webrtc_bin_set_local_description
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1511>
2022-01-13 15:11:35 +00:00
Tim-Philipp Müller cab0eaed1c mxfdemux: don't error out if VANC track only contains packets we don't handle
If the VANC track does contain packets, but we skip over all packets, just
treat it the same as if there hadn't been any packets at all and send a
GAP event instead of erroring out with "Failed to handle essence element".

We would error out because when we reach the end of the loop without having
found a closed caption packet the flow return variable is still FLOW_ERROR
which is what it has been initialised to.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1518>
2022-01-13 11:34:37 +00:00
He Junyan 05ee44b62b codecparsers: h265parser: return invalid profile if len is 0.
Though the profiles[0] is inited as GST_H265_PROFILE_INVALID in the
gst_h265_profile_tier_level_get_profile(), the profile detecting may
change its content later. So the return of profiles[0] may not be an
invalid profile even the len is 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1517>
2022-01-13 05:28:17 +00:00
He Junyan 9eb0f8501f codecparsers: h265parser: Fix the index incrementation error in append_profile().
The current "*idx++" operation just refers the pointer and increment the pointer
itself, not the content of the pointer. This causes that the count of the profiles
is always 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1517>
2022-01-13 05:28:17 +00:00
Dmitry Osipenko 644969e0ba kmssink: Support auto-detection of NVIDIA Tegra driver
NVIDIA Tegra SoCs have a separate (from GPU) display controller. It's
the primary display device on all Tegra SoCs. Add Tegra to the list
of primary DRM drivers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1514>
2022-01-13 04:50:55 +00:00
Mathieu Duponchelle d8c8737e71 cccombiner: fix s334-1a scheduling
The previous code was mistakenly trying to compute a cc_type out
of the first byte in the byte triplet, whereas it is to be interpreted
as:

> Bit b7 of the LINE value is the field number (0 for field 2; 1 for field 1).
> Bits b6 and b5 are 0. Bits b4-b0 form a 5-bit unsigned integer which
> represents the offset

The same mistake was made when creating padding packets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1496>
2022-01-12 14:34:22 +00:00
Mathieu Duponchelle 6861ea8fe1 cccombiner: merge buffers for both fields with caption type s334-1a
Other elements such as line21encoder expect both fields to be present
in the same meta, not one meta per field.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1496>
2022-01-12 14:34:22 +00:00
Mengkejiergeli Ba 5905955cc3 av1parser: Fix data type of film grain param
Fix cb_offset and cr_offset data type from guint8 to guint16. According
to spec, cb_offset and cr_offset are 9 bit long, while guint8 can cause
interger overflow, and thus change to guint16.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1508>
2022-01-12 11:03:17 +00:00
Nirbheek Chauhan 1be6d6ccf5 meson: Add explicit check: kwarg to all run_command() calls
This is required since Meson 0.61.0, and causes a warning to be
emitted otherwise:

2c079d855e
https://github.com/mesonbuild/meson/issues/9300

This exposed a bunch of places where we had broken run_command()
calls, unnecessary run_command() calls, and places where check: true
should be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1507>
2022-01-09 18:12:47 +05:30
Stéphane Cerveau 51e93408a9 alphacombine: update example launch line
Fix typos and missing videoconvert element to demonstrate
the alphacombine element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1494>
2022-01-06 14:59:02 +00:00
He Junyan d334c08b55 av1parse: Set the "tu" as the default alignment.
The tu(temporal unit) is more widely used than the current alignment.
We now change the default alignment to tu.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1468>
2022-01-05 08:47:06 +00:00
He Junyan cfd69b0467 av1parse: Fix the wrong DELTA_UNIT flag setting for key frames.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1468>
2022-01-05 08:47:06 +00:00
He Junyan 2266f70d79 av1parse: Copy the PTS and DURATION when we create data.
We need to create header buffers for annex b format. This kind of
buffers should inherit the PTS and DURATION from the original buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1468>
2022-01-05 08:47:06 +00:00
Nirbheek Chauhan 6b7d819c25 vtenc: Signal ignored alpha component with ProRes
When the image is opaque but the output ProRes format has an alpha
component (4 component, 32 bits per pixel), Apple requires that we
signal that it should be ignored by setting the depth to 24 bits per
pixel. Not doing so causes the encoded files to fail validation.

So we set that in the caps and qtmux sets the depth value in the
container, which will be read by demuxers so that decoders can skip
those bytes entirely. qtdemux does this, but vtdec does not use this
information at present.

The sister change was made in qtmux and qtdemux in:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1061

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1489>
2022-01-04 18:01:54 +00:00
He Junyan e1f9c6d559 codecparsers: h265parser: Correct the read of slice_sao_chroma_flag.
According to the SPEC, for parsing the slice header, we should read the
slice_sao_chroma_flag only when ChromaArrayType is not equal to 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1488>
2022-01-04 09:53:25 +08:00
Rafał Dzięgiel 8889b6351d assrender: Support RFC8081 mime types
Old "application/*" are now as per RFC8081 deprecated in favor of
new "font/*" mime types. Some new encoders are already using the
updated mime types. We need to also add them to the support list
in order for assrender to correctly identify them as fonts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1481>
2022-01-03 06:42:23 +00:00
Rafał Dzięgiel a2719d79ff assrender: Handle ".ttc" attachment extension
TTC stands for "TrueType Collection" file. We can pass it
into libass as any other attachment. Add it to the supported
extensions list, so the fonts it contains will be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1481>
2022-01-03 06:42:23 +00:00
Philippe Normand f0e6959bba webrtcdatachannel: Notify buffered-amount property updates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1484>
2022-01-02 10:18:35 +00:00
Seungha Yang 5fefc689a0 d3d11decoder: Negotiate again on the first output buffer
... unconditionally. There may be updated field in sinkpad caps
after the new_sequence() call (HDR related ones for example),
then we should signal the information to downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1474>
2021-12-30 11:09:45 +00:00
Philippe Normand 43856a0735 webrtcstats: Fix null pointer dereference
If there is no jitterbuffer stats we should not attempt to store them in the
global stats structure.

Also add a g_return_if_fail in _gst_structure_take_structure() about this
because it is a programmer error to pass an invalid pointer address there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1479>
2021-12-29 15:55:57 +00:00
He Junyan 13f0128f7e codecparsers: av1parse: Add the DECODE_ONLY flag to output buffer.
When the alignment is ALIGN_FRAME and the output buf contains a frame
which is not to be shown, the GST_BUFFER_FLAG_DECODE_ONLY flag should
be set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1050>
2021-12-25 12:18:24 +00:00
Olivier Crête 818a185b5d webrtcstats: Fall back to last packet ssrc if caps dont provide it
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1448>
2021-12-23 23:48:17 -05:00
Olivier Crête 4e32d6bf3e webrtcstats: Use our own caps instead of the sticky event
The sticky event seems to get cleared sometimes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1448>
2021-12-23 23:48:17 -05:00
Olivier Crête 29befed685 webrtcbin: Store the ssrc of the last received packet
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1448>
2021-12-23 23:48:17 -05:00
Olivier Crête fc7e7f5ccc webrtc stats: Remove duplicate structure get
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1448>
2021-12-23 23:48:17 -05:00
Olivier Crête f35435f1f7 webrtc stats: Add more details about codecs into the stats
This makes the output a little closer to what the upstream stats are.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1448>
2021-12-23 23:48:17 -05:00
Brad Hards d4379c8df7 doc: typo fix for streaming
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1463>
2021-12-23 07:50:22 +00:00
He Junyan 85d2118a53 va: av1dec: Use named profiles to replace the numeric ones.
Use named AV1 profiles (i.e., main, high, and professional) to replace
the old 0, 1, 2 profiles.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1456>
2021-12-21 22:20:34 +09:00
Seungha Yang 796007f75d av1enc: Update for newly designed AV1 profile signalling
Accept named AV1 profiles (i.e., main, high, and professional)
as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1456>
2021-12-21 22:20:34 +09:00
Seungha Yang 91484ce2ac d3d11av1dec: Update sinkpad template for profile
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1456>
2021-12-21 22:20:34 +09:00
Seungha Yang 40213b5c75 av1parse: Use descriptive profile name instead of numeric
As per AV1 specification Annex A, AV1 profiles have explicit and
descriptive names for each seq_profile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1456>
2021-12-21 22:20:30 +09:00
Seungha Yang ac978099c6 av1parse: Remove trailing white space
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1456>
2021-12-21 01:00:12 +09:00
Seungha Yang 1564567c3e d3d11av1dec: Fix for Cdef param
av1parser will increase the sec_strength values by 1 if parsed
values were equal to 3 as defined in spec. But DXVA wants unmodified
ones.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1455>
2021-12-17 23:28:29 +09:00
Seungha Yang 146815bbb6 d3d11av1dec: Sync DXVA AV1 data structure with released header
Update AV1 data structure based on Windows 11 SDK header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1455>
2021-12-17 23:27:24 +09:00
Víctor Manuel Jáquez Leal 69c4e317d8 tests: h265parser: Add test for multiple compatibility profiles.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1440>
2021-12-16 17:08:30 +01:00
Víctor Manuel Jáquez Leal b80cd503b6 h265parser: Compare upstream profile with in SPS.
Compare if upstream profile in caps is the same as the one parsed in
the SPS. If they are different use the bigger for simplicity and
more chances to decode it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1440>
2021-12-16 17:08:30 +01:00
Víctor Manuel Jáquez Leal 3040a26073 codecparsers: h265parser: Use a table map to get profile.
Instead of a sequence of if statements, declare a table to map profile
idc with profiles and traverse it.

Also, first add the profile from the parsed profile idc and later add,
into the profile array, the profile from the compatibility flags.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1440>
2021-12-16 17:08:30 +01:00
Víctor Manuel Jáquez Leal 168ad9f58f codecparsers: h265parser: Verify all possible profiles.
It's possible a HEVC stream to have multiple profiles given the
compatibility bits. Instead of returning a single profile, internal
gst_h265_profile_tier_level_get_profiles() returns an array with all
it possible profiles.

Profiles are appended into the array only if the generated profile
is not invalid.

gst_h265_profile_tier_level_get_profile() is rewritten in terms of
gst_h265_profile_tier_level_get_profiles(), returning the first
profile found the array.

And  gst_h265_get_profile_from_sps() is also rewritten in terms of
gst_h265_profile_tier_level_get_profiles(), but traversing the array
verifying if the proposed profile is actually valid by Annex A.3.x of
the specification.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1440>
2021-12-16 17:08:30 +01:00
Mathieu Duponchelle abd61732bf webrtcbin: bind transceiver's fec-percentage to encoder percentage
Allows for dynamic control of the applied FEC overhead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1429>
2021-12-14 17:34:53 +00:00
Mathieu Duponchelle 06893b8b5e webrtcbin: fix ulpfec / red for the BUNDLE case
* Add fec / red encoders as direct children of webrtcbin, instead
  of providing them to rtpbin through the request-fec-encoder signal.

  That is because they need to be placed before the rtpfunnel, which
  is placed upstream of rtpbin.

* Update configuration of red decoders to set a list of RED payloads
  on them, instead of setting the pt property.

  That is because there may be one RED pt per media in the same session.

* Connect to request-fec-decoder-full instead of request-fec-decoder,
  in order to instantiate FEC decoders according to the payload type
  of the stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1429>
2021-12-14 17:34:53 +00:00
Seungha Yang f10867dfb5 d3d11videosink: Use only tested color space for swapchain
We are querying supported swapchain colorspace via
CheckColorSpaceSupport() but it doesn't seem to be reliable.
Use only tested full-range RGB formats which are:
- sRGB
- BT709 primaries with linear RGB
- BT2020 primaries with PQ gamma

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1433>
2021-12-12 11:00:24 +00:00
Thibault Saunier d82efb47aa pitch: Specify layout as required for negotiation
There are cases where it might negotiate 'non-interleaved' while it
is wrong.

```
gst-launch-1.0 audiotestsrc !  "audio/x-raw, format=(string)F32LE, layout=(string)non-interleaved" ! audioconvert ! audioresample ! pitch tempo=1.2 ! audioconvert ! "audio/x-raw,format=S16LE" ! fakesink

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
(gst-launch-1.0:3029628): GStreamer-Audio-CRITICAL **: 11:42:22.477: gst_audio_buffer_map: assertion '(!meta && info->layout == GST_AUDIO_LAYOUT_INTERLEAVED) || (meta && info->layout == meta->info.layout)' failed
ERROR: from element /GstPipeline:pipeline0/GstAudioConvert:audioconvert1: The stream is in the wrong format.
Additional debug info:
../subprojects/gst-plugins-base/gst/audioconvert/gstaudioconvert.c(876): gst_audio_convert_transform (): /GstPipeline:pipeline0/GstAudioConvert:audioconvert1:
failed to map input buffer
ERROR: pipeline doesn't want to preroll.
ERROR: from element /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0: Internal data stream error.
Setting pipeline to NULL ...
Additional debug info:
../subprojects/gstreamer/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Freeing pipeline ...
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1441>
2021-12-11 19:09:09 -03:00
Nicolas Dufresne f9668b0697 doc: Update vp9alphadecodebin doc cache
A new field was added to the template cpas.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1439>
2021-12-10 21:37:14 +00:00
Nicolas Dufresne 2886eab3c4 alphacombine: Fix for early allocation queries
When using playbin3, it seems that the alpha decode is always first to
push caps and run an allocation query. As the format change from sink
and alpha were not synchronized, the allocation query could endup
being run before the caps are pushed. That may lead to failing query,
which makes the decoder thinks there is no GstVideoMeta downstream and
most likely CPU copy the frame.

This patch implements a format cookie to track and synchronize the
format changes on both pads fixing the racy performance issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1439>
2021-12-10 21:37:14 +00:00
Nicolas Dufresne e0f8ce501b v4l2codecs: vp9: Add alpha decodebin wrapper
This will allow HW accelerated decoding of WebM alpha videos.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1439>
2021-12-10 21:37:14 +00:00
Nicolas Dufresne 31d49da237 v4l2codecs: plugin: Minor style fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1439>
2021-12-10 21:37:14 +00:00
Nicolas Dufresne 3f02515380 v4l2codecs: decoder: Improve logging of timed out request
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1439>
2021-12-10 21:37:14 +00:00
Nicolas Dufresne c4216a693c v4l2codecs: mpeg2: Check that the decoder output formats
This is to avoid exposing a decoder for which we don't support any
output format. This happens on platform using vendor formats or
not yet supported tiles formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1439>
2021-12-10 21:37:14 +00:00
Nicolas Dufresne 91b7a9497b vp9alphadecodebin: Fix auto-pluging v4l2slvp9dec
This adds the alignment field to the template caps. Without this field
set, the auto-plugger will see fixed caps and will use
gst_caps_is_subset() against the caps produced by the parser. This is a
challenge for all cases where a parser can do conversion. This is fixed
by adding alignment field, which makes the auto-pluggers do an
intersection of the caps as it gets unfixed caps after intersection now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1439>
2021-12-10 21:37:14 +00:00
Seungha Yang e8c923ebde d3d11window: Remove hack related to color space selection
Use input GstVideoColorPrimaries without any special case handling
otherwise rendered image color would be very wrong.

The hack was added to work around an issue that some Intel driver
couldn't handle wide color gamut image without HDR10 metadata, specifically PQ image.
But device capability can be checked via a method added in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1723
so there's no issue now.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1175
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1430>
2021-12-09 20:12:12 +09:00
Seungha Yang 1a12883993 d3d11window: Fix typo in debug message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1430>
2021-12-09 19:51:20 +09:00
Benjamin Gaignard 9e0c2c4a09 codecs: h264decoder: Fix return value type
Return value should be GstFlowReturn not gboolean

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1426>
2021-12-08 11:08:30 +01:00
Benjamin Gaignard 4ff27314f6 codecs: h265decoder: Fix return value if klass->new_picture isn't set
If klass->new_picture isn't set we need to initialize
ret with GST_FLOW_OK to avoid unwanted error case

Fixes: 5b405d1585 ("codecs: h265decoder: Use GstFlowReturn everywhere")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1426>
2021-12-08 11:02:32 +01:00
Philippe Normand 86719e25a4 wpevideosrc: Use basesrc event vfunc
Allows for basic default handling from the base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1422>
2021-12-07 11:43:26 +00:00
Tim-Philipp Müller 26169cee0e teletextdec: fix minor string leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1416>
2021-12-06 13:07:37 +00:00
Marc Leeman 49736fb3fd ristsink: set properties on children early
The properties on the udpsink/udpsrc elements need to be set before
there is any state change. If not, in a network without default gateway,
udpsink tries to bind an a NULL interface and fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1411>
2021-12-03 23:46:08 +00:00
Nicolas Dufresne 7e875ddb2c v4l2codecs: mpeg2: Fix selected sizeimage
Due to a copy paste bug, the bitdepth was never set and that was leading
to requesting sizeimage of 0. Previously that worked since the driver
would in that case pick a size for us. But now the we bumped the minimum
to 4KB, the driver happily allocate 4KB of bitstream which lead to
decoding error.

As MPEG2 have a fixed bitdeph of 8, use a define instead of the run-time
variable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1415>
2021-12-03 07:55:30 -05:00
Nicolas Dufresne 05458f05e0 v4l2codecs: vp9: Drop frames on non-keyframe format change
V4L2 does not yet support this feature, this will skip over the
transition portion up to the next keyframe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1404>
2021-12-02 15:52:03 -05:00
Nicolas Dufresne a6eb1e7782 v4l2codecs: Fix renegotiation
If we hold the last reference to the allocator, leaving the device
streaming will cause an EBUSY error when trying to free the allocate
buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1404>
2021-12-02 15:45:26 -05:00
Seungha Yang e87791592e d3d11vp9dec: Drop frames on non-keyframe format change
... in case of NVIDIA GPU

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1407>
2021-12-02 19:19:59 +00:00
Seungha Yang 2c834b5fc7 nvvp9sldec: Drop frames on non-keyframe format change
NVDEC doesn't seem to be able to handle the case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1407>
2021-12-02 19:19:59 +00:00
Seungha Yang e2e45e51b0 codecs: vp9: Drop frames on non-keyframe format change
... if subclass does not support the case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1407>
2021-12-02 19:19:59 +00:00
Nicolas Dufresne 43759ffeaa codecs: vp9: Also consider render_width/height
Also emits new_sequence if on keyframe and the render_width/height have
change. The subclass can always optimize this if the frame resolution
didn't change, the output caps needs to reflect this though.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1407>
2021-12-02 19:19:59 +00:00
Marc Leeman f699c08af9 rtpsink: set properties on children early
The properties on the udpsink/udpsrc elements need to be set before
there is any state change. If not, in a network without default gateway,
udpsink tries to bind an a NULL interface and fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1398>
2021-12-02 14:23:05 +01:00
Nicolas Dufresne d04fba93f8 v4l2codecs: vp9: Remove uneeded picture data
The GstV4l2Request now holds a reference on the picture buffer and is
recounted already. This effectively removes usage of GRefCount which is only
available in GLib 2.58, while we support 2.56.

Fixes #910

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1402>
2021-11-30 17:11:59 -05:00
Nicolas Dufresne 19d99dbcae v4l2codecs: decoder: Add method to get the pic_buf
This helper will be needed for VP9 frame duplication.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1402>
2021-11-30 17:11:59 -05:00
Nicolas Dufresne 8a1440b3f1 v4l2codecs: vp9: Add missing error checks in decide_allocation
This could otherwise lead to crash.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1402>
2021-11-30 17:11:56 -05:00
Nicolas Dufresne 4ca7f1e014 v4l2codecs: h264: Fix typo in comment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1387>
2021-11-30 00:28:34 +00:00
Nicolas Dufresne 83933b7772 v4l2codecs: h264: Properly set pic_num/frame_num
The V4L2 uAPI uses pic_num for both PicNum and ShortTermPicNum. It also
doe the same for both FrameNum and LongTermFrameIdx. This change does
not change the fluster score, but fixed a visual corruption noticed
with some third party streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1387>
2021-11-30 00:28:34 +00:00
He Junyan b5c07e11ca va: Use a lock to protect the surface copy by using vpp.
If we use vpp to do the surface copy, its operation is not atomic.
 We need to maintain the filter's context unchanged during the whole
 copy progress.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1373>
2021-11-29 19:25:31 +00:00
He Junyan 954f7cf88c va: Use the GstVaSurfaceCopy of the allocator atomically.
The mem_copy() of the allocator can be called simultaneously from
different threads. We should use atomic pointer operations to create
and use the GstVaSurfaceCopy of the allocator.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1373>
2021-11-29 19:25:31 +00:00
He Junyan 7f31dcf084 va: DMA allocator: Set the copied memory properly when popped from pool.
The current code does not set the copied memory correctly when it is popped
from the surface cache pool.
1. We forget to ref the allocator, which causes the allocator to be freed
   unexpected, and we get a crash later because of the memory violation.
2. We forget to add ref_mems_count, which causes the surface leak because
   the surface can not be pushed back to the cache pool again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1373>
2021-11-29 19:25:31 +00:00
Daniel Almeida 285695ee52 v4l2codecs: gstv4l2decoder: set minimum sizeimage
Set minimum sizeimage such that there is enough space for any overhead
introduced by the codec.

Notably fix a vp9 issue in which a small image would not have a
bitstream buffer large enough to accomodate it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida 120b96a974 v4l2codecs: gstv4l2codecsvp9dec: implement a render delay
The v4l2 backend support delayed output for performance reasons.
It is then possible to use render delays to queue multiple requests
simultaneously, thus increasing performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida ccab90773f v4l2codecs: vp9dec: Implement VP9 v4l2 decoder
Implement a v4l2 based vp9 decoder element based on the preexisting vp8
v4l2 decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida c51d74ae3a v4l2codecs: update to the new uAPI
The new VP9 stateless API is in its way to be destaged. Update our
headers to match.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida a2b0837bc5 codecs: gstvp9decoder: copy frame->system_frame_number into picture
A comment in gstvp9picture.h states that picture->system_frame_number
should get its value from frame->system_frame_number, but in fact
it was never copied at all.

Fix it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida 98dc7a64a0 codecs: gstvp9{decoder|statefulparser}: optionally parse compressed headers
Rework gstvp9{decoder|statefulparser} to optionally parse compressed headers.
The information in these headers might be needed for accelerators
downstream, so optionally parse them if downstream requests it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Mathieu Duponchelle e90859f4d8 webrtcbin: deduplicate extmaps
When an extmap is defined twice for the same ID, firefox complains and
errors out (chrome is smart enough to accept strict duplicates).

To work around this, we deduplicate extmap attributes, and also error
out when a different extmap is defined for the same ID.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1383>
2021-11-25 18:38:22 +00:00
He Junyan d867180b4e codecs: mpeg2decoder: drain() only when significant sequence changes.
There are a lot of info in the mpeg2's sequence(also including ext
display_ext and scalable_ext). We need to notify the subclass about
its change, but not all the changes should trigger a drain(), which
may change the output picture order. For example, the matrix changes
in sequence header does not change the decoder context and so no need
to trigger a drain().

Fixes: #899
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1375>
2021-11-24 14:42:57 +00:00
Seungha Yang 2a17618dcc openjpegenc: Fix build warning
Compiling C object subprojects/gst-plugins-bad/ext/openjpeg/gstopenjpeg.dll.p/gstopenjpegenc.c.obj
../subprojects/gst-plugins-bad/ext/openjpeg/gstopenjpegenc.c(416):
  warning C4133: '=': incompatible types - from 'GstFlowReturn (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)' to
  'gboolean (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)'

../subprojects/gst-plugins-bad/ext/openjpeg/gstopenjpegenc.c(418):
  warning C4133: '=': incompatible types - from 'GstFlowReturn (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)' to
  'gboolean (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1378>
2021-11-24 13:11:23 +00:00
Guillaume Desmottes d67a63a298 gssink: add metadata property
This property can be used to set metadata on the storage object.

Similar API has been added to the S3 sink already, see
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/613

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1377>
2021-11-23 16:00:53 +01:00
Seungha Yang ffa8aff6b1 d3d11: Update comments
Remove copy & paste mistake (this is not GstGL) and add more
description.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1374>
2021-11-23 07:23:12 +00:00
Víctor Manuel Jáquez Leal 5e3bf0fff7 vapostproc, vadeinterlace: don't transform caps if no intersection.
If caps to transform don't intersect with those supported by the VA
filter (VAEntrypointVideoProc) then return them as is, because only
pass-through mode is the only possibility.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1369>
2021-11-22 15:27:10 +00:00
Víctor Manuel Jáquez Leal 68379649db vapostproc: Append featured caps rather than merge.
So it would be possible to honor upstream preference.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1369>
2021-11-22 15:27:10 +00:00