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

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

Issue 2799033006: Injectable audio encoders: Moved audio encoder, factory and builtin factory to api/. (Closed)
Patch Set: More backwards-compatibility! Created 3 years, 7 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 (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
11 #ifndef WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ 11 #ifndef WEBRTC_MEDIA_BASE_MEDIAENGINE_H_
12 #define WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ 12 #define WEBRTC_MEDIA_BASE_MEDIAENGINE_H_
13 13
14 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) 14 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
15 #include <CoreAudio/CoreAudio.h> 15 #include <CoreAudio/CoreAudio.h>
16 #endif 16 #endif
17 17
18 #include <string> 18 #include <string>
19 #include <vector> 19 #include <vector>
20 20
21 #include "webrtc/api/audio_codecs/audio_decoder_factory.h" 21 #include "webrtc/api/audio_codecs/audio_decoder_factory.h"
22 #include "webrtc/api/audio_codecs/audio_encoder_factory.h"
22 #include "webrtc/api/rtpparameters.h" 23 #include "webrtc/api/rtpparameters.h"
23 #include "webrtc/base/fileutils.h" 24 #include "webrtc/base/fileutils.h"
24 #include "webrtc/base/sigslotrepeater.h" 25 #include "webrtc/base/sigslotrepeater.h"
25 #include "webrtc/call/audio_state.h" 26 #include "webrtc/call/audio_state.h"
26 #include "webrtc/media/base/codec.h" 27 #include "webrtc/media/base/codec.h"
27 #include "webrtc/media/base/mediachannel.h" 28 #include "webrtc/media/base/mediachannel.h"
28 #include "webrtc/media/base/videocommon.h" 29 #include "webrtc/media/base/videocommon.h"
29 30
30 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) 31 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD)
31 #define DISABLE_MEDIA_ENGINE_FACTORY 32 #define DISABLE_MEDIA_ENGINE_FACTORY
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 static MediaEngineCreateFunction create_function_; 106 static MediaEngineCreateFunction create_function_;
106 }; 107 };
107 #endif 108 #endif
108 109
109 // CompositeMediaEngine constructs a MediaEngine from separate 110 // CompositeMediaEngine constructs a MediaEngine from separate
110 // voice and video engine classes. 111 // voice and video engine classes.
111 template<class VOICE, class VIDEO> 112 template<class VOICE, class VIDEO>
112 class CompositeMediaEngine : public MediaEngineInterface { 113 class CompositeMediaEngine : public MediaEngineInterface {
113 public: 114 public:
114 CompositeMediaEngine(webrtc::AudioDeviceModule* adm, 115 CompositeMediaEngine(webrtc::AudioDeviceModule* adm,
116 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
117 audio_encoder_factory,
115 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& 118 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
116 audio_decoder_factory, 119 audio_decoder_factory,
117 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) 120 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer)
118 : voice_(adm, audio_decoder_factory, audio_mixer) {} 121 : voice_(adm, audio_encoder_factory, audio_decoder_factory, audio_mixer) {
122 }
119 virtual ~CompositeMediaEngine() {} 123 virtual ~CompositeMediaEngine() {}
120 virtual bool Init() { 124 virtual bool Init() {
121 video_.Init(); 125 video_.Init();
122 return true; 126 return true;
123 } 127 }
124 128
125 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { 129 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const {
126 return voice_.GetAudioState(); 130 return voice_.GetAudioState();
127 } 131 }
128 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, 132 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 virtual ~DataEngineInterface() {} 177 virtual ~DataEngineInterface() {}
174 virtual DataMediaChannel* CreateChannel(const MediaConfig& config) = 0; 178 virtual DataMediaChannel* CreateChannel(const MediaConfig& config) = 0;
175 virtual const std::vector<DataCodec>& data_codecs() = 0; 179 virtual const std::vector<DataCodec>& data_codecs() = 0;
176 }; 180 };
177 181
178 webrtc::RtpParameters CreateRtpParametersWithOneEncoding(); 182 webrtc::RtpParameters CreateRtpParametersWithOneEncoding();
179 183
180 } // namespace cricket 184 } // namespace cricket
181 185
182 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ 186 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/fakemediaengine.h ('k') | webrtc/media/engine/nullwebrtcvideoengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698