2

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

知道为什么它会出错吗?

谢谢。

4

1 回答 1

1

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

修复将代码更改为

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

然后初始化

capturer = new CameraVideoCapturer()

修复了它

于 2019-11-13T11:11:35.690 回答