diff options
author | Leo Liu <[email protected]> | 2014-02-03 10:41:05 -0500 |
---|---|---|
committer | Christian König <[email protected]> | 2014-02-14 08:50:32 +0100 |
commit | f87dfc35bc150696f7d89f77e2f92f7d26d29358 (patch) | |
tree | f038dfa9cc7098a816601b64610220eb7a41ac2c | |
parent | 01e637114914453451becc0dc8afe60faff48d84 (diff) |
st/omx/enc: fix scaling src alignment issue
Signed-off-by: Leo Liu <[email protected]>
Signed-off-by: Christian König <[email protected]>
-rw-r--r-- | src/gallium/state_trackers/omx/vid_enc.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c index 1761bcb41b9..6e65274560c 100644 --- a/src/gallium/state_trackers/omx/vid_enc.c +++ b/src/gallium/state_trackers/omx/vid_enc.c @@ -746,10 +746,24 @@ static OMX_ERRORTYPE vid_enc_EncodeFrame(omx_base_PortType *port, OMX_BUFFERHEAD views = vbuf->get_sampler_view_planes(vbuf); dst_surface = priv->scale_buffer->get_surfaces(priv->scale_buffer); vl_compositor_clear_layers(s); + for (i = 0; i < VL_MAX_SURFACES; ++i) { + struct u_rect src_rect; + if (!views[i] || !dst_surface[i]) continue; - vl_compositor_set_rgba_layer(s, compositor, 0, views[i], NULL, NULL, NULL); + + src_rect.x0 = 0; + src_rect.y0 = 0; + src_rect.x1 = port->sPortParam.format.video.nFrameWidth; + src_rect.y1 = port->sPortParam.format.video.nFrameHeight; + + if (i > 0) { + src_rect.x1 /= 2; + src_rect.y1 /= 2; + } + + vl_compositor_set_rgba_layer(s, compositor, 0, views[i], &src_rect, NULL, NULL); vl_compositor_render(s, compositor, dst_surface[i], NULL, false); } |