Commit graph

817 commits

Author SHA1 Message Date
Seungha Yang 8e665fa435 qsvencoder: Move common property to baseclass
adapter-luid and device-path are common for all codecs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2467>
2022-05-23 13:28:11 +00:00
He Junyan fc75e38496 va: baseenc: No need to check the frame pointer in handle_frame().
No need to check the NULL pointer of "frame" in error handling, it
is assured non-NULL by base class and we already use it everywhere
in this function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2471>
2022-05-23 15:03:03 +08:00
He Junyan de5952bc83 va: baseenc: include the "vacompat.h" for old version glib.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2463>
2022-05-22 15:03:54 +08:00
U. Artie Eoff d2651a1e0b va: vpp: enable compositor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2332>
2022-05-21 21:18:15 +02:00
U. Artie Eoff afe8723196 va: vpp: add compositor
New implementation of a VA-API compositor with blend feature.

Various chunks of code was taken from vavpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2332>
2022-05-21 21:18:15 +02:00
He Junyan a2920411d3 va: Apply the va base encoder to the vah264enc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2330>
2022-05-20 22:58:58 +02:00
He Junyan 21a9ba7e7e va: Add the GstVaBaseEnc common object for all va encoders.
Just like the GstVaBaseDec and GstVaBaseTransform, this base encoder
will handle all common logic for all va encoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2330>
2022-05-20 22:58:58 +02:00
Seungha Yang e5ba099fd8 d3d11device: Enhance format enumeration and debugging
* Enhance debug log to print human readable D3D11_FORMAT_SUPPORT flags
  value, instead of packed numeric flagset value.
* Only device supported format will be added to format table.
  Depending on device feature level (i.e., D3D9 feature devices),
  16bits formats will not be supported. Although there might be formats
  we deinfed but not supported, it will not be a major issue in practice
  since our D3D11 implementation does not support legacy devices already
  (known limitation) and also old d3dvideosink will be promoted in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2441>
2022-05-21 02:37:45 +09:00
Víctor Manuel Jáquez Leal 5542dd395d jpegparse: Rewrite element.
Now it uses the JPEG parser in libgstcodecparsers, while the whole
code is simplified by relying more in baseparser class for tag
handling.

The element now signals chroma-format and default framerate is 0/1,
which is for still-images.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Víctor Manuel Jáquez Leal fa2b697389 tests: jpegparse: Mark data as static.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Víctor Manuel Jáquez Leal 17046fc1ad jpegformat: Use codecparsers' for JPEG markers.
Instead of repeating JPEG markers definition, this patch uses those
defined in gstcodecparsers library.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Víctor Manuel Jáquez Leal 547d324325 jpegparse: Headers cleanup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Philippe Normand 556ee45bfa datachannel: Notify low buffered amount according to spec
Quoting
https://www.w3.org/TR/webrtc/#dom-rtcdatachannel-bufferedamountlowthreshold

The bufferedAmountLowThreshold attribute sets the threshold at which the
bufferedAmount is considered to be low. When the bufferedAmount decreases from
above this threshold to **equal** or below it, the bufferedamountlow event fires.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2448>
2022-05-19 05:52:51 +00:00
Sebastian Dröge bf79a6908c tsmux: Make sure to set srcpad caps under all conditions before outputting the first buffer
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1218

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2438>
2022-05-18 12:19:07 +00:00
Seungha Yang ca7081c482 d3d11device: Don't print ERROR log on open failure
Device open can be failed in various reasons, but it's unlikely
our problem

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2433>
2022-05-17 14:11:00 +00:00
Sebastian Dröge 3487c81ac2 sdpdemux: Release request pads from rtpbin when freeing a stream
Otherwise the pads of the rtpbin stay around forever and are leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2437>
2022-05-17 12:36:44 +00:00
Seungha Yang 909154a989 qsv: Disable non-MSVC build on Windows
... and remove pointless UWP consideration that will never work.

Cross-compiled binary has an issue which causes deadlock.
Although cerbero will not build this plugin for non-MSVC build,
people can still build this plugin and may complain its brokenness.

See also
https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/854

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2431>
2022-05-17 03:32:10 +09:00
Diogo Goncalves acfc9ae216 avfvideosrc: fix wrong framerate selected for caps
This fix solves an issue where a format that doesn't support the
requested framerate would be selected. It ensures that we use the first
format and framerate pair that supports the requested caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2331>
2022-05-13 19:38:45 +00:00
Seungha Yang 858520932c d3d11decoder: Add hardcoded minimum resolution values to caps for NVIDIA
NVIDIA GPUs have undocumented limitation regarding minimum resolution
and it can be queried via a NVDEC API. However, since we don't want to
bring CUDA/NVDEC API into D3D11, use hardcoded values for now
until we find a nice way for capability check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2406>
2022-05-12 18:20:26 +00:00
Edward Hervey 7ac4dd3d9d mxfdemux: Handle files produced by legacy FFmpeg
Until March 2022, the FFmpeg MXF muxer would write the various index table
segments with the same instance ID, which should only be used if it is a
duplicate/repeated table.

In order to cope with those, we first compare the other index table segment
properties (body/index SID, start position) before comparing the instance
ID. This will ensure that we don't consider them as duplicate, but can still
detect "real" duplicates (which would have the same other properties).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2407>
2022-05-12 07:27:57 +02:00
Víctor Manuel Jáquez Leal 4c97ffeafb va: basedec: Always select first available format.
If the stream chroma doesn't match with any video format in the source
caps template (generated from va config surface formats) instead of
return unknown, return the first available format in the template,
assuming that the driver would be capable to do color conversions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2404>
2022-05-11 15:03:54 +02:00
Seungha Yang 8d40531f23 h265decoder: Improve robustness against malformed NAL packets
Use newly added gst_h265_parser_identify_and_split_nalu_hevc()
method to handle broken streams where packetized NAL unit
contain start code prefix in it.

It's obviously wrong stream but we know how to work around it
and even need to support such broken streams since
stateless decoder implementations are being a primary
decoder element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2394>
2022-05-10 03:59:47 +09:00
Seungha Yang be84fc23ca h265parser: Add a new NAL parsing API to handle malformed packets
Add gst_h265_parser_identify_and_split_nalu_hevc() method to
handle a case where packetized stream contains start-code prefix.
This new method behaves similar to exisiting gst_h265_parser_identify_nalu_hevc()
but it will scan start-code prefix to split given data into
NAL units.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2394>
2022-05-10 03:58:51 +09:00
Víctor Manuel Jáquez Leal c47255d148 va: basedec: Select format from template or negotiated caps.
Instead of using a hard-coded list of preferred formats according the
chroma type, now if now caps are pre-negotiated, from template caps
will choose the first format with the same chroma type. If
pre-negotiated, then it will choose the first format, with same chroma
type, from the first caps structure.

Also all the decoders will check if GST_VIDEO_FORMAT_UNKNOWN is
returned, failing the negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2351>
2022-05-09 08:50:58 +00:00
Víctor Manuel Jáquez Leal 13fbcde1e7 libs: va: Add O_CLOEXEC flag at opening drm device.
So any other potential subprocess won't have access to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2386>
2022-05-07 09:55:36 +00:00
Olivier Crête 86105a4774 pcapparse: Set timestamp in DTS, not PTS
This matches the behaviour of basesrc, in particular, it matches the
behaviour of udpsrc, so it's easier to use to as a replacement to test
rtpjitterbuffer and other similar elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2388>
2022-05-07 07:32:41 +00:00
Dmitry Osipenko fd694d840a v4l2codecs: h264: Set frame type flags
V4L spec now requires decode_params flags to be set in accordance to the
frame's type. In particular this is required by H.264 decoder of NVIDIA
Tegra SoC to operate properly. Set the flags based on type of parsed
slices.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1757>
2022-05-06 13:35:59 +00:00
Mengkejiergeli Ba efdd63d875 tests: Skip test if srtp element not built
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2383>
2022-05-06 09:13:31 +00:00
Seungha Yang 47ff41bcd2 d3d11memory: Protect against concurrent access from GPU and CPU to staging texture
Staging texture does not allow GPU access while it's CPU mapped.
But because we cannot block concurrent READ access by GstMemory design,
additional staging texture is still required.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1182
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2375>
2022-05-05 18:59:05 +00:00
Seungha Yang e0a9a73adf d3d11screencapturesrc: Fix crash when d3d11 device is different from owned one
GstD3D11ScreenCapture object is pipeline-independent global object
and the object can be shared by multiple src elements,
in order to overcome a limitation of DXGI Desktop Duplication API.
Note that the API allows only single capture session in a process for
a monitor.

Therefore GstD3D11ScreenCapture object must be able to handle a case
where a src element holds different GstD3D11Device object. Which can
happen when GstD3D11Device context is not shared by pipelines.

What's changed:
* Allocates capture texture with D3D11_RESOURCE_MISC_SHARED for the
  texture to be able to copied into other device's texture
* Holds additional shader objects per src element and use it when drawing
  mouse

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1197
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2366>
2022-05-05 18:18:57 +00:00
Sebastian Dröge 7a679cc1f1 mxfmux: Disable aggregator's default negotiation
mxfmux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Sebastian Dröge 52c419b799 mpegtsmux: Disable aggregator's default negotiation
mpegtsmux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Seungha Yang 8ec4452d67 h264decoder: Fix for unhandled low-delay decoding case
Baseclass calls get_preferred_output_delay() in a chain of
sequence header parsing and then new_sequence() is called
with required DPB size (includes render-delay) information.
Thus latency query should happen before the sequence header
parsing for subclass to report required render-delay accordingly
via get_preferred_output_delay() method.
(e.g., zero delay in case of live pipeline)

This commit is to fix wrong liveness signalling in case of
upstream packetized format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2363>
2022-05-05 14:54:54 +00:00
Seungha Yang ad136cb2c5 h265decoder: Fix for unhandled low-delay decoding case
Baseclass calls get_preferred_output_delay() in a chain of
sequence header parsing and then new_sequence() is called
with required DPB size (includes render-delay) information.
Thus latency query should happen before the sequence header
parsing for subclass to report required render-delay accordingly
via get_preferred_output_delay() method.
(e.g., zero delay in case of live pipeline)

This commit is to fix wrong liveness signalling in case of
upstream packetized format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2364>
2022-05-05 14:10:39 +00:00
Seungha Yang 58c94eed84 nvh264dec,nvh265dec: Don't realloc bitstream buffer per slice
Allocated memory size has not been updated which results in
realloc per slice. Fixing it and also release bitstream buffer
on ::close(), not finalize.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2361>
2022-05-05 12:15:27 +00:00
Jakub Adam 03b6dab006 d3d11screencapture: Set viewport when drawing mouse cursor
If there weren't any moved/dirty regions in the captured frame, the
viewport of the ID3D11DeviceContext would be left at whatever previous
value it had, which could lead to the cursor being drawn in a wrong
position and/or in an incorrect size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2362>
2022-05-04 17:18:32 +02:00
Seungha Yang 33e77782c6 nvcodec: Add AV1 decoder
Adding GstCodecs based AV1 decoder element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:23:25 +09:00
Seungha Yang 07cd1dcc6b av1decoder: Add support for render delay
Sync up with other decoder baseclass implementations

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:23:25 +09:00
Seungha Yang 1b4121fded av1decoder: Hold OBU temporal and spatial id in picture struct
NVDEC API requires the information

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:23:11 +09:00
Seungha Yang 1444dd91c5 meson: nvcodec: Remove unnecessary override option and fix build with non-MSVC
cpp_std=c++11 was hack for macOS build but we don't build this plugin
for Apple device anymore. And add "-Wno-deprecated-declarations"
compile option for gcc/clang

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:10:07 +09:00
Seungha Yang fe4d6bb469 nvcodec: Bump SDK header version to 11.1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-03 23:56:34 +09:00
Seungha Yang 29aab904a8 nvdecoder: Handle DPB size margin in a single place
... instead of each subclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2343>
2022-05-03 14:17:49 +00:00
Seungha Yang a8b2fbf77f d3d11decoder: Handle DPB size margin in a single place
... instead of each subclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2343>
2022-05-03 14:17:49 +00:00
Seungha Yang 6a4c42c03f codecs: Signal required DPB size for AV1,MPEG2,VP8, and VP9 via new_sequence()
Make all codecs consistent so that subclass can know additional DPB
size requirement depending on render-delay configuration regardless
of codec. Note that render-delay feature is not implemented for AV1
yet but it's planned.

Also, consider new_sequence() is mandatory requirement, not optional

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2343>
2022-05-03 14:17:49 +00:00
Nicolas Dufresne ab839f3642 v4l2codecs: Port to the new tile size helper
This will complete the scaling of width/height shift scaling
as only a partial implementation was made.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Thibault Saunier dd585ecfcc cuda: Fix introspection warnings
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1183

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2344>
2022-05-02 18:30:22 +00:00
Seungha Yang 1fb3804408 Revert "cuda: Fix GstCudaContext refcount bug"
This reverts commit df7ee0e215.

We should not unref it since gst_message_new_have_context()
takes ownership of the GstContext.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2342>
2022-05-02 17:19:13 +00:00
Edward Hervey 89780341e8 tsdemux: Demote warning to simple debug
That issue is actually handled, so don't pollute the logs with such warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2340>
2022-05-02 09:15:57 +02:00
Sebastian Dröge bf89c80d74 interlace: Also handle a missing "interlace-mode" field as progressive
Otherwise caps negotiation will fail in situations that are supposed
to work, like:

  "video/x-raw,framerate=(fraction)60/1" ! interlace field-pattern=0 ! "video/x-raw,framerate=(fraction)30/1"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2335>
2022-04-29 23:08:50 +00:00
Sebastian Dröge c7db9ce70b interlace: Add some more debug output to the getcaps function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2335>
2022-04-29 23:08:50 +00:00