Merge "This hardware video decoder lies about its required input buffer sizes allocating 2.7 MB of memory instead of the required 176 KB... Added another quirk."
This commit is contained in:
committed by
Android (Google) Code Review
commit
ab9985ed4c
@@ -96,6 +96,7 @@ private:
|
||||
kRequiresFlushBeforeShutdown = 64,
|
||||
kDefersOutputBufferAllocation = 128,
|
||||
kDecoderLiesAboutNumberOfChannels = 256,
|
||||
kInputBufferSizesAreBogus = 512,
|
||||
};
|
||||
|
||||
struct BufferInfo {
|
||||
|
||||
@@ -298,6 +298,10 @@ uint32_t OMXCodec::getComponentQuirks(const char *componentName) {
|
||||
quirks |= kRequiresAllocateBufferOnOutputPorts;
|
||||
}
|
||||
|
||||
if (!strcmp(componentName, "OMX.TI.Video.Decoder")) {
|
||||
quirks |= kInputBufferSizesAreBogus;
|
||||
}
|
||||
|
||||
return quirks;
|
||||
}
|
||||
|
||||
@@ -561,7 +565,8 @@ void OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) {
|
||||
mNode, OMX_IndexParamPortDefinition, &def, sizeof(def));
|
||||
CHECK_EQ(err, OK);
|
||||
|
||||
if (def.nBufferSize < size) {
|
||||
if ((portIndex == kPortIndexInput && (mQuirks & kInputBufferSizesAreBogus))
|
||||
|| (def.nBufferSize < size)) {
|
||||
def.nBufferSize = size;
|
||||
}
|
||||
|
||||
@@ -574,7 +579,12 @@ void OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) {
|
||||
CHECK_EQ(err, OK);
|
||||
|
||||
// Make sure the setting actually stuck.
|
||||
CHECK(def.nBufferSize >= size);
|
||||
if (portIndex == kPortIndexInput
|
||||
&& (mQuirks & kInputBufferSizesAreBogus)) {
|
||||
CHECK_EQ(def.nBufferSize, size);
|
||||
} else {
|
||||
CHECK(def.nBufferSize >= size);
|
||||
}
|
||||
}
|
||||
|
||||
status_t OMXCodec::setVideoPortFormatType(
|
||||
|
||||
Reference in New Issue
Block a user