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
?
MediaExtractor
is a module that implements container or file-format parsing of a multiplexed data. In a file there will be multipletrack
s which correspond to specific data likevideo
oraudio
. Similarly, in aMP3
file, there could be multiple tracks which are identified by their index. The index in the function corresponds to a specifictrack
of interest.Now, why is this function required? Since
MP3Extractor
is another extractor in the framework, it has to support this function, the reason for which follows. Let's consider theplayer
as an example.AwesomePlayer
is 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
decoder
to consume the data. Thedecoder
is 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 inmeta
i.e. metadata which will be employed to create and initialize the down-stream component.