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

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

Issue 1453813005: Fixing some issues with ICE restart signaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 499 }
500 500
501 if (rtc_options.offer_to_receive_audio != RTCOfferAnswerOptions::kUndefined) { 501 if (rtc_options.offer_to_receive_audio != RTCOfferAnswerOptions::kUndefined) {
502 session_options->recv_audio = (rtc_options.offer_to_receive_audio > 0); 502 session_options->recv_audio = (rtc_options.offer_to_receive_audio > 0);
503 } 503 }
504 if (rtc_options.offer_to_receive_video != RTCOfferAnswerOptions::kUndefined) { 504 if (rtc_options.offer_to_receive_video != RTCOfferAnswerOptions::kUndefined) {
505 session_options->recv_video = (rtc_options.offer_to_receive_video > 0); 505 session_options->recv_video = (rtc_options.offer_to_receive_video > 0);
506 } 506 }
507 507
508 session_options->vad_enabled = rtc_options.voice_activity_detection; 508 session_options->vad_enabled = rtc_options.voice_activity_detection;
509 session_options->transport_options.ice_restart = rtc_options.ice_restart; 509 session_options->audio_ice_restart = rtc_options.ice_restart;
510 session_options->video_ice_restart = rtc_options.ice_restart;
511 session_options->data_ice_restart = rtc_options.ice_restart;
510 session_options->bundle_enabled = rtc_options.use_rtp_mux; 512 session_options->bundle_enabled = rtc_options.use_rtp_mux;
511 513
512 return true; 514 return true;
513 } 515 }
514 516
515 bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints, 517 bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints,
516 cricket::MediaSessionOptions* session_options) { 518 cricket::MediaSessionOptions* session_options) {
517 bool value = false; 519 bool value = false;
518 size_t mandatory_constraints_satisfied = 0; 520 size_t mandatory_constraints_satisfied = 0;
519 521
(...skipping 25 matching lines...) Expand all
545 if (FindConstraint(constraints, MediaConstraintsInterface::kUseRtpMux, &value, 547 if (FindConstraint(constraints, MediaConstraintsInterface::kUseRtpMux, &value,
546 &mandatory_constraints_satisfied)) { 548 &mandatory_constraints_satisfied)) {
547 session_options->bundle_enabled = value; 549 session_options->bundle_enabled = value;
548 } else { 550 } else {
549 // kUseRtpMux defaults to true according to spec. 551 // kUseRtpMux defaults to true according to spec.
550 session_options->bundle_enabled = true; 552 session_options->bundle_enabled = true;
551 } 553 }
552 554
553 if (FindConstraint(constraints, MediaConstraintsInterface::kIceRestart, 555 if (FindConstraint(constraints, MediaConstraintsInterface::kIceRestart,
554 &value, &mandatory_constraints_satisfied)) { 556 &value, &mandatory_constraints_satisfied)) {
555 session_options->transport_options.ice_restart = value; 557 session_options->audio_ice_restart = value;
558 session_options->video_ice_restart = value;
559 session_options->data_ice_restart = value;
556 } else { 560 } else {
557 // kIceRestart defaults to false according to spec. 561 // kIceRestart defaults to false according to spec.
558 session_options->transport_options.ice_restart = false; 562 session_options->audio_ice_restart = false;
563 session_options->video_ice_restart = false;
564 session_options->data_ice_restart = false;
559 } 565 }
560 566
561 if (!constraints) { 567 if (!constraints) {
562 return true; 568 return true;
563 } 569 }
564 return mandatory_constraints_satisfied == constraints->GetMandatory().size(); 570 return mandatory_constraints_satisfied == constraints->GetMandatory().size();
565 } 571 }
566 572
567 bool ParseIceServers(const PeerConnectionInterface::IceServers& servers, 573 bool ParseIceServers(const PeerConnectionInterface::IceServers& servers,
568 StunConfigurations* stun_config, 574 StunConfigurations* stun_config,
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { 2035 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const {
2030 for (const auto& channel : sctp_data_channels_) { 2036 for (const auto& channel : sctp_data_channels_) {
2031 if (channel->id() == sid) { 2037 if (channel->id() == sid) {
2032 return channel; 2038 return channel;
2033 } 2039 }
2034 } 2040 }
2035 return nullptr; 2041 return nullptr;
2036 } 2042 }
2037 2043
2038 } // namespace webrtc 2044 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnectioninterface_unittest.cc » ('j') | talk/session/media/mediasession.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698