diff options
author | Shivaprasad Hongal <shongal@codeaurora.org> | 2015-07-30 18:00:18 -0700 |
---|---|---|
committer | Satish Kamuju <skamuj@codeaurora.org> | 2015-10-06 17:37:32 +0530 |
commit | 1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056 (patch) | |
tree | 9e6156dc3c8c52168fd56aa0f06b211c5fd36155 /media/libstagefright | |
parent | bc3028750d3438ebf108298e93f12de461f56430 (diff) | |
download | frameworks_av-1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056.zip frameworks_av-1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056.tar.gz frameworks_av-1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056.tar.bz2 |
Stagefright: Enable custom allocation mode.
Enable custom allocation mode
Change-Id: Idf3f6c0eb9d17d361d2e5b6c36b1fe7586236565
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 97a0be0..238cd47 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -832,15 +832,11 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { : OMXCodec::kRequiresAllocateBufferOnOutputPorts; if ((portIndex == kPortIndexInput && (mFlags & kFlagIsSecure)) - || (portIndex == kPortIndexOutput && usingMetadataOnEncoderOutput())) { + || (portIndex == kPortIndexOutput && usingMetadataOnEncoderOutput()) + || canAllocateBuffer(portIndex)) { mem.clear(); - void *ptr; - err = mOMX->allocateBuffer( - mNode, portIndex, bufSize, &info.mBufferID, - &ptr); - - info.mData = new ABuffer(ptr, bufSize); + err = allocateBuffer(portIndex, bufSize, info); } else if (mQuirks & requiresAllocateBufferBit) { err = mOMX->allocateBufferWithBackup( mNode, portIndex, mem, &info.mBufferID, allottedSize); @@ -1643,6 +1639,8 @@ status_t ACodec::configureCodec( return err; } + enableCustomAllocationMode(msg); + int32_t bitRate = 0; // FLAC encoder doesn't need a bitrate, other encoders do if (encoder && strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC) @@ -6385,6 +6383,16 @@ sp<IOMXObserver> ACodec::createObserver() { return observer; } +status_t ACodec::allocateBuffer( + OMX_U32 portIndex, size_t bufSize, BufferInfo &info) { + void *ptr; + status_t err = mOMX->allocateBuffer( + mNode, portIndex, bufSize, &info.mBufferID, &ptr); + + info.mData = new ABuffer(ptr, bufSize); + return err; +} + bool ACodec::ExecutingState::onOMXFrameRendered(int64_t mediaTimeUs, nsecs_t systemNano) { mCodec->onFrameRendered(mediaTimeUs, systemNano); return true; |