pristineio / webrtc-android

A mirror of the Android AppRTC demo with sources for the libjingle_peerconnection library.
Other
191 stars 96 forks source link

How I can take screenshot of WebRTC View? #7

Open osnaz1939 opened 8 years ago

osnaz1939 commented 8 years ago

I used this library in here : http://mvnrepository.com/artifact/io.pristine/libjingle/9944 and use the gl.glReadPixels(x, 0, w, y+h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, intBuffer); method in my Activity,but returned bmp is black(perhaps because not completely worked method OnDraw).And I do not can extended my custom class from VideoRendererGui class,and redefine OnDraw method. update: I am use old example https://libjingle.googlecode.com/svn-history/r287/trunk/talk/examples/android/ but in my version libjingle(9944) does not exist the "deepcopy" method in I420Frame and my View is green,and after 5-10 seconds appears "Camera failure" error. Can you help me?

pulimento commented 6 years ago

If you use a SurfaceViewRenderer to render your video stream, you can use surfaceViewRenderer.addFrameListener, to attach a listener. Then, you will have a callback with a bitmap of each frame