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

Unified Diff: webrtc/media/engine/webrtcvideocapturer.h

Issue 1817953005: Use rtc::scoped_refptr for WebRtcVideoCapturer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove incorrect early return Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/fakewebrtcvideocapturemodule.h ('k') | webrtc/media/engine/webrtcvideocapturer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideocapturer.h
diff --git a/webrtc/media/engine/webrtcvideocapturer.h b/webrtc/media/engine/webrtcvideocapturer.h
index a76f9dc8fcd9d17fdfa11b8cf179addec39501b7..b6b39386c1b6c5cade252753b626a5393ab23cdd 100644
--- a/webrtc/media/engine/webrtcvideocapturer.h
+++ b/webrtc/media/engine/webrtcvideocapturer.h
@@ -17,6 +17,7 @@
#include "webrtc/base/asyncinvoker.h"
#include "webrtc/base/messagehandler.h"
+#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/media/base/device.h"
#include "webrtc/media/base/videocapturer.h"
@@ -30,8 +31,9 @@ namespace cricket {
class WebRtcVcmFactoryInterface {
public:
virtual ~WebRtcVcmFactoryInterface() {}
- virtual webrtc::VideoCaptureModule* Create(
- int id, const char* device) = 0;
+ virtual rtc::scoped_refptr<webrtc::VideoCaptureModule> Create(
+ int id,
+ const char* device) = 0;
virtual webrtc::VideoCaptureModule::DeviceInfo* CreateDeviceInfo(int id) = 0;
virtual void DestroyDeviceInfo(
webrtc::VideoCaptureModule::DeviceInfo* info) = 0;
@@ -46,7 +48,7 @@ class WebRtcVideoCapturer : public VideoCapturer,
virtual ~WebRtcVideoCapturer();
bool Init(const Device& device);
- bool Init(webrtc::VideoCaptureModule* module);
+ bool Init(const rtc::scoped_refptr<webrtc::VideoCaptureModule>& module);
// Override virtual methods of the parent class VideoCapturer.
bool GetBestCaptureFormat(const VideoFormat& desired,
@@ -77,7 +79,7 @@ class WebRtcVideoCapturer : public VideoCapturer,
void SignalFrameCapturedOnStartThread(const webrtc::VideoFrame& frame);
std::unique_ptr<WebRtcVcmFactoryInterface> factory_;
- webrtc::VideoCaptureModule* module_;
+ rtc::scoped_refptr<webrtc::VideoCaptureModule> module_;
int captured_frames_;
std::vector<uint8_t> capture_buffer_;
rtc::Thread* start_thread_; // Set in Start(), unset in Stop();
« no previous file with comments | « webrtc/media/engine/fakewebrtcvideocapturemodule.h ('k') | webrtc/media/engine/webrtcvideocapturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698