summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-10-19 09:52:25 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-19 09:52:25 -0700
commit2ad46bea6b7ef92b24e9bd98b0b459beb71b96ab (patch)
tree7e5bde609de27235b221dd716c6e417c2cf35d79 /media/libstagefright
parent9969c0b798ad81764b67f5a098f7c417b82dcc89 (diff)
parent1bd36ef733ad5c5fa06106387e7ee0df39c33116 (diff)
downloadframeworks_av-2ad46bea6b7ef92b24e9bd98b0b459beb71b96ab.zip
frameworks_av-2ad46bea6b7ef92b24e9bd98b0b459beb71b96ab.tar.gz
frameworks_av-2ad46bea6b7ef92b24e9bd98b0b459beb71b96ab.tar.bz2
am 9b2f18df: 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 '9b2f18df2436b6c2d9735e65119b92f320bb57e2' * commit '9b2f18df2436b6c2d9735e65119b92f320bb57e2': 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/libstagefright')
-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 5e70888..4be1b38 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -510,12 +510,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);
@@ -698,6 +715,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.");