diff options
author | Andreas Huber <andih@google.com> | 2009-12-03 16:39:27 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-12-03 16:39:27 -0800 |
commit | 4e1e4bfb43d14d867345da7e0680c4636f40f63b (patch) | |
tree | afd29af3a13050468c30189f672c87097354a124 /include | |
parent | c9ffa992276a1aadb6a99a62417f5222daa03c2e (diff) | |
parent | 413f523afe96aff02d2b0a7459127b8f67b2b43c (diff) | |
download | frameworks_av-4e1e4bfb43d14d867345da7e0680c4636f40f63b.zip frameworks_av-4e1e4bfb43d14d867345da7e0680c4636f40f63b.tar.gz frameworks_av-4e1e4bfb43d14d867345da7e0680c4636f40f63b.tar.bz2 |
am bfb9fb14: Refactor MediaScanner. Some steps on the way towards being able to build the tree without OpenCore.
Merge commit 'bfb9fb143b67c2d0307af2bce9af3c08f362b29a' into eclair-mr2-plus-aosp
* commit 'bfb9fb143b67c2d0307af2bce9af3c08f362b29a':
Refactor MediaScanner. Some steps on the way towards being able to build the tree without OpenCore.
Diffstat (limited to 'include')
-rw-r--r-- | include/media/mediascanner.h | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/include/media/mediascanner.h b/include/media/mediascanner.h index cd0b86e..0d397ac 100644 --- a/include/media/mediascanner.h +++ b/include/media/mediascanner.h @@ -28,33 +28,40 @@ namespace android { class MediaScannerClient; class StringArray; -class MediaScanner -{ -public: +struct MediaScanner { MediaScanner(); - ~MediaScanner(); - + virtual ~MediaScanner(); + + virtual status_t processFile( + const char *path, const char *mimeType, + MediaScannerClient &client) = 0; + typedef bool (*ExceptionCheck)(void* env); + virtual status_t processDirectory( + const char *path, const char *extensions, + MediaScannerClient &client, + ExceptionCheck exceptionCheck, void *exceptionEnv); + + void setLocale(const char *locale); - status_t processFile(const char *path, const char *mimeType, MediaScannerClient& client); - status_t processDirectory(const char *path, const char* extensions, - MediaScannerClient& client, ExceptionCheck exceptionCheck, void* exceptionEnv); - void setLocale(const char* locale); - // extracts album art as a block of data - char* extractAlbumArt(int fd); - - static void uninitializeForThread(); + virtual char *extractAlbumArt(int fd) = 0; + +protected: + const char *locale() const; private: - status_t doProcessDirectory(char *path, int pathRemaining, const char* extensions, - MediaScannerClient& client, ExceptionCheck exceptionCheck, void* exceptionEnv); - void initializeForThread(); - // current locale (like "ja_JP"), created/destroyed with strdup()/free() - char* mLocale; -}; + char *mLocale; + status_t doProcessDirectory( + char *path, int pathRemaining, const char *extensions, + MediaScannerClient &client, ExceptionCheck exceptionCheck, + void *exceptionEnv); + + MediaScanner(const MediaScanner &); + MediaScanner &operator=(const MediaScanner &); +}; class MediaScannerClient { @@ -78,7 +85,7 @@ protected: // cached name and value strings, for native encoding support. StringArray* mNames; StringArray* mValues; - + // default encoding based on MediaScanner::mLocale string uint32_t mLocaleEncoding; }; |