Users Manual – svs4021, svs2020,svs2050, svs2051, svs1020, svs1050, svs285, svs340, svs625
p. 72
Last Update 20.07.2009
Programming interface
When opening a camera, an application is supposed to check whether the
camera streams already in multicast mode using the function:
Camera_getMulticastMode()
The multicast mode will be one of the following items:
MULTICAST_MODE_NONE
MULTICAST_MODE_LISTENER
MULTICAST_MODE_CONTROLLER
If the camera is already streaming in multicast mode then the application can
connect to the camera but as listening application (
MULTICAST_MODE_LISTENER
).
Otherwise, if a camera is still idle (
MULTICAST_MODE_NONE
), an application can
request for a multicast session by switching a camera’s mode to “multicast”
(
MULTICAST_MODE_CONTROLLER
) before opening the streaming channel. The
appropriate function is:
Camera_setMulticastMode()
Afterwards the application might check the automatically generated IP for the
multicast group in the “232.x.x.x” range using the following function:
Camera_getMulticastGroup()
Packet size consideration
A controlling application will usually open a streaming channel at the highest
available packet size, e.g. 16112 bytes. If another application connects to that
already running streaming channel then a packet size problem may arise if the
listening application has not at least the packet size available that the image
stream is currently working with.
Therefore a controlling application is supposed to limit the packet size of the
image data stream to a value which allows all intended listening applications to
connect to that image stream.
If a listening application encounters a packet size problem, it will usually receive
the start and stop packages of each image since those are of small size. This
causes a progress of image statistics like image counter, however, there will be
no image data (image payload) available. The packet size has to be reduced in
this case by the controlling application in order to allow all listening applications
for receiving all image payload data properly.
An application might choose to display a message to the user in the above
described case like “
Image payload missing. Multicast packet size too big?
“ as it was
done in the “SVGigE_Example.VC8” application in the SDK.
17.10.10
Receiving messages asynchronously
An application can receive messages like e.g. “start of transfer” asynchronously
in three different ways:
1. by registering an event callback
2. by using a blocking call when asking for new messages
3. by polling the event FIFO at arbitrary time
Before receiving any messages by event, an application will have to create a
new event and then register one or multiple message types against that event.
Afterwards, one of the above methods can be used for receiving events.