Retire cb_handle_old_t::frameworkFormat
replace it with cb_handle_old_t::format.
Bug: 141385612
Test: build, boot
Change-Id: I490f5e6de5498f3156e3bab84727261672b1d811
Signed-off-by: Roman Kiryanov <rkir@google.com>
diff --git a/shared/OpenglCodecCommon/gralloc_cb_old.h b/shared/OpenglCodecCommon/gralloc_cb_old.h
index 1db5878..ab01537 100644
--- a/shared/OpenglCodecCommon/gralloc_cb_old.h
+++ b/shared/OpenglCodecCommon/gralloc_cb_old.h
@@ -33,7 +33,7 @@
struct cb_handle_old_t : public native_handle {
cb_handle_old_t(int p_fd, int p_ashmemSize, int p_usage,
- int p_width, int p_height, int p_frameworkFormat,
+ int p_width, int p_height,
int p_format, int p_glFormat, int p_glType,
EmulatorFrameworkFormat p_emuFrameworkFormat) :
fd(p_fd),
@@ -41,7 +41,6 @@
usage(p_usage),
width(p_width),
height(p_height),
- frameworkFormat(p_frameworkFormat),
format(p_format),
glFormat(p_glFormat),
glType(p_glType),
@@ -126,7 +125,6 @@
int usage; // usage bits the buffer was created with
int width; // buffer width
int height; // buffer height
- int frameworkFormat; // format requested by the Android framework
int format; // real internal pixel format format
int glFormat; // OpenGL format enum used for host h/w color buffer
int glType; // OpenGL type enum used when uploading to host
diff --git a/system/gralloc/gralloc_old.cpp b/system/gralloc/gralloc_old.cpp
index a69798d..032efa8 100644
--- a/system/gralloc/gralloc_old.cpp
+++ b/system/gralloc/gralloc_old.cpp
@@ -433,8 +433,8 @@
uint32_t rgbSz = width * height * bpp;
uint32_t send_buffer_size = rgbSz;
bool is_rgb_format =
- cb->frameworkFormat != HAL_PIXEL_FORMAT_YV12 &&
- cb->frameworkFormat != HAL_PIXEL_FORMAT_YCbCr_420_888;
+ cb->format != HAL_PIXEL_FORMAT_YV12 &&
+ cb->format != HAL_PIXEL_FORMAT_YCbCr_420_888;
std::vector<char> convertedBuf;
@@ -454,7 +454,7 @@
}
if (hasDMA && !grdma->bigbufCount) {
- switch (cb->frameworkFormat) {
+ switch (cb->format) {
case HAL_PIXEL_FORMAT_YV12:
get_yv12_offsets(width, height, NULL, NULL, &send_buffer_size);
break;
@@ -480,7 +480,7 @@
to_send, send_buffer_size);
pthread_mutex_unlock(&grdma->lock);
} else {
- switch (cb->frameworkFormat) {
+ switch (cb->format) {
case HAL_PIXEL_FORMAT_YV12:
convertedBuf.resize(rgbSz);
to_send = &convertedBuf.front();
@@ -790,7 +790,7 @@
}
cb_handle_old_t *cb = new cb_handle_old_t(fd, ashmem_size, usage,
- w, h, frameworkFormat, format,
+ w, h, format,
glFormat, glType,
selectedEmuFrameworkFormat);
@@ -1071,8 +1071,8 @@
return -EINVAL;
}
- D("gralloc_register_buffer(%p) w %d h %d format 0x%x framworkFormat 0x%x",
- handle, cb->width, cb->height, cb->format, cb->frameworkFormat);
+ D("gralloc_register_buffer(%p) w %d h %d format 0x%x",
+ handle, cb->width, cb->height, cb->format);
if (cb->hostHandle != 0 && !cb->hasRefcountPipe()) {
D("Opening host ColorBuffer 0x%x\n", cb->hostHandle);
@@ -1272,11 +1272,11 @@
cb->width, cb->height, cb->ashmemBase, cb->ashmemSize);
void* rgb_addr = cpu_addr;
char* tmpBuf = 0;
- if (cb->frameworkFormat == HAL_PIXEL_FORMAT_YV12 ||
- cb->frameworkFormat == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+ if (cb->format == HAL_PIXEL_FORMAT_YV12 ||
+ cb->format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
if (rcEnc->hasYUVCache()) {
uint32_t buffer_size;
- if (cb->frameworkFormat == HAL_PIXEL_FORMAT_YV12) {
+ if (cb->format == HAL_PIXEL_FORMAT_YV12) {
get_yv12_offsets(cb->width, cb->height, NULL, NULL,
&buffer_size);
} else {
@@ -1292,10 +1292,10 @@
tmpBuf = new char[cb->width * cb->height * 3];
rcEnc->rcReadColorBuffer(rcEnc, cb->hostHandle,
0, 0, cb->width, cb->height, cb->glFormat, cb->glType, tmpBuf);
- if (cb->frameworkFormat == HAL_PIXEL_FORMAT_YV12) {
+ if (cb->format == HAL_PIXEL_FORMAT_YV12) {
D("convert rgb888 to yv12 here");
rgb888_to_yv12((char*)cpu_addr, tmpBuf, cb->width, cb->height, l, t, l+w-1, t+h-1);
- } else if (cb->frameworkFormat == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+ } else if (cb->format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
if (rcEnc->hasYUV420toNV21()) {
D("convert rgb888 to nv21 here");
rgb888_to_nv21((char*)cpu_addr, tmpBuf, cb->width, cb->height, l, t, l+w-1, t+h-1);
@@ -1408,12 +1408,12 @@
return -EINVAL;
}
- if (cb->frameworkFormat != HAL_PIXEL_FORMAT_YV12 &&
- cb->frameworkFormat != HAL_PIXEL_FORMAT_YCbCr_420_888) {
+ if (cb->format != HAL_PIXEL_FORMAT_YV12 &&
+ cb->format != HAL_PIXEL_FORMAT_YCbCr_420_888) {
ALOGE("gralloc_lock_ycbcr can only be used with "
"HAL_PIXEL_FORMAT_YCbCr_420_888 or HAL_PIXEL_FORMAT_YV12, got %x instead. "
"-EINVAL",
- cb->frameworkFormat);
+ cb->format);
return -EINVAL;
}