OLD | NEW |
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 #include "webrtc/api/rtpsenderinterface.h" | 82 #include "webrtc/api/rtpsenderinterface.h" |
83 #include "webrtc/api/statstypes.h" | 83 #include "webrtc/api/statstypes.h" |
84 #include "webrtc/api/umametrics.h" | 84 #include "webrtc/api/umametrics.h" |
85 #include "webrtc/base/fileutils.h" | 85 #include "webrtc/base/fileutils.h" |
86 #include "webrtc/base/network.h" | 86 #include "webrtc/base/network.h" |
87 #include "webrtc/base/rtccertificate.h" | 87 #include "webrtc/base/rtccertificate.h" |
88 #include "webrtc/base/rtccertificategenerator.h" | 88 #include "webrtc/base/rtccertificategenerator.h" |
89 #include "webrtc/base/socketaddress.h" | 89 #include "webrtc/base/socketaddress.h" |
90 #include "webrtc/base/sslstreamadapter.h" | 90 #include "webrtc/base/sslstreamadapter.h" |
91 #include "webrtc/media/base/mediachannel.h" | 91 #include "webrtc/media/base/mediachannel.h" |
| 92 #include "webrtc/media/base/videocapturer.h" |
92 #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h" | 93 #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.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; |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
968 // |capturer|. | 969 // |capturer|. |
969 // TODO(deadbeef): Switch to std::unique_ptr<>, to make this transfership of | 970 // TODO(deadbeef): Make pure virtual once implemented by chromium subclasses. |
970 // ownership more clear. | |
971 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( | 971 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( |
972 cricket::VideoCapturer* capturer) = 0; | 972 std::unique_ptr<cricket::VideoCapturer> capturer) { |
| 973 return nullptr; |
| 974 } |
973 // A video source creator that allows selection of resolution and frame rate. | 975 // A video source creator that allows selection of resolution and frame rate. |
974 // |constraints| decides video resolution and frame rate but can be NULL. | 976 // |constraints| decides video resolution and frame rate but can be NULL. |
975 // In the NULL case, use the version above. | 977 // In the NULL case, use the version above. |
976 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( | 978 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( |
| 979 std::unique_ptr<cricket::VideoCapturer> capturer, |
| 980 const MediaConstraintsInterface* constraints) { |
| 981 return nullptr; |
| 982 } |
| 983 |
| 984 // Deprecated; please use the versions that take unique_ptrs above. |
| 985 // TODO(deadbeef): Remove these once safe to do so. |
| 986 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( |
| 987 cricket::VideoCapturer* capturer) { |
| 988 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer)); |
| 989 } |
| 990 virtual rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoSource( |
977 cricket::VideoCapturer* capturer, | 991 cricket::VideoCapturer* capturer, |
978 const MediaConstraintsInterface* constraints) = 0; | 992 const MediaConstraintsInterface* constraints) { |
| 993 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer), |
| 994 constraints); |
| 995 } |
979 | 996 |
980 // Creates a new local VideoTrack. The same |source| can be used in several | 997 // Creates a new local VideoTrack. The same |source| can be used in several |
981 // tracks. | 998 // tracks. |
982 virtual rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack( | 999 virtual rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack( |
983 const std::string& label, | 1000 const std::string& label, |
984 VideoTrackSourceInterface* source) = 0; | 1001 VideoTrackSourceInterface* source) = 0; |
985 | 1002 |
986 // Creates an new AudioTrack. At the moment |source| can be NULL. | 1003 // Creates an new AudioTrack. At the moment |source| can be NULL. |
987 virtual rtc::scoped_refptr<AudioTrackInterface> | 1004 virtual rtc::scoped_refptr<AudioTrackInterface> |
988 CreateAudioTrack(const std::string& label, | 1005 CreateAudioTrack(const std::string& label, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 1151 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
1135 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | 1152 cricket::WebRtcVideoDecoderFactory* decoder_factory) { |
1136 return CreatePeerConnectionFactory( | 1153 return CreatePeerConnectionFactory( |
1137 worker_and_network_thread, worker_and_network_thread, signaling_thread, | 1154 worker_and_network_thread, worker_and_network_thread, signaling_thread, |
1138 default_adm, encoder_factory, decoder_factory); | 1155 default_adm, encoder_factory, decoder_factory); |
1139 } | 1156 } |
1140 | 1157 |
1141 } // namespace webrtc | 1158 } // namespace webrtc |
1142 | 1159 |
1143 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 1160 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |