summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--media/libavextensions/mediaplayerservice/AVNuUtils.cpp2
-rw-r--r--media/libavextensions/stagefright/AVUtils.cpp2
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp2
-rw-r--r--media/libstagefright/ACodec.cpp29
-rw-r--r--media/libstagefright/FFMPEGSoftCodec.cpp8
-rw-r--r--media/libstagefright/Utils.cpp4
6 files changed, 22 insertions, 25 deletions
diff --git a/media/libavextensions/mediaplayerservice/AVNuUtils.cpp b/media/libavextensions/mediaplayerservice/AVNuUtils.cpp
index 85f07db..31d7b32 100644
--- a/media/libavextensions/mediaplayerservice/AVNuUtils.cpp
+++ b/media/libavextensions/mediaplayerservice/AVNuUtils.cpp
@@ -107,7 +107,7 @@ audio_format_t AVNuUtils::getPCMFormat(const sp<AMessage> &format) {
return (audio_format_t)pcmFormat;
int32_t bits = 16;
- if (format->findInt32("bit-width", &bits)) {
+ if (format->findInt32("bits-per-sample", &bits)) {
if (bits == 8)
return AUDIO_FORMAT_PCM_8_BIT;
if (bits == 24)
diff --git a/media/libavextensions/stagefright/AVUtils.cpp b/media/libavextensions/stagefright/AVUtils.cpp
index 50c0f89..2d5208f 100644
--- a/media/libavextensions/stagefright/AVUtils.cpp
+++ b/media/libavextensions/stagefright/AVUtils.cpp
@@ -68,7 +68,7 @@ int AVUtils::getAudioSampleBits(const sp<MetaData> &) {
int AVUtils::getAudioSampleBits(const sp<AMessage> &format) {
int32_t bits = 16;
- format->findInt32("bit-width", &bits);
+ format->findInt32("bits-per-sample", &bits);
return bits;
}
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 490a0d2..307e0cb 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -1707,7 +1707,7 @@ status_t NuPlayer::Renderer::onOpenAudioSink(
}
int32_t bitWidth = 16;
- format->findInt32("bit-width", &bitWidth);
+ format->findInt32("bits-per-sample", &bitWidth);
int32_t sampleRate;
CHECK(format->findInt32("sample-rate", &sampleRate));
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 {
diff --git a/media/libstagefright/FFMPEGSoftCodec.cpp b/media/libstagefright/FFMPEGSoftCodec.cpp
index 5c6a8ed..6b12a41 100644
--- a/media/libstagefright/FFMPEGSoftCodec.cpp
+++ b/media/libstagefright/FFMPEGSoftCodec.cpp
@@ -53,7 +53,7 @@ static const MetaKeyEntry MetaKeyTable[] {
{kKeyAACAOT , "aac-profile" , INT32},
{kKeyArbitraryMode , "use-arbitrary-mode" , INT32},
{kKeyBitRate , "bitrate" , INT32},
- {kKeyBitsPerSample , "bit-width" , INT32},
+ {kKeyBitsPerSample , "bits-per-sample" , INT32},
{kKeyBlockAlign , "block-align" , INT32},
{kKeyChannelCount , "channel-count" , INT32},
{kKeyCodecId , "codec-id" , INT32},
@@ -404,7 +404,7 @@ status_t FFMPEGSoftCodec::getAudioPortFormat(OMX_U32 portIndex, int coding,
notify->setString("mime", MEDIA_MIMETYPE_AUDIO_APE);
notify->setInt32("channel-count", params.nChannels);
notify->setInt32("sample-rate", params.nSamplingRate);
- notify->setInt32("bit-width", params.nBitsPerSample);
+ notify->setInt32("bits-per-sample", params.nBitsPerSample);
break;
}
case OMX_AUDIO_CodingFLAC:
@@ -422,7 +422,7 @@ status_t FFMPEGSoftCodec::getAudioPortFormat(OMX_U32 portIndex, int coding,
notify->setString("mime", MEDIA_MIMETYPE_AUDIO_FLAC);
notify->setInt32("channel-count", params.nChannels);
notify->setInt32("sample-rate", params.nSampleRate);
- notify->setInt32("bit-width", params.nCompressionLevel); // piggyback
+ notify->setInt32("bits-per-sample", params.nCompressionLevel); // piggyback
break;
}
@@ -821,7 +821,7 @@ status_t FFMPEGSoftCodec::setWMAFormat(
// mm-parser may want a different bit depth
if (msg->findInt32(getMsgKey(kKeyWMABitspersample), &bitsPerSample)) {
- msg->setInt32("bit-width", bitsPerSample);
+ msg->setInt32("bits-per-sample", bitsPerSample);
}
ALOGV("Channels: %d, SampleRate: %d, BitRate: %d, blockAlign: %d",
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp
index b1b860c..0cf76a3 100644
--- a/media/libstagefright/Utils.cpp
+++ b/media/libstagefright/Utils.cpp
@@ -208,7 +208,7 @@ status_t convertMetaDataToMessage(
int32_t bitsPerSample;
if (meta->findInt32(kKeyBitsPerSample, &bitsPerSample)) {
- msg->setInt32("bit-width", bitsPerSample);
+ msg->setInt32("bits-per-sample", bitsPerSample);
}
uint32_t type;
@@ -665,7 +665,7 @@ void convertMessageToMetaData(const sp<AMessage> &msg, sp<MetaData> &meta) {
}
int32_t bitsPerSample;
- if (msg->findInt32("bit-width", &bitsPerSample)) {
+ if (msg->findInt32("bits-per-sample", &bitsPerSample)) {
meta->setInt32(kKeyBitsPerSample, bitsPerSample);
}
}