How to use a "custom" video capturer to create a VideoTrack and provide frames?
The classic approach to create a VideoTrack is:
1 - Get a VideoCapturer instance
VideoCapturer capturer = VideoCapturer.create(name);
2 - Create a VideoSource
VideoSource videoSource = peerconnectionFactory.createVideoSource(capturer, videoConstraints);
3 - Create a VideoTrack using the video source
VideoTrack videoTrack = peerconnectionFactory.createVideoTrack("Label", videoSource);
4 - Add the track to the MediaStream
I was wondering if there is a way to change step one. Instead of using the native Capturer instance, use an Android one, and provide the frames to the VideoTrack using the callback:
public void onPreviewFrame(byte[] data, Camera camera) {
// provide the frames to the VideoTrack
}
Any suggestions?