Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: webrtc/modules/video_capture/video_capture_impl.cc

Issue 1477013005: Replace RefCountImpl with rtc::RefCountedObject. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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();
tommi 2016/01/07 16:41:40 hmm... should we file a bug for this?
pbos-webrtc 2016/01/07 17:23:16 Maybe, not sure if anyone wants to own it though,
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 if (diff > 0) 386 if (diff > 0)
391 { 387 {
392 return uint32_t((nrOfFrames * 1000.0f / diff) + 0.5f); 388 return uint32_t((nrOfFrames * 1000.0f / diff) + 0.5f);
393 } 389 }
394 } 390 }
395 391
396 return nrOfFrames; 392 return nrOfFrames;
397 } 393 }
398 } // namespace videocapturemodule 394 } // namespace videocapturemodule
399 } // namespace webrtc 395 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698