MetalSaint
MetalSaint

Reputation: 53

'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.

Upvotes: 2

Views: 744

Answers (1)

MetalSaint
MetalSaint

Reputation: 53

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

Upvotes: 1

Related Questions