Android 版 WebRTC : VideoRendererGUI 在视频通话中截取屏幕截图 [英] WebRTC for Android : VideoRendererGUI take a screenshot in the video call
问题描述
需求是在视频通话中保存一个视频帧.我做了一个演示,通过 GLSurfaceView 的方法onDrawFrame"截取屏幕截图.但是当我使用webrtc时,它有自己的渲染器VideoRendererGUI".然后当我想覆盖它时,我发现它无法被覆盖.主要部分代码:
The demand is that saving a video frame in the video call. I have made a demo that take a screenshot through the GLSurfaceView's method "onDrawFrame". But when I use the webrtc, it have its own renderer "VideoRendererGUI" .And then when I want to override it, I find it can't be overrided. the main part code :
vsv = (GLSurfaceView) findViewById(R.id.glviewchild_call);
vsv.setPreserveEGLContextOnPause(true);
vsv.setKeepScreenOn(true);
VideoRendererGui.setView(vsv, new Runnable() {
@Override
public void run() {
init();
}
});
如果你有其他截屏方式,也可以分享给我.非常感谢!
And If you have another way to take a screenshot, you can also share with me. Thanks a lot!
推荐答案
如果使用 SurfaceViewRenderer 来显示流,可以使用 这个答案 在通话中捕捉帧.
If you use a SurfaceViewRenderer to display the stream, you can use the solution in this answer to capture a frame on the call.
基本上,将 surfaceViewRenderer.AddFrameListener
与实现 EGLRenderer.FrameListener
Basically, using surfaceViewRenderer.AddFrameListener
with a class that implements EGLRenderer.FrameListener
这篇关于Android 版 WebRTC : VideoRendererGUI 在视频通话中截取屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!