summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-11-19 00:29:37 -0800
committerSteve Kondik <steve@cyngn.com>2015-11-23 17:08:28 -0800
commit29c75250c58bdcc3b38513813ba521cba82d5c61 (patch)
tree046da9cbac5870beed59173bc641aa413b525004 /media/libstagefright/ACodec.cpp
parent186221ad96a20d975cfb41a91023cfde37e95872 (diff)
downloadframeworks_av-29c75250c58bdcc3b38513813ba521cba82d5c61.zip
frameworks_av-29c75250c58bdcc3b38513813ba521cba82d5c61.tar.gz
frameworks_av-29c75250c58bdcc3b38513813ba521cba82d5c61.tar.bz2
stagefright: Welcome to my nightmare, act IV
* Standardize parameter names, clean up stub calls * Attempting to make QC's blob work. We've entered our last days on earth. All is lost, all is lost. Change-Id: Idef9aad100f414e64a737e0f0a8c9c112ad4cb46
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 7f6bcb1..a0282a1 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -543,12 +543,7 @@ ACodec::ACodec()
ACodec::~ACodec() {
}
-status_t ACodec::setupCustomCodec(status_t err, const char *mime, const sp<AMessage> &msg) {
- if (!strncmp(mComponentName.c_str(), "OMX.ffmpeg.", 11) && !mIsEncoder) {
- return FFMPEGSoftCodec::setAudioFormat(
- msg, mime, mOMX, mNode);
- }
-
+status_t ACodec::setupCustomCodec(status_t err, const char * /*mime*/, const sp<AMessage> &/*msg*/) {
return err;
}
@@ -2019,7 +2014,7 @@ status_t ACodec::configureCodec(
err = OK;
} else {
int32_t bitsPerSample = 16;
- msg->findInt32("bit-width", &bitsPerSample);
+ msg->findInt32("bits-per-sample", &bitsPerSample);
err = setupRawAudioFormatInternal(
encoder ? kPortIndexInput : kPortIndexOutput,
sampleRate,
@@ -2098,11 +2093,7 @@ status_t ACodec::configureCodec(
}
err = setupG711Codec(encoder, sampleRate, numChannels);
}
-#ifdef QTI_FLAC_DECODER
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC) && encoder) {
-#else
- } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC)) {
-#endif
int32_t numChannels = 0, sampleRate = 0, compressionLevel = -1;
if (encoder &&
(!msg->findInt32("channel-count", &numChannels)
@@ -2139,7 +2130,7 @@ status_t ACodec::configureCodec(
err = INVALID_OPERATION;
} else {
int32_t bitsPerSample = 16;
- msg->findInt32("bit-width", &bitsPerSample);
+ msg->findInt32("bits-per-sample", &bitsPerSample);
err = setupRawAudioFormatInternal(kPortIndexInput, sampleRate, numChannels, bitsPerSample);
}
} else if (!strncmp(mComponentName.c_str(), "OMX.google.", 11)
@@ -2151,7 +2142,7 @@ status_t ACodec::configureCodec(
err = INVALID_OPERATION;
} else {
int32_t bitsPerSample = 16;
- msg->findInt32("bit-width", &bitsPerSample);
+ msg->findInt32("bits-per-sample", &bitsPerSample);
err = setupAC3Codec(encoder, numChannels, sampleRate, bitsPerSample);
}
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_EAC3)) {
@@ -2162,11 +2153,16 @@ status_t ACodec::configureCodec(
err = INVALID_OPERATION;
} else {
int32_t bitsPerSample = 16;
- msg->findInt32("bit-width", &bitsPerSample);
+ msg->findInt32("bits-per-sample", &bitsPerSample);
err = setupEAC3Codec(encoder, numChannels, sampleRate, bitsPerSample);
}
} else {
- err = setupCustomCodec(err, mime, msg);
+ if (!strncmp(mComponentName.c_str(), "OMX.ffmpeg.", 11) && !mIsEncoder) {
+ err = FFMPEGSoftCodec::setAudioFormat(
+ msg, mime, mOMX, mNode);
+ } else {
+ err = setupCustomCodec(err, mime, msg);
+ }
}
if (err != OK) {
@@ -4277,7 +4273,7 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify) {
notify->setString("mime", MEDIA_MIMETYPE_AUDIO_RAW);
notify->setInt32("channel-count", params.nChannels);
notify->setInt32("sample-rate", params.nSamplingRate);
- notify->setInt32("bit-width", params.nBitPerSample);
+ notify->setInt32("bits-per-sample", params.nBitPerSample);
if (mChannelMaskPresent) {
notify->setInt32("channel-mask", mChannelMask);
@@ -5788,6 +5784,7 @@ bool ACodec::LoadedState::onConfigureComponent(
status_t err = OK;
AString mime;
+
if (!msg->findString("mime", &mime)) {
err = BAD_VALUE;
} else {