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

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

Issue 1903663002: Build dynamic iOS SDK. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix test gyp Created 4 years, 7 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/RTCRtpParameters.h ('k') | webrtc/api/objc/RTCRtpParameters+Private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #import "RTCRtpParameters+Private.h"
12
13 #import "RTCRtpCodecParameters+Private.h"
14 #import "RTCRtpEncodingParameters+Private.h"
15
16 @implementation RTCRtpParameters
17
18 @synthesize encodings = _encodings;
19 @synthesize codecs = _codecs;
20
21 - (instancetype)init {
22 return [super init];
23 }
24
25 - (instancetype)initWithNativeParameters:
26 (const webrtc::RtpParameters &)nativeParameters {
27 if (self = [self init]) {
28 NSMutableArray *encodings = [[NSMutableArray alloc] init];
29 for (const auto &encoding : nativeParameters.encodings) {
30 [encodings addObject:[[RTCRtpEncodingParameters alloc]
31 initWithNativeParameters:encoding]];
32 }
33 _encodings = encodings;
34
35 NSMutableArray *codecs = [[NSMutableArray alloc] init];
36 for (const auto &codec : nativeParameters.codecs) {
37 [codecs addObject:[[RTCRtpCodecParameters alloc]
38 initWithNativeParameters:codec]];
39 }
40 _codecs = codecs;
41 }
42 return self;
43 }
44
45 - (webrtc::RtpParameters)nativeParameters {
46 webrtc::RtpParameters parameters;
47 for (RTCRtpEncodingParameters *encoding in _encodings) {
48 parameters.encodings.push_back(encoding.nativeParameters);
49 }
50 for (RTCRtpCodecParameters *codec in _codecs) {
51 parameters.codecs.push_back(codec.nativeParameters);
52 }
53 return parameters;
54 }
55
56 @end
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCRtpParameters.h ('k') | webrtc/api/objc/RTCRtpParameters+Private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698