From bf7f4eef204e3d4de2d9375ec6f0cf2bd55ab33d Mon Sep 17 00:00:00 2001 From: Mengkejiergeli Ba Date: Wed, 24 Jan 2024 17:11:34 +0800 Subject: [PATCH] msdk: Use gst_video_info_dma_drm_to_video_info to extract video info Note that we need mappings for all drm_fourcc, otherwise we will get GST_VIDEO_FORMAT_UNKNOWN for some formats... Part-of: --- subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c index 7a2a705249..590cbba612 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c @@ -2054,15 +2054,13 @@ gst_msdkcaps_video_info_from_caps (const GstCaps * caps, if (!drm_info) goto failed; - *info = drm_info->vinfo; + if (!gst_video_info_dma_drm_to_video_info (drm_info, info)) { + gst_video_info_dma_drm_free (drm_info); + goto failed; + } if (modifier) *modifier = drm_info->drm_modifier; - /* We need to update the offset/stride in info */ - GstVideoFormat drm_video_format = - gst_va_video_format_from_drm_fourcc (drm_info->drm_fourcc); - gst_video_info_set_format - (info, drm_video_format, drm_info->vinfo.width, drm_info->vinfo.height); gst_video_info_dma_drm_free (drm_info); } else #endif