mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
surface: apply composition to the parent context, if requested.
This commit is contained in:
parent
17538a340e
commit
ac7c4cfe78
4 changed files with 18 additions and 6 deletions
|
@ -875,6 +875,8 @@ gst_vaapi_surface_query_status(
|
|||
* 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
|
||||
|
@ -885,7 +887,8 @@ gst_vaapi_surface_query_status(
|
|||
gboolean
|
||||
gst_vaapi_surface_set_subpictures_from_composition(
|
||||
GstVaapiSurface *surface,
|
||||
GstVideoOverlayComposition *composition
|
||||
GstVideoOverlayComposition *composition,
|
||||
gboolean propagate_context
|
||||
)
|
||||
{
|
||||
GstVaapiDisplay *display;
|
||||
|
@ -893,6 +896,12 @@ gst_vaapi_surface_set_subpictures_from_composition(
|
|||
|
||||
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;
|
||||
|
|
|
@ -236,7 +236,8 @@ gst_vaapi_surface_query_status(
|
|||
gboolean
|
||||
gst_vaapi_surface_set_subpictures_from_composition(
|
||||
GstVaapiSurface *surface,
|
||||
GstVideoOverlayComposition *composition
|
||||
GstVideoOverlayComposition *composition,
|
||||
gboolean propagate_context
|
||||
);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -135,7 +135,8 @@ gst_vaapi_video_converter_glx_upload (GstSurfaceConverter *converter,
|
|||
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,
|
||||
|
|
|
@ -679,7 +679,8 @@ gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *buffer)
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue