OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include <string> | 35 #include <string> |
36 #include <vector> | 36 #include <vector> |
37 | 37 |
38 #include "talk/media/base/codec.h" | 38 #include "talk/media/base/codec.h" |
39 #include "talk/media/base/mediachannel.h" | 39 #include "talk/media/base/mediachannel.h" |
40 #include "talk/media/base/mediacommon.h" | 40 #include "talk/media/base/mediacommon.h" |
41 #include "talk/media/base/videocapturer.h" | 41 #include "talk/media/base/videocapturer.h" |
42 #include "talk/media/base/videocommon.h" | 42 #include "talk/media/base/videocommon.h" |
43 #include "talk/media/base/voiceprocessor.h" | 43 #include "talk/media/base/voiceprocessor.h" |
44 #include "talk/media/devices/devicemanager.h" | 44 #include "talk/media/devices/devicemanager.h" |
45 #include "webrtc/audio_state.h" | |
45 #include "webrtc/base/fileutils.h" | 46 #include "webrtc/base/fileutils.h" |
46 #include "webrtc/base/sigslotrepeater.h" | 47 #include "webrtc/base/sigslotrepeater.h" |
47 | 48 |
48 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) | 49 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) |
49 #define DISABLE_MEDIA_ENGINE_FACTORY | 50 #define DISABLE_MEDIA_ENGINE_FACTORY |
50 #endif | 51 #endif |
51 | 52 |
52 namespace webrtc { | 53 namespace webrtc { |
53 class Call; | 54 class Call; |
54 class VoiceEngine; | |
55 } | 55 } |
56 | 56 |
57 namespace cricket { | 57 namespace cricket { |
58 | 58 |
59 class VideoCapturer; | 59 class VideoCapturer; |
60 | 60 |
61 // MediaEngineInterface is an abstraction of a media engine which can be | 61 // MediaEngineInterface is an abstraction of a media engine which can be |
62 // subclassed to support different media componentry backends. | 62 // subclassed to support different media componentry backends. |
63 // It supports voice and video operations in the same class to facilitate | 63 // It supports voice and video operations in the same class to facilitate |
64 // proper synchronization between both media types. | 64 // proper synchronization between both media types. |
65 class MediaEngineInterface { | 65 class MediaEngineInterface { |
66 public: | 66 public: |
67 virtual ~MediaEngineInterface() {} | 67 virtual ~MediaEngineInterface() {} |
68 | 68 |
69 // Initialization | 69 // Initialization |
70 // Starts the engine. | 70 // Starts the engine. |
71 virtual bool Init(rtc::Thread* worker_thread) = 0; | 71 virtual bool Init(rtc::Thread* worker_thread) = 0; |
72 // Shuts down the engine. | 72 // Shuts down the engine. |
73 virtual void Terminate() = 0; | 73 virtual void Terminate() = 0; |
74 // TODO(solenberg): Remove once VoE API refactoring is done. | 74 // TODO(solenberg): Remove once VoE API refactoring is done. |
75 virtual webrtc::VoiceEngine* GetVoE() = 0; | 75 virtual rtc::linked_ptr<webrtc::AudioState> GetAudioState() const = 0; |
tommi
2015/11/02 13:46:53
are there any threading requirements for being all
the sun
2015/11/03 12:41:07
No, the returned smart pointer should be thread sa
| |
76 | 76 |
77 // MediaChannel creation | 77 // MediaChannel creation |
78 // Creates a voice media channel. Returns NULL on failure. | 78 // Creates a voice media channel. Returns NULL on failure. |
79 virtual VoiceMediaChannel* CreateChannel( | 79 virtual VoiceMediaChannel* CreateChannel( |
80 webrtc::Call* call, | 80 webrtc::Call* call, |
81 const AudioOptions& options) = 0; | 81 const AudioOptions& options) = 0; |
82 // Creates a video media channel, paired with the specified voice channel. | 82 // Creates a video media channel, paired with the specified voice channel. |
83 // Returns NULL on failure. | 83 // Returns NULL on failure. |
84 virtual VideoMediaChannel* CreateVideoChannel( | 84 virtual VideoMediaChannel* CreateVideoChannel( |
85 webrtc::Call* call, | 85 webrtc::Call* call, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 virtual bool Init(rtc::Thread* worker_thread) { | 160 virtual bool Init(rtc::Thread* worker_thread) { |
161 if (!voice_.Init(worker_thread)) | 161 if (!voice_.Init(worker_thread)) |
162 return false; | 162 return false; |
163 video_.Init(); | 163 video_.Init(); |
164 return true; | 164 return true; |
165 } | 165 } |
166 virtual void Terminate() { | 166 virtual void Terminate() { |
167 voice_.Terminate(); | 167 voice_.Terminate(); |
168 } | 168 } |
169 | 169 |
170 virtual webrtc::VoiceEngine* GetVoE() { | 170 virtual rtc::linked_ptr<webrtc::AudioState> GetAudioState() const { |
171 return voice_.GetVoE(); | 171 return voice_.GetAudioState(); |
172 } | 172 } |
173 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 173 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
174 const AudioOptions& options) { | 174 const AudioOptions& options) { |
175 return voice_.CreateChannel(call, options); | 175 return voice_.CreateChannel(call, options); |
176 } | 176 } |
177 virtual VideoMediaChannel* CreateVideoChannel(webrtc::Call* call, | 177 virtual VideoMediaChannel* CreateVideoChannel(webrtc::Call* call, |
178 const VideoOptions& options) { | 178 const VideoOptions& options) { |
179 return video_.CreateChannel(call, options); | 179 return video_.CreateChannel(call, options); |
180 } | 180 } |
181 | 181 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 class DataEngineInterface { | 316 class DataEngineInterface { |
317 public: | 317 public: |
318 virtual ~DataEngineInterface() {} | 318 virtual ~DataEngineInterface() {} |
319 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; | 319 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
320 virtual const std::vector<DataCodec>& data_codecs() = 0; | 320 virtual const std::vector<DataCodec>& data_codecs() = 0; |
321 }; | 321 }; |
322 | 322 |
323 } // namespace cricket | 323 } // namespace cricket |
324 | 324 |
325 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ | 325 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ |
OLD | NEW |