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

Side by Side Diff: webrtc/media/base/mediaengine.h

Issue 1830213002: Remove WVoE::SetAudioDeviceModule() - it is now set in ctor. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 8 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
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/engine/fakewebrtcvoiceengine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 virtual void Terminate() = 0;
60 // TODO(solenberg): Remove once VoE API refactoring is done. 59 // TODO(solenberg): Remove once VoE API refactoring is done.
61 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const = 0; 60 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const = 0;
62 61
63 // MediaChannel creation 62 // MediaChannel creation
64 // Creates a voice media channel. Returns NULL on failure. 63 // Creates a voice media channel. Returns NULL on failure.
65 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, 64 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call,
66 const MediaConfig& config, 65 const MediaConfig& config,
67 const AudioOptions& options) = 0; 66 const AudioOptions& options) = 0;
68 // Creates a video media channel, paired with the specified voice channel. 67 // Creates a video media channel, paired with the specified voice channel.
69 // Returns NULL on failure. 68 // Returns NULL on failure.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 private: 117 private:
119 static MediaEngineCreateFunction create_function_; 118 static MediaEngineCreateFunction create_function_;
120 }; 119 };
121 #endif 120 #endif
122 121
123 // CompositeMediaEngine constructs a MediaEngine from separate 122 // CompositeMediaEngine constructs a MediaEngine from separate
124 // voice and video engine classes. 123 // voice and video engine classes.
125 template<class VOICE, class VIDEO> 124 template<class VOICE, class VIDEO>
126 class CompositeMediaEngine : public MediaEngineInterface { 125 class CompositeMediaEngine : public MediaEngineInterface {
127 public: 126 public:
127 explicit CompositeMediaEngine(webrtc::AudioDeviceModule* adm) : voice_(adm) {}
128 virtual ~CompositeMediaEngine() {} 128 virtual ~CompositeMediaEngine() {}
129 virtual bool Init(rtc::Thread* worker_thread) { 129 virtual bool Init() {
130 if (!voice_.Init(worker_thread))
131 return false;
132 video_.Init(); 130 video_.Init();
133 return true; 131 return true;
134 } 132 }
135 virtual void Terminate() {
136 voice_.Terminate();
137 }
138 133
139 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { 134 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const {
140 return voice_.GetAudioState(); 135 return voice_.GetAudioState();
141 } 136 }
142 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, 137 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call,
143 const MediaConfig& config, 138 const MediaConfig& config,
144 const AudioOptions& options) { 139 const AudioOptions& options) {
145 return voice_.CreateChannel(call, config, options); 140 return voice_.CreateChannel(call, config, options);
146 } 141 }
147 virtual VideoMediaChannel* CreateVideoChannel(webrtc::Call* call, 142 virtual VideoMediaChannel* CreateVideoChannel(webrtc::Call* call,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 virtual ~DataEngineInterface() {} 198 virtual ~DataEngineInterface() {}
204 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; 199 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0;
205 virtual const std::vector<DataCodec>& data_codecs() = 0; 200 virtual const std::vector<DataCodec>& data_codecs() = 0;
206 }; 201 };
207 202
208 webrtc::RtpParameters CreateRtpParametersWithOneEncoding(); 203 webrtc::RtpParameters CreateRtpParametersWithOneEncoding();
209 204
210 } // namespace cricket 205 } // namespace cricket
211 206
212 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ 207 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/engine/fakewebrtcvoiceengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698