Bug 994889 - Fix how to get video size from OMXCodec r=cajbir

This commit is contained in:
Sotaro Ikeda 2014-04-22 20:21:29 -07:00
Родитель 857419fd92
Коммит decd53822e
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -627,6 +627,20 @@ bool OmxDecoder::SetVideoFormat() {
NS_WARNING("slice height not available, assuming height");
}
// Since ICS, valid video side is caluculated from kKeyCropRect.
// kKeyWidth means decoded video buffer width.
// kKeyHeight means decoded video buffer height.
// On some hardwares, decoded video buffer and valid video size are different.
int32_t crop_left, crop_top, crop_right, crop_bottom;
if (mVideoSource->getFormat()->findRect(kKeyCropRect,
&crop_left,
&crop_top,
&crop_right,
&crop_bottom)) {
mVideoWidth = crop_right - crop_left + 1;
mVideoHeight = crop_bottom - crop_top + 1;
}
if (!mVideoSource->getFormat()->findInt32(kKeyRotation, &mVideoRotation)) {
mVideoRotation = 0;
NS_WARNING("rotation not available, assuming 0");