From 2ee14000a38683220fb250d9e7300e1d71ccdaa0 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Tue, 6 Aug 2013 15:02:22 -0700 Subject: Check adaptive playback support via CodecCapabilities Added flags field to CodecCapabilities, so that applications can query whether codecs support various features. For now added one video-decoder feature: kFlagSupportsAdaptivePlayback Media playback applications can query it to see if a codec supports seamless resolution changes, such as by supporting dynamic output buffers. Signed-off-by: Lajos Molnar Change-Id: I09da46e8ab6b8645fa2749e33128e49eda2e865b Related-to-bug: 7093648 --- media/libstagefright/MediaCodecList.cpp | 5 ++++- media/libstagefright/OMXCodec.cpp | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'media') diff --git a/media/libstagefright/MediaCodecList.cpp b/media/libstagefright/MediaCodecList.cpp index d24337f..6248e90 100644 --- a/media/libstagefright/MediaCodecList.cpp +++ b/media/libstagefright/MediaCodecList.cpp @@ -509,7 +509,8 @@ status_t MediaCodecList::getSupportedTypes( status_t MediaCodecList::getCodecCapabilities( size_t index, const char *type, Vector *profileLevels, - Vector *colorFormats) const { + Vector *colorFormats, + uint32_t *flags) const { profileLevels->clear(); colorFormats->clear(); @@ -547,6 +548,8 @@ status_t MediaCodecList::getCodecCapabilities( colorFormats->push(caps.mColorFormats.itemAt(i)); } + *flags = caps.mFlags; + return OK; } diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 3de3c28..7b37365 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -4567,7 +4567,7 @@ status_t QueryCodec( CodecCapabilities *caps) { if (strncmp(componentName, "OMX.", 4)) { // Not an OpenMax component but a software codec. - + caps->mFlags = 0; caps->mComponentName = componentName; return OK; } @@ -4582,8 +4582,15 @@ status_t QueryCodec( OMXCodec::setComponentRole(omx, node, isEncoder, mime); + caps->mFlags = 0; caps->mComponentName = componentName; + if (!isEncoder && !strncmp(mime, "video/", 6) && + omx->storeMetaDataInBuffers( + node, 1 /* port index */, OMX_TRUE) == OK) { + caps->mFlags |= CodecCapabilities::kFlagSupportsAdaptivePlayback; + } + OMX_VIDEO_PARAM_PROFILELEVELTYPE param; InitOMXParams(¶m); -- cgit v1.1