Our problem is with "PCREATE_VIDOUTPUT_PLUGIN(NULLOutput)" macros.
If it used once, now problem. If it used twice problem appears.

Example of code:
PVideoOutputDevice_Screen::PVideoOutputDevice_Screen() {
PVideoOutputDevice_Screen::~PVideoOutputDevice_Screen() {
PStringArray PVideoOutputDevice_Screen::GetDeviceNames() const {
 return GetOutputDeviceNames();
PStringArray PVideoOutputDevice_Screen::GetOutputDeviceNames() {
 return "Screen";
PVideoOutputDevice_Preview::PVideoOutputDevice_Preview() {
PVideoOutputDevice_Preview::~PVideoOutputDevice_Preview() {
PStringArray PVideoOutputDevice_Preview::GetDeviceNames() const {
 return GetOutputDeviceNames();
PStringArray PVideoOutputDevice_Preview::GetOutputDeviceNames() {
 return "Preview";

During processing redefinition errors arise from macros generated code:
videodevice.cpp: In function ‘void PWLibPlugin_TriggerRegister(PPluginManager*)’:
videodevice.cpp:103: error: redefinition of ‘void PWLibPlugin_TriggerRegister(PPluginManager*)’
videodevice.cpp:86: error: ‘void PWLibPlugin_TriggerRegister(PPluginManager*)’ previously defined here
videodevice.cpp: In function ‘unsigned int PWLibPlugin_GetAPIVersion()’:
videodevice.cpp:103: error: redefinition of ‘unsigned int PWLibPlugin_GetAPIVersion()’
videodevice.cpp:86: error: ‘unsigned int PWLibPlugin_GetAPIVersion()’ previously defined here

No such problems in case if only one OutputDevice created.

On 07/16/2014 11:19 AM, Robert Jongbloed wrote:
No time right now to go into details, it should not have changed that much, and there are a number of examples in the system. The simplest would be PVideoOutputDevice_NULLOutput in vfakeio.cxx. Really not that hard.

The only real trick is if your stuff is in a static library, then you need something like:

PPLUGIN_STATIC_LOAD(NULLOutput, PVideoOutputDevice);

somewhere in a header or in the application or the linker doesn't know the plug in is needed and it doesn't load at run time.

Robert Jongbloed
OPAL/OpenH323/PTLib Architect and Co-founder.
Commercial support at http://www.voxlucida.com.au

On 16/07/2014 12:13 AM, Alexander Sbitnev wrote:
   Is there a way to create two of new videodevices/plugins with new 

Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.

Opalvoip-devel mailing list