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

Side by Side Diff: webrtc/api/peerconnectioninterface.h

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)
Patch Set: Rebase onto master 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 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
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "webrtc/api/stats/rtcstatscollectorcallback.h" 83 #include "webrtc/api/stats/rtcstatscollectorcallback.h"
84 #include "webrtc/api/statstypes.h" 84 #include "webrtc/api/statstypes.h"
85 #include "webrtc/api/umametrics.h" 85 #include "webrtc/api/umametrics.h"
86 #include "webrtc/base/fileutils.h" 86 #include "webrtc/base/fileutils.h"
87 #include "webrtc/base/network.h" 87 #include "webrtc/base/network.h"
88 #include "webrtc/base/rtccertificate.h" 88 #include "webrtc/base/rtccertificate.h"
89 #include "webrtc/base/rtccertificategenerator.h" 89 #include "webrtc/base/rtccertificategenerator.h"
90 #include "webrtc/base/socketaddress.h" 90 #include "webrtc/base/socketaddress.h"
91 #include "webrtc/base/sslstreamadapter.h" 91 #include "webrtc/base/sslstreamadapter.h"
92 #include "webrtc/media/base/mediachannel.h" 92 #include "webrtc/media/base/mediachannel.h"
93 #include "webrtc/media/base/videocapturer.h"
93 #include "webrtc/p2p/base/portallocator.h" 94 #include "webrtc/p2p/base/portallocator.h"
94 95
95 namespace rtc { 96 namespace rtc {
96 class SSLIdentity; 97 class SSLIdentity;
97 class Thread; 98 class Thread;
98 } 99 }
99 100
100 namespace cricket { 101 namespace cricket {
101 class WebRtcVideoDecoderFactory; 102 class WebRtcVideoDecoderFactory;
102 class WebRtcVideoEncoderFactory; 103 class WebRtcVideoEncoderFactory;
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 958
958 // Creates a AudioSourceInterface. 959 // Creates a AudioSourceInterface.
959 // |options| decides audio processing settings. 960 // |options| decides audio processing settings.
960 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( 961 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
961 const cricket::AudioOptions& options) = 0; 962 const cricket::AudioOptions& options) = 0;
962 // Deprecated - use version above. 963 // Deprecated - use version above.
963 // Can use CopyConstraintsIntoAudioOptions to bridge the gap. 964 // Can use CopyConstraintsIntoAudioOptions to bridge the gap.
964 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( 965 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
965 const MediaConstraintsInterface* constraints) = 0; 966 const MediaConstraintsInterface* constraints) = 0;
966 967
967 // Creates a VideoTrackSourceInterface. The new source takes ownership of 968 // Creates a VideoTrackSourceInterface. The new source takes ownership of
nisse-webrtc 2017/02/13 08:25:58 You could drop the ownership comment here too, sin
Taylor Brandstetter 2017/02/13 17:47:45 Done.
968 // |capturer|. 969 // |capturer|.
969 // TODO(deadbeef): Switch to std::unique_ptr<>, to make this transfership of 970 // TODO(deadbeef): Make pure virtual once downstream mock PC factory classes
970 // ownership more clear. 971 // are updated.
971 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( 972 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
972 cricket::VideoCapturer* capturer) = 0; 973 std::unique_ptr<cricket::VideoCapturer> capturer) {
nisse-webrtc 2017/02/13 08:25:58 We should aim to kill cricket::VideoCapturer. As f
Taylor Brandstetter 2017/02/13 17:47:45 Added TODO.
974 return nullptr;
975 }
976
973 // A video source creator that allows selection of resolution and frame rate. 977 // A video source creator that allows selection of resolution and frame rate.
974 // |constraints| decides video resolution and frame rate but can be NULL. 978 // |constraints| decides video resolution and frame rate but can be NULL.
975 // In the NULL case, use the version above. 979 // In the NULL case, use the version above.
980 //
981 // |constraints| is only used for the invocation of this method, and can
982 // safely be destroyed afterwards.
983 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
984 std::unique_ptr<cricket::VideoCapturer> capturer,
985 const MediaConstraintsInterface* constraints) {
986 return nullptr;
987 }
988
989 // Deprecated; please use the versions that take unique_ptrs above.
990 // TODO(deadbeef): Remove these once safe to do so.
991 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
992 cricket::VideoCapturer* capturer) {
993 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer));
994 }
976 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( 995 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource(
977 cricket::VideoCapturer* capturer, 996 cricket::VideoCapturer* capturer,
978 const MediaConstraintsInterface* constraints) = 0; 997 const MediaConstraintsInterface* constraints) {
998 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer),
999 constraints);
1000 }
979 1001
980 // Creates a new local VideoTrack. The same |source| can be used in several 1002 // Creates a new local VideoTrack. The same |source| can be used in several
981 // tracks. 1003 // tracks.
982 virtual rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack( 1004 virtual rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack(
983 const std::string& label, 1005 const std::string& label,
984 VideoTrackSourceInterface* source) = 0; 1006 VideoTrackSourceInterface* source) = 0;
985 1007
986 // Creates an new AudioTrack. At the moment |source| can be NULL. 1008 // Creates an new AudioTrack. At the moment |source| can be NULL.
987 virtual rtc::scoped_refptr<AudioTrackInterface> 1009 virtual rtc::scoped_refptr<AudioTrackInterface>
988 CreateAudioTrack(const std::string& label, 1010 CreateAudioTrack(const std::string& label,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 cricket::WebRtcVideoEncoderFactory* encoder_factory, 1156 cricket::WebRtcVideoEncoderFactory* encoder_factory,
1135 cricket::WebRtcVideoDecoderFactory* decoder_factory) { 1157 cricket::WebRtcVideoDecoderFactory* decoder_factory) {
1136 return CreatePeerConnectionFactory( 1158 return CreatePeerConnectionFactory(
1137 worker_and_network_thread, worker_and_network_thread, signaling_thread, 1159 worker_and_network_thread, worker_and_network_thread, signaling_thread,
1138 default_adm, encoder_factory, decoder_factory); 1160 default_adm, encoder_factory, decoder_factory);
1139 } 1161 }
1140 1162
1141 } // namespace webrtc 1163 } // namespace webrtc
1142 1164
1143 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ 1165 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698