Streaming media data

If the plugin listens to server events of type “peCreateNewVideoData” all timing issues are handled by the server. The plugin only has to react on these events and should deliver an actual image each time this event is fired.

 

The server calculates the needed triggering rate depending on the settings for that device channel. Live streaming as well as permanent and event recording settings are comprised.

 

If a device handles more than one channel the calculation combines all settings of all device channels. The method “EventTriggeredForWhichChannel” of the device can be used to identify the channel, for which an image should be created.

 

After the server requests a new image the plugin should push it to the server by using the streamer interface. The following example (in pseudo code) should demonstrate this:

 

switch (pluginEvent)

{

case peCreateNewVideoData: 

{

 // the server requests a new imag

 

if(iPCamJPEGDevice->CreateSnapshot(jPEGPic, MAXPICSIZE, jPEGPicSize))

{

// give the new image to the GeViScope server

streamer->PushJpeg(0, jPEGPic, jPEGPicSize);

}

break;

}

 

For pushing bitmaps into the server the method “PushBitmapAsJpeg” should be used. Please note, that the bitmaps are compressed into JPEG graphics, which needs a lot of CPU performance.