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

Unified Diff: webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm

Issue 2650343006: Pass network config constraint as base64 to avoid mangling bytes (Closed)
Patch Set: Update Created 3 years, 10 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
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMediaConstraints.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm b/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm
index 0a61f99e9efd43444a672f0e4857befbf14436b6..3b9d84584113bd458d139810309eb925eda037f6 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm
@@ -32,6 +32,8 @@ NSString * const kRTCMediaConstraintsMaxFrameRate =
@(webrtc::MediaConstraintsInterface::kMaxFrameRate);
NSString * const kRTCMediaConstraintsLevelControl =
@(webrtc::MediaConstraintsInterface::kLevelControl);
+NSString * const kRTCMediaConstraintsAudioNetworkAdaptorConfig =
+ @(webrtc::MediaConstraintsInterface::kAudioNetworkAdaptorConfig);
NSString * const kRTCMediaConstraintsValueTrue =
@(webrtc::MediaConstraintsInterface::kValueTrue);
@@ -109,8 +111,17 @@ MediaConstraints::GetOptional() const {
NSString *value = [constraints objectForKey:key];
NSAssert([value isKindOfClass:[NSString class]],
@"%@ is not an NSString.", value);
- nativeConstraints.push_back(webrtc::MediaConstraintsInterface::Constraint(
- key.stdString, value.stdString));
+ if ([kRTCMediaConstraintsAudioNetworkAdaptorConfig isEqualToString:key]) {
+ // This value is base64 encoded.
+ NSData *charData = [[NSData alloc] initWithBase64EncodedString:value options:0];
+ std::string configValue =
+ std::string(reinterpret_cast<const char *>(charData.bytes), charData.length);
+ nativeConstraints.push_back(webrtc::MediaConstraintsInterface::Constraint(
+ key.stdString, configValue));
+ } else {
+ nativeConstraints.push_back(webrtc::MediaConstraintsInterface::Constraint(
+ key.stdString, value.stdString));
+ }
}
return nativeConstraints;
}
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMediaConstraints.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698