Bug 1363885 - 2. Sync ViERenderer with upstream; r?jesup
Sync ViERenderer to match the upstream version. This removes the calls
to GeckoInterface.enableOrientationListener and
disableOrientationListener, which are obsolete and will be removed with
this bug.
---
.../src/org/webrtc/videoengine/ViERenderer.java | 49 ++++------------------
1 file changed, 8 insertions(+), 41 deletions(-)
MozReview-Commit-ID: 6tNy0x2ee2A
--- a/media/webrtc/trunk/webrtc/modules/video_render/android/java/src/org/webrtc/videoengine/ViERenderer.java
+++ b/media/webrtc/trunk/webrtc/modules/video_render/android/java/src/org/webrtc/videoengine/ViERenderer.java
@@ -6,59 +6,26 @@
* 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.util.Log;
-import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
-import android.view.View;
-
-import org.mozilla.gecko.GeckoApp;
-import org.mozilla.gecko.GeckoAppShell;
-import org.mozilla.gecko.util.ThreadUtils;
public class ViERenderer {
private final static String TAG = "WEBRTC-ViEREnderer";
- // 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 void CreateLocalRenderer() {
- ThreadUtils.getUiHandler().post(new Runnable() {
- @Override
- public void run() {
- try {
- GeckoAppShell.getGeckoInterface().enableOrientationListener();
- } catch (Exception e) {
- Log.e(TAG, "enableOrientationListener exception: "
- + e.getLocalizedMessage());
- }
- }
- });
+ public static SurfaceView CreateRenderer(Context context) {
+ return CreateRenderer(context, false);
}
- public static void DestroyLocalRenderer() {
- ThreadUtils.getUiHandler().post(new Runnable() {
- @Override
- public void run() {
- try {
- GeckoAppShell.getGeckoInterface().disableOrientationListener();
- } catch (Exception e) {
- Log.e(TAG,
- "disableOrientationListener exception: " +
- e.getLocalizedMessage());
- }
- }
- });
+ public static SurfaceView CreateRenderer(Context context,
+ boolean useOpenGLES2) {
+ if(useOpenGLES2 == true && ViEAndroidGLES20.IsSupported(context))
+ return new ViEAndroidGLES20(context);
+ else
+ return new SurfaceView(context);
}
}