X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fvaapi%2Fgstvaapiupload.c;h=f91f14831c9ba5d399a401d08f4cc9c4216d2c90;hb=e168c7508c86d0aebd23e99e89165393eb006e35;hp=3116449a1b98ce439b3e13bbe37edc12af96ba67;hpb=d2dfe10ba5eb4724b0aa312632e0d056c4bbd713;p=profile%2Fivi%2Fgstreamer-vaapi.git diff --git a/gst/vaapi/gstvaapiupload.c b/gst/vaapi/gstvaapiupload.c index 3116449..f91f148 100644 --- a/gst/vaapi/gstvaapiupload.c +++ b/gst/vaapi/gstvaapiupload.c @@ -24,7 +24,7 @@ * SECTION:gstvaapiupload * @short_description: A video to VA flow filter * - * vaapiupload converts from raw YUV pixels to VA surfaces suitable + * vaapiupload uploads from raw YUV pixels to VA surfaces suitable * for the vaapisink element, for example. */ @@ -47,7 +47,7 @@ GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapiupload); /* ElementFactory information */ static const GstElementDetails gst_vaapiupload_details = GST_ELEMENT_DETAILS( - "VA-API colorspace converter", + "VA-API colorspace uploader", "Filter/Converter/Video", GST_PLUGIN_DESC, "Gwenole Beauchesne "); @@ -448,6 +448,14 @@ error_put_image: } static GstCaps * +gst_vaapi_get_other_support_caps(GstVaapiConvert *upload) +{ + GstCaps *caps; + caps = gst_caps_from_string(GST_VIDEO_CAPS_YUV("YUY2")); + return caps; +} + +static GstCaps * gst_vaapiupload_transform_caps( GstBaseTransform *trans, GstPadDirection direction, @@ -480,10 +488,14 @@ gst_vaapiupload_transform_caps( return NULL; out_caps = gst_caps_from_string(gst_vaapiupload_yuv_caps_str); if (upload->display) { - GstCaps *allowed_caps, *inter_caps; + GstCaps *allowed_caps, *inter_caps, *other_caps; allowed_caps = gst_vaapi_display_get_image_caps(upload->display); if (!allowed_caps) return NULL; + /* can direct copy other YUV to va surface */ + other_caps = gst_vaapi_get_other_support_caps(upload); + 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); @@ -622,7 +634,7 @@ gst_vaapiupload_negotiate_buffers( if (!gst_vaapiupload_ensure_surface_pool(upload, outcaps)) return FALSE; - if (convert->direct_rendering) + if (upload->direct_rendering) gst_vaapiupload_ensure_direct_rendering_caps(upload, incaps); dr = MIN(upload->direct_rendering, upload->direct_rendering_caps); if (upload->direct_rendering != dr) { @@ -642,6 +654,8 @@ gst_vaapiupload_set_caps( if (!gst_vaapiupload_negotiate_buffers(upload, incaps, outcaps)) return FALSE; + GST_INFO("set caps\nIN caps:\n%" GST_PTR_FORMAT "\nOUT caps:\n%" GST_PTR_FORMAT, + incaps, outcaps); return TRUE; }