Inside mp4 extractor we added support to parse ALAC encoded frames. Added SoftOMXComponent for ALAC decoder
Following files we modified for decoder MIME type registration:
OMXUtils.cpp inside function GetComponentRole() added below code:
static const MimeToRole kMimeToRole[] = { { "audio/alac","audio_decoder.alac", "audio_encoder.alac" },}In SoftOMXPlugin.cpp added
{ "OMX.google.alac.decoder", "allgoalacdec", "audio_decoder.alac" }to kComponents[]In media_codecs_google_audio.xml Added an entry for ALAC as below:
Inside media/libstagefright/Utils.cpp Added an entry for ALAC at
static const struct mime_conv_t mimeLookup[] = { { "audio/alac", AUDIO_FORMAT_ALAC}, }
5.Inside /libstagefright/ACodec.cpp at: status_t ACodec::configureCodec() Added for ALAC
else if (!strcasecmp(mime, "audio/alac")) {
int32_t numChannels;
int32_t sampleRate;
if (!msg->findInt32("channel-count", &numChannels)
|| !msg->findInt32("sample-rate", &sampleRate)) {
/* We do not want to setup the ALAC codec.Let the
* Plugin do all the work*/
err = OK;
} else {
err = setupRawAudioFormat(
kPortIndexOutput,
sampleRate,
numChannels);
err = OK;
}
}
And Inside status_t:
ACodec::getPortFormat(){
case OMX_AUDIO_CodingALAC:
{
OMX_AUDIO_PARAM_ALACTYPE params;
InitOMXParams(¶ms);
params.nPortIndex = portIndex;
err = mOMXNode->getParameter(
(OMX_INDEXTYPE)OMX_IndexParamAudioAlac, ¶ms, sizeof(params));
if (err != OK) {
return err;
}
notify->setString("mime", "audio/alac");
notify->setInt32("channel-count", params.nChannels);
notify->setInt32("sample-rate", params.nSamplingRate);
// notify->setInt32("bits-per-sample", params.nBitsPerSample);
break;
}
}
We added above changes and build libstagefright and copied to board also media_codecs_google_audio.xml copied to hardware's /vendor/etc
But still we getting below error:
NuPlayerDecoder: Failed to create audio/alac decoder