本文整理汇总了Java中org.webrtc.EglBase.Context方法的典型用法代码示例。如果您正苦于以下问题:Java EglBase.Context方法的具体用法?Java EglBase.Context怎么用?Java EglBase.Context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.webrtc.EglBase
的用法示例。
在下文中一共展示了EglBase.Context方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPeerConnectionClient
import org.webrtc.EglBase; //导入方法依赖的package包/类
PeerConnectionClient createPeerConnectionClient(MockRenderer localRenderer,
MockRenderer remoteRenderer, PeerConnectionParameters peerConnectionParameters,
VideoCapturer videoCapturer, EglBase.Context eglContext) {
List<PeerConnection.IceServer> iceServers = new LinkedList<PeerConnection.IceServer>();
SignalingParameters signalingParameters =
new SignalingParameters(iceServers, true, // iceServers, initiator.
null, null, null, // clientId, wssUrl, wssPostUrl.
null, null); // offerSdp, iceCandidates.
PeerConnectionClient client = PeerConnectionClient.getInstance();
PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();
options.networkIgnoreMask = 0;
options.disableNetworkMonitor = true;
client.setPeerConnectionFactoryOptions(options);
client.createPeerConnectionFactory(
InstrumentationRegistry.getTargetContext(), peerConnectionParameters, this);
client.createPeerConnection(
eglContext, localRenderer, remoteRenderer, videoCapturer, signalingParameters);
client.createOffer();
return client;
}
示例2: YuvConverter
import org.webrtc.EglBase; //导入方法依赖的package包/类
public YuvConverter (EglBase.Context sharedContext) {
eglBase = EglBase.create(sharedContext, EglBase.CONFIG_PIXEL_RGBA_BUFFER);
eglBase.createDummyPbufferSurface();
eglBase.makeCurrent();
shader = new GlShader(VERTEX_SHADER, FRAGMENT_SHADER);
shader.useProgram();
texMatrixLoc = shader.getUniformLocation("texMatrix");
xUnitLoc = shader.getUniformLocation("xUnit");
coeffsLoc = shader.getUniformLocation("coeffs");
GLES20.glUniform1i(shader.getUniformLocation("oesTex"), 0);
GlUtil.checkNoGLES2Error("Initialize fragment shader uniform values.");
// Initialize vertex shader attributes.
shader.setVertexAttribArray("in_pos", 2, DEVICE_RECTANGLE);
// If the width is not a multiple of 4 pixels, the texture
// will be scaled up slightly and clipped at the right border.
shader.setVertexAttribArray("in_tc", 2, TEXTURE_RECTANGLE);
eglBase.detachCurrent();
}
示例3: createPeerConnection
import org.webrtc.EglBase; //导入方法依赖的package包/类
public void createPeerConnection(final EglBase.Context renderEGLContext,
final VideoRenderer.Callbacks localRender,
final VideoRenderer.Callbacks remoteRender,
final VideoCapturer videoCapturer,
final SignalingParameters signalingParameters) {
createPeerConnection(renderEGLContext, localRender, Collections.singletonList(remoteRender),
videoCapturer, signalingParameters);
}
示例4: init
import org.webrtc.EglBase; //导入方法依赖的package包/类
/**
* Initialize this class, sharing resources with |sharedContext|. The custom |drawer| will be used
* for drawing frames on the EGLSurface. This class is responsible for calling release() on
* |drawer|. It is allowed to call init() to reinitialize the renderer after a previous
* init()/release() cycle.
*/
public void init(final EglBase.Context sharedContext,
RendererCommon.RendererEvents rendererEvents, final int[] configAttributes,
RendererCommon.GlDrawer drawer) {
ThreadUtils.checkIsOnMainThread();
this.rendererEvents = rendererEvents;
synchronized (layoutLock) {
isFirstFrameRendered = false;
rotatedFrameWidth = 0;
rotatedFrameHeight = 0;
frameRotation = 0;
}
eglRenderer.init(sharedContext, configAttributes, drawer);
}
示例5: createPeerConnection
import org.webrtc.EglBase; //导入方法依赖的package包/类
public void createPeerConnection(
final EglBase.Context renderEGLContext,
final VideoRenderer.Callbacks localRender,
final VideoRenderer.Callbacks remoteRender,
final PeerConnectionEvents events,
final PeerConnectionParameters peerConnectionParameters) {
this.peerConnectionParameters = peerConnectionParameters;
this.events = events;
videoCallEnabled = peerConnectionParameters.videoCallEnabled;
//
// PeerConnectionFactory.initializeAndroidGlobals(, true, true,
// false);
// factory = new PeerConnectionFactory();
// if (peerConnectionParameters == null) {
// Log.e(TAG, "Creating peer connection without initializing factory.");
// return;
// }
this.localRender = localRender;
this.remoteRender = remoteRender;
executor.execute(new Runnable() {
@Override
public void run() {
createMediaConstraintsInternal();
// createPeerConnectionInternal(renderEGLContext, iceServers);
if(mediaStream == null) {
mediaStream = factory.createLocalMediaStream("ARDAMS");
if (videoCallEnabled) {
String cameraDeviceName = CameraEnumerationAndroid.getDeviceName(0);
String frontCameraDeviceName =
CameraEnumerationAndroid.getNameOfFrontFacingDevice();
if (numberOfCameras > 1 && frontCameraDeviceName != null) {
cameraDeviceName = frontCameraDeviceName;
}
Log.d(TAG, "Opening camera: " + cameraDeviceName);
videoCapturer = VideoCapturerAndroid.create(cameraDeviceName, null,
peerConnectionParameters.captureToTexture ? renderEGLContext : null);
if (videoCapturer == null) {
reportError("Failed to open camera");
return;
}
mediaStream.addTrack(createVideoTrack(videoCapturer));
}
mediaStream.addTrack(factory.createAudioTrack(
AUDIO_TRACK_ID,
factory.createAudioSource(audioConstraints)));
}
try {
manager = new Manager(new URI(mHost));
client = manager.socket("/");
} catch (URISyntaxException e) {
e.printStackTrace();
}
client
.on(INIT_MESSAGE, messageHandler.onInitMessage)
.on(TEXT_MESSAGE, messageHandler.onTextMessage)
// .on(INVITE_MESSAGE, messageHandler.onInviteMessage)
// .on(READY_MESSAGE, messageHandler.onReadyMessage)
// .on(OFFER_MESSAGE, messageHandler.onOfferMessage)
// .on(ANSWER_MESSAGE, messageHandler.onAnswerMessage)
// .on(ICE_CANDIDATE_MESSAGE, messageHandler.onCandidateMessage)
.on(RTC_MESSAGE, messageHandler.onRtcMessage)
.on(LEAVE_MESSAGE, messageHandler.onLeaveMessage)
.on(AVAILABLE_USERS_MESSAGE, messageHandler.onAvailablePeersMessage)
.on(PRESENCE_MESSAGE, messageHandler.onPresenceMessage);
client.connect();
}
});
}
示例6: VideoCapturerExternalResource
import org.webrtc.EglBase; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param uri uri of resource
* @param width width
* @param height height
*/
public VideoCapturerExternalResource(EglBase.Context sharedContext, final String uri, final int width, final int height) {
mUri = uri;
mWidth = width;
mHeight = height;
mFPS = 30;
HandlerThread cameraThread = new HandlerThread(TAG);
cameraThread.start();
mCameraThreadHandler = new Handler(cameraThread.getLooper());
mSurfaceHelper = SurfaceTextureHelper.create(sharedContext, mCameraThreadHandler);
}
示例7: init
import org.webrtc.EglBase; //导入方法依赖的package包/类
/**
* Initialize this class, sharing resources with |sharedContext|. It is allowed to call init() to
* reinitialize the renderer after a previous init()/release() cycle.
*/
public void init(
EglBase.Context sharedContext, RendererCommon.RendererEvents rendererEvents) {
init(sharedContext, rendererEvents, EglBase.CONFIG_PLAIN, new GlRectDrawer());
}
示例8: getRenderContext
import org.webrtc.EglBase; //导入方法依赖的package包/类
public EglBase.Context getRenderContext() {
return rootEglBase.getEglBaseContext();
}
示例9: createPeerConnection
import org.webrtc.EglBase; //导入方法依赖的package包/类
public void createPeerConnection(final EglBase.Context renderEGLContext,
final VideoRenderer.Callbacks localRender, final VideoRenderer.Callbacks remoteRender,
final VideoCapturer videoCapturer, final SignalingParameters signalingParameters) {
createPeerConnection(renderEGLContext, localRender, Collections.singletonList(remoteRender),
videoCapturer, signalingParameters);
}
示例10: createPeerConnectionInternal
import org.webrtc.EglBase; //导入方法依赖的package包/类
private void createPeerConnectionInternal(EglBase.Context renderEGLContext) {
createPeerConnectionInternal(renderEGLContext, null);
}
示例11: createYuvConverter
import org.webrtc.EglBase; //导入方法依赖的package包/类
public void createYuvConverter(EglBase.Context context) {
mYuvConverter = new YuvConverter(context);
}
示例12: setVideoHwAccelerationOptions
import org.webrtc.EglBase; //导入方法依赖的package包/类
public void setVideoHwAccelerationOptions(EglBase.Context renderEGLContext) {
mFactory.setVideoHwAccelerationOptions(renderEGLContext, renderEGLContext);
}
示例13: createPeerConnection
import org.webrtc.EglBase; //导入方法依赖的package包/类
public void createPeerConnection(final EglBase.Context renderEGLContext,
final VideoRenderer.Callbacks localRender, final VideoRenderer.Callbacks remoteRender,
final VideoCapturer videoCapturer) {
createPeerConnection(renderEGLContext, localRender, Collections.singletonList(remoteRender),
videoCapturer);
}