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

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

使用 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()

修复了它