Bug 994456 - Add a preview surface for webrtc in webapps. r=gcp, a=sledru
authorWes Johnston <wjohnston@mozilla.com>
Fri, 11 Apr 2014 14:19:12 -0700
changeset 192800 557202999f01c30ae6aeb75eb353c1a9b87c74d0
parent 192799 52674ce552fd19958379d04cf45320b6f1c69caa
child 192801 1e0dc18db7e373072c53637bceded24e82d54ba1
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp, sledru
bugs994456
milestone30.0a2
Bug 994456 - Add a preview surface for webrtc in webapps. r=gcp, a=sledru
mobile/android/base/GeckoApp.java
mobile/android/base/resources/layout/gecko_app.xml
mobile/android/base/resources/layout/shared_ui_components.xml
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1826,28 +1826,28 @@ public abstract class GeckoApp
         // Try to make it fully transparent.
         if (mCameraView instanceof SurfaceView) {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                 mCameraView.setAlpha(0.0f);
             }
         } else if (mCameraView instanceof TextureView) {
             mCameraView.setAlpha(0.0f);
         }
-        RelativeLayout mCameraLayout = (RelativeLayout) findViewById(R.id.camera_layout);
+        ViewGroup mCameraLayout = (ViewGroup) findViewById(R.id.camera_layout);
         // Some phones (eg. nexus S) need at least a 8x16 preview size
         mCameraLayout.addView(mCameraView,
                               new AbsoluteLayout.LayoutParams(8, 16, 0, 0));
     }
 
     public void disableCameraView() {
         if (mCameraOrientationEventListener != null) {
             mCameraOrientationEventListener.disable();
             mCameraOrientationEventListener = null;
         }
-        RelativeLayout mCameraLayout = (RelativeLayout) findViewById(R.id.camera_layout);
+        ViewGroup mCameraLayout = (ViewGroup) findViewById(R.id.camera_layout);
         mCameraLayout.removeView(mCameraView);
     }
 
     public String getDefaultUAString() {
         return HardwareUtils.isTablet() ? AppConstants.USER_AGENT_FENNEC_TABLET :
                                           AppConstants.USER_AGENT_FENNEC_MOBILE;
     }
 
--- a/mobile/android/base/resources/layout/gecko_app.xml
+++ b/mobile/android/base/resources/layout/gecko_app.xml
@@ -55,23 +55,16 @@
 
         <org.mozilla.gecko.MediaCastingBar android:id="@+id/media_casting"
                                            android:layout_width="fill_parent"
                                            android:layout_height="wrap_content"
                                            android:layout_alignParentBottom="true"
                                            style="@style/FindBar"
                                            android:visibility="gone"/>
 
-        <RelativeLayout android:id="@+id/camera_layout"
-                        android:layout_height="wrap_content"
-                        android:layout_width="wrap_content"
-                        android:layout_alignParentRight="true"
-                        android:layout_alignParentBottom="true">
-        </RelativeLayout>
-
         <FrameLayout android:id="@+id/search_container"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent"
                      android:layout_below="@+id/browser_actionbar"
                      android:background="@android:color/white"
                      android:visibility="invisible"/>
 
         <!-- When focus is cleared from from BrowserToolbar's EditText to
--- a/mobile/android/base/resources/layout/shared_ui_components.xml
+++ b/mobile/android/base/resources/layout/shared_ui_components.xml
@@ -21,9 +21,16 @@
 
     <org.mozilla.gecko.FormAssistPopup android:id="@+id/form_assist_popup"
                                        android:layout_width="fill_parent"
                                        android:layout_height="fill_parent"
                                        android:visibility="gone"/>
 
     <include layout="@layout/text_selection_handles"/>
 
+    <FrameLayout android:id="@+id/camera_layout"
+                 android:layout_height="wrap_content"
+                 android:layout_width="wrap_content"
+                 android:layout_alignParentRight="true"
+                 android:layout_alignParentBottom="true">
+    </FrameLayout>
+
 </merge>