javaandroidwebrtcwebrtc-android

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


with google webrtc I've been facing this issue and this is the code for creating a video source

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

but I'm getting an error

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

any idea on why its giving an error?

thanks.


Solution

  • Well, I fixed after 10 hours,

    the fix is changing the code to

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

    and then initializing

    capturer = new CameraVideoCapturer()
    

    that fixed it