OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 return true; | 1740 return true; |
1741 } | 1741 } |
1742 | 1742 |
1743 void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) { | 1743 void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) { |
1744 // Destroy video_channel_ first since it may have a pointer to the | 1744 // Destroy video_channel_ first since it may have a pointer to the |
1745 // voice_channel_. | 1745 // voice_channel_. |
1746 const cricket::ContentInfo* video_info = | 1746 const cricket::ContentInfo* video_info = |
1747 cricket::GetFirstVideoContent(desc); | 1747 cricket::GetFirstVideoContent(desc); |
1748 if ((!video_info || video_info->rejected) && video_channel_) { | 1748 if ((!video_info || video_info->rejected) && video_channel_) { |
1749 SignalVideoChannelDestroyed(); | 1749 SignalVideoChannelDestroyed(); |
1750 const std::string content_name = video_channel_->content_name(); | |
1751 channel_manager_->DestroyVideoChannel(video_channel_.release()); | 1750 channel_manager_->DestroyVideoChannel(video_channel_.release()); |
1752 } | 1751 } |
1753 | 1752 |
1754 const cricket::ContentInfo* voice_info = | 1753 const cricket::ContentInfo* voice_info = |
1755 cricket::GetFirstAudioContent(desc); | 1754 cricket::GetFirstAudioContent(desc); |
1756 if ((!voice_info || voice_info->rejected) && voice_channel_) { | 1755 if ((!voice_info || voice_info->rejected) && voice_channel_) { |
1757 SignalVoiceChannelDestroyed(); | 1756 SignalVoiceChannelDestroyed(); |
1758 const std::string content_name = voice_channel_->content_name(); | |
1759 channel_manager_->DestroyVoiceChannel(voice_channel_.release()); | 1757 channel_manager_->DestroyVoiceChannel(voice_channel_.release()); |
1760 } | 1758 } |
1761 | 1759 |
1762 const cricket::ContentInfo* data_info = | 1760 const cricket::ContentInfo* data_info = |
1763 cricket::GetFirstDataContent(desc); | 1761 cricket::GetFirstDataContent(desc); |
1764 if ((!data_info || data_info->rejected) && data_channel_) { | 1762 if ((!data_info || data_info->rejected) && data_channel_) { |
1765 SignalDataChannelDestroyed(); | 1763 SignalDataChannelDestroyed(); |
1766 const std::string content_name = data_channel_->content_name(); | |
1767 channel_manager_->DestroyDataChannel(data_channel_.release()); | 1764 channel_manager_->DestroyDataChannel(data_channel_.release()); |
1768 } | 1765 } |
1769 } | 1766 } |
1770 | 1767 |
1771 // TODO(mallinath) - Add a correct error code if the channels are not created | 1768 // TODO(mallinath) - Add a correct error code if the channels are not created |
1772 // due to BUNDLE is enabled but rtcp-mux is disabled. | 1769 // due to BUNDLE is enabled but rtcp-mux is disabled. |
1773 bool WebRtcSession::CreateChannels(const SessionDescription* desc) { | 1770 bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
1774 // Creating the media channels and transport proxies. | 1771 // Creating the media channels and transport proxies. |
1775 const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc); | 1772 const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc); |
1776 if (voice && !voice->rejected && !voice_channel_) { | 1773 if (voice && !voice->rejected && !voice_channel_) { |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 } | 2192 } |
2196 } | 2193 } |
2197 | 2194 |
2198 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2195 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
2199 const rtc::SentPacket& sent_packet) { | 2196 const rtc::SentPacket& sent_packet) { |
2200 RTC_DCHECK(worker_thread()->IsCurrent()); | 2197 RTC_DCHECK(worker_thread()->IsCurrent()); |
2201 media_controller_->call_w()->OnSentPacket(sent_packet); | 2198 media_controller_->call_w()->OnSentPacket(sent_packet); |
2202 } | 2199 } |
2203 | 2200 |
2204 } // namespace webrtc | 2201 } // namespace webrtc |
OLD | NEW |