blob: 5448955a453c24b0f5333ca683590f6226521611 [file] [log] [blame]
Sami Kalliomäki82f96e62018-01-29 13:18:57 +01001/*
2 * Copyright 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"
12
Karl Wiberg918f50c2018-07-05 11:40:33 +020013#include "absl/memory/memory.h"
Sami Kalliomäki82f96e62018-01-29 13:18:57 +010014#include "sdk/android/src/jni/videodecoderfactorywrapper.h"
15#include "sdk/android/src/jni/videoencoderfactorywrapper.h"
16
17namespace webrtc {
18
19std::unique_ptr<VideoDecoderFactory> JavaToNativeVideoDecoderFactory(
20 JNIEnv* jni,
21 jobject decoder_factory) {
Karl Wiberg918f50c2018-07-05 11:40:33 +020022 return absl::make_unique<jni::VideoDecoderFactoryWrapper>(
Sami Kalliomäki82f96e62018-01-29 13:18:57 +010023 jni, JavaParamRef<jobject>(decoder_factory));
24}
25
26std::unique_ptr<VideoEncoderFactory> JavaToNativeVideoEncoderFactory(
27 JNIEnv* jni,
28 jobject en) {
Karl Wiberg918f50c2018-07-05 11:40:33 +020029 return absl::make_unique<jni::VideoEncoderFactoryWrapper>(
Sami Kalliomäki82f96e62018-01-29 13:18:57 +010030 jni, JavaParamRef<jobject>(en));
31}
32
33} // namespace webrtc