SplitCam plugins  1.0.0
Get your own video or still image source as an integral part of SplitCam user interface
splitcam_plugin.h
Go to the documentation of this file.
1 #pragma once
2 #include <inttypes.h>
3 
13 #define EXPORT comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)
14 
22 namespace splitcam { namespace plugin
23 {
32  static const GUID IPlugin_v1 =
33  { 0xa434fc43, 0xeed2, 0x4eae, { 0xa7, 0x92, 0x4b, 0x92, 0xcd, 0x91, 0x6f, 0xa1 } };
34 
43  static const GUID ISource_v1 =
44  { 0xefedf7cc, 0x795, 0x4c38, { 0xa7, 0x49, 0xdd, 0xea, 0x80, 0xe9, 0xdf, 0x1a } };
45 
46 
55  static const GUID IImageSource_v1 =
56  { 0xd5fe39e8, 0x2501, 0x4d87, { 0x83, 0x79, 0xe8, 0x2a, 0xf9, 0x8d, 0x22, 0x83 } };
57 
66  static const GUID IWebSource_v1 =
67  { 0xacaf8ad1, 0xd7b3, 0x4b6c, { 0xa3, 0x74, 0xe7, 0x9a, 0x71, 0x89, 0x6, 0xf0 } };
68 
69 
78  static const GUID IEventHandler_v1 =
79  { 0x7442fd68, 0x30f1, 0x4d19, { 0x97, 0xc2, 0x80, 0x3, 0x1, 0x44, 0x68, 0xfd } };
80 
88  enum class PluginType
89  {
90  undefined,
91  imageSource,
92  webSource,
93  imageProcessor,
94  audioSource
95  };
96 
102  struct Version
103  {
104  uint8_t major;
105  uint8_t minor;
106  uint8_t build;
107  };
108 
114  enum class ImageFormat
115  {
116  imageRGB24,
117  imageRGBA
118  };
119 
123  class IPlugin
124  {
125  public:
129  virtual GUID iid() const = 0;
130 
134  virtual const wchar_t* getId() const = 0;
135 
139  virtual const wchar_t* getName() const = 0;
140 
144  virtual const wchar_t* getProvider() const = 0;
145 
149  virtual Version getVersion() const = 0;
150 
154  virtual PluginType getType() const = 0;
155 
159  virtual bool init() = 0;
160 
164  virtual void release() = 0;
165  };
166 
170  class ISource
171  {
172  public:
173 
177  virtual GUID iid() const = 0;
178 
182  virtual const wchar_t* getName() const = 0;
183 
187  virtual void getSize(size_t&, size_t&) const = 0;
188 
192  virtual void setCanvasSize(size_t, size_t) = 0;
193 
197  virtual void open(const wchar_t*) = 0;
198 
202  virtual void close(const wchar_t*) = 0;
203 
207  virtual void pause(const wchar_t*, bool) = 0;
208  };
209 
214  {
215  public:
227  using DataCallback = void(__stdcall*)(const wchar_t* srcId, ImageFormat format, const uint8_t* data, const size_t width, const size_t height, void* param);
228 
232  virtual GUID iid() const = 0;
233 
237  virtual ImageFormat getFormat() const = 0;
238 
242  virtual void setDataCallback(DataCallback function, void* param) = 0;
243 
244  };
245 
250  {
251  public:
252 
256  virtual GUID iid() const = 0;
257 
261  virtual const wchar_t* getUrl() const = 0;
262 
263  };
264 
269  {
270  public:
271 
275  virtual GUID iid() const = 0;
276 
280  virtual void onLoad() = 0;
281 
285  virtual void onUnload() = 0;
286 
290  virtual void onCanvasSize(size_t, size_t) = 0;
291 
295  virtual void onPosition(const wchar_t*, int, int, size_t, size_t) = 0;
296 
297  };
298 
307  // << exports >>
309  // IPlugin
310 
317  const GUID getPluginInterfaceId();
318 
325  const wchar_t* getPluginId();
326 
332  const wchar_t* getPluginName();
333 
340  const wchar_t* getPluginProvider();
341 
350 
362 
372  bool init();
373 
381  void release();
382 
390  // << exports >>
392  // IEventHandler
393 
400  const GUID getEventsInterfaceId();
401 
408  void onLoad();
409 
416  void onUnload();
417 
425  void onCanvasSize(size_t width, size_t height);
426 
437  void onPosition(const wchar_t* srcId, int x, int y, size_t width, size_t height);
438 
445  // << exports >>
447  // ISource
448 
455  const GUID getSourceInterfaceId();
456 
462  const wchar_t* getSourceName();
463 
471  void getSourceSize(size_t& width, size_t& height);
472 
482  void setCanvasSize(size_t width, size_t height);
483 
498  void openSource(const wchar_t* srcId);
499 
509  void closeSource(const wchar_t* srcId);
510 
520  void pauseSource(const wchar_t* srcId, bool val);
521 
528  // << exports >>
530  // IImageSource
531 
538  const GUID getImageInterfaceId();
539 
547 
559 
566  // << exports >>
568  // IWebSource
569 
576  const GUID getWebInterfaceId();
577 
584  const wchar_t* getWebUrl();
585 
588 }}
splitcam::plugin::getPluginProvider
const wchar_t * getPluginProvider()
splitcam::plugin::onCanvasSize
void onCanvasSize(size_t width, size_t height)
splitcam::plugin::closeSource
void closeSource(const wchar_t *srcId)
splitcam::plugin::onLoad
void onLoad()
splitcam::plugin::IImageSource_v1
static const GUID IImageSource_v1
IImageSource interface identifier {D5FE39E8-2501-4D87-8379-E82AF98D2283}.
Definition: splitcam_plugin.h:55
splitcam::plugin::IEventHandler::onCanvasSize
virtual void onCanvasSize(size_t, size_t)=0
splitcam::plugin::IPlugin::iid
virtual GUID iid() const =0
splitcam::plugin::getEventsInterfaceId
const GUID getEventsInterfaceId()
splitcam::plugin::IWebSource::getUrl
virtual const wchar_t * getUrl() const =0
splitcam::plugin::getImageFormat
splitcam::plugin::ImageFormat getImageFormat()
splitcam::plugin::onPosition
void onPosition(const wchar_t *srcId, int x, int y, size_t width, size_t height)
splitcam::plugin::ISource
Definition: splitcam_plugin.h:170
splitcam::plugin::getPluginName
const wchar_t * getPluginName()
splitcam::plugin::setDataCallback
void setDataCallback(splitcam::plugin::IImageSource::DataCallback cb, void *param)
splitcam::plugin::IPlugin::getName
virtual const wchar_t * getName() const =0
splitcam::plugin::setCanvasSize
void setCanvasSize(size_t width, size_t height)
splitcam::plugin::getImageInterfaceId
const GUID getImageInterfaceId()
splitcam::plugin::IImageSource::iid
virtual GUID iid() const =0
splitcam::plugin::ISource::close
virtual void close(const wchar_t *)=0
splitcam::plugin::PluginType
PluginType
Definition: splitcam_plugin.h:88
splitcam::plugin::getSourceSize
void getSourceSize(size_t &width, size_t &height)
splitcam::plugin::getSourceName
const wchar_t * getSourceName()
splitcam::plugin::init
bool init()
splitcam::plugin::release
void release()
splitcam::plugin::getPluginId
const wchar_t * getPluginId()
splitcam::plugin::IEventHandler::iid
virtual GUID iid() const =0
splitcam::plugin::IWebSource::iid
virtual GUID iid() const =0
splitcam::plugin::IEventHandler_v1
static const GUID IEventHandler_v1
IEventHandler interface identifier {7442FD68-30F1-4D19-97C2-8003014468FD}.
Definition: splitcam_plugin.h:78
splitcam::plugin::ImageFormat
ImageFormat
Definition: splitcam_plugin.h:114
splitcam::plugin::Version
Definition: splitcam_plugin.h:102
splitcam::plugin::pauseSource
void pauseSource(const wchar_t *srcId, bool val)
splitcam::plugin::getPluginInterfaceId
const GUID getPluginInterfaceId()
splitcam::plugin::IImageSource
Definition: splitcam_plugin.h:213
splitcam::plugin::IImageSource::DataCallback
void(__stdcall *)(const wchar_t *srcId, ImageFormat format, const uint8_t *data, const size_t width, const size_t height, void *param) DataCallback
Definition: splitcam_plugin.h:227
splitcam::plugin::IImageSource::setDataCallback
virtual void setDataCallback(DataCallback function, void *param)=0
splitcam::plugin::IPlugin_v1
static const GUID IPlugin_v1
IPlugin interface identifier {A434FC43-EED2-4EAE-A792-4B92CD916FA1}.
Definition: splitcam_plugin.h:32
splitcam::plugin::ISource::open
virtual void open(const wchar_t *)=0
splitcam::plugin::IWebSource
Definition: splitcam_plugin.h:249
splitcam::plugin::IPlugin::release
virtual void release()=0
splitcam::plugin::IImageSource::getFormat
virtual ImageFormat getFormat() const =0
splitcam::plugin::IWebSource_v1
static const GUID IWebSource_v1
IWebSource interface identifier {ACAF8AD1-D7B3-4B6C-A374-E79A718906F0}.
Definition: splitcam_plugin.h:66
splitcam::plugin::IPlugin::getVersion
virtual Version getVersion() const =0
splitcam::plugin::getWebUrl
const wchar_t * getWebUrl()
splitcam::plugin::ISource::getSize
virtual void getSize(size_t &, size_t &) const =0
splitcam::plugin::IPlugin::getProvider
virtual const wchar_t * getProvider() const =0
splitcam::plugin::IPlugin
Definition: splitcam_plugin.h:123
splitcam::plugin::ISource_v1
static const GUID ISource_v1
ISource interface identifier {EFEDF7CC-0795-4C38-A749-DDEA80E9DF1A}.
Definition: splitcam_plugin.h:43
splitcam::plugin::IPlugin::getId
virtual const wchar_t * getId() const =0
splitcam::plugin::ISource::setCanvasSize
virtual void setCanvasSize(size_t, size_t)=0
splitcam::plugin::IEventHandler::onPosition
virtual void onPosition(const wchar_t *, int, int, size_t, size_t)=0
splitcam::plugin::ISource::pause
virtual void pause(const wchar_t *, bool)=0
splitcam::plugin::IEventHandler::onUnload
virtual void onUnload()=0
splitcam::plugin::IEventHandler
Definition: splitcam_plugin.h:268
splitcam::plugin::IPlugin::getType
virtual PluginType getType() const =0
splitcam::plugin::openSource
void openSource(const wchar_t *srcId)
splitcam::plugin::IEventHandler::onLoad
virtual void onLoad()=0
splitcam::plugin::getPluginVersion
const splitcam::plugin::Version getPluginVersion()
splitcam::plugin::ISource::iid
virtual GUID iid() const =0
splitcam::plugin::getType
splitcam::plugin::PluginType getType()
splitcam::plugin::getSourceInterfaceId
const GUID getSourceInterfaceId()
splitcam::plugin::onUnload
void onUnload()
splitcam::plugin::IPlugin::init
virtual bool init()=0
splitcam::plugin::ISource::getName
virtual const wchar_t * getName() const =0
splitcam::plugin::getWebInterfaceId
const GUID getWebInterfaceId()