| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "talk/media/base/videocapturer.h" | 43 #include "talk/media/base/videocapturer.h" |
| 44 #include "talk/session/media/channel.h" | 44 #include "talk/session/media/channel.h" |
| 45 #include "talk/session/media/channelmanager.h" | 45 #include "talk/session/media/channelmanager.h" |
| 46 #include "talk/session/media/mediasession.h" | 46 #include "talk/session/media/mediasession.h" |
| 47 #include "webrtc/base/basictypes.h" | 47 #include "webrtc/base/basictypes.h" |
| 48 #include "webrtc/base/checks.h" | 48 #include "webrtc/base/checks.h" |
| 49 #include "webrtc/base/helpers.h" | 49 #include "webrtc/base/helpers.h" |
| 50 #include "webrtc/base/logging.h" | 50 #include "webrtc/base/logging.h" |
| 51 #include "webrtc/base/stringencode.h" | 51 #include "webrtc/base/stringencode.h" |
| 52 #include "webrtc/base/stringutils.h" | 52 #include "webrtc/base/stringutils.h" |
| 53 #include "webrtc/base/trace_event.h" | |
| 54 #include "webrtc/call.h" | 53 #include "webrtc/call.h" |
| 55 #include "webrtc/p2p/base/portallocator.h" | 54 #include "webrtc/p2p/base/portallocator.h" |
| 56 #include "webrtc/p2p/base/transportchannel.h" | 55 #include "webrtc/p2p/base/transportchannel.h" |
| 57 | 56 |
| 58 using cricket::ContentInfo; | 57 using cricket::ContentInfo; |
| 59 using cricket::ContentInfos; | 58 using cricket::ContentInfos; |
| 60 using cricket::MediaContentDescription; | 59 using cricket::MediaContentDescription; |
| 61 using cricket::SessionDescription; | 60 using cricket::SessionDescription; |
| 62 using cricket::TransportInfo; | 61 using cricket::TransportInfo; |
| 63 | 62 |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 void WebRtcSession::CreateAnswer( | 783 void WebRtcSession::CreateAnswer( |
| 785 CreateSessionDescriptionObserver* observer, | 784 CreateSessionDescriptionObserver* observer, |
| 786 const MediaConstraintsInterface* constraints, | 785 const MediaConstraintsInterface* constraints, |
| 787 const cricket::MediaSessionOptions& session_options) { | 786 const cricket::MediaSessionOptions& session_options) { |
| 788 webrtc_session_desc_factory_->CreateAnswer(observer, constraints, | 787 webrtc_session_desc_factory_->CreateAnswer(observer, constraints, |
| 789 session_options); | 788 session_options); |
| 790 } | 789 } |
| 791 | 790 |
| 792 bool WebRtcSession::SetLocalDescription(SessionDescriptionInterface* desc, | 791 bool WebRtcSession::SetLocalDescription(SessionDescriptionInterface* desc, |
| 793 std::string* err_desc) { | 792 std::string* err_desc) { |
| 794 TRACE_EVENT0("webrtc", "WebRtcSession::SetLocalDescription"); | |
| 795 ASSERT(signaling_thread()->IsCurrent()); | 793 ASSERT(signaling_thread()->IsCurrent()); |
| 796 | 794 |
| 797 // Takes the ownership of |desc| regardless of the result. | 795 // Takes the ownership of |desc| regardless of the result. |
| 798 rtc::scoped_ptr<SessionDescriptionInterface> desc_temp(desc); | 796 rtc::scoped_ptr<SessionDescriptionInterface> desc_temp(desc); |
| 799 | 797 |
| 800 // Validate SDP. | 798 // Validate SDP. |
| 801 if (!ValidateSessionDescription(desc, cricket::CS_LOCAL, err_desc)) { | 799 if (!ValidateSessionDescription(desc, cricket::CS_LOCAL, err_desc)) { |
| 802 return false; | 800 return false; |
| 803 } | 801 } |
| 804 | 802 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 } | 837 } |
| 840 | 838 |
| 841 if (error() != ERROR_NONE) { | 839 if (error() != ERROR_NONE) { |
| 842 return BadLocalSdp(desc->type(), GetSessionErrorMsg(), err_desc); | 840 return BadLocalSdp(desc->type(), GetSessionErrorMsg(), err_desc); |
| 843 } | 841 } |
| 844 return true; | 842 return true; |
| 845 } | 843 } |
| 846 | 844 |
| 847 bool WebRtcSession::SetRemoteDescription(SessionDescriptionInterface* desc, | 845 bool WebRtcSession::SetRemoteDescription(SessionDescriptionInterface* desc, |
| 848 std::string* err_desc) { | 846 std::string* err_desc) { |
| 849 TRACE_EVENT0("webrtc", "WebRtcSession::SetRemoteDescription"); | |
| 850 ASSERT(signaling_thread()->IsCurrent()); | 847 ASSERT(signaling_thread()->IsCurrent()); |
| 851 | 848 |
| 852 // Takes the ownership of |desc| regardless of the result. | 849 // Takes the ownership of |desc| regardless of the result. |
| 853 rtc::scoped_ptr<SessionDescriptionInterface> desc_temp(desc); | 850 rtc::scoped_ptr<SessionDescriptionInterface> desc_temp(desc); |
| 854 | 851 |
| 855 // Validate SDP. | 852 // Validate SDP. |
| 856 if (!ValidateSessionDescription(desc, cricket::CS_REMOTE, err_desc)) { | 853 if (!ValidateSessionDescription(desc, cricket::CS_REMOTE, err_desc)) { |
| 857 return false; | 854 return false; |
| 858 } | 855 } |
| 859 | 856 |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2192 } | 2189 } |
| 2193 } | 2190 } |
| 2194 | 2191 |
| 2195 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2192 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
| 2196 const rtc::SentPacket& sent_packet) { | 2193 const rtc::SentPacket& sent_packet) { |
| 2197 RTC_DCHECK(worker_thread()->IsCurrent()); | 2194 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2198 media_controller_->call_w()->OnSentPacket(sent_packet); | 2195 media_controller_->call_w()->OnSentPacket(sent_packet); |
| 2199 } | 2196 } |
| 2200 | 2197 |
| 2201 } // namespace webrtc | 2198 } // namespace webrtc |
| OLD | NEW |