use of org.webrtc.GlRectDrawer in project flutter-webrtc by flutter-webrtc.
the class VideoFileRenderer method initVideoEncoder.
private void initVideoEncoder() {
MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, outputFileWidth, outputFileHeight);
// Set some properties. Failing to specify some of these can cause the MediaCodec
// configure() call to throw an unhelpful exception.
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
format.setInteger(MediaFormat.KEY_BIT_RATE, 6000000);
format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, IFRAME_INTERVAL);
// we can use for input and wrap it with a class that handles the EGL work.
try {
encoder = MediaCodec.createEncoderByType(MIME_TYPE);
encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
renderThreadHandler.post(() -> {
eglBase = EglBase.create(sharedContext, EglBase.CONFIG_RECORDABLE);
surface = encoder.createInputSurface();
eglBase.createSurface(surface);
eglBase.makeCurrent();
drawer = new GlRectDrawer();
});
} catch (Exception e) {
Log.wtf(TAG, e);
}
}
use of org.webrtc.GlRectDrawer in project Signal-Android by signalapp.
the class TextureViewRenderer method init.
public void init(@NonNull EglBase eglBase) {
if (isInitialized)
return;
isInitialized = true;
this.init(eglBase.getEglBaseContext(), null, EglBase.CONFIG_PLAIN, new GlRectDrawer());
}
use of org.webrtc.GlRectDrawer in project Signal-Android by WhisperSystems.
the class TextureViewRenderer method init.
public void init(@NonNull EglBase eglBase) {
if (isInitialized)
return;
isInitialized = true;
this.init(eglBase.getEglBaseContext(), null, EglBase.CONFIG_PLAIN, new GlRectDrawer());
}
use of org.webrtc.GlRectDrawer in project Telegram-FOSS by Telegram-FOSS-Team.
the class VoIPFragment method initRenderers.
private void initRenderers() {
currentUserTextureView.renderer.init(VideoCapturerDevice.getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
AndroidUtilities.runOnUIThread(() -> updateViewState());
}
@Override
public void onFrameResolutionChanged(int videoWidth, int videoHeight, int rotation) {
}
});
callingUserTextureView.renderer.init(VideoCapturerDevice.getEglBase().getEglBaseContext(), new RendererCommon.RendererEvents() {
@Override
public void onFirstFrameRendered() {
AndroidUtilities.runOnUIThread(() -> updateViewState());
}
@Override
public void onFrameResolutionChanged(int videoWidth, int videoHeight, int rotation) {
}
}, EglBase.CONFIG_PLAIN, new GlRectDrawer());
callingUserMiniTextureRenderer.init(VideoCapturerDevice.getEglBase().getEglBaseContext(), null);
}
use of org.webrtc.GlRectDrawer in project mollyim-android by mollyim.
the class TextureViewRenderer method init.
public void init(@NonNull EglBase eglBase) {
if (isInitialized)
return;
isInitialized = true;
this.init(eglBase.getEglBaseContext(), null, EglBase.CONFIG_PLAIN, new GlRectDrawer());
}
Aggregations