@@ -279,6 +279,11 @@
use_external_buffer = use_droid_convert && gst_buffer_get_size (out) != size;
map_info.data = NULL;
+ if (dec->codec_type->quirks & DONT_USE_DROID_CONVERT_VALUE) {
+ use_droid_convert = false;
+ GST_INFO_OBJECT (dec, "not using droid convert binary");
+ }
+
if (!gst_buffer_map (out, &map_info, GST_MAP_WRITE)) {
GST_ERROR_OBJECT (dec, "failed to map buffer");
ret = FALSE;
@@ -336,7 +341,30 @@
} else {
DroidMediaColourFormatConstants c;
droid_media_colour_format_constants_init (&c);
- if (dec->hal_format == c.QOMX_COLOR_FormatYUV420PackedSemiPlanar32m) {
+ if (dec->hal_format == c.OMX_COLOR_FormatYUV420Planar) {
+ /* Buffer is already I420, so we can copy it straight over */
+ /* though we need to handle the cropping */
+
+ GST_DEBUG_OBJECT (dec, "Copying I420 buffer");
+ gint top = dec->crop_rect.top;
+ gint left = dec->crop_rect.left;
+ gint crop_width = dec->crop_rect.right - left;
+ gint crop_height = dec->crop_rect.bottom - top;
+
+ guint8 *y = in->data + (top * width) + left;
+ guint8 *u = in->data + (width * height) + (top * width / 2) + (left / 2);
+ guint8 *v =
+ in->data + (width * height) + (width * height / 4) +
+ (top * width / 2) + (left / 2);
+
+ gst_droidvec_copy_plane (map_info.data + info->offset[0],
+ info->stride[0], y, width, crop_width, crop_height);
+ gst_droidvec_copy_plane (map_info.data + info->offset[1],
+ info->stride[1], u, width / 2, crop_width / 2, crop_height / 2);
+ gst_droidvec_copy_plane (map_info.data + info->offset[2],
+ info->stride[2], v, width / 2, crop_width / 2, crop_height / 2);
+
+ } else if (dec->hal_format == c.QOMX_COLOR_FormatYUV420PackedSemiPlanar32m) {
/* copy to the output buffer swapping the u and v planes and cropping if necessary */
/* NV12 format with 128 byte alignment */
GST_DEBUG_OBJECT (dec, "Converting from qcom NV12 semi planar");
@@ -354,6 +382,25 @@
gst_droidvec_copy_packed_planes (map_info.data + info->offset[1],
map_info.data + info->offset[2], info->stride[1], uv, stride,
info->width / 2, info->height / 2);
+
+ } else if (dec->hal_format == c.OMX_COLOR_FormatYUV420SemiPlanar) {
+ GST_DEBUG_OBJECT (dec,
+ "Converting from OMX_COLOR_FormatYUV420SemiPlanar");
+ gint stride = width;
+ gint slice_height = ALIGN_SIZE (height, 16);
+ gint top = dec->crop_rect.top;
+ gint left = dec->crop_rect.left;
+
+ guint8 *y = in->data + (top * stride) + left;
+ guint8 *uv =
+ in->data + (stride * slice_height) + (top * stride / 2) + left;
+
+ gst_droidvec_copy_plane (map_info.data + info->offset[0],
+ info->stride[0], y, stride, info->width, info->height);
+ gst_droidvec_copy_packed_planes (map_info.data + info->offset[1],
+ map_info.data + info->offset[2], info->stride[1], uv, stride,
+ info->width / 2, info->height / 2);
+
} else {
GST_ELEMENT_ERROR (dec, LIBRARY, FAILED, (NULL),
("Unknown codec colour format: %d", dec->hal_format));
|