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 11 matching lines...) Expand all Loading... |
22 // on JAVA thread (i.e., UI thread). Both will access |state_| and |client_|, | 22 // on JAVA thread (i.e., UI thread). Both will access |state_| and |client_|, |
23 // but only VideoCaptureManager would change their value. | 23 // but only VideoCaptureManager would change their value. |
24 class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice { | 24 class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice { |
25 public: | 25 public: |
26 virtual ~VideoCaptureDeviceAndroid(); | 26 virtual ~VideoCaptureDeviceAndroid(); |
27 | 27 |
28 static VideoCaptureDevice* Create(const Name& device_name); | 28 static VideoCaptureDevice* Create(const Name& device_name); |
29 static bool RegisterVideoCaptureDevice(JNIEnv* env); | 29 static bool RegisterVideoCaptureDevice(JNIEnv* env); |
30 | 30 |
31 // VideoCaptureDevice implementation. | 31 // VideoCaptureDevice implementation. |
32 virtual void AllocateAndStart(const VideoCaptureParams& params, | 32 virtual void AllocateAndStart( |
33 scoped_ptr<Client> client) OVERRIDE; | 33 const VideoCaptureCapability& capture_format, |
| 34 scoped_ptr<Client> client) OVERRIDE; |
34 virtual void StopAndDeAllocate() OVERRIDE; | 35 virtual void StopAndDeAllocate() OVERRIDE; |
35 | 36 |
36 // Implement org.chromium.media.VideoCapture.nativeOnFrameAvailable. | 37 // Implement org.chromium.media.VideoCapture.nativeOnFrameAvailable. |
37 void OnFrameAvailable( | 38 void OnFrameAvailable( |
38 JNIEnv* env, | 39 JNIEnv* env, |
39 jobject obj, | 40 jobject obj, |
40 jbyteArray data, | 41 jbyteArray data, |
41 jint length, | 42 jint length, |
42 jint rotation, | 43 jint rotation, |
43 jboolean flip_vert, | 44 jboolean flip_vert, |
(...skipping 21 matching lines...) Expand all Loading... |
65 // Prevent racing on accessing |state_| and |client_| since both could be | 66 // Prevent racing on accessing |state_| and |client_| since both could be |
66 // accessed from different threads. | 67 // accessed from different threads. |
67 base::Lock lock_; | 68 base::Lock lock_; |
68 InternalState state_; | 69 InternalState state_; |
69 bool got_first_frame_; | 70 bool got_first_frame_; |
70 base::TimeTicks expected_next_frame_time_; | 71 base::TimeTicks expected_next_frame_time_; |
71 base::TimeDelta frame_interval_; | 72 base::TimeDelta frame_interval_; |
72 scoped_ptr<VideoCaptureDevice::Client> client_; | 73 scoped_ptr<VideoCaptureDevice::Client> client_; |
73 | 74 |
74 Name device_name_; | 75 Name device_name_; |
75 VideoCaptureFormat capture_format_; | 76 VideoCaptureCapability current_settings_; |
76 | 77 |
77 // Java VideoCaptureAndroid instance. | 78 // Java VideoCaptureAndroid instance. |
78 base::android::ScopedJavaGlobalRef<jobject> j_capture_; | 79 base::android::ScopedJavaGlobalRef<jobject> j_capture_; |
79 | 80 |
80 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); | 81 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); |
81 }; | 82 }; |
82 | 83 |
83 } // namespace media | 84 } // namespace media |
84 | 85 |
85 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 86 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
OLD | NEW |