'org.webrtc.PeerConnectionFactory'中的'createVideoSource(boolean)'不能应用于'(org.webrtc.CameraVideoC



在谷歌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)'

知道为什么会出错吗?

谢谢。

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

修复方法是将代码更改为

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

然后初始化

capturer = new CameraVideoCapturer()

修复了

最新更新