SetChunkMode
Top  Previous  Next

Description

Enables/disables the chunk streaming mode and sets the size of the chunk data block.

[C++]
int
 SetChunkMode(unsigned int chunkSize, unsigned int chunkCount, unsigned int channelIndex=0);


Parameters
[C/C++]
 
[in] unsigned int chunkSize  
Integer value specifying the total size of the chunk data fields in bytes. If zero, no chunk data will be added to image frames.  
 
[in] unsigned int chunkCount  
Integer value specifying the amount of chunk data fields. If zero, no chunk data will be added to image frames.  
 
[in] unsigned int channelIndex  
Index of the associated stream channel. Possible values are 0 or 1.  
 
Return Values

S_OK  
Success  
E_FAIL  
Failure  
 

Example

This fragment of code instantiates a camera object and initiates the chunk mode with 2 data fields of the integer and float types:

static CGevCamera* m_pCamera;  
m_pCamera = createCamera();  
m_pCamera->SetStreamChannelCount(1);  
.......  
int iSize=sizeof (int) + sizeof (float);  
m_pCamera->SetChunkMode(iSize, 2);  
 

Remarks


When the chunk streaming mode is enabled, each frame will contain one or several chunk data fields following the image data. This method informs GigESim of the size of the chunk data block that will be appended to image data in each frame. As a result, the payload size will change accordingly.

Note that you must explicitely call SetStreamChannelCount prior to calling SetChunkMode.

Note that the camera must be in the disconnected state in order for this method to work.

The channelIndex parameter should be used only if your virtual camera must support multiple streaming channels. For a regular GigE Vision transfer this parameter should remain in its default zero value.