| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.media; | 5 package org.chromium.media; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.ImageFormat; | 8 import android.graphics.ImageFormat; |
| 9 import android.view.Surface; | 9 import android.view.Surface; |
| 10 import android.view.WindowManager; | 10 import android.view.WindowManager; |
| 11 | 11 |
| 12 import org.chromium.base.ContextUtils; | 12 import org.chromium.base.ContextUtils; |
| 13 import org.chromium.base.annotations.CalledByNative; | 13 import org.chromium.base.annotations.CalledByNative; |
| 14 import org.chromium.base.annotations.JNINamespace; | 14 import org.chromium.base.annotations.JNINamespace; |
| 15 | 15 |
| 16 import java.nio.ByteBuffer; | 16 import java.nio.ByteBuffer; |
| 17 import java.nio.FloatBuffer; |
| 17 import java.util.ArrayList; | 18 import java.util.ArrayList; |
| 18 import java.util.Collections; | 19 import java.util.Collections; |
| 19 import java.util.Comparator; | 20 import java.util.Comparator; |
| 20 import java.util.List; | 21 import java.util.List; |
| 21 | 22 |
| 22 /** | 23 /** |
| 23 * Video Capture Device base class, defines a set of methods that native code | 24 * Video Capture Device base class, defines a set of methods that native code |
| 24 * needs to use to configure, start capture, and to be reached by callbacks and | 25 * needs to use to configure, start capture, and to be reached by callbacks and |
| 25 * provides some necessary data type(s) with accessors. | 26 * provides some necessary data type(s) with accessors. |
| 26 **/ | 27 **/ |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 119 |
| 119 @CalledByNative | 120 @CalledByNative |
| 120 public final int getColorspace() { | 121 public final int getColorspace() { |
| 121 switch (mCaptureFormat.mPixelFormat) { | 122 switch (mCaptureFormat.mPixelFormat) { |
| 122 case ImageFormat.YV12: | 123 case ImageFormat.YV12: |
| 123 return AndroidImageFormat.YV12; | 124 return AndroidImageFormat.YV12; |
| 124 case ImageFormat.YUV_420_888: | 125 case ImageFormat.YUV_420_888: |
| 125 return AndroidImageFormat.YUV_420_888; | 126 return AndroidImageFormat.YUV_420_888; |
| 126 case ImageFormat.NV21: | 127 case ImageFormat.NV21: |
| 127 return AndroidImageFormat.NV21; | 128 return AndroidImageFormat.NV21; |
| 129 case ImageFormat.DEPTH16: |
| 130 return AndroidImageFormat.DEPTH16; |
| 128 case ImageFormat.UNKNOWN: | 131 case ImageFormat.UNKNOWN: |
| 129 default: | 132 default: |
| 130 return AndroidImageFormat.UNKNOWN; | 133 return AndroidImageFormat.UNKNOWN; |
| 131 } | 134 } |
| 132 } | 135 } |
| 133 | 136 |
| 134 @CalledByNative | 137 @CalledByNative |
| 135 public final void setTestMode() { | 138 public final void setTestMode() { |
| 136 mUseBackgroundThreadForTesting = true; | 139 mUseBackgroundThreadForTesting = true; |
| 137 } | 140 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 232 |
| 230 // Method for VideoCapture implementations to signal an asynchronous error. | 233 // Method for VideoCapture implementations to signal an asynchronous error. |
| 231 public native void nativeOnError(long nativeVideoCaptureDeviceAndroid, Strin
g message); | 234 public native void nativeOnError(long nativeVideoCaptureDeviceAndroid, Strin
g message); |
| 232 | 235 |
| 233 // Method for VideoCapture implementations to send Photos back to. | 236 // Method for VideoCapture implementations to send Photos back to. |
| 234 public native void nativeOnPhotoTaken( | 237 public native void nativeOnPhotoTaken( |
| 235 long nativeVideoCaptureDeviceAndroid, long callbackId, byte[] data); | 238 long nativeVideoCaptureDeviceAndroid, long callbackId, byte[] data); |
| 236 | 239 |
| 237 // Method for VideoCapture implementations to report device started event. | 240 // Method for VideoCapture implementations to report device started event. |
| 238 public native void nativeOnStarted(long nativeVideoCaptureDeviceAndroid); | 241 public native void nativeOnStarted(long nativeVideoCaptureDeviceAndroid); |
| 242 |
| 243 public native void nativeOnPointCloudAvailable(long nativeVideoCaptureDevice
Android, |
| 244 FloatBuffer pointCloudBuffer, int numPoints, double timestamp); |
| 239 } | 245 } |
| OLD | NEW |