I am using webrtc on android.
I did draw video on GLSurfaceView and used FBO to get video byteBuffer, and then push byteBuffer to webrtc.
Before pushing byteBuffer to videoSource I need to convert RGB format to YUV format(NV21).
Like this:
@Override
public void onDrawFrame(GL10 gl) {
// draw video on glSurfaceView
// use FBO get byteBuffer(RGBA)
// convert byteBuffer from RGBA to NV21
// create NV21Buffer for VideoFrame
// set videoFrame to videoSource
videoSource.getCapturerObserver().onFrameCaptured(videoFrame);
}
I'd like to know if it is possible to push the RGB format to webrtc? If so, how? Any part code or hint are fine, thank you.
Android sdk is 34
WebRTC is M116