diff options
author | Andreas Huber <andih@google.com> | 2009-08-20 11:16:40 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2009-08-20 11:16:40 -0700 |
commit | 7530e9c708275c273c134c36c68179f511c1940e (patch) | |
tree | f9b20729ecf6a6f3acdd27ebade2bbae94f50aef /cmds/stagefright | |
parent | bde3caae211e215e4bbfef1a267f8d680efa4764 (diff) | |
download | frameworks_av-7530e9c708275c273c134c36c68179f511c1940e.zip frameworks_av-7530e9c708275c273c134c36c68179f511c1940e.tar.gz frameworks_av-7530e9c708275c273c134c36c68179f511c1940e.tar.bz2 |
Dynamically allocate a pair of MemoryHeaps according buffer count/sizes required by the OMX component, respect JPEG compressed size.
Diffstat (limited to 'cmds/stagefright')
-rw-r--r-- | cmds/stagefright/JPEGSource.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cmds/stagefright/JPEGSource.cpp b/cmds/stagefright/JPEGSource.cpp index 338a3d5..a7994ed 100644 --- a/cmds/stagefright/JPEGSource.cpp +++ b/cmds/stagefright/JPEGSource.cpp @@ -60,6 +60,7 @@ JPEGSource::JPEGSource(const sp<DataSource> &source) mHeight(0), mOffset(0) { CHECK_EQ(parseJPEG(), OK); + CHECK(mSource->getSize(&mSize) == OK); } JPEGSource::~JPEGSource() { @@ -73,10 +74,6 @@ status_t JPEGSource::start(MetaData *) { return UNKNOWN_ERROR; } - if (mSource->getSize(&mSize) != OK) { - return UNKNOWN_ERROR; - } - mGroup = new MediaBufferGroup; mGroup->add_buffer(new MediaBuffer(mSize)); @@ -105,6 +102,7 @@ sp<MetaData> JPEGSource::getFormat() { meta->setCString(kKeyMIMEType, "image/jpeg"); meta->setInt32(kKeyWidth, mWidth); meta->setInt32(kKeyHeight, mHeight); + meta->setInt32(kKeyCompressedSize, mSize); return meta; } |