mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-01 03:52:25 +00:00
plugins: modify image check of extract_allowed_surface_formats.
The extract_allowed_surface_formats function just check whether we can support some kind of surface/image format pair. We just need to create a surface, create an image with the same video-format and putImage from image to surface. All these operations success, that kind of video-format is supported. The old manner do not work for some kind of video-format. For example, the RGBA kind of format will create a NV12 surface and RGBA image, and the putImage will fail because the format is not same. And so the RGBA format is not supported but actually it is supported.
This commit is contained in:
parent
c1de41b841
commit
176bbce975
1 changed files with 5 additions and 5 deletions
|
@ -1266,18 +1266,18 @@ extract_allowed_surface_formats (GstVaapiDisplay * display, GArray * formats)
|
|||
|
||||
for (i = 0; i < formats->len; i++) {
|
||||
const GstVideoFormat format = g_array_index (formats, GstVideoFormat, i);
|
||||
GstVaapiChromaType chroma_type;
|
||||
GstVaapiSurface *surface;
|
||||
GstVaapiImage *image;
|
||||
GstVideoInfo vi;
|
||||
|
||||
if (format == GST_VIDEO_FORMAT_UNKNOWN)
|
||||
continue;
|
||||
chroma_type = gst_vaapi_video_format_get_chroma_type (format);
|
||||
if (chroma_type == 0)
|
||||
continue;
|
||||
surface = gst_vaapi_surface_new (display, chroma_type, 64, 64);
|
||||
|
||||
gst_video_info_set_format (&vi, format, 64, 64);
|
||||
surface = gst_vaapi_surface_new_full (display, &vi, 0);
|
||||
if (!surface)
|
||||
continue;
|
||||
|
||||
image = gst_vaapi_image_new (display, format, 64, 64);
|
||||
if (!image) {
|
||||
gst_vaapi_object_unref (surface);
|
||||
|
|
Loading…
Reference in a new issue