Rasmus Brandt | 5e4ef77 | 2018-07-09 14:39:35 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 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 | #include "sdk/android/native_api/codecs/wrapper.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 12 | #include "media/base/media_constants.h" |
Rasmus Brandt | 5e4ef77 | 2018-07-09 14:39:35 +0200 | [diff] [blame] | 13 | #include "sdk/android/generated_native_unittests_jni/jni/CodecsWrapperTestHelper_jni.h" |
| 14 | #include "test/gtest.h" |
| 15 | |
| 16 | namespace webrtc { |
| 17 | namespace test { |
| 18 | namespace { |
| 19 | TEST(JavaCodecsWrapperTest, JavaToNativeVideoCodecInfo) { |
| 20 | JNIEnv* env = AttachCurrentThreadIfNeeded(); |
| 21 | ScopedJavaLocalRef<jobject> j_video_codec_info = |
| 22 | jni::Java_CodecsWrapperTestHelper_createTestVideoCodecInfo(env); |
| 23 | |
| 24 | const SdpVideoFormat video_format = |
| 25 | JavaToNativeVideoCodecInfo(env, j_video_codec_info.obj()); |
| 26 | |
| 27 | EXPECT_EQ(cricket::kH264CodecName, video_format.name); |
| 28 | const auto it = |
| 29 | video_format.parameters.find(cricket::kH264FmtpProfileLevelId); |
| 30 | ASSERT_NE(it, video_format.parameters.end()); |
| 31 | EXPECT_EQ(cricket::kH264ProfileLevelConstrainedBaseline, it->second); |
| 32 | } |
| 33 | } // namespace |
| 34 | } // namespace test |
| 35 | } // namespace webrtc |