OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 break; | 396 break; |
397 } | 397 } |
398 default: | 398 default: |
399 ASSERT(false); | 399 ASSERT(false); |
400 break; | 400 break; |
401 } | 401 } |
402 } | 402 } |
403 | 403 |
404 void WebRtcSessionDescriptionFactory::InternalCreateOffer( | 404 void WebRtcSessionDescriptionFactory::InternalCreateOffer( |
405 CreateSessionDescriptionRequest request) { | 405 CreateSessionDescriptionRequest request) { |
406 cricket::SessionDescription* desc( | 406 cricket::SessionDescription* desc(session_desc_factory_.CreateOffer( |
407 session_desc_factory_.CreateOffer( | 407 request.options, session_->base_local_description())); |
408 request.options, | |
409 static_cast<cricket::BaseSession*>(session_)->local_description())); | |
410 // RFC 3264 | 408 // RFC 3264 |
411 // When issuing an offer that modifies the session, | 409 // When issuing an offer that modifies the session, |
412 // the "o=" line of the new SDP MUST be identical to that in the | 410 // the "o=" line of the new SDP MUST be identical to that in the |
413 // previous SDP, except that the version in the origin field MUST | 411 // previous SDP, except that the version in the origin field MUST |
414 // increment by one from the previous SDP. | 412 // increment by one from the previous SDP. |
415 | 413 |
416 // Just increase the version number by one each time when a new offer | 414 // Just increase the version number by one each time when a new offer |
417 // is created regardless if it's identical to the previous one or not. | 415 // is created regardless if it's identical to the previous one or not. |
418 // The |session_version_| is a uint64_t, the wrap around should not happen. | 416 // The |session_version_| is a uint64_t, the wrap around should not happen. |
419 ASSERT(session_version_ + 1 > session_version_); | 417 ASSERT(session_version_ + 1 > session_version_); |
(...skipping 23 matching lines...) Expand all Loading... |
443 request.options.transport_options.ice_restart = session_->IceRestartPending(); | 441 request.options.transport_options.ice_restart = session_->IceRestartPending(); |
444 // We should pass current ssl role to the transport description factory, if | 442 // We should pass current ssl role to the transport description factory, if |
445 // there is already an existing ongoing session. | 443 // there is already an existing ongoing session. |
446 rtc::SSLRole ssl_role; | 444 rtc::SSLRole ssl_role; |
447 if (session_->GetSslRole(&ssl_role)) { | 445 if (session_->GetSslRole(&ssl_role)) { |
448 request.options.transport_options.prefer_passive_role = | 446 request.options.transport_options.prefer_passive_role = |
449 (rtc::SSL_SERVER == ssl_role); | 447 (rtc::SSL_SERVER == ssl_role); |
450 } | 448 } |
451 | 449 |
452 cricket::SessionDescription* desc(session_desc_factory_.CreateAnswer( | 450 cricket::SessionDescription* desc(session_desc_factory_.CreateAnswer( |
453 static_cast<cricket::BaseSession*>(session_)->remote_description(), | 451 session_->base_remote_description(), request.options, |
454 request.options, | 452 session_->base_local_description())); |
455 static_cast<cricket::BaseSession*>(session_)->local_description())); | |
456 // RFC 3264 | 453 // RFC 3264 |
457 // If the answer is different from the offer in any way (different IP | 454 // If the answer is different from the offer in any way (different IP |
458 // addresses, ports, etc.), the origin line MUST be different in the answer. | 455 // addresses, ports, etc.), the origin line MUST be different in the answer. |
459 // In that case, the version number in the "o=" line of the answer is | 456 // In that case, the version number in the "o=" line of the answer is |
460 // unrelated to the version number in the o line of the offer. | 457 // unrelated to the version number in the o line of the offer. |
461 // Get a new version number by increasing the |session_version_answer_|. | 458 // Get a new version number by increasing the |session_version_answer_|. |
462 // The |session_version_| is a uint64_t, the wrap around should not happen. | 459 // The |session_version_| is a uint64_t, the wrap around should not happen. |
463 ASSERT(session_version_ + 1 > session_version_); | 460 ASSERT(session_version_ + 1 > session_version_); |
464 JsepSessionDescription* answer(new JsepSessionDescription( | 461 JsepSessionDescription* answer(new JsepSessionDescription( |
465 JsepSessionDescription::kAnswer)); | 462 JsepSessionDescription::kAnswer)); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 if (create_session_description_requests_.front().type == | 530 if (create_session_description_requests_.front().type == |
534 CreateSessionDescriptionRequest::kOffer) { | 531 CreateSessionDescriptionRequest::kOffer) { |
535 InternalCreateOffer(create_session_description_requests_.front()); | 532 InternalCreateOffer(create_session_description_requests_.front()); |
536 } else { | 533 } else { |
537 InternalCreateAnswer(create_session_description_requests_.front()); | 534 InternalCreateAnswer(create_session_description_requests_.front()); |
538 } | 535 } |
539 create_session_description_requests_.pop(); | 536 create_session_description_requests_.pop(); |
540 } | 537 } |
541 } | 538 } |
542 } // namespace webrtc | 539 } // namespace webrtc |
OLD | NEW |