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 #include "webrtc/modules/video_capture/video_capture_impl.h" | 11 #include "webrtc/modules/video_capture/video_capture_impl.h" |
12 | 12 |
13 #include <stdlib.h> | 13 #include <stdlib.h> |
14 | 14 |
| 15 #include "webrtc/base/refcount.h" |
15 #include "webrtc/base/trace_event.h" | 16 #include "webrtc/base/trace_event.h" |
16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 17 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
17 #include "webrtc/modules/include/module_common_types.h" | 18 #include "webrtc/modules/include/module_common_types.h" |
18 #include "webrtc/modules/video_capture/video_capture_config.h" | 19 #include "webrtc/modules/video_capture/video_capture_config.h" |
19 #include "webrtc/system_wrappers/include/clock.h" | 20 #include "webrtc/system_wrappers/include/clock.h" |
20 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 21 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
21 #include "webrtc/system_wrappers/include/logging.h" | 22 #include "webrtc/system_wrappers/include/logging.h" |
22 #include "webrtc/system_wrappers/include/ref_count.h" | |
23 #include "webrtc/system_wrappers/include/tick_util.h" | 23 #include "webrtc/system_wrappers/include/tick_util.h" |
24 | 24 |
25 namespace webrtc | 25 namespace webrtc { |
26 { | 26 namespace videocapturemodule { |
27 | 27 rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create( |
28 namespace videocapturemodule | |
29 { | |
30 VideoCaptureModule* VideoCaptureImpl::Create( | |
31 const int32_t id, | 28 const int32_t id, |
32 VideoCaptureExternal*& externalCapture) | 29 VideoCaptureExternal*& externalCapture) { |
33 { | 30 rtc::scoped_refptr<VideoCaptureImpl> implementation( |
34 RefCountImpl<VideoCaptureImpl>* implementation = | 31 new rtc::RefCountedObject<VideoCaptureImpl>(id)); |
35 new RefCountImpl<VideoCaptureImpl>(id); | 32 externalCapture = implementation.get(); |
36 externalCapture = implementation; | 33 return implementation; |
37 return implementation; | |
38 } | 34 } |
39 | 35 |
40 const char* VideoCaptureImpl::CurrentDeviceName() const | 36 const char* VideoCaptureImpl::CurrentDeviceName() const |
41 { | 37 { |
42 return _deviceUniqueId; | 38 return _deviceUniqueId; |
43 } | 39 } |
44 | 40 |
45 // static | 41 // static |
46 int32_t VideoCaptureImpl::RotationFromDegrees(int degrees, | 42 int32_t VideoCaptureImpl::RotationFromDegrees(int degrees, |
47 VideoRotation* rotation) { | 43 VideoRotation* rotation) { |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 if (diff > 0) | 378 if (diff > 0) |
383 { | 379 { |
384 return uint32_t((nrOfFrames * 1000.0f / diff) + 0.5f); | 380 return uint32_t((nrOfFrames * 1000.0f / diff) + 0.5f); |
385 } | 381 } |
386 } | 382 } |
387 | 383 |
388 return nrOfFrames; | 384 return nrOfFrames; |
389 } | 385 } |
390 } // namespace videocapturemodule | 386 } // namespace videocapturemodule |
391 } // namespace webrtc | 387 } // namespace webrtc |
OLD | NEW |