MediaScanner Java, JNI, mediaservice 呼叫關係
/**
* Internal service helper that no-one should use directly.
*
* The way the scan currently works is:
* - The Java MediaScannerService creates a MediaScanner (this class), and calls
* MediaScanner.scanDirectories on it.
* - scanDirectories() calls the native processDirectory() for each of the specified directories.
* - the processDirectory() JNI method wraps the provided mediascanner client in a native
* 'MyMediaScannerClient' class, then calls processDirectory() on the native MediaScanner
* object (which got created when the Java MediaScanner was created).
* - native MediaScanner.processDirectory() (currently part of opencore) calls
* doProcessDirectory(), which recurses over the folder, and calls
* native MyMediaScannerClient.scanFile() for every file whose extension matches.
* - native MyMediaScannerClient.scanFile() calls back on Java MediaScannerClient.scanFile,
* which calls doScanFile, which after some setup calls back down to native code, calling
* MediaScanner.processFile().
* - MediaScanner.processFile() calls one of several methods, depending on the type of the
* file: parseMP3, parseMP4, parseMidi, parseOgg or parseWMA.
* - each of these methods gets metadata key/value pairs from the file, and repeatedly
* calls native MyMediaScannerClient.handleStringTag, which calls back up to its Java
* counterparts in this file.
* - Java handleStringTag() gathers the key/value pairs that it's interested in.
* - once processFile returns and we're back in Java code in doScanFile(), it calls
* Java MyMediaScannerClient.endFile(), which takes all the data that's been
* gathered and inserts an entry in to the database.
*
* In summary:
* Java MediaScannerService calls
* Java MediaScanner scanDirectories, which calls
* Java MediaScanner processDirectory (native method), which calls
* native MediaScanner processDirectory, which calls
* native MyMediaScannerClient scanFile, which calls
* Java MyMediaScannerClient scanFile, which calls
* Java MediaScannerClient doScanFile, which calls
* Java MediaScanner processFile (native method), which calls
* native MediaScanner processFile, which calls
* native parseMP3, parseMP4, parseMidi, parseOgg or parseWMA, which calls
* native MyMediaScanner handleStringTag, which calls
* Java MyMediaScanner handleStringTag.
* Once MediaScanner processFile returns, an entry is inserted in to the database.
*
*
*/
* Internal service helper that no-one should use directly.
*
* The way the scan currently works is:
* - The Java MediaScannerService creates a MediaScanner (this class), and calls
* MediaScanner.scanDirectories on it.
* - scanDirectories() calls the native processDirectory() for each of the specified directories.
* - the processDirectory() JNI method wraps the provided mediascanner client in a native
* 'MyMediaScannerClient' class, then calls processDirectory() on the native MediaScanner
* object (which got created when the Java MediaScanner was created).
* - native MediaScanner.processDirectory() (currently part of opencore) calls
* doProcessDirectory(), which recurses over the folder, and calls
* native MyMediaScannerClient.scanFile() for every file whose extension matches.
* - native MyMediaScannerClient.scanFile() calls back on Java MediaScannerClient.scanFile,
* which calls doScanFile, which after some setup calls back down to native code, calling
* MediaScanner.processFile().
* - MediaScanner.processFile() calls one of several methods, depending on the type of the
* file: parseMP3, parseMP4, parseMidi, parseOgg or parseWMA.
* - each of these methods gets metadata key/value pairs from the file, and repeatedly
* calls native MyMediaScannerClient.handleStringTag, which calls back up to its Java
* counterparts in this file.
* - Java handleStringTag() gathers the key/value pairs that it's interested in.
* - once processFile returns and we're back in Java code in doScanFile(), it calls
* Java MyMediaScannerClient.endFile(), which takes all the data that's been
* gathered and inserts an entry in to the database.
*
* In summary:
* Java MediaScannerService calls
* Java MediaScanner scanDirectories, which calls
* Java MediaScanner processDirectory (native method), which calls
* native MediaScanner processDirectory, which calls
* native MyMediaScannerClient scanFile, which calls
* Java MyMediaScannerClient scanFile, which calls
* Java MediaScannerClient doScanFile, which calls
* Java MediaScanner processFile (native method), which calls
* native MediaScanner processFile, which calls
* native parseMP3, parseMP4, parseMidi, parseOgg or parseWMA, which calls
* native MyMediaScanner handleStringTag, which calls
* Java MyMediaScanner handleStringTag.
* Once MediaScanner processFile returns, an entry is inserted in to the database.
*
*
*/
相關文章
- JAVA JNI 呼叫C語言 DemoJavaC語言
- C語言 JNI 呼叫JAVA DemoC語言Java
- java呼叫c++動態庫之jni呼叫JavaC++
- JNI:Java程式碼呼叫原生程式碼Java
- JNI/NDK開發指南(3):JNI資料型別及與Java資料型別的對映關係資料型別Java
- 棧呼叫關係跟蹤
- Java如何呼叫C語言程式,JNI技術JavaC語言
- Android JNI實現Java與C/C++互相呼叫,以及so庫的生成和呼叫(JNI方式呼叫美圖秀秀so)AndroidJavaC++
- Android Studio NDK開發-JNI呼叫Java方法AndroidJava
- 指標和陣列的關係(Android之JNI)指標陣列Android
- Android MediaScanner:(一)MediaScanner總體架構Android架構
- Android JNI開發系列之Java與C相互呼叫AndroidJava
- Android Studio NDK開發:JNI呼叫Java函式AndroidJava函式
- C++庫封裝JNI介面——實現java呼叫c++C++封裝Java
- JNI開發系列③C語言呼叫Java欄位與方法C語言Java
- Music Studio專案心得--JNI實現C++呼叫JAVAC++Java
- JNI/NDK開發指南(9):JNI呼叫效能測試及優化優化
- Scala與Java的關係Java
- JavaScript和Java的關係JavaScript
- java JNI簡介Java
- Java jvm級別native關鍵詞、JNI詳解JavaJVM
- android使用JNI呼叫C,C++程式AndroidC++
- 【java】類之間的關係Java
- java物件關係對映ROMJava物件
- java三大特性的關係?Java
- JNI訪問Java方法Java
- jni回撥java方法Java
- MediaScanner原始碼簡單分析原始碼
- Java類關係之代理(代理模式)Java模式
- Java 和 JavaScript 是什麼關係?JavaScript
- MongoDB、Java與物件關係對映MongoDBJava物件
- MongoDB、Java和物件關係對映MongoDBJava物件
- Java JNI 學習筆記Java筆記
- 【JAVA今法修真】 第三章 關係非關係 redis法器JavaRedis
- 關係錶轉dooris 的java 指令碼Java指令碼
- Java面試題:Java中的集合及其繼承關係Java面試題繼承
- Java安全之JNI繞過RASPJava
- 安卓驅動、HAL、JNI與java安卓Java