2003-12-02 02:33:35 +03:00
|
|
|
#ifndef _PLUGIN_MANAGER_H
|
|
|
|
#define _PLUGIN_MANAGER_H
|
|
|
|
|
2009-06-07 23:07:34 +04:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
2003-12-02 02:33:35 +03:00
|
|
|
#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;
|
2009-06-07 22:11:05 +04:00
|
|
|
|
|
|
|
plugin_info& operator=(const plugin_info& other)
|
|
|
|
{
|
|
|
|
strcpy(name, other.name);
|
|
|
|
usecount = other.usecount;
|
|
|
|
plugin = other.plugin;
|
|
|
|
image = other.image;
|
|
|
|
return *this;
|
|
|
|
}
|
2003-12-05 04:18:51 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|