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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 // Indicates whether the media engine is started. | 96 // Indicates whether the media engine is started. |
97 bool initialized() const { return initialized_; } | 97 bool initialized() const { return initialized_; } |
98 // Starts up the media engine. | 98 // Starts up the media engine. |
99 bool Init(); | 99 bool Init(); |
100 // Shuts down the media engine. | 100 // Shuts down the media engine. |
101 void Terminate(); | 101 void Terminate(); |
102 | 102 |
103 // The operations below all occur on the worker thread. | 103 // The operations below all occur on the worker thread. |
104 | 104 |
105 // Creates a voice channel, to be associated with the specified session. | 105 // Creates a voice channel, to be associated with the specified |
106 VoiceChannel* CreateVoiceChannel(BaseSession* session, | 106 // TransportController. |
| 107 VoiceChannel* CreateVoiceChannel(TransportController* transport_controller, |
107 const std::string& content_name, | 108 const std::string& content_name, |
108 bool rtcp, | 109 bool rtcp, |
109 const AudioOptions& options); | 110 const AudioOptions& options); |
110 // Destroys a voice channel created with the Create API. | 111 // Destroys a voice channel created with the Create API. |
111 void DestroyVoiceChannel(VoiceChannel* voice_channel, | 112 void DestroyVoiceChannel(VoiceChannel* voice_channel, |
112 VideoChannel* video_channel); | 113 VideoChannel* video_channel); |
113 // TODO(pbos): Remove as soon as all call sites specify VideoOptions. | 114 // TODO(pbos): Remove as soon as all call sites specify VideoOptions. |
114 VideoChannel* CreateVideoChannel(BaseSession* session, | 115 VideoChannel* CreateVideoChannel(TransportController* transport_controller, |
115 const std::string& content_name, | 116 const std::string& content_name, |
116 bool rtcp, | 117 bool rtcp, |
117 VoiceChannel* voice_channel); | 118 VoiceChannel* voice_channel); |
118 // Creates a video channel, synced with the specified voice channel, and | 119 // Creates a video channel, synced with the specified voice channel, and |
119 // associated with the specified session. | 120 // associated with the specified TransportController. |
120 VideoChannel* CreateVideoChannel(BaseSession* session, | 121 VideoChannel* CreateVideoChannel(TransportController* transport_controller, |
121 const std::string& content_name, | 122 const std::string& content_name, |
122 bool rtcp, | 123 bool rtcp, |
123 const VideoOptions& options, | 124 const VideoOptions& options, |
124 VoiceChannel* voice_channel); | 125 VoiceChannel* voice_channel); |
125 // Destroys a video channel created with the Create API. | 126 // Destroys a video channel created with the Create API. |
126 void DestroyVideoChannel(VideoChannel* video_channel); | 127 void DestroyVideoChannel(VideoChannel* video_channel); |
127 DataChannel* CreateDataChannel( | 128 DataChannel* CreateDataChannel( |
128 BaseSession* session, const std::string& content_name, | 129 TransportController* transport_controller, |
129 bool rtcp, DataChannelType data_channel_type); | 130 const std::string& content_name, bool rtcp, |
| 131 DataChannelType data_channel_type); |
130 // Destroys a data channel created with the Create API. | 132 // Destroys a data channel created with the Create API. |
131 void DestroyDataChannel(DataChannel* data_channel); | 133 void DestroyDataChannel(DataChannel* data_channel); |
132 | 134 |
133 // Indicates whether any channels exist. | 135 // Indicates whether any channels exist. |
134 bool has_channels() const { | 136 bool has_channels() const { |
135 return (!voice_channels_.empty() || !video_channels_.empty()); | 137 return (!voice_channels_.empty() || !video_channels_.empty()); |
136 } | 138 } |
137 | 139 |
138 // Configures the audio and video devices. A null pointer can be passed to | 140 // Configures the audio and video devices. A null pointer can be passed to |
139 // GetAudioOptions() for any parameter of no interest. | 141 // GetAudioOptions() for any parameter of no interest. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 typedef std::vector<DataChannel*> DataChannels; | 250 typedef std::vector<DataChannel*> DataChannels; |
249 | 251 |
250 void Construct(MediaEngineInterface* me, | 252 void Construct(MediaEngineInterface* me, |
251 DataEngineInterface* dme, | 253 DataEngineInterface* dme, |
252 DeviceManagerInterface* dm, | 254 DeviceManagerInterface* dm, |
253 CaptureManager* cm, | 255 CaptureManager* cm, |
254 rtc::Thread* worker_thread); | 256 rtc::Thread* worker_thread); |
255 bool InitMediaEngine_w(); | 257 bool InitMediaEngine_w(); |
256 void DestructorDeletes_w(); | 258 void DestructorDeletes_w(); |
257 void Terminate_w(); | 259 void Terminate_w(); |
258 VoiceChannel* CreateVoiceChannel_w(BaseSession* session, | 260 VoiceChannel* CreateVoiceChannel_w(TransportController* transport_controller, |
259 const std::string& content_name, | 261 const std::string& content_name, |
260 bool rtcp, | 262 bool rtcp, |
261 const AudioOptions& options); | 263 const AudioOptions& options); |
262 void DestroyVoiceChannel_w(VoiceChannel* voice_channel, | 264 void DestroyVoiceChannel_w(VoiceChannel* voice_channel, |
263 VideoChannel* video_channel); | 265 VideoChannel* video_channel); |
264 VideoChannel* CreateVideoChannel_w(BaseSession* session, | 266 VideoChannel* CreateVideoChannel_w(TransportController* transport_controller, |
265 const std::string& content_name, | 267 const std::string& content_name, |
266 bool rtcp, | 268 bool rtcp, |
267 const VideoOptions& options, | 269 const VideoOptions& options, |
268 VoiceChannel* voice_channel); | 270 VoiceChannel* voice_channel); |
269 void DestroyVideoChannel_w(VideoChannel* video_channel); | 271 void DestroyVideoChannel_w(VideoChannel* video_channel); |
270 DataChannel* CreateDataChannel_w( | 272 DataChannel* CreateDataChannel_w( |
271 BaseSession* session, const std::string& content_name, | 273 TransportController* transport_controller, |
272 bool rtcp, DataChannelType data_channel_type); | 274 const std::string& content_name, bool rtcp, |
| 275 DataChannelType data_channel_type); |
273 void DestroyDataChannel_w(DataChannel* data_channel); | 276 void DestroyDataChannel_w(DataChannel* data_channel); |
274 bool SetAudioOptions_w(const AudioOptions& options, int delay_offset, | 277 bool SetAudioOptions_w(const AudioOptions& options, int delay_offset, |
275 const Device* in_dev, const Device* out_dev); | 278 const Device* in_dev, const Device* out_dev); |
276 bool SetCaptureDevice_w(const Device* cam_device); | 279 bool SetCaptureDevice_w(const Device* cam_device); |
277 void OnVideoCaptureStateChange(VideoCapturer* capturer, | 280 void OnVideoCaptureStateChange(VideoCapturer* capturer, |
278 CaptureState result); | 281 CaptureState result); |
279 void GetSupportedFormats_w( | 282 void GetSupportedFormats_w( |
280 VideoCapturer* capturer, | 283 VideoCapturer* capturer, |
281 std::vector<cricket::VideoFormat>* out_formats) const; | 284 std::vector<cricket::VideoFormat>* out_formats) const; |
282 bool RegisterVideoProcessor_w(VideoCapturer* capturer, | 285 bool RegisterVideoProcessor_w(VideoCapturer* capturer, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 // but selected devices while this sting will be empty or contain current | 319 // but selected devices while this sting will be empty or contain current |
317 // selected device. | 320 // selected device. |
318 // TODO(hellner): refactor the code such that there is no need to keep two | 321 // 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. | 322 // strings for video devices that have subtle differences in behavior. |
320 std::string video_device_name_; | 323 std::string video_device_name_; |
321 }; | 324 }; |
322 | 325 |
323 } // namespace cricket | 326 } // namespace cricket |
324 | 327 |
325 #endif // TALK_SESSION_MEDIA_CHANNELMANAGER_H_ | 328 #endif // TALK_SESSION_MEDIA_CHANNELMANAGER_H_ |
OLD | NEW |