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

Side by Side Diff: webrtc/api/objc/RTCPeerConnection.mm

Issue 1854393002: Objective C API to read and set RtpParameters (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: CR feedback Created 4 years, 8 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 | « webrtc/api/objc/RTCPeerConnection.h ('k') | webrtc/api/objc/RTCRtpEncodingParameters.h » ('j') | 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 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #import "webrtc/api/objc/RTCPeerConnection.h" 11 #import "webrtc/api/objc/RTCPeerConnection.h"
12 12
13 #include "webrtc/base/checks.h" 13 #include "webrtc/base/checks.h"
14 14
15 #import "webrtc/api/objc/RTCPeerConnection+Private.h" 15 #import "webrtc/api/objc/RTCPeerConnection+Private.h"
16 #import "webrtc/api/objc/RTCConfiguration+Private.h" 16 #import "webrtc/api/objc/RTCConfiguration+Private.h"
17 #import "webrtc/api/objc/RTCDataChannel+Private.h" 17 #import "webrtc/api/objc/RTCDataChannel+Private.h"
18 #import "webrtc/api/objc/RTCIceCandidate+Private.h" 18 #import "webrtc/api/objc/RTCIceCandidate+Private.h"
19 #import "webrtc/api/objc/RTCMediaConstraints+Private.h" 19 #import "webrtc/api/objc/RTCMediaConstraints+Private.h"
20 #import "webrtc/api/objc/RTCMediaStream+Private.h" 20 #import "webrtc/api/objc/RTCMediaStream+Private.h"
21 #import "webrtc/api/objc/RTCPeerConnectionFactory+Private.h" 21 #import "webrtc/api/objc/RTCPeerConnectionFactory+Private.h"
22 #import "webrtc/api/objc/RTCRtpSender+Private.h"
22 #import "webrtc/api/objc/RTCSessionDescription+Private.h" 23 #import "webrtc/api/objc/RTCSessionDescription+Private.h"
23 #import "webrtc/api/objc/RTCStatsReport+Private.h" 24 #import "webrtc/api/objc/RTCStatsReport+Private.h"
24 #import "webrtc/base/objc/RTCLogging.h" 25 #import "webrtc/base/objc/RTCLogging.h"
25 #import "webrtc/base/objc/NSString+StdString.h" 26 #import "webrtc/base/objc/NSString+StdString.h"
26 27
27 NSString * const kRTCPeerConnectionErrorDomain = 28 NSString * const kRTCPeerConnectionErrorDomain =
28 @"org.webrtc.RTCPeerConnection"; 29 @"org.webrtc.RTCPeerConnection";
29 int const kRTCPeerConnnectionSessionDescriptionError = -1; 30 int const kRTCPeerConnnectionSessionDescriptionError = -1;
30 31
31 namespace webrtc { 32 namespace webrtc {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 305 }
305 306
306 - (void)setRemoteDescription:(RTCSessionDescription *)sdp 307 - (void)setRemoteDescription:(RTCSessionDescription *)sdp
307 completionHandler:(void (^)(NSError *error))completionHandler { 308 completionHandler:(void (^)(NSError *error))completionHandler {
308 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer( 309 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer(
309 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>( 310 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>(
310 completionHandler)); 311 completionHandler));
311 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription); 312 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription);
312 } 313 }
313 314
315 - (NSArray<RTCRtpSender *> *)senders {
316 std::vector<rtc::scoped_refptr<webrtc::RtpSenderInterface>> nativeSenders(
317 _peerConnection->GetSenders());
318 NSMutableArray *senders = [[NSMutableArray alloc] init];
319 for (const auto &nativeSender : nativeSenders) {
320 RTCRtpSender *sender =
321 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender];
322 [senders addObject:sender];
323 }
324 return senders;
325 }
326
314 #pragma mark - Private 327 #pragma mark - Private
315 328
316 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: 329 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState:
317 (RTCSignalingState)state { 330 (RTCSignalingState)state {
318 switch (state) { 331 switch (state) {
319 case RTCSignalingStateStable: 332 case RTCSignalingStateStable:
320 return webrtc::PeerConnectionInterface::kStable; 333 return webrtc::PeerConnectionInterface::kStable;
321 case RTCSignalingStateHaveLocalOffer: 334 case RTCSignalingStateHaveLocalOffer:
322 return webrtc::PeerConnectionInterface::kHaveLocalOffer; 335 return webrtc::PeerConnectionInterface::kHaveLocalOffer;
323 case RTCSignalingStateHaveLocalPrAnswer: 336 case RTCSignalingStateHaveLocalPrAnswer:
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 case RTCStatsOutputLevelDebug: 487 case RTCStatsOutputLevelDebug:
475 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; 488 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug;
476 } 489 }
477 } 490 }
478 491
479 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { 492 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection {
480 return _peerConnection; 493 return _peerConnection;
481 } 494 }
482 495
483 @end 496 @end
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCPeerConnection.h ('k') | webrtc/api/objc/RTCRtpEncodingParameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698