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

Side by Side Diff: webrtc/api/objc/RTCRtpEncodingParameters.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
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 "RTCRtpEncodingParameters+Private.h"
12
13 @implementation RTCRtpEncodingParameters
14
15 @synthesize isActive = _isActive;
16 @synthesize maxBitrateBps = _maxBitrateBps;
17
18 static const int kBitrateUnlimited = -1;
19
20 - (instancetype)init {
21 return [super init];
22 }
23
24 - (instancetype)initWithNativeParameters:
25 (const webrtc::RtpEncodingParameters &)nativeParameters {
26 if (self = [self init]) {
27 _isActive = nativeParameters.active;
28 // TODO(skvlad): Replace with rtc::Optional once the C++ code is updated.
29 if (nativeParameters.max_bitrate_bps != kBitrateUnlimited) {
30 _maxBitrateBps =
31 [NSNumber numberWithInt:nativeParameters.max_bitrate_bps];
32 }
33 }
34 return self;
35 }
36
37 - (webrtc::RtpEncodingParameters)nativeParameters {
38 webrtc::RtpEncodingParameters parameters;
39 parameters.active = _isActive;
40 if (_maxBitrateBps != nil) {
41 parameters.max_bitrate_bps = _maxBitrateBps.intValue;
42 }
43 return parameters;
44 }
45
46 @end
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCRtpEncodingParameters.h ('k') | webrtc/api/objc/RTCRtpEncodingParameters+Private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698