Loading media/libstagefright/OMXCodec.cpp +27 −1 Original line number Diff line number Diff line Loading @@ -4330,7 +4330,6 @@ status_t QueryCodec( caps->mFlags = 0; caps->mComponentName = componentName; // NOTE: OMX does not provide a way to query AAC profile support if (isVideo) { OMX_VIDEO_PARAM_PROFILELEVELTYPE param; InitOMXParams(¶m); Loading Loading @@ -4384,6 +4383,33 @@ status_t QueryCodec( } caps->mColorFormats.push(portFormat.eColorFormat); } } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AAC, mime)) { // More audio codecs if they have profiles. OMX_AUDIO_PARAM_ANDROID_PROFILETYPE param; InitOMXParams(¶m); param.nPortIndex = isEncoder ? 1 : 0; for (param.nProfileIndex = 0;; ++param.nProfileIndex) { err = omx->getParameter( node, (OMX_INDEXTYPE)OMX_IndexParamAudioProfileQuerySupported, ¶m, sizeof(param)); if (err != OK) { break; } CodecProfileLevel profileLevel; profileLevel.mProfile = param.eProfile; // For audio, level is ignored. profileLevel.mLevel = 0; caps->mProfileLevels.push(profileLevel); } // NOTE: Without Android extensions, OMX does not provide a way to query // AAC profile support if (param.nProfileIndex == 0) { ALOGW("component %s doesn't support profile query.", componentName); } } if (isVideo && !isEncoder) { Loading media/libstagefright/codecs/aacenc/SoftAACEncoder2.cpp +30 −1 Original line number Diff line number Diff line Loading @@ -20,9 +20,11 @@ #include "SoftAACEncoder2.h" #include <OMX_AudioExt.h> #include <OMX_IndexExt.h> #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/hexdump.h> #include <utils/misc.h> namespace android { Loading @@ -35,6 +37,14 @@ static void InitOMXParams(T *params) { params->nVersion.s.nStep = 0; } static const OMX_U32 kSupportedProfiles[] = { OMX_AUDIO_AACObjectLC, OMX_AUDIO_AACObjectHE, OMX_AUDIO_AACObjectHE_PS, OMX_AUDIO_AACObjectLD, OMX_AUDIO_AACObjectELD, }; SoftAACEncoder2::SoftAACEncoder2( const char *name, const OMX_CALLBACKTYPE *callbacks, Loading Loading @@ -117,7 +127,7 @@ status_t SoftAACEncoder2::initEncoder() { OMX_ERRORTYPE SoftAACEncoder2::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { switch ((OMX_U32) index) { case OMX_IndexParamAudioPortFormat: { OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams = Loading Loading @@ -220,6 +230,25 @@ OMX_ERRORTYPE SoftAACEncoder2::internalGetParameter( return OMX_ErrorNone; } case OMX_IndexParamAudioProfileQuerySupported: { OMX_AUDIO_PARAM_ANDROID_PROFILETYPE *profileParams = (OMX_AUDIO_PARAM_ANDROID_PROFILETYPE *)params; if (profileParams->nPortIndex != 1) { return OMX_ErrorUndefined; } if (profileParams->nProfileIndex >= NELEM(kSupportedProfiles)) { return OMX_ErrorNoMore; } profileParams->eProfile = kSupportedProfiles[profileParams->nProfileIndex]; return OMX_ErrorNone; } default: return SimpleSoftOMXComponent::internalGetParameter(index, params); } Loading Loading
media/libstagefright/OMXCodec.cpp +27 −1 Original line number Diff line number Diff line Loading @@ -4330,7 +4330,6 @@ status_t QueryCodec( caps->mFlags = 0; caps->mComponentName = componentName; // NOTE: OMX does not provide a way to query AAC profile support if (isVideo) { OMX_VIDEO_PARAM_PROFILELEVELTYPE param; InitOMXParams(¶m); Loading Loading @@ -4384,6 +4383,33 @@ status_t QueryCodec( } caps->mColorFormats.push(portFormat.eColorFormat); } } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AAC, mime)) { // More audio codecs if they have profiles. OMX_AUDIO_PARAM_ANDROID_PROFILETYPE param; InitOMXParams(¶m); param.nPortIndex = isEncoder ? 1 : 0; for (param.nProfileIndex = 0;; ++param.nProfileIndex) { err = omx->getParameter( node, (OMX_INDEXTYPE)OMX_IndexParamAudioProfileQuerySupported, ¶m, sizeof(param)); if (err != OK) { break; } CodecProfileLevel profileLevel; profileLevel.mProfile = param.eProfile; // For audio, level is ignored. profileLevel.mLevel = 0; caps->mProfileLevels.push(profileLevel); } // NOTE: Without Android extensions, OMX does not provide a way to query // AAC profile support if (param.nProfileIndex == 0) { ALOGW("component %s doesn't support profile query.", componentName); } } if (isVideo && !isEncoder) { Loading
media/libstagefright/codecs/aacenc/SoftAACEncoder2.cpp +30 −1 Original line number Diff line number Diff line Loading @@ -20,9 +20,11 @@ #include "SoftAACEncoder2.h" #include <OMX_AudioExt.h> #include <OMX_IndexExt.h> #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/hexdump.h> #include <utils/misc.h> namespace android { Loading @@ -35,6 +37,14 @@ static void InitOMXParams(T *params) { params->nVersion.s.nStep = 0; } static const OMX_U32 kSupportedProfiles[] = { OMX_AUDIO_AACObjectLC, OMX_AUDIO_AACObjectHE, OMX_AUDIO_AACObjectHE_PS, OMX_AUDIO_AACObjectLD, OMX_AUDIO_AACObjectELD, }; SoftAACEncoder2::SoftAACEncoder2( const char *name, const OMX_CALLBACKTYPE *callbacks, Loading Loading @@ -117,7 +127,7 @@ status_t SoftAACEncoder2::initEncoder() { OMX_ERRORTYPE SoftAACEncoder2::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { switch ((OMX_U32) index) { case OMX_IndexParamAudioPortFormat: { OMX_AUDIO_PARAM_PORTFORMATTYPE *formatParams = Loading Loading @@ -220,6 +230,25 @@ OMX_ERRORTYPE SoftAACEncoder2::internalGetParameter( return OMX_ErrorNone; } case OMX_IndexParamAudioProfileQuerySupported: { OMX_AUDIO_PARAM_ANDROID_PROFILETYPE *profileParams = (OMX_AUDIO_PARAM_ANDROID_PROFILETYPE *)params; if (profileParams->nPortIndex != 1) { return OMX_ErrorUndefined; } if (profileParams->nProfileIndex >= NELEM(kSupportedProfiles)) { return OMX_ErrorNoMore; } profileParams->eProfile = kSupportedProfiles[profileParams->nProfileIndex]; return OMX_ErrorNone; } default: return SimpleSoftOMXComponent::internalGetParameter(index, params); } Loading