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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp

Issue 2097683003: Support legacy offerToReceiveAudio/offerToReceiveVideo fields in RTCOfferOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/modules/mediastream/RTCOfferOptions.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "public/platform/WebRTCDataChannelHandler.h" 83 #include "public/platform/WebRTCDataChannelHandler.h"
84 #include "public/platform/WebRTCDataChannelInit.h" 84 #include "public/platform/WebRTCDataChannelInit.h"
85 #include "public/platform/WebRTCICECandidate.h" 85 #include "public/platform/WebRTCICECandidate.h"
86 #include "public/platform/WebRTCKeyParams.h" 86 #include "public/platform/WebRTCKeyParams.h"
87 #include "public/platform/WebRTCOfferOptions.h" 87 #include "public/platform/WebRTCOfferOptions.h"
88 #include "public/platform/WebRTCSessionDescription.h" 88 #include "public/platform/WebRTCSessionDescription.h"
89 #include "public/platform/WebRTCSessionDescriptionRequest.h" 89 #include "public/platform/WebRTCSessionDescriptionRequest.h"
90 #include "public/platform/WebRTCStatsRequest.h" 90 #include "public/platform/WebRTCStatsRequest.h"
91 #include "public/platform/WebRTCVoidRequest.h" 91 #include "public/platform/WebRTCVoidRequest.h"
92 #include "wtf/CurrentTime.h" 92 #include "wtf/CurrentTime.h"
93 93 #include <algorithm>
94 #include <memory> 94 #include <memory>
95 95
96 namespace blink { 96 namespace blink {
97 97
98 namespace { 98 namespace {
99 99
100 const char kSignalingStateClosedMessage[] = "The RTCPeerConnection's signalingSt ate is 'closed'."; 100 const char kSignalingStateClosedMessage[] = "The RTCPeerConnection's signalingSt ate is 'closed'.";
101 101
102 bool throwExceptionIfSignalingStateClosed(RTCPeerConnection::SignalingState stat e, ExceptionState& exceptionState) 102 bool throwExceptionIfSignalingStateClosed(RTCPeerConnection::SignalingState stat e, ExceptionState& exceptionState)
103 { 103 {
(...skipping 30 matching lines...) Expand all
134 return !iceCandidateInit.hasSdpMid() && !iceCandidateInit.hasSdpMLineInd ex(); 134 return !iceCandidateInit.hasSdpMid() && !iceCandidateInit.hasSdpMLineInd ex();
135 } 135 }
136 136
137 DCHECK(candidate.isRTCIceCandidate()); 137 DCHECK(candidate.isRTCIceCandidate());
138 return false; 138 return false;
139 } 139 }
140 140
141 WebRTCOfferOptions convertToWebRTCOfferOptions(const RTCOfferOptions& options) 141 WebRTCOfferOptions convertToWebRTCOfferOptions(const RTCOfferOptions& options)
142 { 142 {
143 return WebRTCOfferOptions(RTCOfferOptionsPlatform::create( 143 return WebRTCOfferOptions(RTCOfferOptionsPlatform::create(
144 -1, -1, 144 options.hasOfferToReceiveVideo() ? std::max(options.offerToReceiveVideo( ), 0) : -1,
145 options.hasOfferToReceiveAudio() ? std::max(options.offerToReceiveAudio( ), 0) : -1,
145 options.hasVoiceActivityDetection() ? options.voiceActivityDetection() : true, 146 options.hasVoiceActivityDetection() ? options.voiceActivityDetection() : true,
146 options.hasIceRestart() ? options.iceRestart() : false)); 147 options.hasIceRestart() ? options.iceRestart() : false));
147 } 148 }
148 149
149 WebRTCAnswerOptions convertToWebRTCAnswerOptions(const RTCAnswerOptions& options ) 150 WebRTCAnswerOptions convertToWebRTCAnswerOptions(const RTCAnswerOptions& options )
150 { 151 {
151 return WebRTCAnswerOptions(RTCAnswerOptionsPlatform::create( 152 return WebRTCAnswerOptions(RTCAnswerOptionsPlatform::create(
152 options.hasVoiceActivityDetection() ? options.voiceActivityDetection() : true)); 153 options.hasVoiceActivityDetection() ? options.voiceActivityDetection() : true));
153 } 154 }
154 155
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 { 1214 {
1214 visitor->trace(m_localStreams); 1215 visitor->trace(m_localStreams);
1215 visitor->trace(m_remoteStreams); 1216 visitor->trace(m_remoteStreams);
1216 visitor->trace(m_dispatchScheduledEventRunner); 1217 visitor->trace(m_dispatchScheduledEventRunner);
1217 visitor->trace(m_scheduledEvents); 1218 visitor->trace(m_scheduledEvents);
1218 EventTargetWithInlineData::trace(visitor); 1219 EventTargetWithInlineData::trace(visitor);
1219 ActiveDOMObject::trace(visitor); 1220 ActiveDOMObject::trace(visitor);
1220 } 1221 }
1221 1222
1222 } // namespace blink 1223 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/mediastream/RTCOfferOptions.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698