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_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
6 #define MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 6 #define MEDIA_CAPTURE_VIDEO_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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void OnError(JNIEnv* env, | 94 void OnError(JNIEnv* env, |
95 const base::android::JavaParamRef<jobject>& obj, | 95 const base::android::JavaParamRef<jobject>& obj, |
96 const base::android::JavaParamRef<jstring>& message); | 96 const base::android::JavaParamRef<jstring>& message); |
97 | 97 |
98 // Implement org.chromium.media.VideoCapture.nativeOnPhotoTaken. | 98 // Implement org.chromium.media.VideoCapture.nativeOnPhotoTaken. |
99 void OnPhotoTaken(JNIEnv* env, | 99 void OnPhotoTaken(JNIEnv* env, |
100 const base::android::JavaParamRef<jobject>& obj, | 100 const base::android::JavaParamRef<jobject>& obj, |
101 jlong callback_id, | 101 jlong callback_id, |
102 const base::android::JavaParamRef<jbyteArray>& data); | 102 const base::android::JavaParamRef<jbyteArray>& data); |
103 | 103 |
| 104 // Implement org.chromium.media.VideoCapture.nativeOnStarted. |
| 105 void OnStarted(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 106 |
104 void ConfigureForTesting(); | 107 void ConfigureForTesting(); |
105 | 108 |
106 private: | 109 private: |
107 enum InternalState { | 110 enum InternalState { |
108 kIdle, // The device is opened but not in use. | 111 kIdle, // The device is opened but not in use. |
109 kConfigured, // The device has been AllocateAndStart()ed. | 112 kConfigured, // The device has been AllocateAndStart()ed. |
110 kError // Hit error. User needs to recover by destroying the object. | 113 kError // Hit error. User needs to recover by destroying the object. |
111 }; | 114 }; |
112 | 115 |
113 VideoPixelFormat GetColorspace(); | 116 VideoPixelFormat GetColorspace(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 base::android::ScopedJavaLocalRef<jobject> j_capture_; | 149 base::android::ScopedJavaLocalRef<jobject> j_capture_; |
147 | 150 |
148 base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_; | 151 base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_; |
149 | 152 |
150 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); | 153 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); |
151 }; | 154 }; |
152 | 155 |
153 } // namespace media | 156 } // namespace media |
154 | 157 |
155 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 158 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
OLD | NEW |