diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/stagefright/DataSource.h | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index 56abe71..de5ddd3 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -36,40 +36,6 @@ class IDataSource; struct IMediaHTTPService; class String8; struct HTTPBase; -class DataSource; - -class Sniffer : public RefBase { -public: - Sniffer(); - - //////////////////////////////////////////////////////////////////////////// - - bool sniff(DataSource *source, String8 *mimeType, float *confidence, sp<AMessage> *meta); - - // The sniffer can optionally fill in "meta" with an AMessage containing - // a dictionary of values that helps the corresponding extractor initialize - // its state without duplicating effort already exerted by the sniffer. - typedef bool (*SnifferFunc)( - const sp<DataSource> &source, String8 *mimeType, - float *confidence, sp<AMessage> *meta); - - //if isExtendedExtractor = true, store the location of the sniffer to register - void registerSniffer_l(SnifferFunc func); - void registerDefaultSniffers(); - - virtual ~Sniffer() {} - -private: - Mutex mSnifferMutex; - List<SnifferFunc> mSniffers; - List<SnifferFunc> mExtraSniffers; - List<SnifferFunc>::iterator extendedSnifferPosition; - - void registerSnifferPlugin(); - - Sniffer(const Sniffer &); - Sniffer &operator=(const Sniffer &); -}; class DataSource : public RefBase { public: @@ -91,7 +57,7 @@ public: static sp<DataSource> CreateMediaHTTP(const sp<IMediaHTTPService> &httpService); static sp<DataSource> CreateFromIDataSource(const sp<IDataSource> &source); - DataSource() : mSniffer(new Sniffer()) {} + DataSource() {} virtual status_t initCheck() const = 0; @@ -145,7 +111,11 @@ public: protected: virtual ~DataSource() {} - sp<Sniffer> mSniffer; +private: + static Mutex gSnifferMutex; + static List<SnifferFunc> gSniffers; + static List<SnifferFunc> gExtraSniffers; + static bool gSniffersRegistered; static void RegisterSniffer_l(SnifferFunc func); static void RegisterSnifferPlugin(); |