| Index: media/base/android/java/src/org/chromium/media/VideoCaptureAndroid.java
|
| diff --git a/media/base/android/java/src/org/chromium/media/VideoCaptureAndroid.java b/media/base/android/java/src/org/chromium/media/VideoCaptureAndroid.java
|
| index f61dce6dae99201c362ea7d7c2cd7644a2e82434..8ea03b697071d6fb3f152e57129529c4140b0e00 100644
|
| --- a/media/base/android/java/src/org/chromium/media/VideoCaptureAndroid.java
|
| +++ b/media/base/android/java/src/org/chromium/media/VideoCaptureAndroid.java
|
| @@ -6,8 +6,6 @@ package org.chromium.media;
|
|
|
| import android.content.Context;
|
| import android.graphics.ImageFormat;
|
| -import android.hardware.Camera;
|
| -import android.hardware.Camera.Size;
|
| import android.util.Log;
|
|
|
| import java.util.ArrayList;
|
| @@ -82,14 +80,14 @@ public class VideoCaptureAndroid extends VideoCapture {
|
| private static final String TAG = "VideoCaptureAndroid";
|
|
|
| static CaptureFormat[] getDeviceSupportedFormats(int id) {
|
| - Camera camera;
|
| + android.hardware.Camera camera;
|
| try {
|
| - camera = Camera.open(id);
|
| + camera = android.hardware.Camera.open(id);
|
| } catch (RuntimeException ex) {
|
| Log.e(TAG, "Camera.open: " + ex);
|
| return null;
|
| }
|
| - Camera.Parameters parameters = getCameraParameters(camera);
|
| + android.hardware.Camera.Parameters parameters = getCameraParameters(camera);
|
| if (parameters == null) {
|
| return null;
|
| }
|
| @@ -123,15 +121,15 @@ public class VideoCaptureAndroid extends VideoCapture {
|
| listFpsRange.add(new int[] {0, 0});
|
| }
|
| for (int[] fpsRange : listFpsRange) {
|
| - List<Camera.Size> supportedSizes =
|
| + List<android.hardware.Camera.Size> supportedSizes =
|
| parameters.getSupportedPreviewSizes();
|
| if (supportedSizes == null) {
|
| - supportedSizes = new ArrayList<Camera.Size>();
|
| + supportedSizes = new ArrayList<android.hardware.Camera.Size>();
|
| }
|
| if (supportedSizes.size() == 0) {
|
| supportedSizes.add(camera.new Size(0, 0));
|
| }
|
| - for (Camera.Size size : supportedSizes) {
|
| + for (android.hardware.Camera.Size size : supportedSizes) {
|
| formatList.add(new CaptureFormat(size.width,
|
| size.height,
|
| (fpsRange[1] + 999) / 1000,
|
| @@ -154,7 +152,7 @@ public class VideoCaptureAndroid extends VideoCapture {
|
| int width,
|
| int height,
|
| int frameRate,
|
| - Camera.Parameters cameraParameters) {
|
| + android.hardware.Camera.Parameters cameraParameters) {
|
| mCaptureFormat = new CaptureFormat(
|
| width, height, frameRate, BuggyDeviceHack.getImageFormat());
|
| // Hack to avoid certain capture resolutions under a minimum one,
|
| @@ -173,12 +171,12 @@ public class VideoCaptureAndroid extends VideoCapture {
|
| }
|
|
|
| @Override
|
| - protected void setPreviewCallback(Camera.PreviewCallback cb) {
|
| + protected void setPreviewCallback(android.hardware.Camera.PreviewCallback cb) {
|
| mCamera.setPreviewCallbackWithBuffer(cb);
|
| }
|
|
|
| @Override
|
| - public void onPreviewFrame(byte[] data, Camera camera) {
|
| + public void onPreviewFrame(byte[] data, android.hardware.Camera camera) {
|
| mPreviewBufferLock.lock();
|
| try {
|
| if (!mIsRunning) {
|
| @@ -189,7 +187,7 @@ public class VideoCaptureAndroid extends VideoCapture {
|
| if (rotation != mDeviceOrientation) {
|
| mDeviceOrientation = rotation;
|
| }
|
| - if (mCameraFacing == Camera.CameraInfo.CAMERA_FACING_BACK) {
|
| + if (mCameraFacing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK) {
|
| rotation = 360 - rotation;
|
| }
|
| rotation = (mCameraOrientation + rotation) % 360;
|
|
|