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

Unified Diff: webrtc/api/peerconnectioninterface.h

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)
Patch Set: Get rid of unneeded comment. Created 3 years, 10 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 | « no previous file | webrtc/media/engine/webrtcmediaengine.h » ('j') | webrtc/pc/channelmanager_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnectioninterface.h
diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h
index ea94f504423e15c4841ad7feadcab770bbb6e3d9..ebc86d4dd3b3c976ebad1db76e8ad3ad3be92f5b 100644
--- a/webrtc/api/peerconnectioninterface.h
+++ b/webrtc/api/peerconnectioninterface.h
@@ -89,6 +89,7 @@
#include "webrtc/base/socketaddress.h"
#include "webrtc/base/sslstreamadapter.h"
#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/videocapturer.h"
#include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h"
#include "webrtc/p2p/base/portallocator.h"
@@ -966,16 +967,32 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
// Creates a VideoTrackSourceInterface. The new source takes ownership of
// |capturer|.
- // TODO(deadbeef): Switch to std::unique_ptr<>, to make this transfership of
- // ownership more clear.
+ // TODO(deadbeef): Make pure virtual once implemented by chromium subclasses.
the sun 2017/02/10 22:00:10 Do you mean MockPeerConnectionImpl?
Taylor Brandstetter 2017/02/11 01:50:08 Actually... It looks like there aren't any chromiu
Taylor Brandstetter 2017/02/11 02:13:22 Oh, but we DO have mock PC factory implementations
virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
- cricket::VideoCapturer* capturer) = 0;
+ std::unique_ptr<cricket::VideoCapturer> capturer) {
+ return nullptr;
+ }
// A video source creator that allows selection of resolution and frame rate.
// |constraints| decides video resolution and frame rate but can be NULL.
// In the NULL case, use the version above.
virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
+ std::unique_ptr<cricket::VideoCapturer> capturer,
+ const MediaConstraintsInterface* constraints) {
the sun 2017/02/10 22:00:10 Since we're clarifying ownership in this CL, what
Taylor Brandstetter 2017/02/11 01:50:08 It's only used within this method, so it's not req
+ return nullptr;
+ }
+
+ // Deprecated; please use the versions that take unique_ptrs above.
+ // TODO(deadbeef): Remove these once safe to do so.
+ virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
+ cricket::VideoCapturer* capturer) {
+ return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer));
+ }
+ virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
cricket::VideoCapturer* capturer,
- const MediaConstraintsInterface* constraints) = 0;
+ const MediaConstraintsInterface* constraints) {
+ return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer),
+ constraints);
+ }
// Creates a new local VideoTrack. The same |source| can be used in several
// tracks.
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcmediaengine.h » ('j') | webrtc/pc/channelmanager_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698