Commit graph

27339 commits

Author SHA1 Message Date
Nicolas Dufresne
e5e2b6a652 v4l2slvp8dec: Only ask for output delay once per negotiation
While it's technically possible to change it per frame, asking for
that every frame is not very useful. This mimic H264 decoder better.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2333>
2021-06-16 17:34:54 +00:00
He Junyan
8d7e6bfb86 va: Improve the default mapping between rt_format and video format.
We add 12 bits entries into this default mapping. And the old mapping
is not precise. For example, the NV12 should not be used as the default
mapping for VA_RT_FORMAT_YUV422 and VA_RT_FORMAT_YUV444, it is even not
a 422 or 444 format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2332>
2021-06-16 14:12:59 +00:00
He Junyan
0849583210 va: Add 12 bits rt_format setting in H265.
In order to support 12 bits format decoding, we need to add the
support for 12 bits rt_format in H265.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2332>
2021-06-16 14:12:59 +00:00
He Junyan
1b4c9eaebb va: Fix a typo in video format mapping.
GST_VIDEO_FORMAT_Y412_LE is a 4:4:4 format and so should be mapped
to VA_RT_YUV444_12 rt format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2332>
2021-06-16 14:12:59 +00:00
He Junyan
7feed2f1ac h265parse: Fix a typo in get_compatible_profile_caps().
The GST_H265_PROFILE_MAIN_444_10 profile should be compatible with
GST_H265_PROFILE_SCREEN_EXTENDED_MAIN_444_10, not the current
GST_H265_PROFILE_SCREEN_EXTENDED_MAIN_10.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2328>
2021-06-16 13:23:50 +00:00
Randy Li (ayaka)
0d746d1022 waylandsink: prevent frame callback being released twice
For those using context from the application which
would be the embedded video case, if the frame callback
is entering at the same time as window is finalizing,
a wayland proxy object would be destroyed twice, leading
the refcout less than zero in the second time, it can
throw an abort() in wayland.

For those top window case, which as a directly connection
to the compositor, they can stop the message queue then
the frame callback won't happen at the same time as the
window is finalizing. It doesn't think it would bother
them about this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1883>
2021-06-15 16:25:17 -04:00
Nicolas Dufresne
4ac9f91921 alphadecodebin: Fix stall due to QoS
alphacombine element is a simple element that assumes buffers are always
paired, or at least that missing buffers are signalled with a GAP. The QoS
implementation in the GstVideoDecoder base class allow decoders dropping
frames independently and that could lead to stall in alphacombine.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2326>
2021-06-14 16:33:15 -04:00
Stéphane Cerveau
a71ec17cf0 jpeg2000parse, openjpeg: add support for YCrCb 4:1:1 sampling
Add YCrCb 4:1:1 support in openjpeg elements
and fix in jpeg2000parse the YCrCb 4:1:0 support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2321>
2021-06-14 11:05:45 +02:00
Seungha Yang
a63539b213 d3d11decoder: Don't print error log when no DPB texture is available
... but we are flushing. The condition is quite expected situation
when pipeline is in the middle of seeking operation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2320>
2021-06-14 07:02:20 +00:00
Yinhang Liu
8530ac286a msdkenc: add extbrc support in ext-coding-props property
The SDK can support external bitrate control [1], so add extbrc
to enable this feature.

[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2139>
2021-06-11 02:00:51 +00:00
Yinhang Liu
ea5636af2c msdkenc: add ext-coding-props for external coding options
This property supports passing multiple parameters using GstStructure.

Example usage:
ext-coding-props="props,key0=value0,key1=value1,..."

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2139>
2021-06-11 02:00:51 +00:00
He Junyan
2db3ce32ef codecs: Fix the H265 poc out of order warning.
We always get a warning such as:
h265decoder gsth265decoder.c:1432:gst_h265_decoder_do_output_picture: \
<vah265dec0> Outputting out of order 255 -> 0, likely a broken stream
in H265 decoder.

The problem is caused because we fail to reset the last_output_poc when
we get IDR and BLA. The incoming IDR and BLA frame already bump all the
frames in the DPB, but we forget to reset the last_output_poc, which
make the POC out of order and generate the warning all the time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2294>
2021-06-10 12:36:34 +00:00
Seungha Yang
a1350852e7 wasapi2sink: Fix ringbuffer object leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2315>
2021-06-10 07:48:38 +00:00
Seungha Yang
cd9b96e143 wasapi2ringbuffer: Implement GstAudioRingBuffer::pause()
WASAPI doesn't support PAUSE so it's not different from Stop().
When pipeline is in paused state, we don't need to waste CPU resource
for feeding silent buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2315>
2021-06-10 07:48:38 +00:00
Seungha Yang
f90506e33b d3d11memory: Implement GstAllocator::mem_copy method
There are a few places which require deep copy
(basesink on drain for example). Also this implementation can be
useful for future use case.
One probable future use case is that copying DPB texture to
another texture for in-place transform since our DPB texture is never
writable, and therefore copying is unavoidable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2308>
2021-06-10 01:20:32 +09:00
Seungha Yang
b7abd34285 wasapi2src: Add support for loopback recording
... and add various device error handling.

This loopback implementation is functionally identical to that of wasapisrc.
When it's enabled, wasapi2src will read data from render device instead of
capture device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2311>
2021-06-09 22:15:06 +09:00
Seungha Yang
a8ec40c850 wasapi2: Rewrite plugin and implement audioringbuffer subclass
... based on MediaFoundation work queue API.

By this commit, wasapi2 plugin will make use of pull mode scheduling
with audioringbuffer subclass.
There are several drawbacks of audiosrc/audiosink subclassing
(not audiobasesrc/audiobasesink) for WASAPI API, which are:
* audiosrc/audiosink classes try to set high priority to
  read/write thread via MMCSS (Multimedia Class Scheduler Service)
  but it's not allowed in case of UWP application.
  In order to use MMCSS in UWP, application should use MediaFoundation
  work queue indirectly.
  Since audiosrc/audiosink scheduling model is not compatible with
  MediaFoundation's work queue model, audioringbuffer subclassing
  is required.
* WASAPI capture device might report larger packet size than expected
  (i.e., larger frames we can read than expected frame size per period).
  Meanwhile, in any case, application should drain all packets at that moment.
  In order to handle the case, wasapi/wasapi2 plugins were making use of
  GstAdapter which is obviously sub-optimal because it requires additional
  memory allocation and copy.
  By implementing audioringbuffer subclassing, we can avoid such inefficiency.

In this commit, all the device read/write operations will be moved
to newly implemented wasapi2ringbuffer class and
existing wasapi2client class will take care of device enumeration
and activation parts only.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2306>
2021-06-08 19:39:27 +09:00
Seungha Yang
4b42671c99 wasapi2: Use AUDCLNT_STREAMFLAGS_NOPERSIST flag
... so that we can disable persistence of our mute/volume status

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2306>
2021-06-08 19:39:26 +09:00
Seungha Yang
d5384ffbd0 wasapi2src: Fix doc typo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2306>
2021-06-08 19:39:26 +09:00
Thibault Saunier
c7684b48d0 wpe: Rename undeserializable_type to not_deserializable_type
Making it more readable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
da150c18bb wpe: Make forwarded messages layout more like GstBinForwaded messages
Making it look more like how we do this kind of things in other places.

See: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2252#note_927653
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
f29e75d1da wpe: Make wpesrc!video pad an always pad
There should always be a `video` pad no matter what.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
870d9b8bd6 wpe: Remove unused env var
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
81a0125a97 wpe: Fix atomic usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
3ffd78787d wpe: Add a note able requiring tracing subsystem for message forwarding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
c38e0cfdb0 wpe: Fix check on whether MEMFD_CREATE is available
The ordering of the ifdef was wrong

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
d93131bfee wpe: Plug a leak
We were freeing after returning

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Thibault Saunier
ca1812f38c Revert "wpe: Properly respect LIBGL_ALWAYS_SOFTWARE"
This causes issues I didn't see:
     https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2252#note_927633

Let's just tell people to use capsfilter to force software rendering in
`wpesrc` for now.

The intent was to allow forcing it easily in playbin2 for the CI, but
we will do it some other way and see when time comes.

This reverts commit 9415106b02.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2273>
2021-06-08 03:15:05 +00:00
Nicolas Dufresne
a6ebda3907 debugutils: Introduce videocodectestsink
This is a video specific sink used to test video CODEC conformance. This is similar
to a combination of filesink and testsink, but will skip over any type of
padding that GStreamer Video library introduces. This is needed in order to obtain the
correct checksum or raw yuv data.

This element currently support writing back non-padded raw I420 through the
location property and will calculate an MD5 and post it as an element message
of type conformance/checksum. More output format or checksum type could be
added in the future as needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2287>
2021-06-07 17:11:32 -04:00
Seungha Yang
4d0f136297 vkinstance: Don't abort in case that system has no available vulkan device
Specification doesn't have restriction that returned
pPhysicalDeviceCount value must be non-zero

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2304>
2021-06-04 07:44:36 +00:00
Edward Hervey
80b3ba7b36 tsdemux: Clear all streams when rewinding
This avoids sending out partial invalid data downstream which could cause
decoders (ex: `dvdlpmdec`) to error out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2301>
2021-06-03 22:54:12 +00:00
Seungha Yang
74f81a1a13 d3d11: Add support for YV12 and NV21 formats
Handle UV swapped 4:2:0 8bits formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2290>
2021-06-03 17:00:49 +00:00
Seungha Yang
73067bfe0c d3d11window_win32: Ensure closing internal HWND from window thread
Window handle must be closed from its own message thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2302>
2021-06-03 15:20:27 +00:00
Nicolas Dufresne
14f97a71cf doc: Update cache after pixel format reorder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2303>
2021-06-03 10:31:39 -04:00
Yinhang Liu
a997524e3f doc: add the msdk elements
Supported elements:
msdkav1dec, msdkh264dec, msdkh264enc, msdkh265dec, msdkh265enc,
msdkmjpegdec, msdkmjpegenc, msdkmpeg2dec, msdkmpeg2enc, msdkvc1dec,
msdkvp8dec, msdkvp9dec, msdkvp9enc, msdkvpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2296>
2021-06-03 10:30:18 +08:00
Nicolas Dufresne
56b56e43f3 waylandsink: Fix for missing initial configure
We were doing our initial "empty" commit on the subsurface instead of the
toplevel surface. As an incidence, we should not have received a configure
event ever, not just on mutter. This fixes the following warning when using
mutter compositor (aka gnome-shell):

  waylandsink wlwindow.c:304:gst_wl_window_new_toplevel: The compositor did not send configure event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2299>
2021-06-02 14:17:13 -04:00
Nicolas Dufresne
a01883013a test: camerabin: Fix buffer size calculation
We were assunming that GStreamer size for RGB (24bit packed) data was width x
height x 3, but GStreamer defaults to specific alignment. Use GstVideoInfo API
in order to obtain the buffer size.

This fixes failure seen when trying to merge: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/998
which make us negoaite 1x1 instead of 16x16 in this test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2297>
2021-06-02 11:26:41 -04:00
He Junyan
c442c9bd5e codecs: Integrate H265 DPB full check into need_bump().
The current DPB check of H265 is not very correct. The current frame
is already in the DPB when we check whether the DPB is full.
For example, the DPB max size is 16 and we have 15 ref frames in the
DPB, so the gst_h265_dpb_delete_unused() cleans no one, and then plus
the current frame, the DPB is 16. This causes an error return, but in
fact, the stream is correct.
We now integrate the DPB full check into the need_bump() function.
We add the correct frame into to DPB and then check whether the picture
num is bigger than max_num_pics of DPB(which means there is no room for
the current picture). If true, we bump the DPB immediately.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2291>
2021-06-02 13:10:35 +00:00
Tim-Philipp Müller
cbe89db444 Back to development 2021-06-01 15:49:48 +01:00
Tim-Philipp Müller
6d9125f01c Release 1.19.1 2021-06-01 00:14:24 +01:00
Daniel Almeida
89bc464360 v4l2codecs: gstv4l2codecsvp8dec: 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/gst-plugins-bad/-/merge_requests/2150>
2021-05-31 15:48:24 -04:00
Daniel Almeida
82c0005793 codecs: gstvp8decoder: add support for render delay
Some decoding APIs support delayed output for performance reasons.
One example would be to request decoding for multiple frames and
then query for the oldest frame in the output queue.

This also increases throughput for transcoding and improves seek
performance when supported by the underlying backend.

Introduce support in the vp8 base class, so that backends that
support render delays can actually implement it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2150>
2021-05-31 15:48:24 -04:00
Philippe Normand
064428cb34 webrtcbin: Stop transceivers update after first SDP error
When invalid SDP is supplied, _update_transceiver_from_sdp_media() sets the
GError, so it is invalid to continue any further SDP processing, we have to exit
early when the first error is raised.

Fixes #1595

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2254>
2021-05-30 00:16:10 +00:00
Seungha Yang
b1541a7470 d3d11: Suppress some warning logs
We uses gst_d3d11_device_new() for enumerating device which can
fail for some reason. Don't print warning log for the case.
And decoding capability check is the same case as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2286>
2021-05-29 10:30:28 +00:00
Roman Sivriver
0b551382c4 hlssink2: Initialize debug category to prevent an assert with fatal-warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2288>
2021-05-28 17:14:43 -04:00
Seungha Yang
fed06df5f6 d3d11compositor: Reuse converter on alpha update
... instead of creating converter object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2276>
2021-05-28 21:44:12 +09:00
Seungha Yang
0d34a0233b d3d11converter: Introduce config to be extensible
Add a config argument like that of GstVideoConverter so that
we can add more options without modifying existing methods

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2276>
2021-05-28 21:44:10 +09:00
Seungha Yang
f3331652f2 d3d11shader: Don't hold state object in GstD3D11Quad
We might want to update state object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2276>
2021-05-28 21:44:07 +09:00
Nicolas Dufresne
49992be643 v4lcodecs: Validate src formats
This add src format validation, this avoid registering element for
drivers we don't support any of their src formats. This also special
case the AlphaDecodeBin wrapper, as we know that alphacombine element
only support I420 and NV12 for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2272>
2021-05-27 17:01:11 -04:00
Daniel Almeida
9e86ac4a22 v4l2codecs: add wrappers for alpha decode
codecalpha is a new plugin introduced to support VP8/VP9 alpha as
defined in the WebM and Matroska specifications. It splits the stream
into two streams, one for the alpha and one for the actual content,
then it decodes them separately with vpxdec and finally combine the
results as A420 or AV12 (i.e. YUV + an extra alpha plane).

The workflow above is setup by means of a bin, gstcodecalphabin.

This patch simulates the same workflow into the v4l2codecs namespace,
thus using the new v4l2 stateless decoders for hardware acceleration.

This is so we can register the new alpha decode elements only if the
hardware produces formats we support, i.e. I420 or NV12 for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2272>
2021-05-27 17:00:06 -04:00