From 32f93b7bedc44b425ba99d69dec998334e759532 Mon Sep 17 00:00:00 2001 From: Vignesh Venkatasubramanian Date: Wed, 28 May 2014 07:59:35 -0700 Subject: [PATCH] DO NOT MERGE: libstagefright: Add Opus support to ACodec::getPortFormat Bug: 15114855 Change-Id: Idb184ae15986450423fc8cf116cf077600b3ea67 (cherry picked from commit 8c6693b73cb4aed9d1dcb8d5d0828a77b7471a55) --- media/libstagefright/ACodec.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 8f154be1c8..d3c508d152 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -2872,6 +2872,24 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp ¬ify) { break; } + case OMX_AUDIO_CodingAndroidOPUS: + { + OMX_AUDIO_PARAM_ANDROID_OPUSTYPE params; + InitOMXParams(¶ms); + params.nPortIndex = portIndex; + + CHECK_EQ((status_t)OK, mOMX->getParameter( + mNode, + (OMX_INDEXTYPE)OMX_IndexParamAudioAndroidOpus, + ¶ms, + sizeof(params))); + + notify->setString("mime", MEDIA_MIMETYPE_AUDIO_OPUS); + notify->setInt32("channel-count", params.nChannels); + notify->setInt32("sample-rate", params.nSampleRate); + break; + } + default: ALOGE("UNKNOWN AUDIO CODING: %d\n", audioDef->eEncoding); TRESPASS(); -- 2.11.0