liboverlay: Add support for interlaced content in updateOverlaySource.

UpdateOverlay source didn't have any support for interlaced content.
Add the required support. Create a new function to check if the content
is interlaced.

Change-Id: Ie47b7669461f773b55c71cad6978fc1c8cf4e91b
This commit is contained in:
Naomi Luis 2011-12-07 12:47:14 -08:00
parent e714021cac
commit 2987491ac8
2 changed files with 21 additions and 5 deletions

View File

@ -256,8 +256,21 @@ bool overlay::enableBarrier (unsigned int orientation) {
int overlay::getColorFormat(int format)
{
return (format == HAL_PIXEL_FORMAT_YV12) ?
format : COLOR_FORMAT(format);
if (format == HAL_PIXEL_FORMAT_YV12)
return format;
else if (format & INTERLACE_MASK)
return format ^ HAL_PIXEL_FORMAT_INTERLACE;
else
return COLOR_FORMAT(format);
}
bool overlay::isInterlacedContent(int format)
{
if ((format != HAL_PIXEL_FORMAT_YV12) &&
(format & INTERLACE_MASK))
return true;
return false;
}
unsigned int overlay::getOverlayConfig (unsigned int format3D, bool poll,
@ -970,8 +983,8 @@ bool OverlayControlChannel::setOverlayInformation(const overlay_buffer_info& inf
mOVInfo.z_order = zorder;
mOVInfo.alpha = 0xff;
mOVInfo.transp_mask = 0xffffffff;
mOVInfo.flags = flags;
}
mOVInfo.flags = flags;
if (!ignoreFB)
mOVInfo.flags |= MDP_OV_PLAY_NOWAIT;
else
@ -1051,7 +1064,9 @@ bool OverlayControlChannel::updateOverlaySource(const overlay_buffer_info& info,
ovBufInfo.height = info.height;
ovBufInfo.format = hw_format;
if (!setOverlayInformation(ovBufInfo, 0, orientation, 0, waitForVsync, UPDATE_REQUEST))
int flags = isInterlacedContent(info.format) ? MDP_DEINTERLACE : 0;
if (!setOverlayInformation(ovBufInfo, flags, orientation, 0, waitForVsync,
UPDATE_REQUEST))
return false;
return startOVRotatorSessions(ovBufInfo, orientation, UPDATE_REQUEST);
@ -1072,7 +1087,7 @@ bool OverlayControlChannel::startControlChannel(int w, int h,
int colorFormat = format;
// 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)) {
if (isInterlacedContent(format)) {
flags |= MDP_DEINTERLACE;
// Get the actual format

View File

@ -144,6 +144,7 @@ bool enableBarrier(unsigned int orientation);
unsigned int getOverlayConfig (unsigned int format3D, bool poll = true,
bool isHDMI = false);
int getColorFormat(int format);
bool isInterlacedContent(int format);
int get_mdp_format(int format);
int get_size(int format, int w, int h);
int get_rot_output_format(int format);