gralloc: Add ITU-R standard info for YUV formats

These format qualifiers will help graphics decide which
standard to use when working with a YUV texture.

Change-Id: I6ad464e6b070d3b375c5e07f03228308d15407cd
This commit is contained in:
Naseer Ahmed
2013-04-29 15:47:47 -04:00
committed by Gerrit - the friendly Code Review server
parent 59793b67c2
commit fc940ef958
2 changed files with 20 additions and 0 deletions

View File

@@ -103,6 +103,23 @@ int gpu_context_t::gralloc_alloc_buffer(size_t size, int usage,
}
}
if (bufferType == BUFFER_TYPE_VIDEO) {
if (usage & GRALLOC_USAGE_HW_CAMERA_WRITE) {
if ((qdutils::MDPVersion::getInstance().getMDPVersion() <
qdutils::MDSS_V5)) { //A-Family
flags |= private_handle_t::PRIV_FLAGS_ITU_R_601_FR;
} else {
if (usage & (GRALLOC_USAGE_HW_TEXTURE |
GRALLOC_USAGE_HW_VIDEO_ENCODER))
flags |= private_handle_t::PRIV_FLAGS_ITU_R_709;
else if (usage & GRALLOC_USAGE_HW_CAMERA_ZSL)
flags |= private_handle_t::PRIV_FLAGS_ITU_R_601_FR;
}
} else {
flags |= private_handle_t::PRIV_FLAGS_ITU_R_601;
}
}
if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER ) {
flags |= private_handle_t::PRIV_FLAGS_VIDEO_ENCODER;
}