| 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 void ConfigureForTesting(); |
| 105 |
| 104 private: | 106 private: |
| 105 enum InternalState { | 107 enum InternalState { |
| 106 kIdle, // The device is opened but not in use. | 108 kIdle, // The device is opened but not in use. |
| 107 kConfigured, // The device has been AllocateAndStart()ed. | 109 kConfigured, // The device has been AllocateAndStart()ed. |
| 108 kError // Hit error. User needs to recover by destroying the object. | 110 kError // Hit error. User needs to recover by destroying the object. |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 VideoPixelFormat GetColorspace(); | 113 VideoPixelFormat GetColorspace(); |
| 112 void SetErrorState(const tracked_objects::Location& from_here, | 114 void SetErrorState(const tracked_objects::Location& from_here, |
| 113 const std::string& reason); | 115 const std::string& reason); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 144 base::android::ScopedJavaLocalRef<jobject> j_capture_; | 146 base::android::ScopedJavaLocalRef<jobject> j_capture_; |
| 145 | 147 |
| 146 base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_; | 148 base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_; |
| 147 | 149 |
| 148 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); | 150 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); |
| 149 }; | 151 }; |
| 150 | 152 |
| 151 } // namespace media | 153 } // namespace media |
| 152 | 154 |
| 153 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 155 #endif // MEDIA_CAPTURE_VIDEO_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
| OLD | NEW |