久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <legend id='Ax6It'><style id='Ax6It'><dir id='Ax6It'><q id='Ax6It'></q></dir></style></legend>

      1. <i id='Ax6It'><tr id='Ax6It'><dt id='Ax6It'><q id='Ax6It'><span id='Ax6It'><b id='Ax6It'><form id='Ax6It'><ins id='Ax6It'></ins><ul id='Ax6It'></ul><sub id='Ax6It'></sub></form><legend id='Ax6It'></legend><bdo id='Ax6It'><pre id='Ax6It'><center id='Ax6It'></center></pre></bdo></b><th id='Ax6It'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Ax6It'><tfoot id='Ax6It'></tfoot><dl id='Ax6It'><fieldset id='Ax6It'></fieldset></dl></div>
        <tfoot id='Ax6It'></tfoot>
          <bdo id='Ax6It'></bdo><ul id='Ax6It'></ul>

        <small id='Ax6It'></small><noframes id='Ax6It'>

        如何獲取 Windows 上的視頻捕獲設(shè)備(網(wǎng)絡(luò)攝像頭

        How to get a list of video capture devices (web cameras) on windows? (C++)(如何獲取 Windows 上的視頻捕獲設(shè)備(網(wǎng)絡(luò)攝像頭)列表?(C++))
      2. <small id='LHdvH'></small><noframes id='LHdvH'>

        <legend id='LHdvH'><style id='LHdvH'><dir id='LHdvH'><q id='LHdvH'></q></dir></style></legend>
        • <i id='LHdvH'><tr id='LHdvH'><dt id='LHdvH'><q id='LHdvH'><span id='LHdvH'><b id='LHdvH'><form id='LHdvH'><ins id='LHdvH'></ins><ul id='LHdvH'></ul><sub id='LHdvH'></sub></form><legend id='LHdvH'></legend><bdo id='LHdvH'><pre id='LHdvH'><center id='LHdvH'></center></pre></bdo></b><th id='LHdvH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LHdvH'><tfoot id='LHdvH'></tfoot><dl id='LHdvH'><fieldset id='LHdvH'></fieldset></dl></div>
        • <tfoot id='LHdvH'></tfoot>
            <tbody id='LHdvH'></tbody>

              <bdo id='LHdvH'></bdo><ul id='LHdvH'></ul>
                • 本文介紹了如何獲取 Windows 上的視頻捕獲設(shè)備(網(wǎng)絡(luò)攝像頭)列表?(C++)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  所以我們有一個(gè)簡(jiǎn)單的 C++ win32 控制臺(tái)應(yīng)用程序.我們想要的只是打印可用的網(wǎng)絡(luò)攝像機(jī)和其他視頻捕獲設(shè)備的列表.我們想盡可能多地使用 windows api - 沒(méi)有外部庫(kù) - 畢竟 - 我們想要的只是打印出一個(gè)列表 - 而不是飛上月球!)如何做這樣的事情?

                  So we have a simple C++ win32 console app. All we want is to print list of web cameras and other video capture devices that are avaliable. We want to use windows apis as much as possible - no external libs - after all - all we want is to print out a a list - not to fly onto the moon!) How to do such thing?

                  我自己的研究:我找到了這個(gè) official msdn sample 但我仍然不知道如何將設(shè)備列表輸出到屏幕上=((抱歉 - 我是 C++ 新手)

                  My own reserch: I found this official msdn sample but I still do not get how to output device list onto screen=( (sorry - I am new to C++)

                  ...更多的研究...

                  ... some more reserch...

                  在最簡(jiǎn)單的 ms 主題示例之一中發(fā)現(xiàn)了這個(gè)

                  In one of simpliest ms samples on topic found this

                  HRESULT OnInitDialog(HWND hwnd, ChooseDeviceParam *pParam)
                  {
                      HRESULT hr = S_OK;
                  
                      HWND hList = GetDlgItem(hwnd, IDC_DEVICE_LIST);
                  
                      // Display a list of the devices.
                  
                      for (DWORD i = 0; i < pParam->count; i++)
                      {
                          WCHAR *szFriendlyName = NULL;
                  
                          hr = pParam->ppDevices[i]->GetAllocatedString(
                              MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME,
                              &szFriendlyName,
                              NULL
                              );
                  
                          if (FAILED(hr))
                          {
                              break;
                          }
                  
                          int index = ListBox_AddString(hList, szFriendlyName);
                  
                          ListBox_SetItemData(hList, index, i);
                  
                          CoTaskMemFree(szFriendlyName);
                      }
                  

                  看起來(lái)應(yīng)該可以完成這項(xiàng)工作,但我不知道如何將其包含在簡(jiǎn)單的命令行應(yīng)用程序中以輸出數(shù)據(jù)...

                  looks like it should do the job but I do not get how to include this into simple command line app so to output data...

                  也來(lái)自這個(gè)系列:

                  • 如何在 Linux 上獲取視頻捕獲設(shè)備列表? 和 有關(guān)獲取相機(jī)名稱的特殊詳細(xì)信息 并提供正確的、經(jīng)過(guò)測(cè)試的答案
                  • 如何在 Mac OS 上獲取視頻捕獲設(shè)備的列表?正確的,尚未經(jīng)過(guò)我的回答測(cè)試
                  • 如何獲取 Windows 上的視頻捕獲設(shè)備列表? 提供正確的、經(jīng)過(guò)測(cè)試的答案
                  • 如何使用 Qt(跨平臺(tái))獲取視頻捕獲設(shè)備名稱列表?
                  • How to get a list of video capture devices on linux? and special details on getting cameras NAMES with correct, tested answers
                  • How to get a list of video capture devices on Mac OS? with correct, not yet tested by my answers
                  • How to get a list of video capture devices on windows? with correct, tested answers
                  • How to get a list video capture devices NAMES using Qt (crossplatform)?

                  推薦答案

                  從顯示的示例中,將以下代碼復(fù)制到 dev.c 中.然后打開(kāi)設(shè)置了所有 SDK 變量的命令行.在命令行鏈接到 ole32.lib 和 oleaut32.lib.然后它會(huì)顯示所有設(shè)備.

                  From the examples shown, copy the following code into dev.c. Then open the command line with all the SDK variables set. At the command line link to ole32.lib and oleaut32.lib. It will then show you all the devices.

                  cl dev.c ole32.lib oleaut32.lib

                  cl dev.c ole32.lib oleaut32.lib

                  dev.exe 會(huì)在命令行中給出列表.

                  dev.exe will give out the list on the command line.

                  #include <windows.h>
                  #include <dshow.h>
                  
                  #pragma comment(lib, "strmiids")
                  
                  HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum)
                  {
                      // Create the System Device Enumerator.
                      ICreateDevEnum *pDevEnum;
                      HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,  
                          CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pDevEnum));
                  
                      if (SUCCEEDED(hr))
                      {
                          // Create an enumerator for the category.
                          hr = pDevEnum->CreateClassEnumerator(category, ppEnum, 0);
                          if (hr == S_FALSE)
                          {
                              hr = VFW_E_NOT_FOUND;  // The category is empty. Treat as an error.
                          }
                          pDevEnum->Release();
                      }
                      return hr;
                  }
                  
                  
                  void DisplayDeviceInformation(IEnumMoniker *pEnum)
                  {
                      IMoniker *pMoniker = NULL;
                  
                      while (pEnum->Next(1, &pMoniker, NULL) == S_OK)
                      {
                          IPropertyBag *pPropBag;
                          HRESULT hr = pMoniker->BindToStorage(0, 0, IID_PPV_ARGS(&pPropBag));
                          if (FAILED(hr))
                          {
                              pMoniker->Release();
                              continue;  
                          } 
                  
                          VARIANT var;
                          VariantInit(&var);
                  
                          // Get description or friendly name.
                          hr = pPropBag->Read(L"Description", &var, 0);
                          if (FAILED(hr))
                          {
                              hr = pPropBag->Read(L"FriendlyName", &var, 0);
                          }
                          if (SUCCEEDED(hr))
                          {
                              printf("%S
                  ", var.bstrVal);
                              VariantClear(&var); 
                          }
                  
                          hr = pPropBag->Write(L"FriendlyName", &var);
                  
                          // WaveInID applies only to audio capture devices.
                          hr = pPropBag->Read(L"WaveInID", &var, 0);
                          if (SUCCEEDED(hr))
                          {
                              printf("WaveIn ID: %d
                  ", var.lVal);
                              VariantClear(&var); 
                          }
                  
                          hr = pPropBag->Read(L"DevicePath", &var, 0);
                          if (SUCCEEDED(hr))
                          {
                              // The device path is not intended for display.
                              printf("Device path: %S
                  ", var.bstrVal);
                              VariantClear(&var); 
                          }
                  
                          pPropBag->Release();
                          pMoniker->Release();
                      }
                  }
                  
                  void main()
                  {
                      HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
                      if (SUCCEEDED(hr))
                      {
                          IEnumMoniker *pEnum;
                  
                          hr = EnumerateDevices(CLSID_VideoInputDeviceCategory, &pEnum);
                          if (SUCCEEDED(hr))
                          {
                              DisplayDeviceInformation(pEnum);
                              pEnum->Release();
                          }
                          hr = EnumerateDevices(CLSID_AudioInputDeviceCategory, &pEnum);
                          if (SUCCEEDED(hr))
                          {
                              DisplayDeviceInformation(pEnum);
                              pEnum->Release();
                          }
                          CoUninitialize();
                      }
                  }
                  

                  這篇關(guān)于如何獲取 Windows 上的視頻捕獲設(shè)備(網(wǎng)絡(luò)攝像頭)列表?(C++)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Why do two functions have the same address?(為什么兩個(gè)函數(shù)的地址相同?)
                  Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復(fù)制構(gòu)造的?)
                  mixing templates with polymorphism(混合模板與多態(tài)性)
                  When should I use the keyword quot;typenamequot; when using templates(我什么時(shí)候應(yīng)該使用關(guān)鍵字“typename?使用模板時(shí))
                  Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標(biāo)準(zhǔn)庫(kù))
                  gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數(shù)模板,而 clang 不能)

                  <small id='u6DQa'></small><noframes id='u6DQa'>

                  <tfoot id='u6DQa'></tfoot>

                  <legend id='u6DQa'><style id='u6DQa'><dir id='u6DQa'><q id='u6DQa'></q></dir></style></legend>

                        • <bdo id='u6DQa'></bdo><ul id='u6DQa'></ul>
                            <tbody id='u6DQa'></tbody>

                          1. <i id='u6DQa'><tr id='u6DQa'><dt id='u6DQa'><q id='u6DQa'><span id='u6DQa'><b id='u6DQa'><form id='u6DQa'><ins id='u6DQa'></ins><ul id='u6DQa'></ul><sub id='u6DQa'></sub></form><legend id='u6DQa'></legend><bdo id='u6DQa'><pre id='u6DQa'><center id='u6DQa'></center></pre></bdo></b><th id='u6DQa'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='u6DQa'><tfoot id='u6DQa'></tfoot><dl id='u6DQa'><fieldset id='u6DQa'></fieldset></dl></div>
                          2. 主站蜘蛛池模板: 久久久久久91香蕉国产 | 99精品视频网 | 夜夜草 | 久久久精品视频一区二区三区 | 欧美不卡在线 | 亚洲情综合五月天 | 毛片免费观看 | 免费久久久 | 中文在线一区 | 久久精品99国产精品日本 | 天天弄天天操 | 午夜激情网 | 日本成人在线网址 | 亚洲国产欧美日韩 | 欧美成人精品一区二区三区 | 视频一区二区三区四区五区 | 一本色道精品久久一区二区三区 | 最新国产精品 | 欧美1区 | 国产精品久久久久一区二区三区 | 综合久久一区 | 国产1区2区在线观看 | 一区二区在线 | 三级成人在线 | 亚洲国产成人精品久久久国产成人一区 | 亚洲一区国产 | 国产高清在线精品一区二区三区 | 午夜在线观看视频 | 91视视频在线观看入口直接观看 | 欧美成人一区二区 | 91在线免费观看 | 亚洲日本国产 | 91国在线观看 | 91激情视频 | 国产在线观看一区二区 | 国产成人精品久久二区二区91 | 最新中文字幕在线 | 精品中文字幕一区二区 | 91看片网 | 亚洲一区二区三区免费在线观看 | 91在线播|