Bug 1363885 - 2. Sync ViERenderer with upstream; r?jesup draft
authorJim Chen <nchen@mozilla.com>
Mon, 15 May 2017 19:35:03 -0400
changeset 578144 59354180180614db3fcff3607a595e912a37f1d8
parent 578143 be6787fa6f54bf597d6950d9f1cf9726b037299d
child 628704 1f60aa11d3e8402d266fbeaff00e1a80711e5f94
push id58910
push userbmo:nchen@mozilla.com
push dateMon, 15 May 2017 23:35:27 +0000
reviewersjesup
bugs1363885
milestone55.0a1
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
media/webrtc/trunk/webrtc/modules/video_render/android/java/src/org/webrtc/videoengine/ViERenderer.java
--- 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);
     }
 }