音乐文件扫描过程

来源:互联网 发布:p2p平台 知乎 编辑:程序博客网 时间:2024/05/20 09:21
1, In mediascanner.java->doScanFile(), we start scan file. 
// we only extract metadata for audio and video files 
if (MediaFile.isAudioFileType(mFileType) 
|| MediaFile.isVideoFileType(mFileType)) { 
processFile(path, mimeType, this); //begin to process file. you can print the path of the file. 

2, android_media_MediaScanner.cpp->android_media_MediaScanner_processFile() 
3, StagefrightMediaScanner.cpp->processFile() 
4, in StagefrightMediaScanner.cpp, call MediaScannerClient.cpp->addStringTag() to add tag. 
5, in addStringTag, if the char is not ascii, then put to mNames and mValues for later convert, the addStringTag() parameter is the tag you want to see and you can print the values in the begin of the method. 
6, MediaScannerClient.cpp->endFile() to convert. 

7, after convert, you can print the mNames and mValues for check. 


打开Log调试信息,具体见system/core/include/cutils/log.h

原创粉丝点击