GstCaps *allowed_caps;
GstVaapiVideoPool *images;
GstVideoInfo image_info;
- GstCaps *image_caps;
GstVaapiVideoPool *surfaces;
GstVideoInfo surface_info;
guint direct_rendering;
{
GstVaapiUploaderPrivate * const priv = uploader->priv;
- gst_caps_replace(&priv->image_caps, NULL);
gst_caps_replace(&priv->allowed_caps, NULL);
-
gst_vaapi_video_pool_replace(&priv->images, NULL);
gst_vaapi_video_pool_replace(&priv->surfaces, NULL);
gst_vaapi_display_replace(&priv->display, NULL);
return FALSE;
gst_video_info_set_format(&priv->image_info, format, width, height);
- gst_caps_replace(&priv->image_caps, caps);
gst_vaapi_video_pool_replace(&priv->images, pool);
gst_vaapi_video_pool_unref(pool);
return TRUE;
{
GstVaapiUploaderPrivate *priv;
GstVaapiImage *image;
- GstVideoFormat format;
- GstVideoInfo vi;
gboolean image_caps_changed, surface_caps_changed;
g_return_val_if_fail(GST_VAAPI_IS_UPLOADER(uploader), FALSE);
priv = uploader->priv;
priv->direct_rendering = 0;
- /* Strip out non-YUV formats */
- if (!gst_video_info_from_caps(&vi, src_caps))
- return FALSE;
- if (!GST_VIDEO_INFO_IS_YUV(&vi))
- return FALSE;
- format = GST_VIDEO_INFO_FORMAT(&vi);
-
/* Check if we can alias source and output buffers (same data_size) */
image = gst_vaapi_video_pool_get_object(priv->images);
if (image) {
- if (gst_vaapi_image_get_format(image) == format &&
+ if ((gst_vaapi_image_get_format(image) ==
+ GST_VIDEO_INFO_FORMAT(&priv->image_info)) &&
gst_vaapi_image_is_linear(image) &&
- gst_vaapi_image_get_data_size(image) == GST_VIDEO_INFO_SIZE(&vi))
+ (gst_vaapi_image_get_data_size(image) ==
+ GST_VIDEO_INFO_SIZE(&priv->image_info)))
priv->direct_rendering = 1;
gst_vaapi_video_pool_put_object(priv->images, image);
}
+
+ GST_INFO("direct-rendering: level %u", priv->direct_rendering);
return TRUE;
}
#if !GST_CHECK_VERSION(1,0,0)
GST_BUFFER_DATA(buffer) = gst_vaapi_image_get_plane(image, 0);
GST_BUFFER_SIZE(buffer) = gst_vaapi_image_get_data_size(image);
-
- gst_buffer_set_caps(buffer, priv->image_caps);
#endif
return buffer;