OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 using cricket::kCodecParamStereo; | 70 using cricket::kCodecParamStereo; |
71 using cricket::kCodecParamUseInbandFec; | 71 using cricket::kCodecParamUseInbandFec; |
72 using cricket::kCodecParamUseDtx; | 72 using cricket::kCodecParamUseDtx; |
73 using cricket::kCodecParamSctpProtocol; | 73 using cricket::kCodecParamSctpProtocol; |
74 using cricket::kCodecParamSctpStreams; | 74 using cricket::kCodecParamSctpStreams; |
75 using cricket::kCodecParamMaxAverageBitrate; | 75 using cricket::kCodecParamMaxAverageBitrate; |
76 using cricket::kCodecParamMaxPlaybackRate; | 76 using cricket::kCodecParamMaxPlaybackRate; |
77 using cricket::kCodecParamAssociatedPayloadType; | 77 using cricket::kCodecParamAssociatedPayloadType; |
78 using cricket::MediaContentDescription; | 78 using cricket::MediaContentDescription; |
79 using cricket::MediaType; | 79 using cricket::MediaType; |
80 using cricket::NS_JINGLE_ICE_UDP; | |
81 using cricket::RtpHeaderExtension; | 80 using cricket::RtpHeaderExtension; |
82 using cricket::SsrcGroup; | 81 using cricket::SsrcGroup; |
83 using cricket::StreamParams; | 82 using cricket::StreamParams; |
84 using cricket::StreamParamsVec; | 83 using cricket::StreamParamsVec; |
85 using cricket::TransportDescription; | 84 using cricket::TransportDescription; |
86 using cricket::TransportInfo; | 85 using cricket::TransportInfo; |
87 using cricket::VideoContentDescription; | 86 using cricket::VideoContentDescription; |
88 using rtc::SocketAddress; | 87 using rtc::SocketAddress; |
89 | 88 |
90 typedef std::vector<RtpHeaderExtension> RtpHeaderExtensions; | 89 typedef std::vector<RtpHeaderExtension> RtpHeaderExtensions; |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 ASSERT(message.find(kLineBreak) == message.size() - 2); | 884 ASSERT(message.find(kLineBreak) == message.size() - 2); |
886 message.resize(message.size() - 2); | 885 message.resize(message.size() - 2); |
887 return message; | 886 return message; |
888 } | 887 } |
889 | 888 |
890 bool SdpDeserialize(const std::string& message, | 889 bool SdpDeserialize(const std::string& message, |
891 JsepSessionDescription* jdesc, | 890 JsepSessionDescription* jdesc, |
892 SdpParseError* error) { | 891 SdpParseError* error) { |
893 std::string session_id; | 892 std::string session_id; |
894 std::string session_version; | 893 std::string session_version; |
895 TransportDescription session_td(NS_JINGLE_ICE_UDP, | 894 TransportDescription session_td("", ""); |
896 std::string(), std::string()); | |
897 RtpHeaderExtensions session_extmaps; | 895 RtpHeaderExtensions session_extmaps; |
898 cricket::SessionDescription* desc = new cricket::SessionDescription(); | 896 cricket::SessionDescription* desc = new cricket::SessionDescription(); |
899 std::vector<JsepIceCandidate*> candidates; | 897 std::vector<JsepIceCandidate*> candidates; |
900 size_t current_pos = 0; | 898 size_t current_pos = 0; |
901 bool supports_msid = false; | 899 bool supports_msid = false; |
902 | 900 |
903 // Session Description | 901 // Session Description |
904 if (!ParseSessionDescription(message, ¤t_pos, &session_id, | 902 if (!ParseSessionDescription(message, ¤t_pos, &session_id, |
905 &session_version, &supports_msid, &session_td, | 903 &session_version, &supports_msid, &session_td, |
906 &session_extmaps, desc, error)) { | 904 &session_extmaps, desc, error)) { |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2188 int pl = 0; | 2186 int pl = 0; |
2189 if (!GetPayloadTypeFromString(line, fields[j], &pl, error)) { | 2187 if (!GetPayloadTypeFromString(line, fields[j], &pl, error)) { |
2190 return false; | 2188 return false; |
2191 } | 2189 } |
2192 codec_preference.push_back(pl); | 2190 codec_preference.push_back(pl); |
2193 } | 2191 } |
2194 } | 2192 } |
2195 | 2193 |
2196 // Make a temporary TransportDescription based on |session_td|. | 2194 // Make a temporary TransportDescription based on |session_td|. |
2197 // Some of this gets overwritten by ParseContent. | 2195 // Some of this gets overwritten by ParseContent. |
2198 TransportDescription transport(NS_JINGLE_ICE_UDP, | 2196 TransportDescription transport(session_td.transport_options, |
2199 session_td.transport_options, | |
2200 session_td.ice_ufrag, | 2197 session_td.ice_ufrag, |
2201 session_td.ice_pwd, | 2198 session_td.ice_pwd, |
2202 session_td.ice_mode, | 2199 session_td.ice_mode, |
2203 session_td.connection_role, | 2200 session_td.connection_role, |
2204 session_td.identity_fingerprint.get(), | 2201 session_td.identity_fingerprint.get(), |
2205 Candidates()); | 2202 Candidates()); |
2206 | 2203 |
2207 rtc::scoped_ptr<MediaContentDescription> content; | 2204 rtc::scoped_ptr<MediaContentDescription> content; |
2208 std::string content_name; | 2205 std::string content_name; |
2209 if (HasAttribute(line, kMediaTypeVideo)) { | 2206 if (HasAttribute(line, kMediaTypeVideo)) { |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3071 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( | 3068 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( |
3072 media_desc, payload_type, feedback_param); | 3069 media_desc, payload_type, feedback_param); |
3073 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { | 3070 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
3074 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( | 3071 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( |
3075 media_desc, payload_type, feedback_param); | 3072 media_desc, payload_type, feedback_param); |
3076 } | 3073 } |
3077 return true; | 3074 return true; |
3078 } | 3075 } |
3079 | 3076 |
3080 } // namespace webrtc | 3077 } // namespace webrtc |
OLD | NEW |