Commit graph

911 commits

Author SHA1 Message Date
Yinhang Liu b1ebe93eb2 msdkvpp: Add function to dynamically create sink caps and src caps
We need to create the sink caps and src caps dynamically for different
platforms. By default, the vpp init function create static pad template
and the compatibility and flexibility of the platform are too poor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu bfbde5ce22 msdkdec: Enable dynamic capability support
Enable dynamic capability support for msdkav1dec, msdkh264dec,
msdkh265dec, msdkmjpegdec, msdkmpeg2dec, msdkvc1dec, msdkvp8dec,
msdkvp9dec.
The gstmsdkdec elements can create the sink caps and src caps
dynamically for different platforms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu aa59d9828f msdkdec: Add function to dynamically create sink caps and src caps
We need to create the sink caps and src caps dynamically for different
platforms. By default, the dec init function create static pad template
and the compatibility and flexibility of the platform are too poor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu a4fc1c5031 msdkenc: Add documented capabilities to expose "stable" caps
Although msdkenc supports dynamic caps, it still needs to expose
"stable" caps to users.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu da4b6f17cf msdkenc: Support image formats in low power mode for sink caps
There are some special image formats in low power mode, these
image formats should be supported in sink caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu 3cb9c34030 msdkenc: Remove static templates in format setting
The elements have supported dynamic capability query, and it is not
necessary to refer the static templates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu 30d3ce3a9e msdkenc: Enable dynamic capability support
Enable dynamic capability support for msdkav1enc, msdkh264enc,
msdkh265enc, msdkmjpegenc, msdkvp9enc, msdkmpeg2enc.
The gstmsdkenc elements can create the sink caps and src caps
dynamically for different platforms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu 7aa0b29da8 msdk: Add function to specify string array parameters
Sometimes it is necessary to manually specify string parameters
of multiple options, such as format, interlace-mode, etc.
Add function to support this requirment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:06 +00:00
Yinhang Liu 1f8d939559 msdkenc: Add function to dynamically create sink caps and src caps
We need to create the sink caps and src caps dynamically for different
platforms. By default, the enc init function create static pad template
and the compatibility and flexibility of the platform are too poor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:05 +00:00
Yinhang Liu 3f47cdaee8 msdk: add function to get the format list
This static format list will be used to check the formats
supported by the platform.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:05 +00:00
Yinhang Liu 97e081c9d6 msdk: Register elements based on the codecs supported by the platform
By default, msdk plugin will register all encoders and decoders
on any platform, even unsupported encoders and decoders will be
registered. Dynamically register encoders and decoders besed on
the supported codecs on different platforms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:05 +00:00
Yinhang Liu f773752bd8 msdk: Add function to get the implementation description
Through the implementation description, we can dynamically obtain
the codec capabilities supported by the platform.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:05 +00:00
Yinhang Liu 34a812a0c0 msdk: Add functions to get data members from MsdkSession
When getting mfxImplDescription, these data members need to
be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:05 +00:00
Yinhang Liu 6242fca526 msdk: Create msdk context without job_type
The job_type is not necessary when creating a normal msdk
context. Make the APIs for creating context more flexible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:05 +00:00
Yinhang Liu dafb801a18 msdk: Move all _gst_caps_has_feature to gstmsdkcaps.c
_gst_caps_has_feature is used by all msdk elements, so
move it to gstmsdkcaps.c

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4177>
2023-04-17 05:24:05 +00:00
Seungha Yang af86c4b80e d3d11videosink: Remove pointless GetDC call
We don't use the Win32 device context handle at all.
Removing code which was copied from GL code blindly
in early d3d11 implementation stage a long time ago

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4407>
2023-04-12 19:54:31 +00:00
Mengkejiergeli Ba 471f3b3b93 msdkcontext: Remove unused codes in msdkcontext
We don't maintain three list (i.e. avail, locked and used) surfaces
as the old way did to achieve memory management, so remove the
correcponding codes for old memory management.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4276>
2023-04-11 06:59:33 +00:00
Mengkejiergeli Ba ec2ef6e2d3 msdk: Remove unused gstmsdkbufferpool and memory
GstMsdkBufferPool, GstMsdkVideoMemory and GstMsdkSystemMemory are no
longer used in msdk plugins, instead we use va/d3d11 pool for memory
allocation. So, remove the codes of unused stuffs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4276>
2023-04-11 06:59:33 +00:00
Mengkejiergeli Ba ef1397cbe3 msdk: Remove the func gst_msdk_is_msdk_buffer
Since we use va/d3d11 pool to allocate memory, the old msdk bufferpool
stuffs are not used anymore, so we don't need to check if an input
buffer is msdk buffer using gst_msdk_is_msdk_buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4276>
2023-04-11 06:59:33 +00:00
Wang Chuan d7d0c969df gstd3d11window: fix memory leak
GstStructure may leak when using external HWND

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4373>
2023-04-10 12:12:27 +00:00
Seungha Yang ba8f944df7 amfencoder: Set output DTS
AMF runtime does not provide correct DTS. Although GetPts() seems to
be returning DTS, it still needs to be adjusted to meet DTS <= PTS
requirement. Do calculate DTS in baseclass instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4092>
2023-04-08 23:11:32 +09:00
Evgeny Pavlov 6f62128433 amfcodec: Add options for B-frames for amfh264enc plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4092>
2023-04-08 23:11:28 +09:00
Seungha Yang 7117cba831 decklinkaudiosink: Fix playback when video caps is configured before audio
Scheduled playback starts on videosink's state change or on caps
but it's possible that audiosink is configure without caps yet.
Try start scheduled playback on audiosink's caps event as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4364>
2023-04-07 18:59:17 +00:00
Dario Marino Saccavino 07cf7b2a29 wasapi2: Add option to monitor loopback device's mute state
When loopback recording from a render device, the wasapi2src element
captures audio even if the device is muted. This change adds the
'loopback-silence-on-device-mute' property that, when set to `true`,
causes wasapi2src to inject silence in the pipeline when
the device is muted.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1306
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4337>
2023-04-07 17:19:33 +00:00
Wojciech Kapsa 8d4916df84 decklink: fix 10 bit RGB (r210) format auto detection
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2391

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4332>
2023-04-04 20:37:09 +03:00
Seungha Yang 47fda2c51c d3d11screencapturesrc: Add "window-capture-mode" property
... to support capturing only window's client area

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2425
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4324>
2023-04-03 15:06:47 +00:00
Aleksandr Slobodeniuk e683000573 d3d11videosink: fix race conditions in win32 window
One race condition is the fact that the window object
can be destroyed while running some routine in the UI
thread (such as resizing). To avoid that situation we make
UI thread hold a reference on the window object while it's
running.
Other probpematic case is when the window handle is reused:
if we stop and start the pipeline very fast,
so the sink creates a new window object that is going to use
the same window handle as the previous one.
And finally the case when the pipeline is stopped immediatelly
right after starting, this one is also handled in this commit.

NOTE: a unit test that reproduces this cases have been added
in the previous commit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4260>
2023-04-03 11:19:11 +00:00
Seungha Yang 7755cd2f7a d3d11videosink: Enhancement for initial window size decision
Use AdjustWindowRect() method to calculate window size so that
video scene can be rendered on client area without black borders

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4323>
2023-04-02 00:31:58 +09:00
Tim-Philipp Müller 330836db8e taglist, plugins: fix compiler warnings with GLib >= 2.76
Fix compiler warnings about not using the return value when
freeing the GString segment with g_string_free(.., FALSE):

    ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’

which we get with newer GLib versions. These were all harmless.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4273>
2023-03-27 07:37:11 +00:00
Víctor Manuel Jáquez Leal 292d6cdbed vaencoder: remove display reference in decode picture
Since it's possible to grab the VA display from the GstBuffer and
GstMemory, there's no need to keep a reference to it in
GstVaEncodePicture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3066>
2023-03-24 14:05:15 +00:00
Víctor Manuel Jáquez Leal 494169aad4 vadecoder: remove display reference in decode picture
Since it's possible to grab the VA display from the GstBuffer and
GstMemory, there's no need to keep a reference to it in
GstVaDecodePicture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3066>
2023-03-24 14:05:15 +00:00
Stéphane Cerveau e88e8527ed sys: avoid double definition of symbol MEDIASUBTYPE_I420
Namespace the symbol MEDIASUBTYPE_I420 to avoid double definition
across dshow and mediafoundation plugins.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4246>
2023-03-23 00:56:04 +00:00
Seungha Yang 96555c7ee9 nvh264encoder: Fix template caps
It should include progressive as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4236>
2023-03-22 23:40:58 +00:00
Tong Wu ebc9780c5f msdkdec: delete use_video_memory
Since msdkdec uses video pool as the output buffer pool at all time. The
use_video_memory variable is not useful anymore. Now delete it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Tong Wu 8105d2044d msdkdec: expand retry times to 1s
One-frame sleep time is not enough to wait until there is a surface
unlocked from downstream. Now expand it to 1s and add a return when
fail.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Tong Wu 123c8d14c1 msdkallocator_d3d: add gst_msdk_frame_free callback function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Tong Wu abe4d0046a msdkdec: acquire buffer from video pool on Windows
Video memory is available on Windows. This patch is to make the buffers
acquired from d3d11 video pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Tong Wu d2902be9eb msdkdec: add thiz->ds_has_known_allocator for d3d11
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Tong Wu 245df2778e msdkallocator_d3d: add alloc callback function for d3d allocator
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Tong Wu b3e13df8c1 msdkdec: add d3d11 pool during negotiation
Enable use_video_memory for Windows and add d3d11 pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Tong Wu 2b9cda928b msdkdec: add d3d11 caps for srcpad
Set decoder srcpad with D3D11Memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
2023-03-22 05:07:19 +00:00
Aleksandr Slobodeniuk 1f834eaacb d3d11convert: add "method" property
It allows to select the sampling method, same
as "method" property of videoconvert.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4205>
2023-03-21 12:08:54 +00:00
Aleksandr Slobodeniuk 4c9d4d30cb d3d11convert: protect 'add-borders' with mutex
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4205>
2023-03-21 12:08:54 +00:00
Mengkejiergeli Ba 9e3faf69f2 msdkvpp: Pass null formats when create va allocator for RGB565
Fix https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1780

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4136>
2023-03-21 05:42:34 +00:00
Víctor Manuel Jáquez Leal e794fcaa1c va: add driver description in element metadata
In the same spirit of libva-win32 elements this patch shows the driver of each
element in gst-inspect, giving more information to the user. This driver
description is parsed from vaQueryVendorString from mesa and intel drivers,
while copied as is for others. Also appends the render node for multi gpu
systems.

Fixes #2349

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4204>
2023-03-20 15:27:25 +00:00
Adrien De Coninck ab69e24d9e ksdeviceprovider: Fix leak in gst_dshow_device_provider_start
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4224>
2023-03-20 09:50:37 +00:00
Adrien De Coninck 0aea6a86ac dshowdeviceprovider: Fix leak in gst_dshow_device_provider_start
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4224>
2023-03-20 09:50:37 +00:00
Seungha Yang 3bbfab1cf3 va: Return default device from device-path property getter
Otherwise application would not be able to know matching element
for wanted device. Typical use case of the read-only device path
(DXGI Adapter LUID, CUDA device index, etc) property is that
application enumerates physical devices and then selects matching
GStreamer element (in null state) via device path property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4220>
2023-03-19 17:50:43 +00:00
Sebastian Dröge ccad9a7338 plugins: Fix various trivial clang compiler warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4210>
2023-03-18 16:16:55 +02:00
Seungha Yang fed252cabd nvencoder: Fix CQP option setting
... and zero initialize LUID and CUDA device list to address
coverity issue

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4215>
2023-03-17 18:30:19 +00:00