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