| 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 26 matching lines...) Expand all Loading... |
| 37 #include "talk/session/media/voicechannel.h" | 37 #include "talk/session/media/voicechannel.h" |
| 38 #include "webrtc/base/criticalsection.h" | 38 #include "webrtc/base/criticalsection.h" |
| 39 #include "webrtc/base/fileutils.h" | 39 #include "webrtc/base/fileutils.h" |
| 40 #include "webrtc/base/sigslotrepeater.h" | 40 #include "webrtc/base/sigslotrepeater.h" |
| 41 #include "webrtc/base/thread.h" | 41 #include "webrtc/base/thread.h" |
| 42 | 42 |
| 43 namespace cricket { | 43 namespace cricket { |
| 44 | 44 |
| 45 const int kDefaultAudioDelayOffset = 0; | 45 const int kDefaultAudioDelayOffset = 0; |
| 46 | 46 |
| 47 class VideoProcessor; | |
| 48 class VoiceChannel; | 47 class VoiceChannel; |
| 49 class VoiceProcessor; | 48 class VoiceProcessor; |
| 50 | 49 |
| 51 // ChannelManager allows the MediaEngine to run on a separate thread, and takes | 50 // ChannelManager allows the MediaEngine to run on a separate thread, and takes |
| 52 // care of marshalling calls between threads. It also creates and keeps track of | 51 // care of marshalling calls between threads. It also creates and keeps track of |
| 53 // voice and video channels; by doing so, it can temporarily pause all the | 52 // voice and video channels; by doing so, it can temporarily pause all the |
| 54 // channels when a new audio or video device is chosen. The voice and video | 53 // channels when a new audio or video device is chosen. The voice and video |
| 55 // channels are stored in separate vectors, to easily allow operations on just | 54 // channels are stored in separate vectors, to easily allow operations on just |
| 56 // voice or just video channels. | 55 // voice or just video channels. |
| 57 // ChannelManager also allows the application to discover what devices it has | 56 // ChannelManager also allows the application to discover what devices it has |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 bool monitoring() const { return monitoring_; } | 167 bool monitoring() const { return monitoring_; } |
| 169 bool capturing() const { return capturing_; } | 168 bool capturing() const { return capturing_; } |
| 170 | 169 |
| 171 // Configures the logging output of the mediaengine(s). | 170 // Configures the logging output of the mediaengine(s). |
| 172 void SetVoiceLogging(int level, const char* filter); | 171 void SetVoiceLogging(int level, const char* filter); |
| 173 void SetVideoLogging(int level, const char* filter); | 172 void SetVideoLogging(int level, const char* filter); |
| 174 | 173 |
| 175 // Gets capturer's supported formats in a thread safe manner | 174 // Gets capturer's supported formats in a thread safe manner |
| 176 std::vector<cricket::VideoFormat> GetSupportedFormats( | 175 std::vector<cricket::VideoFormat> GetSupportedFormats( |
| 177 VideoCapturer* capturer) const; | 176 VideoCapturer* capturer) const; |
| 178 // The channel manager handles the Tx side for Video processing, | 177 // The channel manager handles the Tx and Rx side for Voice processing. |
| 179 // as well as Tx and Rx side for Voice processing. | |
| 180 // (The Rx Video processing will go throug the simplerenderingmanager, | |
| 181 // to be implemented). | |
| 182 bool RegisterVideoProcessor(VideoCapturer* capturer, | |
| 183 VideoProcessor* processor); | |
| 184 bool UnregisterVideoProcessor(VideoCapturer* capturer, | |
| 185 VideoProcessor* processor); | |
| 186 bool RegisterVoiceProcessor(uint32 ssrc, | 178 bool RegisterVoiceProcessor(uint32 ssrc, |
| 187 VoiceProcessor* processor, | 179 VoiceProcessor* processor, |
| 188 MediaProcessorDirection direction); | 180 MediaProcessorDirection direction); |
| 189 bool UnregisterVoiceProcessor(uint32 ssrc, | 181 bool UnregisterVoiceProcessor(uint32 ssrc, |
| 190 VoiceProcessor* processor, | 182 VoiceProcessor* processor, |
| 191 MediaProcessorDirection direction); | 183 MediaProcessorDirection direction); |
| 192 // The following are done in the new "CaptureManager" style that | 184 // The following are done in the new "CaptureManager" style that |
| 193 // all local video capturers, processors, and managers should move to. | 185 // all local video capturers, processors, and managers should move to. |
| 194 // TODO(pthatcher): Make methods nicer by having start return a handle that | 186 // TODO(pthatcher): Make methods nicer by having start return a handle that |
| 195 // can be used for stop and restart, rather than needing to pass around | 187 // can be used for stop and restart, rather than needing to pass around |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 bool rtcp, DataChannelType data_channel_type); | 264 bool rtcp, DataChannelType data_channel_type); |
| 273 void DestroyDataChannel_w(DataChannel* data_channel); | 265 void DestroyDataChannel_w(DataChannel* data_channel); |
| 274 bool SetAudioOptions_w(const AudioOptions& options, int delay_offset, | 266 bool SetAudioOptions_w(const AudioOptions& options, int delay_offset, |
| 275 const Device* in_dev, const Device* out_dev); | 267 const Device* in_dev, const Device* out_dev); |
| 276 bool SetCaptureDevice_w(const Device* cam_device); | 268 bool SetCaptureDevice_w(const Device* cam_device); |
| 277 void OnVideoCaptureStateChange(VideoCapturer* capturer, | 269 void OnVideoCaptureStateChange(VideoCapturer* capturer, |
| 278 CaptureState result); | 270 CaptureState result); |
| 279 void GetSupportedFormats_w( | 271 void GetSupportedFormats_w( |
| 280 VideoCapturer* capturer, | 272 VideoCapturer* capturer, |
| 281 std::vector<cricket::VideoFormat>* out_formats) const; | 273 std::vector<cricket::VideoFormat>* out_formats) const; |
| 282 bool RegisterVideoProcessor_w(VideoCapturer* capturer, | |
| 283 VideoProcessor* processor); | |
| 284 bool UnregisterVideoProcessor_w(VideoCapturer* capturer, | |
| 285 VideoProcessor* processor); | |
| 286 bool IsScreencastRunning_w() const; | 274 bool IsScreencastRunning_w() const; |
| 287 virtual void OnMessage(rtc::Message *message); | 275 virtual void OnMessage(rtc::Message *message); |
| 288 | 276 |
| 289 rtc::scoped_ptr<MediaEngineInterface> media_engine_; | 277 rtc::scoped_ptr<MediaEngineInterface> media_engine_; |
| 290 rtc::scoped_ptr<DataEngineInterface> data_media_engine_; | 278 rtc::scoped_ptr<DataEngineInterface> data_media_engine_; |
| 291 rtc::scoped_ptr<DeviceManagerInterface> device_manager_; | 279 rtc::scoped_ptr<DeviceManagerInterface> device_manager_; |
| 292 rtc::scoped_ptr<CaptureManager> capture_manager_; | 280 rtc::scoped_ptr<CaptureManager> capture_manager_; |
| 293 bool initialized_; | 281 bool initialized_; |
| 294 rtc::Thread* main_thread_; | 282 rtc::Thread* main_thread_; |
| 295 rtc::Thread* worker_thread_; | 283 rtc::Thread* worker_thread_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 316 // but selected devices while this sting will be empty or contain current | 304 // but selected devices while this sting will be empty or contain current |
| 317 // selected device. | 305 // selected device. |
| 318 // TODO(hellner): refactor the code such that there is no need to keep two | 306 // TODO(hellner): refactor the code such that there is no need to keep two |
| 319 // strings for video devices that have subtle differences in behavior. | 307 // strings for video devices that have subtle differences in behavior. |
| 320 std::string video_device_name_; | 308 std::string video_device_name_; |
| 321 }; | 309 }; |
| 322 | 310 |
| 323 } // namespace cricket | 311 } // namespace cricket |
| 324 | 312 |
| 325 #endif // TALK_SESSION_MEDIA_CHANNELMANAGER_H_ | 313 #endif // TALK_SESSION_MEDIA_CHANNELMANAGER_H_ |
| OLD | NEW |