Java ';createVideoSource(布尔)和#x27;在';org.webrtc.PeerConnectionFactory';无法应用于';(org.webrtc.CameraVideoCapturer)和#x27;
在GoogleWebRTC中,我一直面临着这个问题,这是创建视频源的代码Java ';createVideoSource(布尔)和#x27;在';org.webrtc.PeerConnectionFactory';无法应用于';(org.webrtc.CameraVideoCapturer)和#x27;,java,android,webrtc,webrtc-android,Java,Android,Webrtc,Webrtc Android,在GoogleWebRTC中,我一直面临着这个问题,这是创建视频源的代码 private VideoTrack getVideoTrack() { this.capturer = createCapturer(); return factory.createVideoTrack("video1", factory.createVideoSource(this.capturer)); } 但我有个错误 'createVideoSource(boolean)' in 'org.we
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()
这解决了它这似乎是一个依赖版本问题。你能给我们展示一下你的build.gradle模块吗?在另一个函数中,它的PeerConnectionFactory.initialize(PeerConnectionFactory.InitializationOptions.builder(c.createInitializationOptions());factory=PeerConnectionFactory.builder().createPeerConnectionFactory();我已经切换到一个旧版本的webrtc,但没有运气,因为所有的代码都是基于新版本的,即使在网上我也找到了一些例子,但它仍然给出了错误,而且gradle是3.1.3依赖项{implementation'com.google.zxing:core:3.4.0'implementation'org.webrtc:google webrtc:1.0.28513'Github上的代码您在哪里看到错误?在运行时?