summaryrefslogtreecommitdiffstats
path: root/include/media/mediascanner.h
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-12-03 11:31:19 -0800
committerAndreas Huber <andih@google.com>2009-12-03 13:21:54 -0800
commit413f523afe96aff02d2b0a7459127b8f67b2b43c (patch)
tree395251a728a780bf6d46e4ef4a721e0cf4a77f3a /include/media/mediascanner.h
parent8908d616cc9d74f9fe2c17f1d8d9335ee28c290d (diff)
downloadframeworks_av-413f523afe96aff02d2b0a7459127b8f67b2b43c.zip
frameworks_av-413f523afe96aff02d2b0a7459127b8f67b2b43c.tar.gz
frameworks_av-413f523afe96aff02d2b0a7459127b8f67b2b43c.tar.bz2
Refactor MediaScanner. Some steps on the way towards being able to build the tree without OpenCore.
Diffstat (limited to 'include/media/mediascanner.h')
-rw-r--r--include/media/mediascanner.h47
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;
};