Back to project page webrtc-app-mono.
The source code is released under:
Copyright (c) 2011, The WebRTC project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditi...
If you think the Android project webrtc-app-mono listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. *// www . j a va 2 s.co m * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ package org.webrtc.videoengine; import android.content.Context; import android.view.SurfaceHolder; import android.view.SurfaceView; public class ViERenderer { // View used for local rendering that Cameras can use for Video Overlay. private static SurfaceHolder g_localRenderer; public static SurfaceView CreateRenderer(Context context) { return CreateRenderer(context, false); } public static SurfaceView CreateRenderer(Context context, boolean useOpenGLES2) { if(useOpenGLES2 == true && ViEAndroidGLES20.IsSupported(context)) return new ViEAndroidGLES20(context); else return new SurfaceView(context); } // Creates a SurfaceView to be used by Android Camera // service to display a local preview. // This needs to be used on Android prior to version 2.1 // in order to run the camera. // Call this function before ViECapture::StartCapture. // The created view needs to be added to a visible layout // after a camera has been allocated // (with the call ViECapture::AllocateCaptureDevice). // IE. // CreateLocalRenderer // ViECapture::AllocateCaptureDevice // LinearLayout.addview // ViECapture::StartCapture public static SurfaceView CreateLocalRenderer(Context context) { SurfaceView localRender = new SurfaceView(context); g_localRenderer = localRender.getHolder(); return localRender; } public static SurfaceHolder GetLocalRenderer() { return g_localRenderer; } }