diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2014-09-19 08:03:23 +0200 |
---|---|---|
committer | prasanth kamuju <prasanth.kamuju@linaro.org> | 2014-10-07 16:29:57 +0530 |
commit | ab28513b834a31ff3eebcd450efae9734876ccda (patch) | |
tree | a54ca27c3b58efe1abd29f9faf53b73cd0285b7d | |
parent | 7fff2b381f984d1c4d665e60f158f82a52e984c8 (diff) |
gstqcvideodec: adjust luma and chroma alignment
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rw-r--r-- | src/gstqcvideodec.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gstqcvideodec.c b/src/gstqcvideodec.c index 2e136fc..34ded39 100644 --- a/src/gstqcvideodec.c +++ b/src/gstqcvideodec.c @@ -1171,7 +1171,20 @@ static void* video_thread (void *context) ret = gst_video_decoder_allocate_output_frame(GST_VIDEO_DECODER(decode_context),g_frame); if (ret == GST_FLOW_OK && gst_buffer_map (g_frame->output_buffer, &map, GST_MAP_WRITE)) { - memcpy (map.data,outputbuffer->bufferaddr, map.size); + // copy the luma plane + int y_size = GST_ROUND_UP_128(decode_context->video_resoultion.frame_width) * + GST_ROUND_UP_32(decode_context->video_resoultion.frame_height); + + int c_size = GST_ROUND_UP_128(decode_context->video_resoultion.frame_width) * + GST_ROUND_UP_32(decode_context->video_resoultion.frame_height/2); + + memcpy (map.data, outputbuffer->bufferaddr, GST_ROUND_UP_N(y_size, 4096)); + + // copy the chroma plane + memcpy (map.data + GST_ROUND_UP_N(y_size,4096), + outputbuffer->bufferaddr + GST_ROUND_UP_N(y_size, 8192), + GST_ROUND_UP_N(c_size, 4096)); + ret = gst_video_decoder_finish_frame(GST_VIDEO_DECODER(decode_context),g_frame); gst_buffer_unmap(g_frame->output_buffer, &map); gst_buffer_unref(g_frame->output_buffer); |