Commit graph

10 commits

Author SHA1 Message Date
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 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
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
Mengkejiergeli Ba 3062f1b6b0 msdkdec: Apply the modified memory allocation logic
We did several things to enable the new memory logic in msdkdec:
(1) We always use video memory for decoder in linux path;
(2) We give negotiated pool to alloc_pool stored in GstMsdkContext which
will be used in callback mfxFrameAllocator:Alloc to alloc surfaces as
MediaSDK needs, and this pool is also available for decoder itself;
(3) We modify decide_allocation process, that is we make pool negotiaion
before gst_msdk_init_decoder to ensure the pool is decided and ready for
use in mfxFrameAllocator:Alloc callback; then we will consider the case
when we need to do the gpu to cpu copy.
(4) In gst_msdkdec_finish_task, we modify the way for copy following the
logic in (3).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3439>
2023-02-27 12:22:13 +00:00
Mengkejiergeli Ba 75efb204e5 msdkdec: Add a function to create va pool
Add a pool creation function name as 2 for later use which will create
va pool for video memory in linux and keep system pool for windows.
This gst_msdkdec_create_buffer_pool2 will replace gst_msdkdec_create_buffer_pool
when all the memory allocation modifications are ready in the commits after.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3439>
2023-02-27 12:22:13 +00:00
Mengkejiergeli Ba 4124b8ffd4 msdkdec: Add a function to directly allocate output GstMsdkSurface
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3439>
2023-02-27 12:22:13 +00:00
Mengkejiergeli Ba 1fe5655c2a msdkdec: Decoder should use its own pool when downstream allocator is not recognizable
Msdkdec should use it own pool when the allocation from downstream query
is not any msdk_allocator (i.e. msdk_video_allocator,
msdk_dmabuf_allocator and msdk_system_allocator). Otherwise, when using
pipeline "msdkh264dec ! vah264enc !" to transcode a not 16-bit-aligned
stream (i.e. 1920x1080), the transcoding will fail due to the size
mismatch issue between decoder pool and encoder pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2451>
2022-06-08 02:48:53 +00:00
Mengkejiergeli Ba 586dfab9bd msdkdec: Enable SFC scaling for AVC and HEVC
Decoder SFC only supports down-scaling at most to 1/8.
For example, given a 4K bistream, SFC can scale it to 1080p via:
"msdkh265dec ! video/x-raw,width=1920,height=1080 ! glimagesink"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>
2022-02-16 08:26:46 +00:00
Mengkejiergeli Ba eb742c8ed0 msdkdec: Add SFC codes
SFC refers to Scaler Format Converter, more details here:
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol15-sfc.pdf
By attaching mfxExtDecVideoProcessing buffer to mfxVideoParam, decoder
can do SFC for csc and scaling.

MSDK will check if surface bitdepth equals to input when no SFC is
triggered, which means in the case of SFC, there is no need to update
surface bitdepth via gst_msdk_update_mfx_frame_info_from_mfx_video_param.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>
2022-02-16 08:26:46 +00:00
Thibault Saunier 019971a3c7 Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir 2021-09-24 16:14:36 -03:00
Renamed from sys/msdk/gstmsdkdec.h (Browse further)