summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-11-08 19:25:41 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-11-08 19:25:41 -0800
commit2cef2eff28fd5ba3eaa875dd2e22e74b6f464121 (patch)
treefccc5363910bb749a95cecaa9d8a48b867a83693
parent858154e43f7646b767ef4c27af889c741fc5d9c2 (diff)
parentbeda607a0b2775484b10d7e6a15eec1e956b3cec (diff)
downloadframeworks_av-2cef2eff28fd5ba3eaa875dd2e22e74b6f464121.zip
frameworks_av-2cef2eff28fd5ba3eaa875dd2e22e74b6f464121.tar.gz
frameworks_av-2cef2eff28fd5ba3eaa875dd2e22e74b6f464121.tar.bz2
am c4a2ead2: am d2d62d04: Merge "Support extracting thumbnail from rotated video tracks" into gingerbread
* commit 'c4a2ead2aa5ab4403553e4956ba71b44782f0c84': Support extracting thumbnail from rotated video tracks
-rw-r--r--include/private/media/VideoFrame.h1
-rw-r--r--media/libmediaplayerservice/MetadataRetrieverClient.cpp2
-rw-r--r--media/libstagefright/StagefrightMetadataRetriever.cpp6
3 files changed, 9 insertions, 0 deletions
diff --git a/include/private/media/VideoFrame.h b/include/private/media/VideoFrame.h
index 9c35274..3aff0c6 100644
--- a/include/private/media/VideoFrame.h
+++ b/include/private/media/VideoFrame.h
@@ -120,6 +120,7 @@ public:
uint32_t mDisplayHeight;
uint32_t mSize; // Number of bytes in mData
uint8_t* mData; // Actual binary data
+ int32_t mRotationAngle; // rotation angle, clockwise
};
}; // namespace android
diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
index ca229fa..39fce81 100644
--- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp
+++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
@@ -253,6 +253,8 @@ sp<IMemory> MetadataRetrieverClient::captureFrame()
frameCopy->mDisplayWidth = frame->mDisplayWidth;
frameCopy->mDisplayHeight = frame->mDisplayHeight;
frameCopy->mSize = frame->mSize;
+ frameCopy->mRotationAngle = frame->mRotationAngle;
+ LOGV("rotation: %d", frameCopy->mRotationAngle);
frameCopy->mData = (uint8_t *)frameCopy + sizeof(VideoFrame);
memcpy(frameCopy->mData, frame->mData, frame->mSize);
delete frame; // Fix memory leakage
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index a800a93..9b2dec9 100644
--- a/media/libstagefright/StagefrightMetadataRetriever.cpp
+++ b/media/libstagefright/StagefrightMetadataRetriever.cpp
@@ -191,6 +191,11 @@ static VideoFrame *extractVideoFrameWithCodecFlags(
CHECK(meta->findInt32(kKeyWidth, &width));
CHECK(meta->findInt32(kKeyHeight, &height));
+ int32_t rotationAngle;
+ if (!trackMeta->findInt32(kKeyRotation, &rotationAngle)) {
+ rotationAngle = 0; // By default, no rotation
+ }
+
VideoFrame *frame = new VideoFrame;
frame->mWidth = width;
frame->mHeight = height;
@@ -198,6 +203,7 @@ static VideoFrame *extractVideoFrameWithCodecFlags(
frame->mDisplayHeight = height;
frame->mSize = width * height * 2;
frame->mData = new uint8_t[frame->mSize];
+ frame->mRotationAngle = rotationAngle;
int32_t srcFormat;
CHECK(meta->findInt32(kKeyColorFormat, &srcFormat));