gpt4 book ai didi

java - 'createVideoSource(boolean )' in ' org.webrtc.PeerConnectionFactory' 不能应用于 '(org.webrtc.CameraVideoCapturer)'

转载 作者:行者123 更新时间:2023-11-30 04:57:50 24 4
gpt4 key购买 nike

使用 google webrtc 我一直面临这个问题,这是创建视频源的代码

private VideoTrack getVideoTrack() {
this.capturer = createCapturer();
return factory.createVideoTrack("video1", factory.createVideoSource(this.capturer));
}

但是我遇到了一个错误

'createVideoSource(boolean)' in 'org.webrtc.PeerConnectionFactory' cannot be applied to '(org.webrtc.CameraVideoCapturer)'

any idea on why its giving an error?

谢谢。

最佳答案

好吧,我在 10 小时后修好了,

修复是将代码更改为

private VideoTrack getVideoTrack() {
this.capturer = createCapturer();
assert this.capturer != null;
return factory.createVideoTrack("video1", factory.createVideoSource(this.capturer.isScreencast()));
}

然后初始化

capturer = new CameraVideoCapturer()

修好了

关于java - 'createVideoSource(boolean )' in ' org.webrtc.PeerConnectionFactory' 不能应用于 '(org.webrtc.CameraVideoCapturer)',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58820006/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com