* gst_vaapi_surface_set_subpictures_from_composition:
* @surface: a #GstVaapiSurface
* @compostion: a #GstVideoOverlayCompositon
+ * @propagate_context: a flag specifying whether to apply composition
+ * to the parent context, if any
*
* Helper to update the subpictures from #GstVideoOverlayCompositon. Sending
* a NULL composition will clear all the current subpictures. Note that this
*/
gboolean
gst_vaapi_surface_set_subpictures_from_composition(
- GstVaapiSurface *surface,
- GstVideoOverlayComposition *composition
+ GstVaapiSurface *surface,
+ GstVideoOverlayComposition *composition,
+ gboolean propagate_context
)
{
GstVaapiDisplay *display;
g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE);
+ if (propagate_context) {
+ GstVaapiContext * const context = surface->priv->parent_context;
+ if (context)
+ return gst_vaapi_context_apply_composition(context, composition);
+ }
+
display = GST_VAAPI_OBJECT_DISPLAY(surface);
if (!display)
return FALSE;
gboolean
gst_vaapi_surface_set_subpictures_from_composition(
- GstVaapiSurface *surface,
- GstVideoOverlayComposition *composition
+ GstVaapiSurface *surface,
+ GstVideoOverlayComposition *composition,
+ gboolean propagate_context
);
G_END_DECLS
GL_BGRA);
}
- if (!gst_vaapi_surface_set_subpictures_from_composition (surface, composition))
+ if (!gst_vaapi_surface_set_subpictures_from_composition (surface,
+ composition, TRUE))
GST_WARNING ("could not update subtitles");
return gst_vaapi_texture_put_surface (priv->texture, surface,
flags = GST_VAAPI_PICTURE_STRUCTURE_FRAME;
- if (!gst_vaapi_surface_set_subpictures_from_composition(surface, composition))
+ if (!gst_vaapi_surface_set_subpictures_from_composition(surface,
+ composition, TRUE))
GST_WARNING("could not update subtitles");
#if USE_VAAPISINK_GLX