本文整理汇总了Java中org.webrtc.SurfaceViewRenderer类的典型用法代码示例。如果您正苦于以下问题:Java SurfaceViewRenderer类的具体用法?Java SurfaceViewRenderer怎么用?Java SurfaceViewRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SurfaceViewRenderer类属于org.webrtc包,在下文中一共展示了SurfaceViewRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setScalingType
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
private void setScalingType(ScalingType scalingType) {
SurfaceViewRenderer surfaceViewRenderer;
synchronized (layoutSyncRoot) {
if (this.scalingType == scalingType) {
return;
}
this.scalingType = scalingType;
surfaceViewRenderer = getSurfaceViewRenderer();
surfaceViewRenderer.setScalingType(scalingType);
}
// Both this instance ant its SurfaceViewRenderer take the value of
// their scalingType properties into account upon their layouts.
requestSurfaceViewRendererLayout();
}
示例2: initializeVideo
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
private void initializeVideo() {
Util.runOnMainSync(new Runnable() {
@Override
public void run() {
eglBase = EglBase.create();
localRenderer = new SurfaceViewRenderer(WebRtcCallService.this);
remoteRenderer = new SurfaceViewRenderer(WebRtcCallService.this);
localRenderer.init(eglBase.getEglBaseContext(), null);
remoteRenderer.init(eglBase.getEglBaseContext(), null);
peerConnectionFactory.setVideoHwAccelerationOptions(eglBase.getEglBaseContext(),
eglBase.getEglBaseContext());
}
});
}
示例3: VideoView
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
public VideoView(String strPeerId, Context ctx, EglBase eglBase, int index, int x, int y, int w, int h, AnyRTCVideoLayout videoLayout) {
this.strPeerId = strPeerId;
this.index = index;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.mRTCVideoLayout = videoLayout;
mLayout = new PercentFrameLayout(ctx);
mLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
View view = View.inflate(ctx, R.layout.layout_top_right, null);
mView = (SurfaceViewRenderer) view.findViewById(R.id.suface_view);
btnClose = (ImageView) view.findViewById(R.id.img_close_render);
mLocalCamera = (ImageView) view.findViewById(R.id.camera_off);
mAudioImageView = (ImageView) view.findViewById(R.id.img_audio_close);
mVideoImageView = (ImageView) view.findViewById(R.id.img_video_close);
layoutCamera = (RelativeLayout) view.findViewById(R.id.layout_camera);
mView.init(eglBase.getEglBaseContext(), null);
mView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
mLayout.addView(view);
}
示例4: VideoView
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
public VideoView(String strPeerId, Context ctx, EglBase eglBase, int index, int x, int y, int w, int h, AnyRTCVideoLayout videoLayout) {
this.strPeerId = strPeerId;
this.index = index;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.mRTCVideoLayout = videoLayout;
mLayout = new PercentFrameLayout(ctx);
mLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
View view = View.inflate(ctx, org.anyrtc.meet_kit.R.layout.layout_top_right, null);
mView = (SurfaceViewRenderer) view.findViewById(org.anyrtc.meet_kit.R.id.suface_view);
btnClose = (ImageView) view.findViewById(org.anyrtc.meet_kit.R.id.img_close_render);
mLocalCamera = (ImageView) view.findViewById(org.anyrtc.meet_kit.R.id.camera_off);
mAudioImageView = (ImageView) view.findViewById(org.anyrtc.meet_kit.R.id.img_audio_close);
mVideoImageView = (ImageView) view.findViewById(org.anyrtc.meet_kit.R.id.img_video_close);
layoutCamera = (RelativeLayout) view.findViewById(org.anyrtc.meet_kit.R.id.layout_camera);
mView.init(eglBase.getEglBaseContext(), null);
mView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
mLayout.addView(view);
}
示例5: VideoView
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
public VideoView(String strPeerId, Context ctx, EglBase eglBase, int index, int x, int y, int w, int h) {
this.strPeerId = strPeerId;
this.index = index;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
mLayout = new PercentFrameLayout(ctx);
// mLayout.setBackgroundResource(R.drawable.background);
mLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
View view = View.inflate(ctx, R.layout.layout_top_right, null);
mView = (SurfaceViewRenderer) view.findViewById(R.id.suface_view);
layoutCamera = (RelativeLayout) view.findViewById(R.id.layout_camera);
mView.init(eglBase.getEglBaseContext(), null);
mView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
mLayout.addView(view);
}
示例6: AVMemberView
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
public AVMemberView(final Context context,EglBase rootEglBase,AVMember avMember, String trackType){
this.context = context;
this.rootEglBase = rootEglBase;
this.avMember = avMember;
this.trackType = trackType;
convertView = LayoutInflater.from(context).inflate(R.layout.avcall_member_preview_item, null);
viewHolder = new ViewHolder();
viewHolder.sfv_video= (SurfaceViewRenderer)convertView.findViewById(R.id.svr_video_item);
viewHolder.iv_header = (ImageView) convertView.findViewById(R.id.iv_av_member_avatar);
viewHolder.rl_bg = (RelativeLayout) convertView.findViewById(R.id.rl_bg);
viewHolder.sfv_video.init(rootEglBase.getEglBaseContext(), null);
viewHolder.sfv_video.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT);
viewHolder.sfv_video.setMirror(false);
viewHolder.sfv_video.setZOrderMediaOverlay(true);
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onMemberViewClickListener != null)
onMemberViewClickListener.itemClick(avMemberView);
}
});
avMemberView = this;
setRenderer();
}
示例7: initializeVideo
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
private void initializeVideo(boolean videoEnabled, PercentFrameLayout localRenderLayout, PercentFrameLayout remoteRenderLayout)
{
if (localRenderLayout == null ||remoteRenderLayout == null) {
return;
}
scalingType = ScalingType.SCALE_ASPECT_FILL;
this.localRenderLayout = localRenderLayout;
this.remoteRenderLayout = remoteRenderLayout;
localRender = (SurfaceViewRenderer)localRenderLayout.getChildAt(0);
remoteRender = (SurfaceViewRenderer)remoteRenderLayout.getChildAt(0);
localRender.init(peerConnectionClient.getRenderContext(), null);
localRender.setZOrderMediaOverlay(true);
remoteRender.init(peerConnectionClient.getRenderContext(), null);
updateVideoView(VideoViewState.NONE);
}
示例8: setZOrder
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
/**
* Sets the z-order of this {@link WebRTCView} in the stacking space of all
* {@code WebRTCView}s. For more details, refer to the documentation of the
* {@code zOrder} property of the JavaScript counterpart of
* {@code WebRTCView} i.e. {@code RTCView}.
*
* @param zOrder The z-order to set on this {@code WebRTCView}.
*/
public void setZOrder(int zOrder) {
SurfaceViewRenderer surfaceViewRenderer = getSurfaceViewRenderer();
switch (zOrder) {
case 0:
surfaceViewRenderer.setZOrderMediaOverlay(false);
break;
case 1:
surfaceViewRenderer.setZOrderMediaOverlay(true);
break;
case 2:
surfaceViewRenderer.setZOrderOnTop(true);
break;
}
}
示例9: setConnected
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
private void setConnected(SurfaceViewRenderer localRenderer,
SurfaceViewRenderer remoteRenderer)
{
if (localRenderLayout.getChildCount() == 0 && remoteRenderLayout.getChildCount() == 0) {
if (localRenderer.getParent() != null) {
((ViewGroup)localRenderer.getParent()).removeView(localRenderer);
}
if (remoteRenderer.getParent() != null) {
((ViewGroup)remoteRenderer.getParent()).removeView(remoteRenderer);
}
localRenderLayout.setPosition(7, 70, 25, 25);
localRenderLayout.setSquare(true);
remoteRenderLayout.setPosition(0, 0, 100, 100);
localRenderer.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
remoteRenderer.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
localRenderer.setMirror(true);
localRenderer.setZOrderMediaOverlay(true);
localRenderLayout.addView(localRenderer);
remoteRenderLayout.addView(remoteRenderer);
}
}
示例10: RcTest
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
public RcTest(final Config config, final EglBase eglBase, final SurfaceViewRenderer renderer,
final Notifier notifier) {
mEglBase = eglBase;
mSurfaceViewRenderer = renderer;
File videoFile = new File(Environment.getExternalStorageDirectory(),
"alien-covenant.mp4");
mFrameProducer = new FrameProducer(mEglBase, videoFile, config.outputFps(), this);
mEncoderWrapper = new EncoderWrapper(config, notifier);
}
示例11: onCreate
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_chat);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
mHandler = new Handler();
masterView = (SurfaceViewRenderer) findViewById(R.id.gl_surface);
localView = (SurfaceViewRenderer) findViewById(R.id.gl_surface_local);
this.mCallStatus = (TextView) findViewById(R.id.call_status);
callState = CallState.IDLE;
MainActivity.getKurentoRoomAPIInstance().addObserver(this);
}
示例12: initViews
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
private void initViews() {
start = (Button) findViewById(R.id.start_call);
call = (Button) findViewById(R.id.init_call);
hangup = (Button) findViewById(R.id.end_call);
localVideoView = (SurfaceViewRenderer) findViewById(R.id.local_gl_surface_view);
remoteVideoView = (SurfaceViewRenderer) findViewById(R.id.remote_gl_surface_view);
start.setOnClickListener(this);
call.setOnClickListener(this);
hangup.setOnClickListener(this);
}
示例13: MXWebRtcView
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
public MXWebRtcView(Context context) {
super(context);
surfaceViewRenderer = new SurfaceViewRenderer(context);
addView(surfaceViewRenderer);
setMirror(false);
setScalingType(DEFAULT_SCALING_TYPE);
}
示例14: setMirror
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
/**
* Sets the indicator which determines whether this {@code WebRTCView} is to
* mirror the video represented by {@link #videoTrack} during its rendering.
*
* @param mirror If this {@code WebRTCView} is to mirror the video
* represented by {@code videoTrack} during its rendering, {@code true};
* otherwise, {@code false}.
*/
public void setMirror(boolean mirror) {
if (this.mirror != mirror) {
this.mirror = mirror;
SurfaceViewRenderer surfaceViewRenderer = getSurfaceViewRenderer();
surfaceViewRenderer.setMirror(mirror);
// SurfaceViewRenderer takes the value of its mirror property into
// account upon its layout.
requestSurfaceViewRendererLayout();
}
}
示例15: updateVideoView
import org.webrtc.SurfaceViewRenderer; //导入依赖的package包/类
protected void updateVideoView(SurfaceViewRenderer surfaceViewRenderer, boolean mirror) {
updateVideoView(surfaceViewRenderer, mirror, RendererCommon.ScalingType.SCALE_ASPECT_FILL);
}