本文整理汇总了C++中CDevice::GetDevId方法的典型用法代码示例。如果您正苦于以下问题:C++ CDevice::GetDevId方法的具体用法?C++ CDevice::GetDevId怎么用?C++ CDevice::GetDevId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDevice
的用法示例。
在下文中一共展示了CDevice::GetDevId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
if (argc != 2)
{
printf("Usage: %s [video device index]\n", argv[0]);
return 0;
}
gtk_init(&argc, &argv);
if (atoi(argv[1]) < 0)
{
ScreenDevice dev;
dev.Init(1);
CGui gui(dev);
gui.CreateWindow();
return 0;
}
CamAbstractionLayerV4L cam;
cam.Init(atoi(argv[1]));
CDevice *pDevice = cam.GetDevice();
if (!pDevice)
{
printf("Cannot get device!\n");
return 0;
}
std::string deviceName = pDevice->GetDevId();
printf("device: %s selected\n", deviceName.c_str());
printDevCapabilities(deviceName);
std::deque<DeviceInput> inputList;
cam.GetInputList(inputList);
printf("\n");
printf("This device has %u inputs\n", inputList.size());
printf("\n");
for (int index=0; index<inputList.size(); index++)
printf("index: %u - name: %s\n", inputList[index].index, inputList[index].name.c_str());
printf("\n");
int selectedInput = 0;
if (inputList.size() > 1)
{
printf("\n");
char szInput[10];
printf("\n");
printf("Choose input:\n");
printf("\n");
printf("Input: "); scanf("%s", szInput);
selectedInput = atoi(szInput);
cam.SelectInput(selectedInput);
}
printf("\"%s\" selected\n", inputList[selectedInput].name.c_str());
std::deque<PixFmt> pixFmtList;
std::deque<FrameDimension> dimensionList;
std::string pixFmtDesc;
pDevice->GetSupportedPixelFmt(pixFmtList);
printf("\n");
printf("This device supports %u types of pixel format\n", pixFmtList.size());
printf("We list them below:\n");
printf("\n");
unsigned uMenuItem = 0;
for (unsigned i=0; i < pixFmtList.size(); i++)
{
pDevice->GetSupportedDimensions(pixFmtList[i], dimensionList);
GetPixFmtDesc(pixFmtList[i], pixFmtDesc);
for (unsigned j=0; j < dimensionList.size(); j++)
printf("%u. %s - %ux%u\n", ++uMenuItem, pixFmtDesc.c_str(), dimensionList[j].uWidth, dimensionList[j].uHeight);
printf("\n");
}
unsigned standardsCount=0;
cam.GetAnagStdCount(standardsCount);
printf("\n");
printf("This device has %u standards\n", standardsCount);
printf("\n");
if (standardsCount)
{
int stdCounter=0;
std::deque<AnagVideoStd> allAvailableStds;
//.........这里部分代码省略.........