OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 15 matching lines...) Expand all Loading... |
26 #include "webrtc/media/base/mediachannel.h" | 26 #include "webrtc/media/base/mediachannel.h" |
27 #include "webrtc/media/base/mediacommon.h" | 27 #include "webrtc/media/base/mediacommon.h" |
28 #include "webrtc/media/base/videocapturer.h" | 28 #include "webrtc/media/base/videocapturer.h" |
29 #include "webrtc/media/base/videocommon.h" | 29 #include "webrtc/media/base/videocommon.h" |
30 | 30 |
31 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) | 31 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) |
32 #define DISABLE_MEDIA_ENGINE_FACTORY | 32 #define DISABLE_MEDIA_ENGINE_FACTORY |
33 #endif | 33 #endif |
34 | 34 |
35 namespace webrtc { | 35 namespace webrtc { |
| 36 class AudioDeviceModule; |
36 class Call; | 37 class Call; |
37 } | 38 } |
38 | 39 |
39 namespace cricket { | 40 namespace cricket { |
40 | 41 |
41 class VideoCapturer; | 42 class VideoCapturer; |
42 | 43 |
43 struct RtpCapabilities { | 44 struct RtpCapabilities { |
44 std::vector<RtpHeaderExtension> header_extensions; | 45 std::vector<RtpHeaderExtension> header_extensions; |
45 }; | 46 }; |
46 | 47 |
47 // MediaEngineInterface is an abstraction of a media engine which can be | 48 // MediaEngineInterface is an abstraction of a media engine which can be |
48 // subclassed to support different media componentry backends. | 49 // subclassed to support different media componentry backends. |
49 // It supports voice and video operations in the same class to facilitate | 50 // It supports voice and video operations in the same class to facilitate |
50 // proper synchronization between both media types. | 51 // proper synchronization between both media types. |
51 class MediaEngineInterface { | 52 class MediaEngineInterface { |
52 public: | 53 public: |
53 virtual ~MediaEngineInterface() {} | 54 virtual ~MediaEngineInterface() {} |
54 | 55 |
55 // Initialization | 56 // Initialization |
56 // Starts the engine. | 57 // Starts the engine. |
57 virtual bool Init(rtc::Thread* worker_thread) = 0; | 58 virtual bool Init() = 0; |
58 // Shuts down the engine. | 59 // Shuts down the engine. |
59 virtual void Terminate() = 0; | 60 virtual void Terminate() = 0; |
60 // TODO(solenberg): Remove once VoE API refactoring is done. | 61 // TODO(solenberg): Remove once VoE API refactoring is done. |
61 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const = 0; | 62 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const = 0; |
62 | 63 |
63 // MediaChannel creation | 64 // MediaChannel creation |
64 // Creates a voice media channel. Returns NULL on failure. | 65 // Creates a voice media channel. Returns NULL on failure. |
65 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 66 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
66 const MediaConfig& config, | 67 const MediaConfig& config, |
67 const AudioOptions& options) = 0; | 68 const AudioOptions& options) = 0; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 private: | 119 private: |
119 static MediaEngineCreateFunction create_function_; | 120 static MediaEngineCreateFunction create_function_; |
120 }; | 121 }; |
121 #endif | 122 #endif |
122 | 123 |
123 // CompositeMediaEngine constructs a MediaEngine from separate | 124 // CompositeMediaEngine constructs a MediaEngine from separate |
124 // voice and video engine classes. | 125 // voice and video engine classes. |
125 template<class VOICE, class VIDEO> | 126 template<class VOICE, class VIDEO> |
126 class CompositeMediaEngine : public MediaEngineInterface { | 127 class CompositeMediaEngine : public MediaEngineInterface { |
127 public: | 128 public: |
| 129 explicit CompositeMediaEngine(webrtc::AudioDeviceModule* adm) : voice_(adm) {} |
128 virtual ~CompositeMediaEngine() {} | 130 virtual ~CompositeMediaEngine() {} |
129 virtual bool Init(rtc::Thread* worker_thread) { | 131 virtual bool Init() { |
130 if (!voice_.Init(worker_thread)) | 132 if (!voice_.Init()) |
131 return false; | 133 return false; |
132 video_.Init(); | 134 video_.Init(); |
133 return true; | 135 return true; |
134 } | 136 } |
135 virtual void Terminate() { | 137 virtual void Terminate() { |
136 voice_.Terminate(); | 138 voice_.Terminate(); |
137 } | 139 } |
138 | 140 |
139 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { | 141 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { |
140 return voice_.GetAudioState(); | 142 return voice_.GetAudioState(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 virtual ~DataEngineInterface() {} | 205 virtual ~DataEngineInterface() {} |
204 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; | 206 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
205 virtual const std::vector<DataCodec>& data_codecs() = 0; | 207 virtual const std::vector<DataCodec>& data_codecs() = 0; |
206 }; | 208 }; |
207 | 209 |
208 webrtc::RtpParameters CreateRtpParametersWithOneEncoding(); | 210 webrtc::RtpParameters CreateRtpParametersWithOneEncoding(); |
209 | 211 |
210 } // namespace cricket | 212 } // namespace cricket |
211 | 213 |
212 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ | 214 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ |
OLD | NEW |