OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/sdk/android/src/jni/pc/mediaconstraints_jni.h" | 11 #include "webrtc/sdk/android/src/jni/pc/mediaconstraints_jni.h" |
12 | 12 |
13 namespace webrtc_jni { | 13 namespace webrtc { |
| 14 namespace jni { |
14 | 15 |
15 MediaConstraintsJni::MediaConstraintsJni(JNIEnv* jni, jobject j_constraints) { | 16 MediaConstraintsJni::MediaConstraintsJni(JNIEnv* jni, jobject j_constraints) { |
16 PopulateConstraintsFromJavaPairList(jni, j_constraints, "mandatory", | 17 PopulateConstraintsFromJavaPairList(jni, j_constraints, "mandatory", |
17 &mandatory_); | 18 &mandatory_); |
18 PopulateConstraintsFromJavaPairList(jni, j_constraints, "optional", | 19 PopulateConstraintsFromJavaPairList(jni, j_constraints, "optional", |
19 &optional_); | 20 &optional_); |
20 } | 21 } |
21 | 22 |
22 // static | 23 // static |
23 void MediaConstraintsJni::PopulateConstraintsFromJavaPairList( | 24 void MediaConstraintsJni::PopulateConstraintsFromJavaPairList( |
(...skipping 13 matching lines...) Expand all Loading... |
37 jmethodID get_value = GetMethodID(jni, GetObjectClass(jni, entry), | 38 jmethodID get_value = GetMethodID(jni, GetObjectClass(jni, entry), |
38 "getValue", "()Ljava/lang/String;"); | 39 "getValue", "()Ljava/lang/String;"); |
39 jstring j_value = | 40 jstring j_value = |
40 reinterpret_cast<jstring>(jni->CallObjectMethod(entry, get_value)); | 41 reinterpret_cast<jstring>(jni->CallObjectMethod(entry, get_value)); |
41 CHECK_EXCEPTION(jni) << "error during CallObjectMethod"; | 42 CHECK_EXCEPTION(jni) << "error during CallObjectMethod"; |
42 field->push_back( | 43 field->push_back( |
43 Constraint(JavaToStdString(jni, j_key), JavaToStdString(jni, j_value))); | 44 Constraint(JavaToStdString(jni, j_key), JavaToStdString(jni, j_value))); |
44 } | 45 } |
45 } | 46 } |
46 | 47 |
47 } // namespace webrtc_jni | 48 } // namespace jni |
| 49 } // namespace webrtc |
OLD | NEW |