2009-07-29 16:01:28 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2003, Marcus Overhagen. All rights reserved.
|
2018-12-01 11:11:46 +01:00
|
|
|
* Copyright 2018, Dario Casalinuovo. All rights reserverd.
|
2009-07-29 16:01:28 +00:00
|
|
|
* Distributed under the terms of the MIT license.
|
|
|
|
*/
|
2003-11-04 01:32:33 +00:00
|
|
|
#ifndef _MEDIA_PLUGIN_H
|
|
|
|
#define _MEDIA_PLUGIN_H
|
2003-10-17 23:55:19 +00:00
|
|
|
|
2018-11-26 13:18:35 +01:00
|
|
|
|
2003-11-23 18:17:35 +00:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2018-11-26 13:18:35 +01:00
|
|
|
|
|
|
|
namespace BCodecKit {
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
class PluginManager;
|
|
|
|
}
|
2003-10-17 23:55:19 +00:00
|
|
|
|
2018-11-22 09:48:04 +01: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 12:40:49 +01:00
|
|
|
class BMediaPlugin {
|
2003-10-17 23:55:19 +00:00
|
|
|
public:
|
2018-11-25 12:40:49 +01:00
|
|
|
BMediaPlugin();
|
|
|
|
virtual ~BMediaPlugin();
|
2016-10-31 23:34:48 +01:00
|
|
|
|
|
|
|
private:
|
2018-10-29 09:41:21 +01:00
|
|
|
int32 fRefCount;
|
|
|
|
|
2016-10-31 23:34:48 +01:00
|
|
|
// needed for plug-in reference count management
|
2018-11-26 13:18:35 +01:00
|
|
|
friend class BCodecKit::BPrivate::PluginManager;
|
2016-10-31 23:34:48 +01:00
|
|
|
|
2018-10-28 16:14:25 +01:00
|
|
|
virtual void _ReservedMediaPlugin1();
|
|
|
|
virtual void _ReservedMediaPlugin2();
|
|
|
|
|
|
|
|
uint32 fReserved[5];
|
2003-10-17 23:55:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-11-26 13:18:35 +01:00
|
|
|
extern "C" BMediaPlugin* instantiate_plugin();
|
2018-12-01 11:11:46 +01:00
|
|
|
extern "C" uint32 get_plugin_version();
|
|
|
|
extern "C" const char* get_plugin_name();
|
|
|
|
|
|
|
|
|
2019-02-17 14:15:08 +01:00
|
|
|
#define B_CODEC_KIT_PLUGIN_VERSION 100
|
2018-12-01 11:11:46 +01: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-17 23:55:19 +00:00
|
|
|
|
|
|
|
|
2018-11-26 13:18:35 +01:00
|
|
|
} // namespace BCodecKit
|
|
|
|
|
2003-11-04 01:32:33 +00:00
|
|
|
|
2009-07-29 16:01:28 +00:00
|
|
|
#endif // _MEDIA_PLUGIN_H
|