OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_IMPL_H_ |
12 #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_IMPL_H_ | 12 #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_IMPL_H_ |
13 | 13 |
14 /* | 14 /* |
15 * video_capture_impl.h | 15 * video_capture_impl.h |
16 */ | 16 */ |
17 | 17 |
| 18 #include "webrtc/base/scoped_ref_ptr.h" |
18 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 19 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
19 #include "webrtc/common_video/rotation.h" | 20 #include "webrtc/common_video/rotation.h" |
20 #include "webrtc/modules/video_capture/video_capture.h" | 21 #include "webrtc/modules/video_capture/video_capture.h" |
21 #include "webrtc/modules/video_capture/video_capture_config.h" | 22 #include "webrtc/modules/video_capture/video_capture_config.h" |
22 #include "webrtc/system_wrappers/include/tick_util.h" | 23 #include "webrtc/system_wrappers/include/tick_util.h" |
23 #include "webrtc/video_frame.h" | 24 #include "webrtc/video_frame.h" |
24 | 25 |
25 namespace webrtc | 26 namespace webrtc |
26 { | 27 { |
27 class CriticalSectionWrapper; | 28 class CriticalSectionWrapper; |
28 | 29 |
29 namespace videocapturemodule { | 30 namespace videocapturemodule { |
30 // Class definitions | 31 // Class definitions |
31 class VideoCaptureImpl: public VideoCaptureModule, public VideoCaptureExternal | 32 class VideoCaptureImpl: public VideoCaptureModule, public VideoCaptureExternal |
32 { | 33 { |
33 public: | 34 public: |
34 | 35 |
35 /* | 36 /* |
36 * Create a video capture module object | 37 * Create a video capture module object |
37 * | 38 * |
38 * id - unique identifier of this video capture module object | 39 * id - unique identifier of this video capture module object |
39 * deviceUniqueIdUTF8 - name of the device. Available names can be found
by using GetDeviceName | 40 * deviceUniqueIdUTF8 - name of the device. Available names can be found
by using GetDeviceName |
40 */ | 41 */ |
41 static VideoCaptureModule* Create(const int32_t id, | 42 static rtc::scoped_refptr<VideoCaptureModule> Create( |
42 const char* deviceUniqueIdUTF8); | 43 const int32_t id, |
| 44 const char* deviceUniqueIdUTF8); |
43 | 45 |
44 /* | 46 /* |
45 * Create a video capture module object used for external capture. | 47 * Create a video capture module object used for external capture. |
46 * | 48 * |
47 * id - unique identifier of this video capture module object | 49 * id - unique identifier of this video capture module object |
48 * externalCapture - [out] interface to call when a new frame is captured. | 50 * externalCapture - [out] interface to call when a new frame is captured. |
49 */ | 51 */ |
50 static VideoCaptureModule* Create(const int32_t id, | 52 static rtc::scoped_refptr<VideoCaptureModule> Create( |
51 VideoCaptureExternal*& externalCapture); | 53 const int32_t id, |
| 54 VideoCaptureExternal*& externalCapture); |
52 | 55 |
53 static DeviceInfo* CreateDeviceInfo(const int32_t id); | 56 static DeviceInfo* CreateDeviceInfo(const int32_t id); |
54 | 57 |
55 // Helpers for converting between (integral) degrees and | 58 // Helpers for converting between (integral) degrees and |
56 // VideoRotation values. Return 0 on success. | 59 // VideoRotation values. Return 0 on success. |
57 static int32_t RotationFromDegrees(int degrees, VideoRotation* rotation); | 60 static int32_t RotationFromDegrees(int degrees, VideoRotation* rotation); |
58 static int32_t RotationInDegrees(VideoRotation rotation, int* degrees); | 61 static int32_t RotationInDegrees(VideoRotation rotation, int* degrees); |
59 | 62 |
60 //Call backs | 63 //Call backs |
61 virtual void RegisterCaptureDataCallback( | 64 virtual void RegisterCaptureDataCallback( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // capture module. | 136 // capture module. |
134 | 137 |
135 VideoFrame _captureFrame; | 138 VideoFrame _captureFrame; |
136 | 139 |
137 // Indicate whether rotation should be applied before delivered externally. | 140 // Indicate whether rotation should be applied before delivered externally. |
138 bool apply_rotation_; | 141 bool apply_rotation_; |
139 }; | 142 }; |
140 } // namespace videocapturemodule | 143 } // namespace videocapturemodule |
141 } // namespace webrtc | 144 } // namespace webrtc |
142 #endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_IMPL_H_ | 145 #endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_IMPL_H_ |
OLD | NEW |