简体   繁体   English

在Win32应用中选择捕获设备

[英]Choosing capture devices in Win32 app

I have an Win32 application based on Chromium Embedded Framework (CEF3) API. 我有一个基于Chromium嵌入式框架(CEF3)API的Win32应用程序。 In embedded browser window displays the web-page, that uses WebRTC-connection to communicate with another side that has the same application. 在嵌入式浏览器窗口中显示网页,该网页使用WebRTC连接与具有相同应用程序的另一端进行通信。 So we have real-time videochat between two sides. 因此,我们在双方之间进行了实时视频聊天。

Now I should provide users an ability to choose capture devices (microphone and webcam) for WebRTC session if the system has several ones, because browser window captures only default devices. 现在,如果系统有多个设备,我应该为用户提供选择用于WebRTC会话的捕获设备(麦克风和网络摄像头)的能力,因为浏览器窗口仅捕获默认设备。 The problem is that CEF3 API doesn't provide that functionality (documentation nothing says about it, also there are no answers on official CEF forum in topic about this question ). 问题在于CEF3 API不提供该功能(文档对此没有任何说明,在官方CEF论坛上也没有关于该问题的解答 )。

Is there any way to implement that task via Win32 API? 有什么方法可以通过Win32 API来实现该任务吗? I found some information about how to enumerate devices (using SetupDi* functions, using DirectShow API), but not about how to enable/disable a specific device for my app. 我找到了一些有关如何枚举设备的信息(使用SetupDi *函数,使用DirectShow API),但没有找到有关如何为我的应用启用/禁用特定设备的信息。 What exactly I should use for solve this problem? 我究竟应该使用什么来解决这个问题?

Advice please, I'll be thankful for any help. 请提供建议,我将感谢您的帮助。 It will be nice to see the code examples, if possible. 如果可能的话,很高兴看到代码示例。

Take a look at microsoft samples of directshow. 看一下DirectShow的Microsoft示例。 It's all over there. 在那边。 https://msdn.microsoft.com/en-us/library/windows/desktop/dd375468(v=vs.85).aspx https://msdn.microsoft.com/zh-CN/library/windows/desktop/dd375468(v=vs.85).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM