diff options
author | Gurkirpal Singh <[email protected]> | 2018-01-20 07:27:07 +0530 |
---|---|---|
committer | Julien Isorce <[email protected]> | 2018-03-06 17:21:11 +0000 |
commit | c62cf1f165919bc74296952452906b517d49b64a (patch) | |
tree | 3d5139e5e4535182d539689fbe89e5a768f5d19b /src/gallium/state_trackers/omx/vid_dec_common.c | |
parent | b2f2236dc565dd1460f0c1d26af905955bf3a6a1 (diff) |
st/omx/tizonia/h264d: Add EGLImage support
Example Gstreamer pipeline :
MESA_ENABLE_OMX_EGLIMAGE=1 GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 filesrc location=movie.mp4 ! qtdemux ! h264parse ! omxh264dec ! glimagesink
Acked-by: Leo Liu <[email protected]>
Reviewed-by: Julien Isorce <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/omx/vid_dec_common.c')
-rw-r--r-- | src/gallium/state_trackers/omx/vid_dec_common.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/omx/vid_dec_common.c b/src/gallium/state_trackers/omx/vid_dec_common.c index 56010ca0aea..21952513de1 100644 --- a/src/gallium/state_trackers/omx/vid_dec_common.c +++ b/src/gallium/state_trackers/omx/vid_dec_common.c @@ -90,6 +90,44 @@ void vid_dec_FillOutput(vid_dec_PrivateType *priv, struct pipe_video_buffer *buf views = buf->get_sampler_view_planes(buf); +#if ENABLE_ST_OMX_TIZONIA + if (!output->pBuffer) { + struct pipe_video_buffer *dst_buf = NULL; + struct pipe_surface **dst_surface = NULL; + struct u_rect src_rect; + struct u_rect dst_rect; + struct vl_compositor *compositor = &priv->compositor; + struct vl_compositor_state *s = &priv->cstate; + enum vl_compositor_deinterlace deinterlace = VL_COMPOSITOR_WEAVE; + + dst_buf = util_hash_table_get(priv->video_buffer_map, output); + assert(dst_buf); + + dst_surface = dst_buf->get_surfaces(dst_buf); + assert(views); + + src_rect.x0 = 0; + src_rect.y0 = 0; + src_rect.x1 = def->nFrameWidth; + src_rect.y1 = def->nFrameHeight; + + dst_rect.x0 = 0; + dst_rect.y0 = 0; + dst_rect.x1 = def->nFrameWidth; + dst_rect.y1 = def->nFrameHeight; + + vl_compositor_clear_layers(s); + vl_compositor_set_buffer_layer(s, compositor, 0, buf, + &src_rect, NULL, deinterlace); + vl_compositor_set_layer_dst_area(s, 0, &dst_rect); + vl_compositor_render(s, compositor, dst_surface[0], NULL, false); + + priv->pipe->flush(priv->pipe, NULL, 0); + + return; + } +#endif + for (i = 0; i < 2 /* NV12 */; i++) { if (!views[i]) continue; width = def->nFrameWidth; |