| 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 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2382 enable_default_channel_playout = true; | 2382 enable_default_channel_playout = true; |
| 2383 } | 2383 } |
| 2384 if (enable_default_channel_playout && playout_) { | 2384 if (enable_default_channel_playout && playout_) { |
| 2385 LOG(LS_INFO) << "Enabling playback on the default voice channel"; | 2385 LOG(LS_INFO) << "Enabling playback on the default voice channel"; |
| 2386 SetPlayout(voe_channel(), true); | 2386 SetPlayout(voe_channel(), true); |
| 2387 } | 2387 } |
| 2388 | 2388 |
| 2389 return true; | 2389 return true; |
| 2390 } | 2390 } |
| 2391 | 2391 |
| 2392 bool WebRtcVoiceMediaChannel::SetRemoteRenderer(uint32_t ssrc, | |
| 2393 AudioRenderer* renderer) { | |
| 2394 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | |
| 2395 ChannelMap::iterator it = receive_channels_.find(ssrc); | |
| 2396 if (it == receive_channels_.end()) { | |
| 2397 if (renderer) { | |
| 2398 // Return an error if trying to set a valid renderer with an invalid ssrc. | |
| 2399 LOG(LS_ERROR) << "SetRemoteRenderer failed with ssrc "<< ssrc; | |
| 2400 return false; | |
| 2401 } | |
| 2402 | |
| 2403 // The channel likely has gone away, do nothing. | |
| 2404 return true; | |
| 2405 } | |
| 2406 | |
| 2407 if (renderer) | |
| 2408 it->second->Start(renderer); | |
| 2409 else | |
| 2410 it->second->Stop(); | |
| 2411 | |
| 2412 return true; | |
| 2413 } | |
| 2414 | |
| 2415 bool WebRtcVoiceMediaChannel::SetLocalRenderer(uint32_t ssrc, | 2392 bool WebRtcVoiceMediaChannel::SetLocalRenderer(uint32_t ssrc, |
| 2416 AudioRenderer* renderer) { | 2393 AudioRenderer* renderer) { |
| 2417 ChannelMap::iterator it = send_channels_.find(ssrc); | 2394 ChannelMap::iterator it = send_channels_.find(ssrc); |
| 2418 if (it == send_channels_.end()) { | 2395 if (it == send_channels_.end()) { |
| 2419 if (renderer) { | 2396 if (renderer) { |
| 2420 // Return an error if trying to set a valid renderer with an invalid ssrc. | 2397 // Return an error if trying to set a valid renderer with an invalid ssrc. |
| 2421 LOG(LS_ERROR) << "SetLocalRenderer failed with ssrc "<< ssrc; | 2398 LOG(LS_ERROR) << "SetLocalRenderer failed with ssrc "<< ssrc; |
| 2422 return false; | 2399 return false; |
| 2423 } | 2400 } |
| 2424 | 2401 |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3178 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); | 3155 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); |
| 3179 return false; | 3156 return false; |
| 3180 } | 3157 } |
| 3181 } | 3158 } |
| 3182 return true; | 3159 return true; |
| 3183 } | 3160 } |
| 3184 | 3161 |
| 3185 } // namespace cricket | 3162 } // namespace cricket |
| 3186 | 3163 |
| 3187 #endif // HAVE_WEBRTC_VOICE | 3164 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |