diff options
author | Keith Mok <kmok@cyngn.com> | 2015-12-09 16:47:54 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-12-09 22:52:49 -0800 |
commit | 4d1793b8a90eb4b9e19184532f713c6aba7828cf (patch) | |
tree | 7b05e54c48e9cd27f1fb55c34ade7fe0a9a55c13 /media/libstagefright/FFMPEGSoftCodec.cpp | |
parent | 6904c9ac0058e81d2ea063e2b09f3f1754d7e8f4 (diff) | |
download | frameworks_av-4d1793b8a90eb4b9e19184532f713c6aba7828cf.zip frameworks_av-4d1793b8a90eb4b9e19184532f713c6aba7828cf.tar.gz frameworks_av-4d1793b8a90eb4b9e19184532f713c6aba7828cf.tar.bz2 |
stagefright: Fix videot thumbnail retrival for wmv
We override some h/w decoders in video configure
since we know some h/w decoder does not support
certain types of video. e.g. WMV7/8.
But we did not do that when application retrieving
video frame for thumbnail causing video frame retrieved
is corrupted.
Fix it by calling FFMPEGSoftCodec::overrideComponentName
when we retrieve a single video frame for thumbnail purpose.
Change-Id: I334698c331dfd3d49bb5d8b8e9c1fe381b304179
Diffstat (limited to 'media/libstagefright/FFMPEGSoftCodec.cpp')
-rw-r--r-- | media/libstagefright/FFMPEGSoftCodec.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/media/libstagefright/FFMPEGSoftCodec.cpp b/media/libstagefright/FFMPEGSoftCodec.cpp index 0a42fc7..ddb688a 100644 --- a/media/libstagefright/FFMPEGSoftCodec.cpp +++ b/media/libstagefright/FFMPEGSoftCodec.cpp @@ -192,6 +192,40 @@ static void InitOMXParams(T *params) { params->nVersion.s.nStep = 0; } +const char* FFMPEGSoftCodec::overrideComponentName( + uint32_t /*quirks*/, const sp<MetaData> &meta, const char *mime, bool isEncoder) { + const char* componentName = NULL; + + int32_t wmvVersion = 0; + if (!strncasecmp(mime, MEDIA_MIMETYPE_VIDEO_WMV, strlen(MEDIA_MIMETYPE_VIDEO_WMV)) && + meta->findInt32(kKeyWMVVersion, &wmvVersion)) { + ALOGD("Found WMV version key %d", wmvVersion); + if (wmvVersion != 2) { + ALOGD("Use FFMPEG for unsupported WMV track"); + componentName = "OMX.ffmpeg.wmv.decoder"; + } + } + + int32_t encodeOptions = 0; + if (!isEncoder && !strncasecmp(mime, MEDIA_MIMETYPE_AUDIO_WMA, strlen(MEDIA_MIMETYPE_AUDIO_WMA)) && + !meta->findInt32(kKeyWMAEncodeOpt, &encodeOptions)) { + ALOGD("Use FFMPEG for unsupported WMA track"); + componentName = "OMX.ffmpeg.wma.decoder"; + } + + // Google's decoder doesn't support MAIN profile + int32_t aacProfile = 0; + if (!isEncoder && !strncasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC, strlen(MEDIA_MIMETYPE_AUDIO_AAC)) && + meta->findInt32(kKeyAACAOT, &aacProfile)) { + if (aacProfile == OMX_AUDIO_AACObjectMain) { + ALOGD("Use FFMPEG for AAC MAIN profile"); + componentName = "OMX.ffmpeg.aac.decoder"; + } + } + + return componentName; +} + void FFMPEGSoftCodec::overrideComponentName( uint32_t /*quirks*/, const sp<AMessage> &msg, AString* componentName, AString* mime, int32_t isEncoder) { |