summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-10-09 21:33:53 -0700
committerChong Zhang <chz@google.com>2014-10-09 22:00:46 -0700
commit9c78328f4dfd2c8a1dd5d31010f10ffcd762f04b (patch)
tree4314477d2679a26977d41ec1dd4de06787530551 /media
parent07811789ebf31f5317403356f624d04282e666aa (diff)
downloadframeworks_av-9c78328f4dfd2c8a1dd5d31010f10ffcd762f04b.zip
frameworks_av-9c78328f4dfd2c8a1dd5d31010f10ffcd762f04b.tar.gz
frameworks_av-9c78328f4dfd2c8a1dd5d31010f10ffcd762f04b.tar.bz2
handle case OMX_AUDIO_CodingG711 in ACodec::getPortFormat
Bug: 17935293 Change-Id: I8eab0acf55df6934e05947b0dbdd1fd456130088
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/ACodec.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index b693625..a6c9dcc 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -3458,6 +3458,27 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify) {
break;
}
+ case OMX_AUDIO_CodingG711:
+ {
+ OMX_AUDIO_PARAM_PCMMODETYPE params;
+ InitOMXParams(&params);
+ params.nPortIndex = portIndex;
+
+ CHECK_EQ((status_t)OK, mOMX->getParameter(
+ mNode,
+ (OMX_INDEXTYPE)OMX_IndexParamAudioPcm,
+ &params,
+ sizeof(params)));
+
+ // mime type:
+ // MEDIA_MIMETYPE_AUDIO_G711_ALAW or
+ // MEDIA_MIMETYPE_AUDIO_G711_MLAW
+ notify->setString("mime", audioDef->cMIMEType);
+ notify->setInt32("channel-count", params.nChannels);
+ notify->setInt32("sample-rate", params.nSamplingRate);
+ break;
+ }
+
default:
ALOGE("UNKNOWN AUDIO CODING: %d\n", audioDef->eEncoding);
TRESPASS();