c++ - 如何从 qml webgl 获取麦克风到 c++?

标签 c++ qml webrtc gstreamer

我正在使用 Qt 和 Qml 进行调用软件,我需要从作为 webgl 运行的 Qml 获取麦克风馈送到 C++ 端,如果不是使用服务器直接到 GStreamer。

我已经有一个 Qt 程序作为客户端使用 GStreamer 将音频流推送到服务器。当然,GStreamer 不会转到 webgl 客户端。我发现,您可以从 Qml 获得使用麦克风/相机的权限,但我还没有找到任何实际从那里获取流的示例。我还检查了 WebRTC 的用法。它似乎可以与 Qml 一起使用,我已经找到了一些将它与 GStreamer 一起使用的示例,但即使使用这些示例,我也无法获得 WebRTC 和 GStreamer 的组合。

所以完整的问题: 如何从作为 webgl 运行的 Qml 获取音频? Qt 中有什么方法还是我必须通过 WebRTC?如果是这样,是否有比 Nirbheek's gstwebrtc demos 更简单或更适合初学者的示例?用于将 WebRTC 连接到 GStreamer?

最佳答案

Not the answer I wanted, but this ended up working in my case:

As the C++ side is also running another Qt GUI, Qml to be specific, I can use WebEngineView with html and javascript to never bother the C++ implementation with GStreamer for WebRTC. So currently I'm running PeerJS on both sides of the connection with PeerJS' signaling server in between.

I'd have preferred to use C++ with GStreamer to connect to WebRTC, but I can't find other easy way for me to connect browser's audio to Qt.

编辑:我很抱歉,这个答案最终不起作用。我一直在一台计算机上测试这些程序,因此我没有意识到 WebGL 托管的 Qml 没有在前端运行 WebEngineView 的 Javascript,而是在后端运行。

关于c++ - 如何从 qml webgl 获取麦克风到 c++?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57094736/

相关文章:

c++ - 如何中断绑定(bind)到 istream_iterator 的输入流

qt - QML:如何实现子级的信号处理程序

android - 启动 Qt/QML android 应用程序时如何立即显示启动画面?

javascript - 调用非父对象的函数

c++ - 代码行 1 中的 '(void)' 有什么用?

C++ 多重逻辑运算符

webrtc - 在浏览器和Electron平台中使用WebRTC API共享P2P文件

ffmpeg - 来自 OpenGL 的 WebRTC H264 视频直播流 (w FFMPEG)

c# - 如何将 getUserMedia 与 geckofx 一起使用

c++ - 如何销毁由 std::thread 显式创建的线程?