LockFormat
|
![]() ![]() ![]() |
|
[in] unsigned int channelIndex
|
Index of the associated stream channel. Possible values are 0 or 1.
|
|
S_OK
|
Success
|
E_FAIL
|
Failure
|
void CGigemuDlg::videoGenerator()
|
{
|
int width;
|
int height;
|
int i=0;
|
char buffer[MAXWIDTH*MAXHEIGHT];
|
char *ptr;
|
while (!m_exitThread)
|
{
|
m_pCamera->LockFormat();
|
width=m_pCamera->GetWidth();
|
height=m_pCamera->GetHeight();
|
for (ptr=buffer; ptr < buffer+width*heigh; ptr++)
|
*ptr=i++;
|
m_pCamera->SendImage(buffer);
|
}
|
}
|
1) It allows you to start your image streaming cycle without waiting for the client application to issue the AcquisitionStart command. LockFormat will block the execution of the thread until the AcquisitionStart command is received from the client.
|
2) It lets you generate your images based on the image size and format returned by GetWidth, GetHeight and GetPixelFormat without being concerned about those parameters being modified by the client application in the middle of the image transfer. If a format change request is received from the client, LockFormat will block the execution of the thread until the virtual camera finalizes the format change procedure.
|