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 |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
15 #include "media/video/capture/video_capture_device.h" | 15 #include "media/video/capture/video_capture_device.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 // VideoCaptureDevice on Android. The VideoCaptureDevice API's are called | 19 // VideoCaptureDevice on Android. The VideoCaptureDevice API's are called |
20 // by VideoCaptureManager on its own thread, while OnFrameAvailable is called | 20 // by VideoCaptureManager on its own thread, while OnFrameAvailable is called |
21 // on JAVA thread (i.e., UI thread). Both will access |state_| and |observer_|, | 21 // on JAVA thread (i.e., UI thread). Both will access |state_| and |observer_|, |
22 // but only VideoCaptureManager would change their value. | 22 // but only VideoCaptureManager would change their value. |
23 class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice { | 23 class MEDIA_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice1 { |
24 public: | 24 public: |
25 virtual ~VideoCaptureDeviceAndroid(); | 25 virtual ~VideoCaptureDeviceAndroid(); |
26 | 26 |
27 static VideoCaptureDevice* Create(const Name& device_name); | 27 static VideoCaptureDevice* Create(const Name& device_name); |
28 static bool RegisterVideoCaptureDevice(JNIEnv* env); | 28 static bool RegisterVideoCaptureDevice(JNIEnv* env); |
29 | 29 |
30 // VideoCaptureDevice implementation. | 30 // VideoCaptureDevice implementation. |
31 virtual void Allocate(const VideoCaptureCapability& capture_format, | 31 virtual void Allocate(const VideoCaptureCapability& capture_format, |
32 EventHandler* observer) OVERRIDE; | 32 EventHandler* observer) OVERRIDE; |
33 virtual void Start() OVERRIDE; | 33 virtual void Start() OVERRIDE; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Java VideoCaptureAndroid instance. | 69 // Java VideoCaptureAndroid instance. |
70 base::android::ScopedJavaGlobalRef<jobject> j_capture_; | 70 base::android::ScopedJavaGlobalRef<jobject> j_capture_; |
71 | 71 |
72 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); | 72 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceAndroid); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace media | 75 } // namespace media |
76 | 76 |
77 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ | 77 #endif // MEDIA_VIDEO_CAPTURE_ANDROID_VIDEO_CAPTURE_DEVICE_ANDROID_H_ |
OLD | NEW |