Commit graph

750 commits

Author SHA1 Message Date
Seungha Yang 7c92ed0bd0 d3d11videosink: Fixing focus lost on desktop layout change
Watch all message on the window thread, instead of internal window only.
Otherwise, some global window messages, such as desktop layout change,
wouldn't be handled by our window.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3593>
2022-12-17 11:17:28 +00:00
Nirbheek Chauhan b3806da265 avfvideosrc: Report latency when doing screen capture
There is no `device` when doing screen capture, but there is always an
`input`, so use that to decide when we can reply to a latency query.
Without this, the latency query just fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3589>
2022-12-16 23:58:07 +00:00
Victor Manuel Jaquez Leal 171a626c6c vaav1dec: Remove double caps unref.
There was a duplicated caps unref raising a warning.

Also it reorgs the sorrounding code for simplicity.

Fixes: #1196
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3587>
2022-12-16 19:18:25 +00:00
Seungha Yang 068a5c1053 d3d11videosink: Move potentially time-consuming operations to ::prepare()
Move following tasks to ::prepare() from ::show_frame()
* CPU -> GPU upload
* GstD3D11Window object setup, including input caps change handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3574>
2022-12-17 02:11:07 +09:00
Seungha Yang 04451b108a d3d11videosink: Call ShowWindow() from window thread
... when rendering on external HWND. ShowWindow() will cause
synchronous message passing to window thread and then can be blocked.
At the same time, window thread can wait for GStreamer thread.
Instead of the synchronous call, queue the task to window message
and performs from the window thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3583>
2022-12-16 22:18:14 +09:00
Seungha Yang a27c5c81df d3d11videosink: Fix deadlock when parent window is busy
Deadlock sequence:
* From a streaming thread, d3d11videosink sends synchronous message
  to the parent window, so that internal (child) window can be
  constructed on the parent window's thread
* App thread (parent window thread) is waiting for pipeline's
  state change (to GST_STATE_NULL) but streaming thread is
  blocked and waiting for app thread

To avoid the deadlock, GstD3D11WindowWin32 should send message
to the parent window asynchronously.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3570>
2022-12-15 17:37:48 +00:00
Brad Hards 29dd254f7a h264parser: typo fix in enum value
Old value is marked deprecated, new enum with same entry is added. Should be binary compatible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1318>
2022-12-12 21:43:14 +00:00
Seungha Yang e6585c89ea cuda: Hide memory copy util function
The method was intended to be used by only cudaupload/download elements
and not ready to be a part of public API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3545>
2022-12-08 19:52:23 +00:00
Seungha Yang f588932547 ksvideosrc: Warn for deprecated plugin use
This plugin should not be used any more

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3544>
2022-12-08 17:48:11 +00:00
Seungha Yang 1e124682c8 winscreencap: Warn for deprecated plugin use
This plugin should not be used any more

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3544>
2022-12-08 17:48:11 +00:00
Nirbheek Chauhan d4f8067064 directshow: Fix build error with glib 2.75 and newer
Starting with glib 2.75, `NULL` is `nullptr`, which cannot be
implicitly coerced to `0`, unlike `NULL`. So explicitly pass `0`.

```
[3206/4524] Compiling C++ object subprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj
FAILED: subprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj
"cl" "-Isubprojects\gst-plugins-bad\sys\directshow\gstdirectshow.dll.p" "-Isubprojects\gst-plugins-bad\sys\directshow" "-I..\subprojects\gst-plugins-bad\sys\directshow" "-Isubprojects\gst-plugins-bad" "-I..\subprojects\gst-plugins-bad" "-Isubprojects\gst-plugins-base\gst-libs" "-I..\subprojects\gst-plugins-base\gst-libs" "-Isubprojects\gstreamer\libs" "-I..\subprojects\gstreamer\libs" "-Isubprojects\gstreamer" "-I..\subprojects\gstreamer" "-Isubprojects\orc" "-I..\subprojects\orc" "-I..\subprojects\gst-plugins-bad\sys\directshow\strmbase\baseclasses" "-Isubprojects\gst-plugins-base\gst-libs\gst\video" "-Isubprojects\gstreamer\gst" "-Isubprojects\gst-plugins-base\gst-libs\gst\audio" "-Isubprojects\gst-plugins-base\gst-libs\gst\tag" "-IC:/gst-install/include/glib-2.0" "-IC:/gst-install/lib/glib-2.0/include" "-IC:/gst-install/include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/W2" "/EHsc" "/O2" "/Zi" "/wd4018" "/wd4146" "/wd4244" "/wd4305" "/utf-8" "/we4002" "/we4003" "/we4013" "/we4020" "/we4027" "/we4029" "/we4033" "/we4045" "/we4047" "/we4053" "/we4062" "/we4098" "/we4101" "/we4189" "/utf-8" "-D_MBCS" "/wd4189" "/wd4456" "/wd4701" "/wd4703" "/wd4706" "/wd4996" "-DHAVE_CONFIG_H" "/Fdsubprojects\gst-plugins-bad\sys\directshow\gstdirectshow.dll.p\dshowvideosink.cpp.pdb" /Fosubprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj "/c" ../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(62): warning C5051: attribute 'noinline' requires at least '/std:c++20'; ignored
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(123): error C2664: 'LRESULT SendMessageA(HWND,UINT,WPARAM,LPARAM)': cannot convert argument 3 from 'nullptr' to 'WPARAM'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(123): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(3690): note: see declaration of 'SendMessageA'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(635): error C2664: 'BOOL SystemParametersInfoA(UINT,UINT,PVOID,UINT)': cannot convert argument 2 from 'nullptr' to 'UINT'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(635): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(13153): note: see declaration of 'SystemParametersInfoA'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(1593): error C2664: 'LRESULT SendMessageA(HWND,UINT,WPARAM,LPARAM)': cannot convert argument 3 from 'nullptr' to 'WPARAM'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(1593): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(3690): note: see declaration of 'SendMessageA'
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3528>
2022-12-05 14:18:14 +00:00
Seungha Yang ac6b3e9a45 d3d11av1dec: Promote rank to primary + 1
... so that this element can have higher rank than the other software
AV1 decoders

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3495>
2022-12-02 17:56:22 +00:00
Víctor Manuel Jáquez Leal 901ad2b4f5 vajpegdec: Reenable element negotiation.
negotiation vmethod were overwritten by vabasedec, leading to errors.

This was a regression of commit b6538e0560.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3509>
2022-12-02 08:37:02 +00:00
Victor Manuel Jaquez Leal 4cbdf43e7d va: Handle input caps change.
Update output caps if it's notified by baseclass

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal 19b83bc156 vaav1dec: Use gst_va_base_dec_set_output_state().
And even that vaav1dec doesn't use vabasedec negotiate vmethod, it should align
with the new scheme of using base's width & height for surface size and
output_info structure for downstream display size negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal e5417b2db7 vavp9dec: Use gst_va_base_dec_set_output_state().
As this element reopen the internal decoder differently, it only uses the helper
function to negotiate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal 6dfca46ada vampeg2dec: Streams are progressive by default.
By initializating progressive, then interlaced streams are detected correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal b6538e0560 va: Add and use common decode negotiate vmethod.
This vmethod can be used by decoders with the same VA decoder reopen logic:
same profile, chroma, width and height.

Also a new public method called gst_va_base_dec_set_output_state() with the
common GStreamer code for setting the output state, which is always called by
the negotiate vmethod.

In order to do this refactoring, new variables in vabasedec have to be populated
by the decoders:

* width and height define the resolution set in VA decoder. In the case of H264
  would be de coded_width and codec_height, or max_width and max_height in AV1.
* output_info is the downstream video info used for negotiation in
  gst_va_base_dec_set_output_state().
* input_state, from codec parent class shall be also held by vabasedec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal 31c63a6e6c vaav1dec: Use gst_va_base_dec_prepare_output_frame().
And simplify a bit the code flow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal 4a8ecc2dba va: Add and use gst_va_base_dec_prepare_output_frame().
This helper will do downstream negotiation and later will
allocate the output frame.

H265 and AV1 decoders don't use this approach since their output
frame allocation is different.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal f1a9728b30 va: Remove last_ret error handling in decoders.
It was used in the early development of the base classes. Now it
shouldn't be needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal de5b76a922 va: Add and use gst_va_base_dec_process_output().
This function will copy the frame, if it's needed, and will apply buffer flags.

The function is used by all the decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
He Junyan 765adf5325 va: Fix the caps memory leak by gst_va_pool_new_with_config().
The gst_va_pool_new_with_config() will ref the caps, and so we need
to unref after that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3503>
2022-12-01 17:31:16 +00:00
Víctor Manuel Jáquez Leal c8a0d706ca va: Add render node name in non-first devices.
There could be multi-GPU setups where the non-first has more
entrypoints than the first one, and the elements names are not
homogeneous, leading to pipeline building error.

This patch add the render node in the elements names when they belong
to the non-first device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3491>
2022-12-01 16:00:55 +00:00
Victor Manuel Jaquez Leal cccbf1f02d vafilter: Increase the caps for HDR.
As they might be other medatadata types.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3473>
2022-12-01 15:17:49 +00:00
Victor Manuel Jaquez Leal b25b1be70d vafilter: Increase the number of 3DLUT caps to 16.
To fix the warning on Alderlake

vafilter gstvafilter.c:534:gst_va_filter_ensure_filters:<vafilter0>
vaQueryVideoProcFiltersCaps: list argument exceeds maximum number

Increase the number of caps to 16 as vadumpcaps does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3473>
2022-12-01 15:17:49 +00:00
He Junyan c365389930 va: Add H265 SCC profile support.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:19 +08:00
He Junyan 0952c556dc va: Add extended formats support such as 10/12 bits, 4:2:2 and 4:4:4.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:14 +08:00
He Junyan 17c416ca92 va: enable multi tile support for H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:07 +08:00
He Junyan 2f8ce208e8 va: enable vah265lpenc for low power mode H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:00 +08:00
He Junyan 2677d4c6db va: Add the low-delay-b frame support for H265.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:41 +08:00
He Junyan 9ee657cdee va: Add prediction direction attribute support for H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:33 +08:00
He Junyan 4e7eddeafe va: Register and enable and the vah265enc plugin.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:26 +08:00
He Junyan 3d99f24843 va: Implement the vah265enc plugin for va HEVC encoding.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:08 +08:00
Seungha Yang a3b352c99d mfvideosrc: Fix buffer leak
The allocated buffer should be released

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3479>
2022-11-28 18:50:03 +00:00
Seungha Yang 581481c12f mediafoundation: Chain up from GObject::constructed
... so that GstTracer can trace it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3479>
2022-11-28 18:50:03 +00:00
Seungha Yang b9b3a9c4e1 d3d11: Use correct ref/unref methods
Those objects are GstObject subclasses

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3479>
2022-11-28 18:50:03 +00:00
Seungha Yang 468b049a04 win32ipcvideosrc: Fix property name and enum value mismatch
Make them consistent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3465>
2022-11-25 15:50:33 +00:00
Seungha Yang 20e83fa45b win32ipcvideosrc: Protect pipe from flush thread
The pipe object must be protected against GstBaseSrc::unlock()
thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3465>
2022-11-25 15:50:33 +00:00
Ma, Mingyang 66087b6276 msdkdec: Update decoding pts
Update frame pts before calling gst_video_decoder_finish_frame, or frames may be lost when transcoding in specific stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3449>
2022-11-25 01:42:58 +00:00
Seungha Yang 4f846540cb win32ipc: Add WIN32 shared memory videosrc/sink elements
Windows supports various IPC methods but that's completely
different form that of *nix from implementation point of view.
So, instead of adding shared memory functionality to existing
shm plugin, new WIN32 shared memory source/sink elements
are implemented in this commit.

Each videosink (server) and videosrc (client) pair will communicate
using WIN32 named pipe and thus user should configure unique/proper
pipe name to them (e.g., \\.\pipe\MyPipeName).
Once connection is established, videosink will create named shared memory
object per frame and client will be able to consume the object
(i.e., memory mapped file handle) without additional copy operation.

Note that implementations under "protocol" directory are almost
pure C/C++ with WIN32 APIs except for a few defines and debug functions.
So, applications can take only the protocol part so that the application
can send/receive shared-memory object from/to the other end
even if it's not an actual GStreamer element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3441>
2022-11-24 12:41:18 +00:00
Jan Lorenz 47b8762774 mfvideosrc: check HRESULT of CreateClassEnumerator correctly
Fixes a crash during direct show device enumeration

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1599
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3460>
2022-11-23 14:45:50 +00:00
Nicolas Dufresne 6981384184 kmssink: Fix compilation without kernel headers
There was a drm/drm_mode.h included added recently, drm/ is usually
referencing the linux kernel header, but we only requires the libdrm
headers to be installed. On top of this, including drm_mode.h is never
needed as its already included by drm.h.

Fixes #1596

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3452>
2022-11-23 08:39:49 +00:00
Bill Hofmann afb18e0e31 kmssink: add HDR10 infoframe support
If stream has HDR10 metadata and HDMI device EDID supports it, this patch
will set the DRM properties accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3303>
2022-11-21 17:55:41 -05:00
Bill Hofmann daecbd1ff0 kmssink: Add skip-vsync property
The legacy emulation in DRM/KMS drivers badly interact with GStreamer and
may cause the framerate to be halved. With this property, users can disable
vsync (which is handled internally by the emulation) in order to regain the
full framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3303>
2022-11-21 17:55:20 -05:00
Seungha Yang f6327e25a7 qsv: Promote encoder rank to PRIMARY on Windows
QSV is very well integrated with GstD3D11 infrastructure on Windows,
and this is the recommended H/W encoder element over the MediaFoundation
plugins on Intel GPU system.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3393>
2022-11-19 00:43:10 +00:00
Nicolas Dufresne 5980fb76e7 video: Add arbitrary tile dimensions support
In current tile representation, only tiles with power of two
width and height in bytes are supported. This limitation
prevents adding more complex tiles formats.

In this patch, we deprecate tile_ws and tile_hs from GstVideoFormatInfo and
replace if with an array of GstVideoTileInfo. Each plane tiles are then
described with their pixels width/height, line stride and total size.
The helper gst_video_format_info_get_tile_sizes() that depends on the
deprecated API is also being removed. This can simply be removed as it wasn't
in any stable release yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>
2022-11-18 22:59:29 +00:00
Víctor Manuel Jáquez Leal b2bfb066ec vabaseenc: Reduce logging noise if finish_frame fails.
Fixes: #1579
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3423>
2022-11-17 05:25:18 +00:00
Seungha Yang 433301d0e5 amfcodec: Promote encoder rank to PRIMARY
This H/W encoder implementation is the recommended element
on AMD system over the MediaFoundation one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3394>
2022-11-16 14:47:27 +00:00
Nicolas Dufresne d3c5fc815e v4l2codecs: Allow output caps to be updated
This change allow output caps to be updated even though we stay in
streaming state. This is needed so that any upstream updated to fields
like framerate, hdr data, etc. can result in a downstream caps event
being pushed.

Previously, any of these changes was being ignored and the downstream
caps would not reflect it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
2022-11-16 13:12:38 +00:00