Skip to content
Snippets Groups Projects
Commit ba776504 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5476769 from 76835be6 to qt-release

Change-Id: I2363f0efbebbf5dee02557e94125510bea9ce6c4
parents f7ce8cef 76835be6
Branches
No related tags found
No related merge requests found
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
enum EmulatorFrameworkFormat { enum EmulatorFrameworkFormat {
FRAMEWORK_FORMAT_GL_COMPATIBLE = 0, FRAMEWORK_FORMAT_GL_COMPATIBLE = 0,
FRAMEWORK_FORMAT_YV12 = 1, FRAMEWORK_FORMAT_YV12 = 1,
FRAMEWORK_FORMAT_YUV_420_888 = 2, FRAMEWORK_FORMAT_YUV_420_888 = 2, // (Y+)(U+)(V+)
FRAMEWORK_FORMAT_YUV_420_888_INTERLEAVED = 3, // (Y+)(UV)+
}; };
// //
... ...
......
...@@ -622,7 +622,13 @@ static int gralloc_alloc(alloc_device_t* dev, ...@@ -622,7 +622,13 @@ static int gralloc_alloc(alloc_device_t* dev,
// We are going to use RGB888 on the host // We are going to use RGB888 on the host
glFormat = GL_RGB; glFormat = GL_RGB;
glType = GL_UNSIGNED_BYTE; glType = GL_UNSIGNED_BYTE;
if (usage & (GRALLOC_USAGE_HW_CAMERA_READ | GRALLOC_USAGE_HW_CAMERA_WRITE)) {
// EmulatedFakeCamera3.cpp assumes it is NV21
selectedEmuFrameworkFormat = FRAMEWORK_FORMAT_YUV_420_888_INTERLEAVED;
} else {
selectedEmuFrameworkFormat = FRAMEWORK_FORMAT_YUV_420_888; selectedEmuFrameworkFormat = FRAMEWORK_FORMAT_YUV_420_888;
}
break; break;
default: default:
ALOGE("gralloc_alloc: Unknown format %d", format); ALOGE("gralloc_alloc: Unknown format %d", format);
...@@ -1360,12 +1366,21 @@ static int gralloc_lock_ycbcr(gralloc_module_t const* module, ...@@ -1360,12 +1366,21 @@ static int gralloc_lock_ycbcr(gralloc_module_t const* module,
cStep = 1; cStep = 1;
break; break;
case HAL_PIXEL_FORMAT_YCbCr_420_888: case HAL_PIXEL_FORMAT_YCbCr_420_888:
if (cb->emuFrameworkFormat == FRAMEWORK_FORMAT_YUV_420_888_INTERLEAVED) {
yStride = cb->width;
cStride = cb->width;
yOffset = 0;
vOffset = yStride * cb->height;
uOffset = vOffset + 1;
cStep = 2;
} else {
yStride = cb->width; yStride = cb->width;
cStride = yStride / 2; cStride = yStride / 2;
yOffset = 0; yOffset = 0;
uOffset = cb->height * yStride; uOffset = cb->height * yStride;
vOffset = uOffset + cStride * cb->height / 2; vOffset = uOffset + cStride * cb->height / 2;
cStep = 1; cStep = 1;
}
break; break;
default: default:
ALOGE("gralloc_lock_ycbcr unexpected internal format %x", ALOGE("gralloc_lock_ycbcr unexpected internal format %x",
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment