summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-09-03 11:05:02 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-03 11:06:00 +0200
commitd065c09684959172d4dbb0bcfc6b9324da230ae5 (patch)
treec987796ddb772bb95138d585ef76ec8b2646840e
parentc4e742f428ec54a057b6a22df5afae2f250ebece (diff)
downloadgstreamer-plugins-bad-d065c09684959172d4dbb0bcfc6b9324da230ae5.tar.gz
amcvideodec: Port tiled NV12 conversion to 1.0
-rw-r--r--sys/androidmedia/gstamcvideodec.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index cfdbb5a6d..8abfe5558 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -1004,26 +1004,25 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, gint idx,
}
/* FIXME: This should be in libgstvideo as MT12 or similar, see v4l2 */
case COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka:{
+ GstVideoFrame vframe;
gint width = self->width;
gint height = self->height;
- gint src_stride = self->stride;
- gint dest_luma_stride = GST_VIDEO_INFO_COMP_STRIDE (info, 0);
- gint dest_chroma_stride = GST_VIDEO_INFO_COMP_STRIDE (info, 1);
+ gint dest_luma_stride, dest_chroma_stride;
guint8 *src = buf->data + buffer_info->offset;
- guint8 *dest_luma =
- GST_BUFFER_DATA (outbuf) + GST_VIDEO_INFO_COMP_OFFSET (info, 0);
- guint8 *dest_chroma =
- GST_BUFFER_DATA (outbuf) + GST_VIDEO_INFO_COMP_OFFSET (info, 1);
+ guint8 *dest_luma, *dest_chroma;
gint y;
-
const size_t tile_w = (width - 1) / TILE_WIDTH + 1;
const size_t tile_w_align = (tile_w + 1) & ~1;
-
const size_t tile_h_luma = (height - 1) / TILE_HEIGHT + 1;
const size_t tile_h_chroma = (height / 2 - 1) / TILE_HEIGHT + 1;
-
size_t luma_size = tile_w_align * tile_h_luma * TILE_SIZE;
+ gst_video_frame_map (&vframe, info, outbuf, GST_MAP_WRITE);
+ dest_luma = GST_VIDEO_FRAME_PLANE_DATA (&vframe, 0);
+ dest_chroma = GST_VIDEO_FRAME_PLANE_DATA (&vframe, 1);
+ dest_luma_stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, 0);
+ dest_chroma_stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, 1);
+
if ((luma_size % TILE_GROUP_SIZE) != 0)
luma_size = (((luma_size - 1) / TILE_GROUP_SIZE) + 1) * TILE_GROUP_SIZE;
@@ -1080,6 +1079,7 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, gint idx,
}
height -= TILE_HEIGHT;
}
+ gst_video_frame_unmap (&vframe);
ret = TRUE;
break;