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

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

Issue 1854393002: Objective C API to read and set RtpParameters (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
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 maxBitrateBps = _maxBitrateBps;
16 @synthesize active = _active;
17
18 const int kBitrateUnlimited = -1;
tkchin_webrtc 2016/04/05 18:48:15 no namespace, so either static linkage or prefix:
skvlad 2016/04/05 23:21:27 Made static.
19
20 - (webrtc::RtpEncodingParameters)nativeParameters {
21 webrtc::RtpEncodingParameters parameters;
22 parameters.active = self.active;
tkchin_webrtc 2016/04/05 18:48:15 usually we just access instance variable directly
skvlad 2016/04/05 23:21:28 Done.
23 if (self.maxBitrateBps != nil) {
24 parameters.max_bitrate_bps = [self.maxBitrateBps intValue];
25 }
26 return parameters;
27 }
28
29 - (instancetype)initWithNativeParameters:
30 (const webrtc::RtpEncodingParameters&)nativeParameters {
31 if (self = [super init]) {
32 if (nativeParameters.max_bitrate_bps != kBitrateUnlimited) {
tkchin_webrtc 2016/04/05 18:48:15 isn't there a C++ equivalent of unlimited bitrate?
skvlad 2016/04/05 23:21:27 The C++ equivalent will be replaced with rtc::Opti
33 self.maxBitrateBps =
tkchin_webrtc 2016/04/05 18:48:15 ditto _maxBitrateBps = nativeParameters.max_bitrat
skvlad 2016/04/05 23:21:27 Done.
34 [NSNumber numberWithInt:nativeParameters.max_bitrate_bps];
35 } else {
36 self.maxBitrateBps = nil;
37 }
38 self.active = nativeParameters.active;
39 }
40 return self;
41 }
42
43 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698