OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
6 #define MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 6 #define MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 enum AndroidImageFormat { | 30 enum AndroidImageFormat { |
31 // Android graphics ImageFormat mapping, see reference in: | 31 // Android graphics ImageFormat mapping, see reference in: |
32 // http://developer.android.com/reference/android/graphics/ImageFormat.html | 32 // http://developer.android.com/reference/android/graphics/ImageFormat.html |
33 ANDROID_IMAGE_FORMAT_NV21 = 17, | 33 ANDROID_IMAGE_FORMAT_NV21 = 17, |
34 ANDROID_IMAGE_FORMAT_YUV_420_888 = 35, | 34 ANDROID_IMAGE_FORMAT_YUV_420_888 = 35, |
35 ANDROID_IMAGE_FORMAT_YV12 = 842094169, | 35 ANDROID_IMAGE_FORMAT_YV12 = 842094169, |
36 ANDROID_IMAGE_FORMAT_UNKNOWN = 0, | 36 ANDROID_IMAGE_FORMAT_UNKNOWN = 0, |
37 }; | 37 }; |
38 | 38 |
39 explicit VideoCaptureDeviceAndroid(const Name& device_name); | 39 explicit VideoCaptureDeviceAndroid(const Name& device_name); |
40 virtual ~VideoCaptureDeviceAndroid(); | 40 ~VideoCaptureDeviceAndroid() override; |
41 | 41 |
42 static VideoCaptureDevice* Create(const Name& device_name); | 42 static VideoCaptureDevice* Create(const Name& device_name); |
43 static bool RegisterVideoCaptureDevice(JNIEnv* env); | 43 static bool RegisterVideoCaptureDevice(JNIEnv* env); |
44 | 44 |
45 // Registers the Java VideoCaptureDevice pointer, used by the rest of the | 45 // Registers the Java VideoCaptureDevice pointer, used by the rest of the |
46 // methods of the class to operate the Java capture code. This method must be | 46 // methods of the class to operate the Java capture code. This method must be |
47 // called after the class constructor and before AllocateAndStart(). | 47 // called after the class constructor and before AllocateAndStart(). |
48 bool Init(); | 48 bool Init(); |
49 | 49 |
50 // VideoCaptureDevice implementation. | 50 // VideoCaptureDevice implementation. |
51 virtual void AllocateAndStart(const VideoCaptureParams& params, | 51 void AllocateAndStart(const VideoCaptureParams& params, |
52 scoped_ptr<Client> client) override; | 52 scoped_ptr<Client> client) override; |
53 virtual void StopAndDeAllocate() override; | 53 void StopAndDeAllocate() override; |
54 | 54 |
55 // Implement org.chromium.media.VideoCapture.nativeOnFrameAvailable. | 55 // Implement org.chromium.media.VideoCapture.nativeOnFrameAvailable. |
56 void OnFrameAvailable( | 56 void OnFrameAvailable( |
57 JNIEnv* env, | 57 JNIEnv* env, |
58 jobject obj, | 58 jobject obj, |
59 jbyteArray data, | 59 jbyteArray data, |
60 jint length, | 60 jint length, |
61 jint rotation); | 61 jint rotation); |
62 | 62 |
63 // Implement org.chromium.media.VideoCapture.nativeOnError. | 63 // Implement org.chromium.media.VideoCapture.nativeOnError. |
(...skipping 23 matching lines...) Expand all Loading... |
87 | 87 |
88 // Java VideoCaptureAndroid instance. | 88 // Java VideoCaptureAndroid instance. |
89 base::android::ScopedJavaLocalRef<jobject> j_capture_; | 89 base::android::ScopedJavaLocalRef<jobject> j_capture_; |
90 | 90 |
91 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); | 91 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); |
92 }; | 92 }; |
93 | 93 |
94 } // namespace media | 94 } // namespace media |
95 | 95 |
96 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 96 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
OLD | NEW |