diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2011-12-14 14:40:37 +0100 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2011-12-14 14:40:37 +0100 |
commit | ac7c4cfe785e134319b3e232389056e4d9bd99e5 (patch) | |
tree | 3368bdffdac199a4dd87291fa0861b03315fd5c8 | |
parent | 17538a340e2e72e1770d40b563d6a0d89421b1f8 (diff) |
surface: apply composition to the parent context, if requested.
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface.c | 13 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface.h | 5 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c | 3 | ||||
-rw-r--r-- | gst/vaapi/gstvaapisink.c | 3 |
4 files changed, 18 insertions, 6 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 57eab42f..c29b1ba1 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -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 @@ -884,8 +886,9 @@ gst_vaapi_surface_query_status( */ gboolean gst_vaapi_surface_set_subpictures_from_composition( - GstVaapiSurface *surface, - GstVideoOverlayComposition *composition + GstVaapiSurface *surface, + 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; diff --git a/gst-libs/gst/vaapi/gstvaapisurface.h b/gst-libs/gst/vaapi/gstvaapisurface.h index 07418781..ce9bd9e8 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.h +++ b/gst-libs/gst/vaapi/gstvaapisurface.h @@ -235,8 +235,9 @@ gst_vaapi_surface_query_status( gboolean gst_vaapi_surface_set_subpictures_from_composition( - GstVaapiSurface *surface, - GstVideoOverlayComposition *composition + GstVaapiSurface *surface, + GstVideoOverlayComposition *composition, + gboolean propagate_context ); G_END_DECLS diff --git a/gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c b/gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c index a4d35628..fdeb817e 100644 --- a/gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c +++ b/gst-libs/gst/vaapi/gstvaapivideoconverter_glx.c @@ -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, diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index c1749248..7dab2710 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -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 |