2003-12-02 02:33:35 +03:00
|
|
|
#ifndef _PLUGIN_MANAGER_H
|
|
|
|
#define _PLUGIN_MANAGER_H
|
|
|
|
|
|
|
|
#include "ReaderPlugin.h"
|
|
|
|
#include "DecoderPlugin.h"
|
2003-12-05 04:18:51 +03:00
|
|
|
#include <TList.h>
|
|
|
|
#include <Locker.h>
|
2003-12-02 02:33:35 +03:00
|
|
|
|
2003-12-05 04:18:51 +03:00
|
|
|
|
2007-06-03 03:16:54 +04:00
|
|
|
namespace BPrivate { namespace media {
|
|
|
|
|
2003-12-05 04:18:51 +03:00
|
|
|
class PluginManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PluginManager();
|
|
|
|
~PluginManager();
|
|
|
|
|
2003-12-14 22:23:16 +03:00
|
|
|
MediaPlugin * GetPlugin(const entry_ref &ref);
|
2003-12-05 04:18:51 +03:00
|
|
|
void PutPlugin(MediaPlugin *plugin);
|
2007-06-03 00:00:48 +04:00
|
|
|
|
|
|
|
|
|
|
|
status_t CreateReader(Reader **reader, int32 *streamCount, media_file_format *mff, BDataIO *source);
|
|
|
|
void DestroyReader(Reader *reader);
|
|
|
|
|
|
|
|
status_t CreateDecoder(Decoder **decoder, const media_format &format);
|
|
|
|
status_t CreateDecoder(Decoder **decoder, const media_codec_info &mci);
|
|
|
|
status_t GetDecoderInfo(Decoder *decoder, media_codec_info *out_info) const;
|
|
|
|
void DestroyDecoder(Decoder *decoder);
|
2003-12-05 04:18:51 +03:00
|
|
|
|
|
|
|
private:
|
2007-06-03 03:16:54 +04:00
|
|
|
status_t LoadPlugin(const entry_ref &ref, MediaPlugin **plugin, image_id *image);
|
2003-12-05 04:18:51 +03:00
|
|
|
|
|
|
|
struct plugin_info
|
|
|
|
{
|
|
|
|
char name[260];
|
|
|
|
int usecount;
|
|
|
|
MediaPlugin *plugin;
|
|
|
|
image_id image;
|
|
|
|
};
|
|
|
|
|
|
|
|
List<plugin_info> *fPluginList;
|
|
|
|
BLocker *fLocker;
|
|
|
|
};
|
|
|
|
|
2007-06-03 03:16:54 +04:00
|
|
|
} } // namespace BPrivate::media
|
|
|
|
|
|
|
|
using namespace BPrivate::media;
|
|
|
|
|
2007-06-03 00:00:48 +04:00
|
|
|
extern PluginManager _plugin_manager;
|
|
|
|
|
2003-12-02 02:33:35 +03:00
|
|
|
#endif
|