liboverlay: Add YV12 support

Add support in the overlay for the YV12 color format.

(cherry picked from commit 0f9a27cc39b6d4202b54059bc7c64eea9efcf3f1)

Change-Id: I4b57eb383ca8f728243bd7e397696932e26c8889
This commit is contained in:
Naomi Luis 2011-06-28 11:58:56 -07:00 committed by Govind Surti
parent 49dbd79cf7
commit 7e2db6e3d0
3 changed files with 13 additions and 3 deletions

View File

@ -259,7 +259,7 @@ void gpu_context_t::getGrallocInformationFromFormat(int inputFormat, int *colorF
*colorFormat = inputFormat;
if (inputFormat == HAL_PIXEL_FORMAT_YV12) {
*bufferType = BUFFER_TYPE_UI; // There is no overlay support for this format yet.
*bufferType = BUFFER_TYPE_VIDEO;
} else if (inputFormat & S3D_FORMAT_MASK) {
// S3D format
*colorFormat = COLOR_FORMAT(inputFormat);

View File

@ -42,6 +42,8 @@ int overlay::get_mdp_format(int format) {
return MDP_Y_CBCR_H2V2;
case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
return MDP_Y_CRCB_H2V2_TILE;
case HAL_PIXEL_FORMAT_YV12:
return MDP_Y_CR_CB_H2V2;
}
return -1;
}
@ -320,6 +322,11 @@ int Overlay::hasHDMIStatusChanged() {
}
int Overlay::getS3DFormat(int format) {
// The S3D is part of the HAL_PIXEL_FORMAT_YV12 value. Add
// an explicit check for the format
if (format == HAL_PIXEL_FORMAT_YV12) {
return 0;
}
int format3D = FORMAT_3D(format);
int fIn3D = FORMAT_3D_INPUT(format3D); // MSB 2 bytes are input format
int fOut3D = FORMAT_3D_OUTPUT(format3D); // LSB 2 bytes are output format
@ -773,7 +780,9 @@ bool OverlayControlChannel::startControlChannel(int w, int h,
int hw_format;
int flags = 0;
int colorFormat = format;
if (format & INTERLACE_MASK) {
// The interlace mask is part of the HAL_PIXEL_FORMAT_YV12 value. Add
// an explicit check for the format
if ((format != HAL_PIXEL_FORMAT_YV12) && (format & INTERLACE_MASK)) {
flags |= MDP_DEINTERLACE;
// Get the actual format

View File

@ -265,7 +265,8 @@ private:
bool setChannelCrop(uint32_t x, uint32_t y, uint32_t w, uint32_t h, int channel);
bool queueBuffer(int fd, uint32_t offset, int channel);
int hasHDMIStatusChanged();
int getColorFormat(int format) { return COLOR_FORMAT(format); }
int getColorFormat(int format) { return (format == HAL_PIXEL_FORMAT_YV12) ?
format : COLOR_FORMAT(format); }
int getS3DFormat(int format);
};