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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5991>
This commit is contained in:
Mengkejiergeli Ba 2024-01-24 17:11:34 +08:00 committed by GStreamer Marge Bot
parent ffdec6bc2b
commit bf7f4eef20

View file

@ -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