mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-14 11:25:39 +00:00
vaapidecode: set initial decode format according surface chroma type
For surfaces with different chroma type, it is prefer to initialize a format which chroma type should be same with surface chroma type instead of using fixed NV12.
This commit is contained in:
parent
67ed67515b
commit
e4bec306b6
1 changed files with 6 additions and 1 deletions
|
@ -413,9 +413,14 @@ is_surface_resolution_changed (GstVaapiDecode * decode,
|
||||||
surface_format = gst_vaapi_surface_get_format (surface);
|
surface_format = gst_vaapi_surface_get_format (surface);
|
||||||
|
|
||||||
/* if the VA context delivers a currently unrecognized format
|
/* if the VA context delivers a currently unrecognized format
|
||||||
* (ICM3, e.g.), we can assume NV12 "safely" */
|
* (ICM3, e.g.), we can assume one according surface chroma
|
||||||
|
* type. If fail, then use NV12 "safely" */
|
||||||
if (surface_format == GST_VIDEO_FORMAT_UNKNOWN
|
if (surface_format == GST_VIDEO_FORMAT_UNKNOWN
|
||||||
|| surface_format == GST_VIDEO_FORMAT_ENCODED)
|
|| surface_format == GST_VIDEO_FORMAT_ENCODED)
|
||||||
|
surface_format =
|
||||||
|
gst_vaapi_video_format_from_chroma (gst_vaapi_surface_get_chroma_type
|
||||||
|
(surface));
|
||||||
|
if (surface_format == GST_VIDEO_FORMAT_UNKNOWN)
|
||||||
surface_format = GST_VIDEO_FORMAT_NV12;
|
surface_format = GST_VIDEO_FORMAT_NV12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue