summaryrefslogtreecommitdiffstats
path: root/include/media/mediascanner.h
diff options
context:
space:
mode:
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;
};