Commit graph

2627 commits

Author SHA1 Message Date
Sebastian Dröge 6b22f53fa9 player: Without dispatcher emit signals directly instead of via the default main context
This is how it was documented and how it worked before the port to GstPlay.

Without this, applications expecting signals to be emitted directly
without anything running the main context will simply not receive any
signals.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5672>
2023-11-15 17:16:36 +00:00
Seungha Yang cb3c1390f2 d3d11: Avoid ID3D11DeviceContext::Map if possible
Allocate resource with initial date instead of calling Map/Unmap
after allocation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5660>
2023-11-15 23:38:59 +09:00
Seungha Yang ac11ccd4ff dwrite: Protect entire draw operation with D3D11 lock
d2d runtime seems to execute pending GPU command list
when DXGI ID2D1RenderTarget is being released, and it will invoke
d3d11 immediate context APIs. Should protect all rendering operations
and DXGI resources with lock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5659>
2023-11-15 19:25:46 +09:00
Mengkejiergeli Ba cef1f179c6 msdk: Add device env in plugin dependencies
Add env vars GST_MSDK_DRM_DEVICE in plugin_add_dependencies to register
msdk plugins according to user's choice in a multi-gpu platform.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5615>
2023-11-15 02:34:27 +00:00
Michael Grzeschik 23a4b72631 codecparsers: h264bitwriter: Fix trace typo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5661>
2023-11-14 14:41:37 -05:00
Seungha Yang 75560329c1 cea608mux: Fix buffer leak
Release buffer after use

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5648>
2023-11-14 11:14:26 +00:00
Olivier Crête 7104c867c0 webrtcsdp: Don't require fingerprint in inactive media
Inactive m-lines don't need a fingerprint as they may not
have a connection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1118>
2023-11-13 20:51:31 +00:00
Olivier Crête 9eddf844f0 webrtcsdp: Remove comparison between media and session fingerprint
The code seems to validate that the media-level fingerprint matches
the fingerprint of the previous media or of the whole session. There
is no such requirement in any RFC I found. The session-session one
is just meant to act as a fallback when there is no media-level
fingerprint.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1118>
2023-11-13 20:51:31 +00:00
Stéphane Cerveau fdc3db68cd codecparsers: introduce h265 level enum
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5644>
2023-11-13 16:37:46 +00:00
Benjamin Gaignard 8cd8eeff20 codec2json: Add h2652json element
This element convert H.265 frame parameters into human readable json data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3865>
2023-11-13 14:09:59 +00:00
Benjamin Gaignard 3a7fec4ea1 codec2json: Add h2642json element
This element convert H.264 frame header into human readable
json data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3865>
2023-11-13 14:09:59 +00:00
Philippe Normand 99fa06e73f play: Improve documentation header
If the application relies on GstPlaySignalAdapter, no special clean-up is
required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5643>
2023-11-12 11:07:37 +00:00
HuQian 050e7f4831 waylandsink: fix incorrect RGB and BGR mapping about GST DRM and WL_SHM
This commit corrects the mapping relationship between RGB and BGR in GST and DRM.
The previous mapping was incorrect, causing potential color mismatches in the output.

The changes are as follows:

  {WL_SHM_FORMAT_RGB888, DRM_FORMAT_RGB888, GST_VIDEO_FORMAT_BGR},
  {WL_SHM_FORMAT_BGR888, DRM_FORMAT_BGR888, GST_VIDEO_FORMAT_RGB},

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5620>
2023-11-11 14:41:18 +00:00
Sebastian Dröge a238caebbb play: Automatically flush the bus when disposing the signal adapter
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3107

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5642>
2023-11-11 14:11:30 +02:00
Philippe Normand 66373721d5 gstplay: Add a minimal documentation header
Also mentioning the need to set the bus to flushing state before disposing the
player in order to avoid reference cycles.

Fixes #3107

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5631>
2023-11-11 10:48:27 +00:00
Víctor Manuel Jáquez Leal 43ce583460 vulkan/operation: wait for pending objects at reset
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5591>
2023-11-10 16:36:44 +01:00
Víctor Manuel Jáquez Leal 0296c8a53a vulkan/operation: get query only if a operation is submitted
To avoid a validation error if get query is performed before.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5591>
2023-11-10 16:36:44 +01:00
Víctor Manuel Jáquez Leal 3464710bf0 vulkan/operation: remove stored fences at the end
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5591>
2023-11-10 16:36:44 +01:00
Víctor Manuel Jáquez Leal 405ae91ed7 vulkan/operation: don't fail if extension isn't available
gst_vulkan_operation_add_dependency_frame() is a noop if the required extensions
aren't available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5591>
2023-11-10 16:36:44 +01:00
Sebastian Dröge 274551d450 mxfdemux: Store GstMXFDemuxEssenceTrack in their own fixed allocation
Previously they were stored inline inside a GArray, but as references to
the tracks were stored in various other places although the array could
still be updated (and reallocated!), this could lead to dangling
references in various places.

Instead now store them in a GPtrArray in their own allocation so each
track's memory position stays fixed.

Fixes ZDI-CAN-22299

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3055

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5635>
2023-11-10 14:38:40 +00:00
Benjamin Gaignard 1db83d3f74 codecparsers: av1: Clip max tile rows and cols values
Clip tile rows and cols to 64 as describe in AV1 specification.

Fixes ZDI-CAN-22226 / CVE-2023-44429

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3015

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5634>
2023-11-10 13:45:43 +00:00
Mathieu Duponchelle 39efd788a8 timecodestamper: set drop-frame property default to TRUE
After talking with Vivia on IRC, she does not remember why the default
was FALSE and it is in my opinion preferable to stick to whatever
representation best represents time for a given framerate as a default
behavior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5628>
2023-11-09 21:05:02 +00:00
Víctor Manuel Jáquez Leal 9f5b2c4e25 va: use GstVideoInfoDmaDrm when importing buffers
In the case of encoders and filters when importing a DMABuf, use
GstVideoInfoDmaDrm to get the drm fourcc and modifier.

In both cases, instead of keeping the original GstVideoInfoDmaDrm from caps, the
GstVideoInfo part of the structure is converted as canonical one, given the
format from the fourcc. It's kept in the way to handle V4L2 linear DMABufs and
to avoid too many changes in the current code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Víctor Manuel Jáquez Leal 7c0227145c vaallocator: use GstVideoInfoDmaDrm for dmabuf setup
Instead of guessing the DRM format and modifier, pass a DRM video info to
gst_va_dmabuf_memories_setup().

Still, it checks for the DRM parameters in DRM info, if they are not available,
as in the case of V4L2 buffers, the part of the video info is used.

This is an API breakage, but since the plugin is still in stage, it's still
allowed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Víctor Manuel Jáquez Leal d1210d6dc0 vaallocator: use VADRMPRIMESurfaceDescriptor to create surfaces
To import DMAbufs we used VASurfaceAttribExternalBuffers which works, but it's
not specific for DRM PRIME 2, since it lacks of many metadata. This patch
replaces VASurfaceAttribExternalBuffers with VADRMPRIMESurfaceDescriptor in
va_create_surfaces().

Still, this patch assumes linear modifier only.

The hack for RGB surfaces in I965 driver was pushed down into
va_create_surfaces() to avoid handling both structures.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Víctor Manuel Jáquez Leal 76115528ac vallocator: remove n_planes argument in dmabuf_memories_setup()
Instead of passing the number of planes to process, take that number from the
passed GstVideoInfo.

This is an API breakage, but since the plugin is still in stage, it's still
allowed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Víctor Manuel Jáquez Leal 2d358cb22a vaallocator: fix assumption object size equal fd size
Remove the comment and warning message that object size should be equal to the
file descriptor size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5264>
2023-11-09 17:36:06 +00:00
Tobias Rapp cd98d12f2e decklink: Fix typo in element documentation
DechLink -> DeckLink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5625>
2023-11-09 07:53:12 +00:00
Tobias Rapp 7ec3a97a70 decklink: Increase section level of video sink/source element documentation
Should fix auto-generated follow-up sections like "Hierarchy" or
"Factory details" to be listed under the element name in the
table-of-contents of the document, instead of a stand-alone
"Duplex-Mode" section.

Also cleanup some spurious colon suffix after section names.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5625>
2023-11-09 07:53:12 +00:00
Víctor Manuel Jáquez Leal d7b5b54eda vadisplay: only register elements of allowed drivers
Now that nvidia-vaapi-driver appeared and isn't yet supported by GstVA, we've to
add an allowed list of supported drivers.

This patch implements it adding a environment variable to disable this driver
check: GST_VA_ALL_DRIVERS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5616>
2023-11-08 13:53:26 +00:00
Vivia Nikolaidou dd00dab5e9 ccutils: Add padding also for ccp data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5423>
2023-11-08 10:06:45 +00:00
Slava Andrejev 93b4272e6c meson: change Wayland scanner command from "code" to "private-code"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5593>
2023-11-07 18:40:35 +00:00
Slava Andrejev cad42b0511 meson: add processing of "staging" Wayland protocols
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5593>
2023-11-07 18:40:35 +00:00
Slava Andrejev c48e96fd76 meson: prevent sandbox violation if GStreamer and wayland-protocols are subprojects
Suppose you have a project where GStreamer and wayland-protocols are
pulled in as dependencies via .wrap files. In that case, Meson's setup
step will fail for gst-plugins-bad with the message "Sandbox violation:
Tried to grab file viewporter.xml outside current (sub)project." To
avoid this exception, one should use Meson's `files` and `join_paths`
functions. The suggested solution is identical to how GTK 4 processes
Wayland files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5593>
2023-11-07 18:40:35 +00:00
Balló György 6f8b9574f2 gstwayland: Don't depend on wayland-protocols
wayland-protocols are needed to build gstwayland, but not for dependent projects.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4724>
2023-11-07 17:52:31 +00:00
Seungha Yang 02bf1dbf1f d3d11window: Fix scale factor setting
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5602>
2023-11-07 11:19:31 +00:00
Seungha Yang 0bcddfc894 d3d11: Enable DirectXMath SIMD
* Enable SIMD except for x86 target
* Use aligned matrix struct
* Remove unnecessary matrix copy operations

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5602>
2023-11-07 11:19:31 +00:00
Vivia Nikolaidou 78bc3d53dd ccutils: Keep upstream padding payload
A payload of 0x80 0x80 means that it's padding. It's not a good idea to
throw this away though, because of the cc_valid field.

According to CEA 10-B section 25.2.1, if cc_valid is zero, the run-in
clock and start bit should not be generated. In practice, this means
that any closed captions will be erased and the end-user TV will show
that captions are not available for this stream. This might have
undesired consequences, e.g. we were just showing a long line of
captions and we disable it before the user has had time to read it, or
you can't enable closed captions during silence/music intervals.

We cannot reliably detect whether there's a currently-silent closed
caption stream or just nothing, but we have this information coming from
upstream, so we can at least not discard it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5508>
2023-11-06 13:44:36 +00:00
Seungha Yang b12d43bd89 wasapi2device: Ignore activation failed device
Enumerates all devices even if activation error is detected

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3090
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5599>
2023-11-06 12:28:50 +00:00
Marek Vasut 5d2d602e4a v4l2codecs: Avoid QBUF/DQBUF struct timeval .tv_usec wrap-around at frame 1000000
When decoding stream using hardware V4L2 decoder element, in any of the
currently supported formats, the decoding will fail once frame number
1000000 is reached. The reported error clearly indicates a wrap-around
occured, instead of receiving decoded frame 1000000, frame 0 is received
from the hardware V4L2 decoder driver.

The problem is actually not in the driver itself, but rather in gstreamer,
which uses `struct v4l2_buffer` member `.timestamp` in a special way. The
timestamp of buffers with encoded data added to the SINK (input) queue of
the driver is copied by the driver into matching buffers with decoded data
added to the SOURCE (output) queue of the driver. In fact, the timestamp
is not a timestamp at all, but rather in this special case, only part of
it is used as an incrementing frame counter.

The `.timestamp` is of type `struct timeval`, which is defined in
`sys/time.h` [1]. Only the `tv_usec` member of this structure is used
for the incrementing frame counter. However, suseconds_t tv_usec [2]
may be limited to range [-1, 1000000]:
"
[XSI] The type suseconds_t shall be a signed integer type capable of
      storing values at least in the range [-1, 1000000].
"
Therefore, once frame 1000000 is reached, a rollover occurs and decoding
fails.

Fix this by using both `struct timeval` members, `.tv_sec` and `.tv_usec`
with matching modular arithmetic, this way the failure would occur again
just short of 2^84 frames, which should be plenty.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

A test case using stateless hardware h264 decoder, the WARN/ERROR output
in gstreamer log indicates a failure occurred. With this change, that
error no longer occurs and the WARN/ERROR are not present:
```
pc$ gst-launch-1.0 videotestsrc num-buffers=1001001 pattern=6 ! \
                   video/x-raw,width=16,height=16,format=I420 ! \
                   x264enc ! filesink location=/tmp/test.h264

dut$ GST_DEBUG="*:3" gst-launch-1.0 filesrc location=/tmp/test.h264 ! \
                                    h264parse ! v4l2slh264dec ! fakesink
...
0:03:51.393677606 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000000, but driver returned frame 0.
0:03:51.394140597 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000001, but driver returned frame 1.
0:03:51.394425216 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000002, but driver returned frame 2.
0:03:51.394665211 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000003, but driver returned frame 3.
0:03:51.394785833 12111     0x370df400 WARN      \
  v4l2codecs-h264dec gstv4l2codech264dec.c:1059:gst_v4l2_codec_h264_dec_output_picture:<v4l2slh264dec0> \
  error: Failed to decode frame 1000000
ERROR: from element /GstPipeline:pipeline0/v4l2slh264dec:v4l2slh264dec0: Failed to decode frame 1000000
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5598>
2023-11-04 15:51:45 +01:00
Xavier Claessens 47c56e3865 unixfd: Add support for abstract socket
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:01 +00:00
Xavier Claessens d44aa71f24 unixfd: Use DMABuf allocator when needed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:01 +00:00
Xavier Claessens 1f928c6c1a unixfd: Update gst_plugins_cache.json
Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:01 +00:00
Xavier Claessens f1a1901b8b unixfd: New plugin with unixfdsink and unixfdsrc elements
This pair of elements, inspired from shmsink/shmsrc, send unix file
descriptors (e.g. memfd, dmabuf) from one sink to multiple source
elements in other processes.

The unixfdsink proposes a memfd/shm allocator, which causes for example
videotestsrc to write directly into memories that can be transfered to
other processes without copying.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Xavier Claessens 7df22b338b GstShmAllocator: New shared memory allocator
This makes Wayland's allocator public. It is generally useful to have a
shared memory allocator that can create memfd on Linux.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Seungha Yang 34d221dad5 wasapi2: Fix build with GST_DISABLE_GST_DEBUG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5585>
2023-11-03 13:31:03 +00:00
Seungha Yang 8009f5275a mediafoundation: Fix build with GST_DISABLE_GST_DEBUG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5585>
2023-11-03 13:31:03 +00:00
Seungha Yang c3cef6e923 d3d12: Fix build with GST_DISABLE_GST_DEBUG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5585>
2023-11-03 13:31:03 +00:00
Seungha Yang bf05cfea45 d3d11: Fix build with GST_DISABLE_GST_DEBUG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5585>
2023-11-03 13:31:03 +00:00
Seungha Yang 5e147ed3b8 meson: Fix MSVC build with GST_DISABLE_GST_DEBUG
MSVC does not understand Wno-unused

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5585>
2023-11-03 13:31:03 +00:00