Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Side by Side Diff: talk/app/webrtc/webrtcsession.cc

Issue 1413713003: Adding the ability to create an RtpSender without a track. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding some unit tests for new methods on the sender. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 return true; 1756 return true;
1757 } 1757 }
1758 1758
1759 void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) { 1759 void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) {
1760 // Destroy video_channel_ first since it may have a pointer to the 1760 // Destroy video_channel_ first since it may have a pointer to the
1761 // voice_channel_. 1761 // voice_channel_.
1762 const cricket::ContentInfo* video_info = 1762 const cricket::ContentInfo* video_info =
1763 cricket::GetFirstVideoContent(desc); 1763 cricket::GetFirstVideoContent(desc);
1764 if ((!video_info || video_info->rejected) && video_channel_) { 1764 if ((!video_info || video_info->rejected) && video_channel_) {
1765 SignalVideoChannelDestroyed(); 1765 SignalVideoChannelDestroyed();
1766 const std::string content_name = video_channel_->content_name();
1767 channel_manager_->DestroyVideoChannel(video_channel_.release()); 1766 channel_manager_->DestroyVideoChannel(video_channel_.release());
1768 } 1767 }
1769 1768
1770 const cricket::ContentInfo* voice_info = 1769 const cricket::ContentInfo* voice_info =
1771 cricket::GetFirstAudioContent(desc); 1770 cricket::GetFirstAudioContent(desc);
1772 if ((!voice_info || voice_info->rejected) && voice_channel_) { 1771 if ((!voice_info || voice_info->rejected) && voice_channel_) {
1773 SignalVoiceChannelDestroyed(); 1772 SignalVoiceChannelDestroyed();
1774 const std::string content_name = voice_channel_->content_name();
1775 channel_manager_->DestroyVoiceChannel(voice_channel_.release()); 1773 channel_manager_->DestroyVoiceChannel(voice_channel_.release());
1776 } 1774 }
1777 1775
1778 const cricket::ContentInfo* data_info = 1776 const cricket::ContentInfo* data_info =
1779 cricket::GetFirstDataContent(desc); 1777 cricket::GetFirstDataContent(desc);
1780 if ((!data_info || data_info->rejected) && data_channel_) { 1778 if ((!data_info || data_info->rejected) && data_channel_) {
1781 SignalDataChannelDestroyed(); 1779 SignalDataChannelDestroyed();
1782 const std::string content_name = data_channel_->content_name();
1783 channel_manager_->DestroyDataChannel(data_channel_.release()); 1780 channel_manager_->DestroyDataChannel(data_channel_.release());
1784 } 1781 }
1785 } 1782 }
1786 1783
1787 // TODO(mallinath) - Add a correct error code if the channels are not created 1784 // TODO(mallinath) - Add a correct error code if the channels are not created
1788 // due to BUNDLE is enabled but rtcp-mux is disabled. 1785 // due to BUNDLE is enabled but rtcp-mux is disabled.
1789 bool WebRtcSession::CreateChannels(const SessionDescription* desc) { 1786 bool WebRtcSession::CreateChannels(const SessionDescription* desc) {
1790 // Creating the media channels and transport proxies. 1787 // Creating the media channels and transport proxies.
1791 const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc); 1788 const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc);
1792 if (voice && !voice->rejected && !voice_channel_) { 1789 if (voice && !voice->rejected && !voice_channel_) {
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 } 2208 }
2212 } 2209 }
2213 2210
2214 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, 2211 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel,
2215 const rtc::SentPacket& sent_packet) { 2212 const rtc::SentPacket& sent_packet) {
2216 RTC_DCHECK(worker_thread()->IsCurrent()); 2213 RTC_DCHECK(worker_thread()->IsCurrent());
2217 media_controller_->call_w()->OnSentPacket(sent_packet); 2214 media_controller_->call_w()->OnSentPacket(sent_packet);
2218 } 2215 }
2219 2216
2220 } // namespace webrtc 2217 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698