mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
vaapisink: add helper function to apply a composition buffer.
Simplify application of a composition buffer to a GstVaapiSurface, and all its peers, until that function is eventually promoted to libgstvaapi.
This commit is contained in:
parent
6ce6712ed5
commit
9e1da76971
1 changed files with 13 additions and 4 deletions
|
@ -832,11 +832,22 @@ gst_vaapisink_put_surface(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
set_composition_from_buffer(GstVaapiSurface *surface, GstBuffer *buffer)
|
||||
{
|
||||
GstVideoOverlayComposition * const composition =
|
||||
gst_video_buffer_get_overlay_composition(buffer);
|
||||
|
||||
if (!composition)
|
||||
return FALSE;
|
||||
return gst_vaapi_surface_set_subpictures_from_composition(surface,
|
||||
composition, TRUE);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *src_buffer)
|
||||
{
|
||||
GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
|
||||
GstVideoOverlayComposition *composition;
|
||||
GstVaapiVideoMeta *meta;
|
||||
GstVaapiSurface *surface;
|
||||
GstBuffer *buffer;
|
||||
|
@ -882,9 +893,7 @@ gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *src_buffer)
|
|||
|
||||
flags = gst_vaapi_video_meta_get_render_flags(meta);
|
||||
|
||||
composition = gst_video_buffer_get_overlay_composition(src_buffer);
|
||||
if (!gst_vaapi_surface_set_subpictures_from_composition(surface,
|
||||
composition, TRUE))
|
||||
if (!set_composition_from_buffer(surface, src_buffer))
|
||||
GST_WARNING("could not update subtitles");
|
||||
|
||||
switch (sink->display_type) {
|
||||
|
|
Loading…
Reference in a new issue