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 status_t _CreateReader(Reader **reader, int32 *streamCount, media_file_format *mff, BDataIO *source); 10 status_t _CreateDecoder(Decoder **decoder, const media_format &format); 11 12 void _DestroyReader(Reader *reader); 13 void _DestroyDecoder(Decoder *decoder); 14 15 16 class PluginManager 17 { 18 public: 19 PluginManager(); 20 ~PluginManager(); 21 22 MediaPlugin * GetPlugin(const entry_ref &ref); 23 void PutPlugin(MediaPlugin *plugin); 24 25 private: 26 bool LoadPlugin(const entry_ref &ref, MediaPlugin **plugin, image_id *image); 27 28 struct plugin_info 29 { 30 char name[260]; 31 int usecount; 32 MediaPlugin *plugin; 33 image_id image; 34 }; 35 36 List<plugin_info> *fPluginList; 37 BLocker *fLocker; 38 }; 39 40 #endif 41