summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2012-12-18 12:28:27 -0800
committerMarco Nelissen <marcone@google.com>2012-12-18 14:46:11 -0800
commit616d9ea56744a9aeb3ae93e850450732acfe96a8 (patch)
treecb2da176ff5f4924f34415122bdcdd02fc775967 /media
parent34d7db5dd43000cac7e8e156d79e9f97ccbb8990 (diff)
downloadframeworks_av-616d9ea56744a9aeb3ae93e850450732acfe96a8.zip
frameworks_av-616d9ea56744a9aeb3ae93e850450732acfe96a8.tar.gz
frameworks_av-616d9ea56744a9aeb3ae93e850450732acfe96a8.tar.bz2
Report buffer size even when using hardware buffers
This makes it so that the buffers dequeued from a MediaCodec show a non-zero size when there's actually data in them, which allows the caller to distinguish between a valid frame and an empty buffer. Change-Id: I891b2301501e26f0b4e8cf2e24c169e501a6d026
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/ACodec.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 2b20ab0..7920d32 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -612,7 +612,7 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {
sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(buf, false));
BufferInfo info;
info.mStatus = BufferInfo::OWNED_BY_US;
- info.mData = new ABuffer(0);
+ info.mData = new ABuffer(NULL /* data */, def.nBufferSize /* capacity */);
info.mGraphicBuffer = graphicBuffer;
mBuffers[kPortIndexOutput].push(info);
@@ -2868,15 +2868,14 @@ bool ACodec::BaseState::onOMXFillBufferDone(
mCodec->sendFormatChange();
}
- if (mCodec->mNativeWindow == NULL) {
- info->mData->setRange(rangeOffset, rangeLength);
-
+ info->mData->setRange(rangeOffset, rangeLength);
#if 0
+ if (mCodec->mNativeWindow == NULL) {
if (IsIDR(info->mData)) {
ALOGI("IDR frame");
}
-#endif
}
+#endif
if (mCodec->mSkipCutBuffer != NULL) {
mCodec->mSkipCutBuffer->submit(info->mData);