2009-07-29 20:01:28 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2003, Marcus Overhagen. All rights reserved.
|
2018-12-01 13:11:46 +03:00
|
|
|
* Copyright 2018, Dario Casalinuovo. All rights reserverd.
|
2009-07-29 20:01:28 +04:00
|
|
|
* Distributed under the terms of the MIT license.
|
|
|
|
*/
|
2003-11-04 04:32:33 +03:00
|
|
|
#ifndef _MEDIA_PLUGIN_H
|
|
|
|
#define _MEDIA_PLUGIN_H
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2018-11-26 15:18:35 +03:00
|
|
|
|
2003-11-23 21:17:35 +03:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2018-11-26 15:18:35 +03:00
|
|
|
|
|
|
|
namespace BCodecKit {
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
class PluginManager;
|
|
|
|
}
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2018-11-22 11:48:04 +03:00
|
|
|
|
|
|
|
// TODO: Shouldn't this be a BReferenceable?
|
|
|
|
// TODO: This will replace BMediaAddOn in media2,
|
|
|
|
// see if we need some more accessor method and
|
|
|
|
// add the needed padding.
|
2018-11-25 14:40:49 +03:00
|
|
|
class BMediaPlugin {
|
2003-10-18 03:55:19 +04:00
|
|
|
public:
|
2018-11-25 14:40:49 +03:00
|
|
|
BMediaPlugin();
|
|
|
|
virtual ~BMediaPlugin();
|
2016-11-01 01:34:48 +03:00
|
|
|
|
|
|
|
private:
|
2018-10-29 11:41:21 +03:00
|
|
|
int32 fRefCount;
|
|
|
|
|
2016-11-01 01:34:48 +03:00
|
|
|
// needed for plug-in reference count management
|
2018-11-26 15:18:35 +03:00
|
|
|
friend class BCodecKit::BPrivate::PluginManager;
|
2016-11-01 01:34:48 +03:00
|
|
|
|
2018-10-28 18:14:25 +03:00
|
|
|
virtual void _ReservedMediaPlugin1();
|
|
|
|
virtual void _ReservedMediaPlugin2();
|
|
|
|
|
|
|
|
uint32 fReserved[5];
|
2003-10-18 03:55:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-11-26 15:18:35 +03:00
|
|
|
extern "C" BMediaPlugin* instantiate_plugin();
|
2018-12-01 13:11:46 +03:00
|
|
|
extern "C" uint32 get_plugin_version();
|
|
|
|
extern "C" const char* get_plugin_name();
|
|
|
|
|
|
|
|
|
2019-02-17 16:15:08 +03:00
|
|
|
#define B_CODEC_KIT_PLUGIN_VERSION 100
|
2018-12-01 13:11:46 +03:00
|
|
|
|
|
|
|
#define B_DECLARE_CODEC_KIT_PLUGIN(className, name, version) \
|
|
|
|
extern "C" { \
|
|
|
|
BCodecKit::BMediaPlugin* instantiate_plugin() \
|
|
|
|
{ \
|
|
|
|
return new(std::nothrow) className(); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
uint32 get_plugin_version() \
|
|
|
|
{ \
|
|
|
|
return version; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
const char* get_plugin_name() \
|
|
|
|
{ \
|
|
|
|
return name; \
|
|
|
|
} \
|
|
|
|
}
|
2003-10-18 03:55:19 +04:00
|
|
|
|
|
|
|
|
2018-11-26 15:18:35 +03:00
|
|
|
} // namespace BCodecKit
|
|
|
|
|
2003-11-04 04:32:33 +03:00
|
|
|
|
2009-07-29 20:01:28 +04:00
|
|
|
#endif // _MEDIA_PLUGIN_H
|