DO NOT MERGE: Support non-multiple-of-16 dimensions in MPEG4/H.263 software decoder
Change-Id: I6c27c00a6e13cb3635e61089c0db0989f5810c37 related-to-bug: 3384367
This commit is contained in:
@@ -23,8 +23,8 @@
|
|||||||
#include "mp4dec_api.h"
|
#include "mp4dec_api.h"
|
||||||
|
|
||||||
#include <OMX_Component.h>
|
#include <OMX_Component.h>
|
||||||
|
#include <media/stagefright/foundation/ADebug.h>
|
||||||
#include <media/stagefright/MediaBufferGroup.h>
|
#include <media/stagefright/MediaBufferGroup.h>
|
||||||
#include <media/stagefright/MediaDebug.h>
|
|
||||||
#include <media/stagefright/MediaDefs.h>
|
#include <media/stagefright/MediaDefs.h>
|
||||||
#include <media/stagefright/MediaErrors.h>
|
#include <media/stagefright/MediaErrors.h>
|
||||||
#include <media/stagefright/MetaData.h>
|
#include <media/stagefright/MetaData.h>
|
||||||
@@ -106,7 +106,7 @@ status_t M4vH263Decoder::start(MetaData *) {
|
|||||||
int32_t vol_size = 0;
|
int32_t vol_size = 0;
|
||||||
if (meta->findData(kKeyESDS, &type, &data, &size)) {
|
if (meta->findData(kKeyESDS, &type, &data, &size)) {
|
||||||
ESDS esds((const uint8_t *)data, size);
|
ESDS esds((const uint8_t *)data, size);
|
||||||
CHECK_EQ(esds.InitCheck(), OK);
|
CHECK_EQ(esds.InitCheck(), (status_t)OK);
|
||||||
|
|
||||||
const void *codec_specific_data;
|
const void *codec_specific_data;
|
||||||
size_t codec_specific_data_size;
|
size_t codec_specific_data_size;
|
||||||
@@ -132,7 +132,7 @@ status_t M4vH263Decoder::start(MetaData *) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MP4DecodingMode actualMode = PVGetDecBitstreamMode(mHandle);
|
MP4DecodingMode actualMode = PVGetDecBitstreamMode(mHandle);
|
||||||
CHECK_EQ(mode, actualMode);
|
CHECK_EQ((int)mode, (int)actualMode);
|
||||||
|
|
||||||
PVSetPostProcType((VideoDecControls *) mHandle, 0);
|
PVSetPostProcType((VideoDecControls *) mHandle, 0);
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ status_t M4vH263Decoder::read(
|
|||||||
ReadOptions::SeekMode mode;
|
ReadOptions::SeekMode mode;
|
||||||
if (options && options->getSeekTo(&seekTimeUs, &mode)) {
|
if (options && options->getSeekTo(&seekTimeUs, &mode)) {
|
||||||
seeking = true;
|
seeking = true;
|
||||||
CHECK_EQ(PVResetVideoDecoder(mHandle), PV_TRUE);
|
CHECK_EQ((int)PVResetVideoDecoder(mHandle), PV_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaBuffer *inputBuffer = NULL;
|
MediaBuffer *inputBuffer = NULL;
|
||||||
@@ -220,19 +220,26 @@ status_t M4vH263Decoder::read(
|
|||||||
return UNKNOWN_ERROR;
|
return UNKNOWN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t width, height;
|
int32_t disp_width, disp_height;
|
||||||
PVGetVideoDimensions(mHandle, &width, &height);
|
PVGetVideoDimensions(mHandle, &disp_width, &disp_height);
|
||||||
if (width != mWidth || height != mHeight) {
|
|
||||||
|
int32_t buf_width, buf_height;
|
||||||
|
PVGetBufferDimensions(mHandle, &buf_width, &buf_height);
|
||||||
|
|
||||||
|
if (buf_width != mWidth || buf_height != mHeight) {
|
||||||
++mNumSamplesOutput; // The client will never get to see this frame.
|
++mNumSamplesOutput; // The client will never get to see this frame.
|
||||||
|
|
||||||
inputBuffer->release();
|
inputBuffer->release();
|
||||||
inputBuffer = NULL;
|
inputBuffer = NULL;
|
||||||
|
|
||||||
mWidth = width;
|
mWidth = buf_width;
|
||||||
mHeight = height;
|
mHeight = buf_height;
|
||||||
mFormat->setInt32(kKeyWidth, mWidth);
|
mFormat->setInt32(kKeyWidth, mWidth);
|
||||||
mFormat->setInt32(kKeyHeight, mHeight);
|
mFormat->setInt32(kKeyHeight, mHeight);
|
||||||
|
|
||||||
|
CHECK_LE(disp_width, buf_width);
|
||||||
|
CHECK_LE(disp_height, buf_height);
|
||||||
|
|
||||||
return INFO_FORMAT_CHANGED;
|
return INFO_FORMAT_CHANGED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ extern "C"
|
|||||||
Bool PVDecodeVopBody(VideoDecControls *decCtrl, int32 buffer_size[]);
|
Bool PVDecodeVopBody(VideoDecControls *decCtrl, int32 buffer_size[]);
|
||||||
void PVDecPostProcess(VideoDecControls *decCtrl, uint8 *outputYUV);
|
void PVDecPostProcess(VideoDecControls *decCtrl, uint8 *outputYUV);
|
||||||
OSCL_IMPORT_REF void PVGetVideoDimensions(VideoDecControls *decCtrl, int32 *display_width, int32 *display_height);
|
OSCL_IMPORT_REF void PVGetVideoDimensions(VideoDecControls *decCtrl, int32 *display_width, int32 *display_height);
|
||||||
|
OSCL_IMPORT_REF void PVGetBufferDimensions(VideoDecControls *decCtrl, int32 *buf_width, int32 *buf_height);
|
||||||
OSCL_IMPORT_REF void PVSetPostProcType(VideoDecControls *decCtrl, int mode);
|
OSCL_IMPORT_REF void PVSetPostProcType(VideoDecControls *decCtrl, int mode);
|
||||||
uint32 PVGetVideoTimeStamp(VideoDecControls *decoderControl);
|
uint32 PVGetVideoTimeStamp(VideoDecControls *decoderControl);
|
||||||
int PVGetDecBitrate(VideoDecControls *decCtrl);
|
int PVGetDecBitrate(VideoDecControls *decCtrl);
|
||||||
|
|||||||
@@ -722,6 +722,12 @@ OSCL_EXPORT_REF void PVGetVideoDimensions(VideoDecControls *decCtrl, int32 *disp
|
|||||||
*display_height = video->displayHeight;
|
*display_height = video->displayHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OSCL_EXPORT_REF void PVGetBufferDimensions(VideoDecControls *decCtrl, int32 *width, int32 *height) {
|
||||||
|
VideoDecData *video = (VideoDecData *)decCtrl->videoDecoderData;
|
||||||
|
*width = video->width;
|
||||||
|
*height = video->height;
|
||||||
|
}
|
||||||
|
|
||||||
/* ======================================================================== */
|
/* ======================================================================== */
|
||||||
/* Function : PVGetVideoTimeStamp() */
|
/* Function : PVGetVideoTimeStamp() */
|
||||||
/* Date : 04/27/2000, 08/29/2000 */
|
/* Date : 04/27/2000, 08/29/2000 */
|
||||||
|
|||||||
Reference in New Issue
Block a user