Lines Matching refs:channel

226 // were supplied as a combination of flags from the channel manager (ec, agc,
256 // StopPlayout() while deleting the channel. We should fix the bug
609 // when we clear option (channel) overrides. External clients can still
985 : channel(c),
990 WebRtcVoiceMediaChannel *channel;
1033 WebRtcVoiceMediaChannel *channel = *i;
1034 if (!channel->PausePlayout()) {
1038 if (!channel->PauseSend()) {
1073 WebRtcVoiceMediaChannel *channel = *i;
1074 if (!channel->ResumePlayout()) {
1078 if (!channel->ResumeSend()) {
1388 WebRtcVoiceMediaChannel* channel = NULL;
1390 LOG(LS_WARNING) << "VoiceEngine error " << err_code << " reported on channel "
1392 if (FindChannelAndSsrc(channel_num, &channel, &ssrc)) {
1393 ASSERT(channel != NULL);
1394 channel->OnError(ssrc, err_code);
1396 LOG(LS_ERROR) << "VoiceEngine channel " << channel_num
1397 << " could not be found in channel list when error reported.";
1402 int channel_num, WebRtcVoiceMediaChannel** channel, uint32* ssrc) const {
1403 ASSERT(channel != NULL && ssrc != NULL);
1405 *channel = NULL;
1407 // Find corresponding channel and ssrc
1412 *channel = *it;
1421 // obtain the voice engine's channel number.
1428 // Find corresponding channel for ssrc.
1446 void WebRtcVoiceEngine::RegisterChannel(WebRtcVoiceMediaChannel *channel) {
1448 channels_.push_back(channel);
1451 void WebRtcVoiceEngine::UnregisterChannel(WebRtcVoiceMediaChannel *channel) {
1455 channel);
1580 LOG(LS_INFO) << "Media Processing Registration Succeeded. channel:"
1636 LOG(LS_INFO) << "Media Processing DeRegistration Succeeded. channel:"
1669 void WebRtcVoiceEngine::Process(int channel,
1683 << " channel: " << channel << " type: " << type
1793 // Accessor to the VoE channel ID.
1794 int channel() const { return channel_; }
1839 // Remove any remaining send streams, the default channel will be deleted
1851 // Delete the default channel.
1856 LOG(LS_INFO) << "Setting voice channel options: "
1873 "Failed to engine SetOptionOverrides during channel SetOptions.";
1880 // Receiver-side auto gain control happens per channel, so set it here from
1883 // the media engine when those options are applied per-channel.
1901 // settings for the channel and bail if they aren't available.
1908 << "channel " << voe_channel() << ". Since not all rx "
1934 LOG(LS_WARNING) << "Failed to set DSCP settings for audio channel";
1944 LOG(LS_INFO) << "Set voice channel options. Current options: "
1990 // Set the receive codecs on the default channel explicitly if the
1991 // default channel is not used by |receive_channels_|, this happens in
1993 // channel.
1994 // TODO(xians): Figure out how we use the default channel in conference
2007 it->second->channel(), voe_codec) == -1) {
2008 LOG_RTCERR2(SetRecPayloadType, it->second->channel(),
2029 int channel, const std::vector<AudioCodec>& codecs) {
2031 engine()->voe()->codec()->SetVADStatus(channel, false);
2032 engine()->voe()->rtp()->SetNACKStatus(channel, false, 0);
2034 engine()->voe()->rtp()->SetREDStatus(channel, false);
2035 engine()->voe()->codec()->SetFECStatus(channel, false);
2038 engine()->voe()->rtp()->SetFECStatus(channel, false);
2085 LOG(LS_INFO) << "Enabling RED on channel " << channel;
2086 if (engine()->voe()->rtp()->SetREDStatus(channel, true, it->id) == -1) {
2087 LOG_RTCERR3(SetREDStatus, channel, true, it->id);
2091 if (engine()->voe()->rtp()->SetFECStatus(channel, true, it->id) == -1) {
2092 LOG_RTCERR3(SetFECStatus, channel, true, it->id);
2110 SetNack(channel, nack_enabled);
2121 if (!SetSendCodec(channel, send_codec))
2126 LOG(LS_INFO) << "Attempt to enable codec internal FEC on channel "
2127 << channel;
2129 if (engine()->voe()->codec()->SetFECStatus(channel, true) == -1) {
2131 LOG_RTCERR2(SetFECStatus, channel, true);
2141 << " Hz on channel "
2142 << channel;
2146 channel, max_playback_rate) == -1) {
2174 channel, it->id) == -1) {
2175 LOG_RTCERR2(SetSendTelephoneEventPayloadType, channel, it->id);
2202 channel, it->id, cn_freq) == -1) {
2203 LOG_RTCERR3(SetSendCNPayloadType, channel, it->id, cn_freq);
2208 // the channel is already sending.
2218 if (engine()->voe()->codec()->SetVADStatus(channel, true) == -1) {
2219 LOG_RTCERR2(SetVADStatus, channel, true);
2240 // Cache the codecs in order to configure the channel created later.
2244 if (!SetSendCodecs(iter->second->channel(), codecs)) {
2258 SetNack(it->second->channel(), nack_enabled);
2262 void WebRtcVoiceMediaChannel::SetNack(int channel, bool nack_enabled) {
2264 LOG(LS_INFO) << "Enabling NACK for channel " << channel;
2265 engine()->voe()->rtp()->SetNACKStatus(channel, true, kNackMaxPackets);
2267 LOG(LS_INFO) << "Disabling NACK for channel " << channel;
2268 engine()->voe()->rtp()->SetNACKStatus(channel, false, 0);
2278 if (!SetSendCodec(iter->second->channel(), send_codec))
2286 int channel, const webrtc::CodecInst& send_codec) {
2287 LOG(LS_INFO) << "Send channel " << channel << " selected voice codec "
2291 if (engine()->voe()->codec()->GetSendCodec(channel, current_codec) == 0 &&
2297 if (engine()->voe()->codec()->SetSendCodec(channel, send_codec) == -1) {
2298 LOG_RTCERR2(SetSendCodec, channel, ToString(send_codec));
2310 // The default channel may or may not be in |receive_channels_|. Set the rtp
2311 // header extensions for default channel regardless.
2319 if (!SetChannelRecvRtpHeaderExtensions(channel_it->second->channel(),
2355 // The default channel may or may not be in |send_channels_|. Set the rtp
2356 // header extensions for default channel regardless.
2365 if (!SetChannelSendRtpHeaderExtensions(channel_it->second->channel(),
2418 // Only toggle the default channel if we don't have any other channels.
2423 if (!SetPlayout(it->second->channel(), playout)) {
2424 LOG(LS_ERROR) << "SetPlayout " << playout << " on channel "
2425 << it->second->channel() << " failed";
2456 // Change the settings on each send channel.
2460 // Change the settings on each send channel.
2463 if (!ChangeSend(iter->second->channel(), send))
2475 bool WebRtcVoiceMediaChannel::ChangeSend(int channel, SendFlags send) {
2477 if (engine()->voe()->base()->StartSend(channel) == -1) {
2478 LOG_RTCERR1(StartSend, channel);
2482 engine()->voe()->file()->StopPlayingFileAsMicrophone(channel) == -1) {
2483 LOG_RTCERR1(StopPlayingFileAsMicrophone, channel);
2488 if (engine()->voe()->base()->StopSend(channel) == -1) {
2489 LOG_RTCERR1(StopSend, channel);
2498 void WebRtcVoiceMediaChannel::ConfigureSendChannel(int channel) {
2500 channel, *this) == -1) {
2501 LOG_RTCERR2(RegisterExternalTransport, channel, this);
2505 EnableRtcp(channel);
2508 ResetRecvCodecs(channel);
2510 // Set RTP header extension for the new channel.
2511 SetChannelSendRtpHeaderExtensions(channel, send_extensions_);
2514 bool WebRtcVoiceMediaChannel::DeleteChannel(int channel) {
2515 if (engine()->voe()->network()->DeRegisterExternalTransport(channel) == -1) {
2516 LOG_RTCERR1(DeRegisterExternalTransport, channel);
2519 if (engine()->voe()->base()->DeleteChannel(channel) == -1) {
2520 LOG_RTCERR1(DeleteChannel, channel);
2528 // If the default channel is already used for sending create a new channel
2529 // otherwise use the default channel for sending.
2530 int channel = GetSendChannelNum(sp.first_ssrc());
2531 if (channel != -1) {
2539 if (IsDefaultChannel(iter->second->channel())) {
2545 channel = voe_channel();
2547 // Create a new channel for sending audio data.
2548 channel = engine()->CreateMediaVoiceChannel();
2549 if (channel == -1) {
2554 ConfigureSendChannel(channel);
2557 // Save the channel to send_channels_, so that RemoveSendStream() can still
2558 // delete the channel in case failure happens below.
2563 new WebRtcVoiceChannelRenderer(channel, audio_transport)));
2569 if (engine()->voe()->rtp()->SetLocalSSRC(channel, sp.first_ssrc()) == -1) {
2570 LOG_RTCERR2(SetSendSSRC, channel, sp.first_ssrc());
2574 // At this point the channel's local SSRC has been updated. If the channel is
2575 // the default channel make sure that all the receive channels are updated as
2576 // well. Receive channels have to have the same SSRC as the default channel in
2578 if (IsDefaultChannel(channel)) {
2582 if (!IsDefaultChannel(it->second->channel())) {
2583 if (engine()->voe()->rtp()->SetLocalSSRC(it->second->channel(),
2585 LOG_RTCERR2(SetLocalSSRC, it->second->channel(), sp.first_ssrc());
2592 if (engine()->voe()->rtp()->SetRTCP_CNAME(channel, sp.cname.c_str()) == -1) {
2593 LOG_RTCERR2(SetRTCP_CNAME, channel, sp.cname);
2597 // Set the current codecs to be used for the new channel.
2598 if (!send_codecs_.empty() && !SetSendCodecs(channel, send_codecs_))
2601 return ChangeSend(channel, desired_send_);
2612 int channel = it->second->channel();
2613 ChangeSend(channel, SEND_NOTHING);
2615 // Delete the WebRtcVoiceChannelRenderer object connected to the channel,
2616 // this will disconnect the audio renderer with the send channel.
2620 if (IsDefaultChannel(channel)) {
2621 // Do not delete the default channel since the receive channels depend on
2622 // the default channel, recycle it instead.
2623 ChangeSend(channel, SEND_NOTHING);
2625 // Clean up and delete the send channel.
2627 << " with VoiceEngine channel #" << channel << ".";
2628 if (!DeleteChannel(channel))
2655 // Reuse default channel for recv stream in non-conference mode call
2656 // when the default channel is not being used.
2661 << " reuse default channel";
2672 // Create a new channel for receiving audio data.
2673 int channel = engine()->CreateMediaVoiceChannel();
2674 if (channel == -1) {
2679 if (!ConfigureRecvChannel(channel)) {
2680 DeleteChannel(channel);
2686 ssrc, new WebRtcVoiceChannelRenderer(channel, audio_transport)));
2689 << " registered to VoiceEngine channel #"
2690 << channel << ".";
2694 bool WebRtcVoiceMediaChannel::ConfigureRecvChannel(int channel) {
2695 // Configure to use external transport, like our default channel.
2697 channel, *this) == -1) {
2698 LOG_RTCERR2(SetExternalTransport, channel, this);
2702 // Use the same SSRC as our default channel (so the RTCP reports are correct).
2706 LOG_RTCERR1(GetSendSSRC, channel);
2709 if (rtp->SetLocalSSRC(channel, send_ssrc) == -1) {
2710 LOG_RTCERR1(SetSendSSRC, channel);
2714 // Use the same recv payload types as our default channel.
2715 ResetRecvCodecs(channel);
2726 channel, voe_codec) == -1) {
2727 LOG_RTCERR2(SetRecPayloadType, channel, ToString(voe_codec));
2743 // the default channel will be mixed in with the other streams
2745 LOG(LS_INFO) << "Disabling playback on the default voice channel";
2749 SetNack(channel, nack_enabled_);
2751 // Set RTP header extension for the new channel.
2752 if (!SetChannelRecvRtpHeaderExtensions(channel, receive_extensions_)) {
2756 // Set up channel to be able to forward incoming packets to video engine BWE.
2757 if (!SetupSharedBweOnChannel(channel)) {
2761 return SetPlayout(channel, playout_);
2773 // Delete the WebRtcVoiceChannelRenderer object connected to the channel, this
2774 // will disconnect the audio renderer with the receive channel.
2775 // Cache the channel before the deletion.
2776 const int channel = it->second->channel();
2781 ASSERT(IsDefaultChannel(channel));
2782 // Recycle the default channel is for recv stream.
2791 << " with VoiceEngine channel #" << channel << ".";
2792 if (!DeleteChannel(channel))
2798 // channel for new channels to be played out immediately without
2801 // TODO(oja): Does the default channel still have it's CN state?
2806 // Only the default channel is active, enable the playout on default
2807 // channel.
2811 LOG(LS_INFO) << "Enabling playback on the default voice channel";
2828 // The channel likely has gone away, do nothing.
2850 // The channel likely has gone away, do nothing.
2864 // In conference mode, the default channel should not be in
2869 int level = GetOutputLevel(it->second->channel());
2882 int level = GetOutputLevel(it->second->channel());
2919 // Default channel is not in receive_channels_ if it is not being used for
2925 channels.push_back(it->second->channel());
2927 } else { // Collect only the channel of the specified ssrc.
2928 int channel = GetReceiveChannelNum(ssrc);
2929 if (-1 == channel) {
2930 LOG(LS_WARNING) << "Cannot find channel for ssrc:" << ssrc;
2933 channels.push_back(channel);
2958 << " for channel " << *it << " and ssrc " << ssrc;
2968 // Determine which channel based on ssrc.
2969 int channel = (0 == ssrc) ? voe_channel() : GetReceiveChannelNum(ssrc);
2970 if (channel == -1) {
2971 LOG(LS_WARNING) << "Cannot find channel for ssrc:" << ssrc;
2977 channel, scaling)) {
2978 LOG_RTCERR2(GetChannelOutputVolumeScaling, channel, scaling);
2985 channel, left_pan, right_pan)) {
2986 LOG_RTCERR3(GetOutputVolumePan, channel, left_pan, right_pan);
3013 // Determine which VoiceEngine channel to play on.
3014 int channel = (ssrc == 0) ? voe_channel() : GetReceiveChannelNum(ssrc);
3015 if (channel == -1) {
3023 if (engine()->voe()->file()->StartPlayingFileLocally(channel,
3025 LOG_RTCERR2(StartPlayingFileLocally, channel, ringback_tone_.get());
3029 ringback_channels_.insert(channel);
3030 LOG(LS_INFO) << "Started ringback on channel " << channel;
3032 if (engine()->voe()->file()->IsPlayingFileLocally(channel) == 1 &&
3033 engine()->voe()->file()->StopPlayingFileLocally(channel) == -1) {
3034 LOG_RTCERR1(StopPlayingFileLocally, channel);
3037 LOG(LS_INFO) << "Stopped ringback on channel " << channel;
3038 ringback_channels_.erase(channel);
3056 int channel = -1;
3061 if (IsDefaultChannel(iter->second->channel())) {
3067 channel = voe_channel();
3069 channel = send_channels_.begin()->second->channel();
3072 channel = GetSendChannelNum(ssrc);
3074 if (channel == -1) {
3081 channel, event, true, duration) == -1) {
3082 LOG_RTCERR4(SendTelephoneEvent, channel, event, true, duration);
3101 // Pick which channel to send this packet to. If this packet doesn't match
3102 // any multiplexed streams, just send it to the default channel. Otherwise,
3110 // Stop any ringback that might be playing on the channel.
3112 // use the opportunity to remove the channel from ringback_channels_.
3119 LOG(LS_INFO) << "Stopped ringback on channel " << which_channel
3146 // If it is a sender report, find the channel that is listening.
3167 // Make sure not sending the same packet to default channel more than once.
3168 if (IsDefaultChannel(iter->second->channel()) &&
3173 iter->second->channel(),
3180 int channel = (ssrc == 0) ? voe_channel() : GetSendChannelNum(ssrc);
3181 if (channel == -1) {
3185 if (engine()->voe()->volume()->SetInputMute(channel, muted) == -1) {
3186 LOG_RTCERR2(SetInputMute, channel, muted);
3191 // the mic channel is muted/unmuted. We can't do it today because there
3192 // is no good way to know which stream is mapping to the mic channel.
3196 if (engine()->voe()->volume()->GetInputMute(iter->second->channel(),
3198 LOG_RTCERR1(GetInputMute, iter->second->channel());
3301 const int channel = channel_iter->second->channel();
3307 if (engine()->voe()->rtp()->GetRTCPStatistics(channel, cs) == -1 ||
3308 engine()->voe()->rtp()->GetLocalSSRC(channel, ssrc) == -1) {
3328 channel, &receive_blocks) != -1 &&
3329 engine()->voe()->codec()->GetSendCodec(channel, codec) != -1) {
3353 // channels here because there is no good way to know which send channel
3368 // Build the list of receivers, one for each receiving channel, or 1 in
3373 channels.push_back(it->second->channel());
3462 // This means the error is not limited to a specific channel. Signal the
3463 // message using ssrc=0. If the current channel is sending, use this
3464 // channel for sending the message.
3468 // Check whether this is a sending channel.
3471 if (it->second->channel() == channel_num) {
3472 // This is a sending channel.
3482 // Check whether this is a receiving channel.
3485 if (it->second->channel() == channel_num) {
3503 int WebRtcVoiceMediaChannel::GetOutputLevel(int channel) {
3506 engine()->voe()->volume()->GetSpeechOutputLevel(channel, ulevel);
3513 return it->second->channel();
3520 return it->second->channel();
3535 if (!SetupSharedBweOnChannel(it->second->channel())) {
3589 bool WebRtcVoiceMediaChannel::EnableRtcp(int channel) {
3590 if (engine()->voe()->rtp()->SetRTCPStatus(channel, true) == -1) {
3591 LOG_RTCERR2(SetRTCPStatus, channel, 1);
3601 bool WebRtcVoiceMediaChannel::ResetRecvCodecs(int channel) {
3608 channel, voe_codec) == -1) {
3609 LOG_RTCERR2(SetRecPayloadType, channel, ToString(voe_codec));
3617 bool WebRtcVoiceMediaChannel::SetPlayout(int channel, bool playout) {
3619 LOG(LS_INFO) << "Starting playout for channel #" << channel;
3620 if (engine()->voe()->base()->StartPlayout(channel) == -1) {
3621 LOG_RTCERR1(StartPlayout, channel);
3625 LOG(LS_INFO) << "Stopping playout for channel #" << channel;
3626 engine()->voe()->base()->StopPlayout(channel);