summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-10-18 11:50:19 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-18 11:50:19 -0700
commit1bd36ef733ad5c5fa06106387e7ee0df39c33116 (patch)
tree8b81f4ed3d680453321cec681afa2d6a668ff7a5 /media
parent232c33806f6e839a7db76f645d52b5647e097f8c (diff)
parentb5b39d2c348f54a40fc800c9efec17d7f1e8a486 (diff)
downloadframeworks_av-1bd36ef733ad5c5fa06106387e7ee0df39c33116.zip
frameworks_av-1bd36ef733ad5c5fa06106387e7ee0df39c33116.tar.gz
frameworks_av-1bd36ef733ad5c5fa06106387e7ee0df39c33116.tar.bz2
am bc96c284: Merge "For thumbnail extraction make sure we instantiate a decoder that allows access to the framebuffer. Implement the samsung workaround to support this by reconfiguring the decoder." into gingerbread
Merge commit 'bc96c2848dadaa844f95e89708d9941f73bbf400' into gingerbread-plus-aosp * commit 'bc96c2848dadaa844f95e89708d9941f73bbf400': For thumbnail extraction make sure we instantiate a decoder that allows access to the framebuffer. Implement the samsung workaround to support this by reconfiguring the decoder.
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/OMXCodec.cpp46
-rw-r--r--media/libstagefright/StagefrightMetadataRetriever.cpp2
2 files changed, 46 insertions, 2 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 4648ad3..9a49a9b 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -493,12 +493,29 @@ sp<MediaSource> OMXCodec::Create(
LOGV("Attempting to allocate OMX node '%s'", componentName);
+ uint32_t quirks = getComponentQuirks(componentName, createEncoder);
+
+ if (!createEncoder
+ && (quirks & kOutputBuffersAreUnreadable)
+ && (flags & kClientNeedsFramebuffer)) {
+ if (strncmp(componentName, "OMX.SEC.", 8)) {
+ // For OMX.SEC.* decoders we can enable a special mode that
+ // gives the client access to the framebuffer contents.
+
+ LOGW("Component '%s' does not give the client access to "
+ "the framebuffer contents. Skipping.",
+ componentName);
+
+ continue;
+ }
+ }
+
status_t err = omx->allocateNode(componentName, observer, &node);
if (err == OK) {
LOGV("Successfully allocated OMX node '%s'", componentName);
sp<OMXCodec> codec = new OMXCodec(
- omx, node, getComponentQuirks(componentName, createEncoder),
+ omx, node, quirks,
createEncoder, mime, componentName,
source);
@@ -681,6 +698,33 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta, uint32_t flags) {
initOutputFormat(meta);
+ if ((flags & kClientNeedsFramebuffer)
+ && !strncmp(mComponentName, "OMX.SEC.", 8)) {
+ OMX_INDEXTYPE index;
+
+ status_t err =
+ mOMX->getExtensionIndex(
+ mNode,
+ "OMX.SEC.index.ThumbnailMode",
+ &index);
+
+ if (err != OK) {
+ return err;
+ }
+
+ OMX_BOOL enable = OMX_TRUE;
+ err = mOMX->setConfig(mNode, index, &enable, sizeof(enable));
+
+ if (err != OK) {
+ CODEC_LOGE("setConfig('OMX.SEC.index.ThumbnailMode') "
+ "returned error 0x%08x", err);
+
+ return err;
+ }
+
+ mQuirks &= ~kOutputBuffersAreUnreadable;
+ }
+
return OK;
}
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index af9c70c..a800a93 100644
--- a/media/libstagefright/StagefrightMetadataRetriever.cpp
+++ b/media/libstagefright/StagefrightMetadataRetriever.cpp
@@ -112,7 +112,7 @@ static VideoFrame *extractVideoFrameWithCodecFlags(
sp<MediaSource> decoder =
OMXCodec::Create(
client->interface(), source->getFormat(), false, source,
- NULL, flags);
+ NULL, flags | OMXCodec::kClientNeedsFramebuffer);
if (decoder.get() == NULL) {
LOGV("unable to instantiate video decoder.");