sp<MetaData> MP3Extractor::getTrackMetaData(size_t index, uint32_t flags) {
ALOGE("%s\t%d",__FUNCTION__,__LINE__);
if (mInitCheck != OK || index != 0) {
return NULL;
}
return mMeta;
}
Why this function is required in the MP3Extractor?
MediaExtractoris a module that implements container or file-format parsing of a multiplexed data. In a file there will be multipletracks which correspond to specific data likevideooraudio. Similarly, in aMP3file, there could be multiple tracks which are identified by their index. The index in the function corresponds to a specifictrackof interest.Now, why is this function required? Since
MP3Extractoris another extractor in the framework, it has to support this function, the reason for which follows. Let's consider theplayeras an example.AwesomePlayeris a player engine which sets up the entire pipeline.In this process, the player engine would setup the extractor first and then try to create a down-stream component like a
decoderto consume the data. Thedecoderis specific to a track which is identified by theindex. To create adecoder, one requires to know the characteristics of the data which is represented or captured inmetai.e. metadata which will be employed to create and initialize the down-stream component.