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 |
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/audio_state.h" | 21 #include "webrtc/audio_state.h" |
22 #include "webrtc/api/rtpparameters.h" | 22 #include "webrtc/api/rtpparameters.h" |
23 #include "webrtc/base/fileutils.h" | 23 #include "webrtc/base/fileutils.h" |
24 #include "webrtc/base/sigslotrepeater.h" | 24 #include "webrtc/base/sigslotrepeater.h" |
25 #include "webrtc/media/base/codec.h" | 25 #include "webrtc/media/base/codec.h" |
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 #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h" |
30 | 31 |
31 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) | 32 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) |
32 #define DISABLE_MEDIA_ENGINE_FACTORY | 33 #define DISABLE_MEDIA_ENGINE_FACTORY |
33 #endif | 34 #endif |
34 | 35 |
35 namespace webrtc { | 36 namespace webrtc { |
36 class AudioDeviceModule; | 37 class AudioDeviceModule; |
37 class Call; | 38 class Call; |
38 } | 39 } |
39 | 40 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 private: | 121 private: |
121 static MediaEngineCreateFunction create_function_; | 122 static MediaEngineCreateFunction create_function_; |
122 }; | 123 }; |
123 #endif | 124 #endif |
124 | 125 |
125 // CompositeMediaEngine constructs a MediaEngine from separate | 126 // CompositeMediaEngine constructs a MediaEngine from separate |
126 // voice and video engine classes. | 127 // voice and video engine classes. |
127 template<class VOICE, class VIDEO> | 128 template<class VOICE, class VIDEO> |
128 class CompositeMediaEngine : public MediaEngineInterface { | 129 class CompositeMediaEngine : public MediaEngineInterface { |
129 public: | 130 public: |
130 explicit CompositeMediaEngine(webrtc::AudioDeviceModule* adm) : voice_(adm) {} | 131 CompositeMediaEngine( |
| 132 webrtc::AudioDeviceModule* adm, |
| 133 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
| 134 audio_decoder_factory) |
| 135 : voice_(adm, audio_decoder_factory) {} |
131 virtual ~CompositeMediaEngine() {} | 136 virtual ~CompositeMediaEngine() {} |
132 virtual bool Init() { | 137 virtual bool Init() { |
133 video_.Init(); | 138 video_.Init(); |
134 return true; | 139 return true; |
135 } | 140 } |
136 | 141 |
137 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { | 142 virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const { |
138 return voice_.GetAudioState(); | 143 return voice_.GetAudioState(); |
139 } | 144 } |
140 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 145 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 virtual ~DataEngineInterface() {} | 207 virtual ~DataEngineInterface() {} |
203 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; | 208 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
204 virtual const std::vector<DataCodec>& data_codecs() = 0; | 209 virtual const std::vector<DataCodec>& data_codecs() = 0; |
205 }; | 210 }; |
206 | 211 |
207 webrtc::RtpParameters CreateRtpParametersWithOneEncoding(); | 212 webrtc::RtpParameters CreateRtpParametersWithOneEncoding(); |
208 | 213 |
209 } // namespace cricket | 214 } // namespace cricket |
210 | 215 |
211 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ | 216 #endif // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_ |
OLD | NEW |