SetAdvancedOptions
Top  Previous  Next

Description

Sets advanced operational parameters for the virtual camera.

[C++]
int
 SetAdvancedOptions(const AdvancedOptions* advOpt);


Parameters
[C/C++]
 
[in] const AdvancedOptions* advOpt  
Pointer to an AdvancedOptions structure containing the following fields:  
 
   bool
 disorderEnabled [false]

     
If true, enables packets to be sent in a random order.
   
   bool
 dropEnabled [false]
     
If true, enables the packet drop simulation. 
   
   unsigned
 int dropPeriod [1]
    Interval in frames between packet drops.    
   
   unsigned
 int
 dropFrom [0]
     Index of the first packet in a frame to be dropped.    
  
   unsigned
 int dropCount [1] 
     
The amount of sequential packets to drop in a frame.
   
   unsigned
 int interPacketDelay [0]
     
The delay to insert between sequential stream packets in timestamp units.

   unsigned
 int readDelay [0]
     
Time in milliseconds which will take for the virtual camera reply to a read command.
   
   unsigned
 int writeDelay [0]
     
Time in milliseconds which will take for the virtual camera reply to a write command.
   
   unsigned
 int readAttempts [0]
     
The number of repetitions of each read request necessary for the virtual camera to respond.
   
   unsigned
 int writeAttempts [0]
     
The number of repetitions of each write request necessary for the virtual camera to respond.
   
   unsigned
 int discoveryDelay [0]
     
Time in milliseconds which will take the virtual camera to respond to a discovery request from a client application

   unsigned
 int discoveryAttempts [0]
     
The number of repetitions of each discovery request necessary for the virtual camera to respond with a discovery message   
   
   

Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_INVALIDARG  
Unsupported format  
 
 
Example
 
This line of code sets up the packet drop options. As a result, 2 consecutive packets will be dropped in every 4th frame starting from packet #10:

CGevCamera::AdvancedOptions options;  
memcpy(&options, 0, sizeof(CGevCamera::AdvancedOptions));  
options.dropEnabled=true;  
options.dropPeriod=3;  
options.dropFrom=10;  
options.dropCount=2;  
options.interPacketDelay=htonl(1000);  
m_pCamera->SetAdvancedOptions(&options);  
 

Remarks


Use this method allows you to simulate unusual and erroneous conditions for a virtual camera.

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