question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Step-1: SurfaceViewRenderer cannot be converted to Callbacks

See original GitHub issue

Hello, I am doing the very first step but I met a problem in the last line of code in MainActivity:

localVideoTrack.addRenderer(new VideoRenderer(videoView));

Is this connected with the library which I use? I got it from here: implementation 'org.webrtc:google-webrtc:1.0.23171'

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
kostyabakaycommented, Dec 9, 2020

@soommy12 thank you! Your comment helped me a lot.

1reaction
soommy12commented, Jun 15, 2018

Hello @niroj08 , according to the official Android WebRTC example here (which is, unfortunately, a little bit complicated) you should create a private class which extends VideoSink:

private static class ProxyVideoSink implements VideoSink { private VideoSink target; @Override synchronized public void onFrame(VideoFrame frame) { if (target == null) { Logging.d(TAG, "Dropping frame in proxy because target is null."); return; } target.onFrame(frame); } synchronized void setTarget(VideoSink target) { this.target = target; } }

Then, you need to create it: private final ProxyVideoSink localProxyVideoSink = new ProxyVideoSink();

and instead of adding a new render you add this sink to local video track: localVideoTrack.addSink(localProxyVideoSink);

Read more comments on GitHub >

github_iconTop Results From Across the Web

webrtc/sdk/android/api/org/webrtc/SurfaceViewRenderer.java
VideoRenderer.Callbacks by displaying the video stream on a SurfaceView. * renderFrame() is asynchronous to avoid blocking the calling thread.
Read more >
How to add callback: cannot be converted to ... - Stack Overflow
I am gotten this code from an online tutorial but it doesn't seem to work. android · google-api · Share.
Read more >
SurfaceViewRenderer (Video Android 6.4.1)
Register a callback to be invoked when a new video frame has been received. void, clearImage(). Post a task to clear the SurfaceView...
Read more >
SurfaceHolder.Callback - Android Developers
holder, SurfaceHolder : The SurfaceHolder whose surface has changed. This value cannot be null . format, int : The new PixelFormat of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found