*/
static gboolean
_gst_vaapi_texture_put_surface (GstVaapiTexture * texture,
- GstVaapiSurface * surface, guint flags)
+ GstVaapiSurface * surface, const GstVaapiRectangle * crop_rect, guint flags)
{
VAStatus status;
if (!vaapi_check_status (status, "vaCopySurfaceGLX()"))
return FALSE;
#else
- guint surface_width, surface_height;
+ GstVaapiRectangle rect;
GLContextState old_cs;
gboolean success = FALSE;
- gst_vaapi_surface_get_size (surface, &surface_width, &surface_height);
+ if (!crop_rect) {
+ rect.x = 0;
+ rect.y = 0;
+ gst_vaapi_surface_get_size (surface, &rect.width, &rect.height);
+ crop_rect = ▭
+ }
GST_VAAPI_OBJECT_LOCK_DISPLAY (texture);
status = vaPutSurface (GST_VAAPI_OBJECT_VADISPLAY (texture),
GST_VAAPI_OBJECT_ID (surface),
texture->pixo->pixmap,
- 0, 0, surface_width, surface_height,
+ crop_rect->x, crop_rect->y, crop_rect->width, crop_rect->height,
0, 0, texture->width, texture->height,
NULL, 0, from_GstVaapiSurfaceRenderFlags (flags)
);
gboolean
gst_vaapi_texture_put_surface (GstVaapiTexture * texture,
- GstVaapiSurface * surface, guint flags)
+ GstVaapiSurface * surface, const GstVaapiRectangle * crop_rect, guint flags)
{
g_return_val_if_fail (texture != NULL, FALSE);
g_return_val_if_fail (surface != NULL, FALSE);
- return _gst_vaapi_texture_put_surface (texture, surface, flags);
+ return _gst_vaapi_texture_put_surface (texture, surface, crop_rect, flags);
}
gboolean
gst_vaapi_texture_put_surface (GstVaapiTexture * texture,
- GstVaapiSurface * surface, guint flags);
+ GstVaapiSurface * surface, const GstVaapiRectangle * crop_rect,
+ guint flags);
G_END_DECLS
GstVaapiVideoConverterGLXPrivate *const priv =
GST_VAAPI_VIDEO_CONVERTER_GLX (self)->priv;
GstVaapiVideoMeta *const meta = gst_buffer_get_vaapi_video_meta (buffer);
- GstVaapiSurface *const surface = gst_vaapi_video_meta_get_surface (meta);
+ GstVaapiSurfaceProxy *const proxy =
+ gst_vaapi_video_meta_get_surface_proxy (meta);
+ GstVaapiSurface *const surface = gst_vaapi_surface_proxy_get_surface (proxy);
GstVaapiDisplay *new_dpy, *old_dpy;
new_dpy = gst_vaapi_object_get_display (GST_VAAPI_OBJECT (surface));
GST_WARNING ("could not update subtitles");
return gst_vaapi_texture_put_surface (priv->texture, surface,
+ gst_vaapi_surface_proxy_get_crop_rect (proxy),
gst_vaapi_video_meta_get_render_flags (meta));
}
GstVaapiVideoMeta *const vmeta =
gst_buffer_get_vaapi_video_meta (meta->buffer);
GstVaapiVideoMetaTexture *const meta_texture = meta->user_data;
- GstVaapiSurface *const surface = gst_vaapi_video_meta_get_surface (vmeta);
+ GstVaapiSurfaceProxy *const proxy =
+ gst_vaapi_video_meta_get_surface_proxy (vmeta);
+ GstVaapiSurface *const surface = gst_vaapi_surface_proxy_get_surface (proxy);
GstVaapiDisplay *const dpy = GST_VAAPI_OBJECT_DISPLAY (surface);
if (gst_vaapi_display_get_display_type (dpy) != GST_VAAPI_DISPLAY_TYPE_GLX)
gst_vaapi_texture_unref (texture);
}
return gst_vaapi_texture_put_surface (meta_texture->texture, surface,
+ gst_vaapi_surface_proxy_get_crop_rect (proxy),
gst_vaapi_video_meta_get_render_flags (vmeta));
}
textures[0] = texture;
texture_id = gst_vaapi_texture_get_id(texture);
- if (!gst_vaapi_texture_put_surface(texture, surface, flags))
+ if (!gst_vaapi_texture_put_surface(texture, surface, NULL, flags))
g_error("could not transfer VA surface to texture");
if (!gst_vaapi_window_glx_put_texture(glx_window, texture, NULL, NULL))
textures[1] = texture;
- if (!gst_vaapi_texture_put_surface(texture, surface, flags))
+ if (!gst_vaapi_texture_put_surface(texture, surface, NULL, flags))
g_error("could not transfer VA surface to texture");
if (gl_get_current_texture_2d() != texture_id)