From: Gwenole Beauchesne Date: Tue, 20 Nov 2012 13:42:24 +0000 (+0100) Subject: vaapiupload: fix sink caps to report the supported set of YUV caps. X-Git-Tag: accepted/2.0/20130417.170005~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=713e6091a0911868015fcfce003df2f08c26fb1b;p=profile%2Fivi%2Fgstreamer-vaapi.git vaapiupload: fix sink caps to report the supported set of YUV caps. Try to allocate the GstVaapiUploader helper object prior to listing the supported image formats. Otherwise, only a single generic caps is output with no particular pixel format referenced in there. --- diff --git a/gst/vaapi/gstvaapiupload.c b/gst/vaapi/gstvaapiupload.c index d75fc57..6e08c5b 100644 --- a/gst/vaapi/gstvaapiupload.c +++ b/gst/vaapi/gstvaapiupload.c @@ -358,9 +358,9 @@ gst_vaapiupload_transform_caps( if (!gst_structure_has_name(structure, GST_VAAPI_SURFACE_CAPS_NAME)) return NULL; out_caps = gst_caps_from_string(gst_vaapiupload_yuv_caps_str); - if (upload->display) { + if (gst_vaapiupload_ensure_uploader(upload)) { GstCaps *allowed_caps, *inter_caps, *other_caps; - allowed_caps = gst_vaapi_display_get_image_caps(upload->display); + allowed_caps = gst_vaapi_uploader_get_caps(upload->uploader); if (!allowed_caps) return NULL; /* can direct copy other YUV to va surface */ @@ -368,7 +368,6 @@ gst_vaapiupload_transform_caps( gst_caps_merge(allowed_caps, other_caps); inter_caps = gst_caps_intersect(out_caps, allowed_caps); - gst_caps_unref(allowed_caps); gst_caps_unref(out_caps); out_caps = inter_caps; }