Registering a device

After the second call of the function “GSCMediaPluginRequest” (with parameter “request” is set to “prPluginRegisterDevices”) the plugin DLL can register one or multiple devices. This is done by calling the global function “SetSimpleDevice”.

 

The user can create device instances of registered devices by using GSCSetup. Actually only one instance per device can be created. So as a workaround the plugin should register multiple devices of the same type. A later version of GeViScope will arrange this procedure more smooth and transparently.

 

The following example (in pseudo code) should demonstrate the registration of 16 devices of the same type:

case prPluginRegisterDevices:

{

// register 16 devices to support maximal 16 IP cams

for(int i = 1; i <= 16; ++i)

{

// plugin (device) name and serial

wstring PluginName(L"VS2008CPP_IPCamJPEG");

wstring PluginSerial(PluginName);

wchar_t Buf[1024];

_itow_s(i, Buf, 1024, 10);

PluginSerial += L" ";

PluginSerial += Buf;

PluginSerial += L" ";

PluginSerial += L" Serial";

// device properties

const DevicePropertiesEx

localDeviceProperties(

1,

0,

0,

PluginName.c_str(),

PluginSerial.c_str(),

L"VS2008CPP - IP-Cam-JPEG-Example",

GSCMediaPlugins::pcIPCameraPlugin,

0);

 

// register the device

SetSimpleDevice(pluginHandler, MediaDataLoop, localDeviceProperties, i,

GetDefaultSettings(pluginHandler));

}

break;

}

 

If the media plugin that should be developed is an IP camera driver or an driver for a video encoder, the property "description" of the structure "DevicePropertiesEx" should follow a special naming convention:

 

DevicePropertiesEx.description = L"#Manufacturer IPC";

 

This ensures the consistent presentation of this plugin like all IP camera drivers in a future version of the GeViScope software especially in GSCSetup.