#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
{
int c;
while ( (c = getchar()) != '\n' && c != EOF );
fprintf( stderr, "\nPress enter to exit.\n");
while( getchar() != '\n');
sleep(1);
}
{
if (NULL == pstMVDevInfo)
{
printf("The Pointer of pstMVDevInfo is NULL!\n");
return false;
}
{
printf("CurrentIp: %d.%d.%d.%d\n" , nIp1, nIp2, nIp3, nIp4);
}
{
}
{
}
{
}
{
}
{
}
else
{
printf("Not support.\n");
}
return true;
}
{
while(1)
{
{
printf("Get One Frame: Width[%d], Height[%d], nFrameNum[%d]\n",
}
else
{
printf("No data[0x%x]\n", nRet);
}
{
break;
}
}
return 0;
}
{
do
{
{
printf("Initialize SDK fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Enum Devices fail! nRet [0x%x]\n", nRet);
break;
}
{
for (
unsigned int i = 0; i < stDeviceList.
nDeviceNum; i++)
{
printf("[device %d]:\n", i);
if (NULL == pDeviceInfo)
{
break;
}
}
}
else
{
printf("Find No Devices!\n");
break;
}
printf("Please Intput camera index: ");
unsigned int nIndex = 0;
scanf("%d", &nIndex);
{
printf("Intput error!\n");
break;
}
{
printf("Create Handle fail! nRet [0x%x]\n", nRet);
break;
}
int c;
while ( (c = getchar()) != '\n' && c != EOF );
char key;
printf("Start multicast sample in (c)ontrol or in (m)onitor mode? (c/m)\n");
scanf("%c", &key);
if((key != 'c') && (key != 'm') && (key != 'C') && (key != 'M'))
{
printf("Input error\n");
break;
}
bool monitorMode = (key == 'm') || (key == 'M');
if (monitorMode)
{
}
else
{
}
{
printf("Open Device fail! nRet [0x%x]\n", nRet);
break;
}
{
if (nPacketSize > 0)
{
{
printf("Warning: Set Packet Size fail nRet [0x%x]!\n", nRet);
}
}
else
{
printf("Warning: Get Packet Size fail nRet [0x%x]!\n", nPacketSize);
}
}
char strIp[] = "239.192.1.1";
unsigned int nIp1, nIp2, nIp3, nIp4, nIp;
sscanf(strIp, "%d.%d.%d.%d", &nIp1, &nIp2, &nIp3, &nIp4);
nIp = (nIp1 << 24) | (nIp2 << 16) | (nIp3 << 8) | nIp4;
{
printf("Set Transmission Type fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Start Grabbing fail! nRet [0x%x]\n", nRet);
break;
}
pthread_t nThreadID = 0;
if (nRet != 0)
{
printf("thread create failed.ret = %d\n",nRet);
break;
}
sleep(1);
{
printf("Stop Grabbing fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("ClosDevice fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Destroy Handle fail! nRet [0x%x]\n", nRet);
break;
}
} while (0);
{
}
printf("exit.\n");
return 0;
}