summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodec.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-01-06 15:56:39 -0800
committerLajos Molnar <lajos@google.com>2015-01-06 16:41:13 -0800
commit8140a2b7ef0650e8cce6be16efcbfce56d0ed1e4 (patch)
tree2af3abd74b8195764c076dac76940e8073a55277 /media/libstagefright/MediaCodec.cpp
parent7ae3dfabb40d061aa613b255cba65ee35567f323 (diff)
downloadframeworks_av-8140a2b7ef0650e8cce6be16efcbfce56d0ed1e4.zip
frameworks_av-8140a2b7ef0650e8cce6be16efcbfce56d0ed1e4.tar.gz
frameworks_av-8140a2b7ef0650e8cce6be16efcbfce56d0ed1e4.tar.bz2
stagefright: report crop rectangle as codec resolution if exists
Bug: 18789054 Change-Id: I08b82a400541b5e09580801473c34ce56bfef5db
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r--media/libstagefright/MediaCodec.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index e1c8a41..c2381b4 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -1014,11 +1014,13 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
// Notify mCrypto of video resolution changes
if (mCrypto != NULL) {
- int32_t height, width;
- if (mOutputFormat->findInt32("height", &height) &&
- mOutputFormat->findInt32("width", &width)) {
- mCrypto->notifyResolution(width, height);
- }
+ int32_t left, top, right, bottom, width, height;
+ if (mOutputFormat->findRect("crop", &left, &top, &right, &bottom)) {
+ mCrypto->notifyResolution(right - left + 1, bottom - top + 1);
+ } else if (mOutputFormat->findInt32("width", &width)
+ && mOutputFormat->findInt32("height", &height)) {
+ mCrypto->notifyResolution(width, height);
+ }
}
break;