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

Unified Diff: webrtc/api/objc/RTCRtpCodecParameters.mm

Issue 1885473004: Adding codecs to the RtpParameters returned by an RtpSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing minor issues 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/api/objc/RTCRtpCodecParameters.mm
diff --git a/webrtc/api/objc/RTCRtpCodecParameters.mm b/webrtc/api/objc/RTCRtpCodecParameters.mm
new file mode 100644
index 0000000000000000000000000000000000000000..d98f46467a4c05cb954e1a1ec67e9b1c8d5804d1
--- /dev/null
+++ b/webrtc/api/objc/RTCRtpCodecParameters.mm
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#import "RTCRtpCodecParameters+Private.h"
tkchin_webrtc 2016/04/14 17:52:51 nit: one blank line after interface header import
Taylor Brandstetter 2016/04/14 18:17:22 Done.
+#import "webrtc/base/objc/NSString+StdString.h"
+
+@implementation RTCRtpCodecParameters
+
+@synthesize payloadType = _payloadType;
+@synthesize mimeType = _mimeType;
+@synthesize clockRate = _clockRate;
+@synthesize channels = _channels;
+
+- (instancetype)init {
+ return [super init];
+}
+
+- (instancetype)initWithNativeParameters:
+ (const webrtc::RtpCodecParameters &)nativeParameters {
+ if (self = [self init]) {
+ _payloadType = nativeParameters.payload_type;
+ _mimeType = [NSString stringForStdString:nativeParameters.mime_type];
+ _clockRate = nativeParameters.clock_rate;
+ _channels = nativeParameters.channels;
+ }
+ return self;
+}
+
+- (webrtc::RtpCodecParameters)nativeParameters {
+ webrtc::RtpCodecParameters parameters;
+ parameters.payload_type = _payloadType;
+ parameters.mime_type = [NSString stdStringForString:_mimeType];
+ parameters.clock_rate = _clockRate;
+ parameters.channels = _channels;
+ return parameters;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698