org.webrtc.VideoEncoderFactory Java Examples

The following examples show how to use org.webrtc.VideoEncoderFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebRtcCallService.java    From bcm-android with GNU General Public License v3.0 6 votes vote down vote up
private void initializeVideo() {
    Util.runOnMainSync(() -> {
        eglBase = EglBase.create();
        localRenderer = new SurfaceViewRenderer(WebRtcCallService.this);
        remoteRenderer = new SurfaceViewRenderer(WebRtcCallService.this);

        localRenderer.init(eglBase.getEglBaseContext(), null);
        remoteRenderer.init(eglBase.getEglBaseContext(), null);

        VideoEncoderFactory encoderFactory = new DefaultVideoEncoderFactory(eglBase.getEglBaseContext(), true, true);
        VideoDecoderFactory decoderFactory = new DefaultVideoDecoderFactory(eglBase.getEglBaseContext());

        peerConnectionFactory = PeerConnectionFactory.builder()
                .setOptions(new PeerConnectionFactoryOptions())
                .setVideoEncoderFactory(encoderFactory)
                .setVideoDecoderFactory(decoderFactory)
                .createPeerConnectionFactory();
    });

}
 
Example #2
Source File: ContextInitialization.java    From owt-client-android with Apache License 2.0 5 votes vote down vote up
/**
 * Set the customized video encoder factory.
 *
 * @param encoderFactory VideoEncoderFactory to be set.
 * @return ContextInitialization
 */
public ContextInitialization setCustomizedVideoEncoderFactory(
        VideoEncoderFactory encoderFactory) {
    RCHECK(!initialized);
    PCFactoryProxy.encoderFactory = encoderFactory;
    return this;
}