OLD | NEW |
---|---|
(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 - (webrtc::RtpEncodingParameters)nativeParameters { | |
21 webrtc::RtpEncodingParameters parameters; | |
22 parameters.active = _isActive; | |
23 if (_maxBitrateBps != nil) { | |
24 parameters.max_bitrate_bps = [_maxBitrateBps intValue]; | |
tkchin_webrtc
2016/04/06 22:04:48
dot syntax for properties
skvlad
2016/04/08 19:33:18
Done.
| |
25 } | |
26 return parameters; | |
27 } | |
28 | |
29 - (instancetype)initWithNativeParameters: | |
30 (const webrtc::RtpEncodingParameters &)nativeParameters { | |
31 if ([self init]) { | |
32 _isActive = nativeParameters.active; | |
33 //TODO(skvlad): Replace with rtc::Optional once the C++ code is updated. | |
tkchin_webrtc
2016/04/06 22:04:48
nit: space after. // TODO
skvlad
2016/04/08 19:33:19
Done.
| |
34 if (nativeParameters.max_bitrate_bps != kBitrateUnlimited) { | |
35 _maxBitrateBps = | |
36 [NSNumber numberWithInt:nativeParameters.max_bitrate_bps]; | |
37 } else { | |
38 _maxBitrateBps = nil; | |
tkchin_webrtc
2016/04/06 22:04:48
not needed. ivar objects are initialized to nil
skvlad
2016/04/08 19:33:19
Done. I thought this made it clearer that the valu
| |
39 } | |
40 } | |
41 return self; | |
42 } | |
43 | |
44 - (instancetype)init { | |
tkchin_webrtc
2016/04/06 22:04:48
this should be declared after static const int kBi
skvlad
2016/04/08 19:33:19
Done.
| |
45 self = [super init]; | |
46 return self; | |
47 } | |
48 | |
49 @end | |
OLD | NEW |