1 #ifndef _PLUGIN_MANAGER_H 2 #define _PLUGIN_MANAGER_H 3 4 #include "ReaderPlugin.h" 5 #include "DecoderPlugin.h" 6 #include <TList.h> 7 #include <Locker.h> 8 9 10 namespace BPrivate { namespace media { 11 12 class PluginManager 13 { 14 public: 15 PluginManager(); 16 ~PluginManager(); 17 18 MediaPlugin * GetPlugin(const entry_ref &ref); 19 void PutPlugin(MediaPlugin *plugin); 20 21 22 status_t CreateReader(Reader **reader, int32 *streamCount, media_file_format *mff, BDataIO *source); 23 void DestroyReader(Reader *reader); 24 25 status_t CreateDecoder(Decoder **decoder, const media_format &format); 26 status_t CreateDecoder(Decoder **decoder, const media_codec_info &mci); 27 status_t GetDecoderInfo(Decoder *decoder, media_codec_info *out_info) const; 28 void DestroyDecoder(Decoder *decoder); 29 30 private: 31 status_t LoadPlugin(const entry_ref &ref, MediaPlugin **plugin, image_id *image); 32 33 struct plugin_info 34 { 35 char name[260]; 36 int usecount; 37 MediaPlugin *plugin; 38 image_id image; 39 }; 40 41 List<plugin_info> *fPluginList; 42 BLocker *fLocker; 43 }; 44 45 } } // namespace BPrivate::media 46 47 using namespace BPrivate::media; 48 49 extern PluginManager _plugin_manager; 50 51 #endif 52