blob: 53efd224b084e78ab72151da23e4e795b3a1168f [file] [log] [blame]
Rasmus Brandt5e4ef772018-07-09 14:39:35 +02001/*
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 Anton10542f22019-01-11 09:11:00 -080012#include "media/base/media_constants.h"
Rasmus Brandt5e4ef772018-07-09 14:39:35 +020013#include "sdk/android/generated_native_unittests_jni/jni/CodecsWrapperTestHelper_jni.h"
14#include "test/gtest.h"
15
16namespace webrtc {
17namespace test {
18namespace {
19TEST(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