当前位置: 首页>>代码示例>>Java>>正文


Java EglBase.Context方法代码示例

本文整理汇总了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;
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:22,代码来源:PeerConnectionClientTest.java

示例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();
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:20,代码来源:YuvConverter.java

示例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);
}
 
开发者ID:nhancv,项目名称:nc-android-webrtcpeer,代码行数:9,代码来源:PeerConnectionClient.java

示例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);
}
 
开发者ID:Piasy,项目名称:VideoCRE,代码行数:20,代码来源:TextureViewRenderer.java

示例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();
			}
		});

	}
 
开发者ID:ardnezar,项目名称:webrtc-android,代码行数:73,代码来源:PeerConnectionClient.java

示例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);
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:19,代码来源:VideoCapturerExternalResource.java

示例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());
}
 
开发者ID:angellsl10,项目名称:react-native-webrtc,代码行数:9,代码来源:SurfaceViewRenderer.java

示例8: getRenderContext

import org.webrtc.EglBase; //导入方法依赖的package包/类
public EglBase.Context getRenderContext() {
  return rootEglBase.getEglBaseContext();
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:4,代码来源:PeerConnectionClient.java

示例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);
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:7,代码来源:PeerConnectionClient.java

示例10: createPeerConnectionInternal

import org.webrtc.EglBase; //导入方法依赖的package包/类
private void createPeerConnectionInternal(EglBase.Context renderEGLContext) {
	createPeerConnectionInternal(renderEGLContext, null);
}
 
开发者ID:ardnezar,项目名称:webrtc-android,代码行数:4,代码来源:PeerConnectionClient.java

示例11: createYuvConverter

import org.webrtc.EglBase; //导入方法依赖的package包/类
public void createYuvConverter(EglBase.Context context) {
    mYuvConverter = new YuvConverter(context);
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:4,代码来源:MySurfaceViewRenderer.java

示例12: setVideoHwAccelerationOptions

import org.webrtc.EglBase; //导入方法依赖的package包/类
public void setVideoHwAccelerationOptions(EglBase.Context renderEGLContext) {
    mFactory.setVideoHwAccelerationOptions(renderEGLContext, renderEGLContext);
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:4,代码来源:Peer.java

示例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);
}
 
开发者ID:GoBelieveIO,项目名称:voip_android,代码行数:7,代码来源:PeerConnectionClient.java


注:本文中的org.webrtc.EglBase.Context方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。