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.annotations.CalledByNative; | 12 import org.chromium.base.annotations.CalledByNative; |
13 import org.chromium.base.annotations.JNINamespace; | 13 import org.chromium.base.annotations.JNINamespace; |
14 | 14 |
| 15 import java.nio.ByteBuffer; |
| 16 |
15 /** | 17 /** |
16 * Video Capture Device base class, defines a set of methods that native code | 18 * Video Capture Device base class, defines a set of methods that native code |
17 * needs to use to configure, start capture, and to be reached by callbacks and | 19 * needs to use to configure, start capture, and to be reached by callbacks and |
18 * provides some neccesary data type(s) with accessors. | 20 * provides some neccesary data type(s) with accessors. |
19 **/ | 21 **/ |
20 @JNINamespace("media") | 22 @JNINamespace("media") |
21 public abstract class VideoCapture { | 23 public abstract class VideoCapture { |
22 // The angle (0, 90, 180, 270) that the image needs to be rotated to show in | 24 // The angle (0, 90, 180, 270) that the image needs to be rotated to show in |
23 // the display's native orientation. | 25 // the display's native orientation. |
24 protected int mCameraNativeOrientation; | 26 protected int mCameraNativeOrientation; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 orientation = 0; | 117 orientation = 0; |
116 break; | 118 break; |
117 } | 119 } |
118 return orientation; | 120 return orientation; |
119 } | 121 } |
120 | 122 |
121 // Method for VideoCapture implementations to call back native code. | 123 // Method for VideoCapture implementations to call back native code. |
122 public native void nativeOnFrameAvailable( | 124 public native void nativeOnFrameAvailable( |
123 long nativeVideoCaptureDeviceAndroid, byte[] data, int length, int r
otation); | 125 long nativeVideoCaptureDeviceAndroid, byte[] data, int length, int r
otation); |
124 | 126 |
| 127 public native void nativeOnI420FrameAvailable(long nativeVideoCaptureDeviceA
ndroid, |
| 128 ByteBuffer yBuffer, int yStride, ByteBuffer uBuffer, ByteBuffer vBuf
fer, |
| 129 int uvRowStride, int uvPixelStride, int width, int height, int rotat
ion); |
| 130 |
125 // Method for VideoCapture implementations to signal an asynchronous error. | 131 // Method for VideoCapture implementations to signal an asynchronous error. |
126 public native void nativeOnError(long nativeVideoCaptureDeviceAndroid, Strin
g message); | 132 public native void nativeOnError(long nativeVideoCaptureDeviceAndroid, Strin
g message); |
127 | 133 |
128 // Method for VideoCapture implementations to send Photos back to. | 134 // Method for VideoCapture implementations to send Photos back to. |
129 public native void nativeOnPhotoTaken( | 135 public native void nativeOnPhotoTaken( |
130 long nativeVideoCaptureDeviceAndroid, long callbackId, byte[] data); | 136 long nativeVideoCaptureDeviceAndroid, long callbackId, byte[] data); |
131 } | 137 } |
OLD | NEW |