diff options
author | Lajos Molnar <lajos@google.com> | 2014-07-25 07:53:14 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-07-25 18:48:36 -0700 |
commit | 03c556ae1eb409ad088c49037e185946c54e1d25 (patch) | |
tree | b8e9df056b53db4742c1684f279c92e9807fe236 /media/libstagefright/MediaCodec.cpp | |
parent | 90b16fbdef406d95a6fb2f9395719dd7b7ca6adb (diff) | |
download | frameworks_av-03c556ae1eb409ad088c49037e185946c54e1d25.zip frameworks_av-03c556ae1eb409ad088c49037e185946c54e1d25.tar.gz frameworks_av-03c556ae1eb409ad088c49037e185946c54e1d25.tar.bz2 |
stagefright: add flexible YUV support
Bug: 10706245
Change-Id: Icd246f22edfc67ed5240d59f5a5bde3e5f749465
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r-- | media/libstagefright/MediaCodec.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index 15e062e..e944766 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -1948,6 +1948,18 @@ ssize_t MediaCodec::dequeuePortBuffer(int32_t portIndex) { Mutex::Autolock al(mBufferLock); info->mFormat = portIndex == kPortIndexInput ? mInputFormat : mOutputFormat; info->mOwnedByClient = true; + + // set image-data + if (info->mFormat != NULL) { + sp<ABuffer> imageData; + if (info->mFormat->findBuffer("image-data", &imageData)) { + info->mData->meta()->setBuffer("image-data", imageData); + } + int32_t left, top, right, bottom; + if (info->mFormat->findRect("crop", &left, &top, &right, &bottom)) { + info->mData->meta()->setRect("crop-rect", left, top, right, bottom); + } + } } return index; |