diff options
author | Xavi Artigas <xartigas@fluendo.com> | 2013-06-20 09:52:31 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-06-20 09:53:41 +0200 |
commit | 85c1510d6b9ac6eb9aaee1dd68a89e5f6bef4b56 (patch) | |
tree | ab79b002a4d5265dbd7813cd7e4a14fa64ef6d1b /sys/androidmedia | |
parent | 44807dcc1a4052f460d06f3b9b29e45c12e17113 (diff) | |
download | gstreamer-plugins-bad-85c1510d6b9ac6eb9aaee1dd68a89e5f6bef4b56.tar.gz |
androidmedia: Fix copying of raw video frames on Samsung Galaxy S3 with Exynos 4 SOC
Diffstat (limited to 'sys/androidmedia')
-rw-r--r-- | sys/androidmedia/gstamcvideodec.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c index e78cb77b8..d99132a92 100644 --- a/sys/androidmedia/gstamcvideodec.c +++ b/sys/androidmedia/gstamcvideodec.c @@ -926,7 +926,7 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, gint idx, case COLOR_FormatYUV420SemiPlanar:{ gint i, j, height; guint8 *src, *dest; - gint src_stride, dest_stride; + gint src_stride, dest_stride, fixed_stride; gint row_length; GstVideoFrame vframe; @@ -936,25 +936,30 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, gint idx, goto done; } - /* FIXME: This is untested! */ + /* Samsung Galaxy S3 seems to report wrong strides. + I.e. BigBuckBunny 854x480 H264 reports a stride of 864 when it is + actually 854, so we use width instead of stride here. + This is obviously bound to break in the future. */ + if (g_str_has_prefix (klass->codec_info->name, "OMX.SEC.")) { + fixed_stride = self->width; + } else { + fixed_stride = self->stride; + } + gst_video_frame_map (&vframe, info, outbuf, GST_MAP_WRITE); + for (i = 0; i < 2; i++) { - if (i == 0) { - src_stride = self->stride; - dest_stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, i); - } else { - src_stride = self->stride; - dest_stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, i); - } + src_stride = fixed_stride; + dest_stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, i); src = buf->data + buffer_info->offset; if (i == 0) { - src += self->crop_top * self->stride; + src += self->crop_top * fixed_stride; src += self->crop_left; row_length = self->width; } else if (i == 1) { - src += self->slice_height * self->stride; - src += self->crop_top * self->stride; + src += self->slice_height * fixed_stride; + src += self->crop_top * fixed_stride; src += self->crop_left; row_length = self->width; } |