Bug 1143694 - Care about gralloc YV12 stride r=jesup

This commit is contained in:
Sotaro Ikeda 2015-04-02 09:28:11 -07:00
Родитель 80cc90223f
Коммит 806c406d91
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -774,7 +774,7 @@ MediaEngineGonkVideoSource::RotateImage(layers::Image* aImage, uint32_t aWidth,
dstPtr + (yStride * dstHeight + (uvStride * dstHeight / 2)), uvStride,
dstPtr + (yStride * dstHeight), uvStride,
0, 0,
aWidth, aHeight,
graphicBuffer->getStride(), aHeight,
aWidth, aHeight,
static_cast<libyuv::RotationMode>(mRotation),
libyuv::FOURCC_NV21);
@ -796,7 +796,7 @@ MediaEngineGonkVideoSource::RotateImage(layers::Image* aImage, uint32_t aWidth,
dstPtr + (dstWidth * dstHeight), half_width,
dstPtr + (dstWidth * dstHeight * 5 / 4), half_width,
0, 0,
aWidth, aHeight,
graphicBuffer->getStride(), aHeight,
aWidth, aHeight,
static_cast<libyuv::RotationMode>(mRotation),
ConvertPixelFormatToFOURCC(graphicBuffer->getPixelFormat()));

Просмотреть файл

@ -245,7 +245,7 @@ int ConvertToI420(VideoType src_video_type,
if (src_video_type == kYV12) {
// In gralloc buffer, yv12 color format's cb and cr's strides are aligned
// to 16 Bytes boundary. See /system/core/include/system/graphics.h
int stride_y = src_width;
int stride_y = (src_width + 15) & ~0x0F;
int stride_uv = (((stride_y + 1) / 2) + 15) & ~0x0F;
return libyuv::I420Rotate(src_frame,
stride_y,