* 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.
*/
/* 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 <gwenole.beauchesne@intel.com>");
}
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,
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);
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) {
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;
}