当前位置: 首页>>代码示例>>C++>>正文


C++ CDevice::GetSupportedDimensions方法代码示例

本文整理汇总了C++中CDevice::GetSupportedDimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ CDevice::GetSupportedDimensions方法的具体用法?C++ CDevice::GetSupportedDimensions怎么用?C++ CDevice::GetSupportedDimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDevice的用法示例。


在下文中一共展示了CDevice::GetSupportedDimensions方法的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;

//.........这里部分代码省略.........
开发者ID:xiaobinshe,项目名称:multitv,代码行数:101,代码来源:main.cpp


注:本文中的CDevice::GetSupportedDimensions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。