blob: fc670ea91607ad30bd15bddd70a6924f054293e5 [file] [log] [blame]
Jonathan Yufa6a2832018-02-12 17:32:37 -08001/*
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#ifndef SDK_ANDROID_NATIVE_API_VIDEO_WRAPPER_H_
12#define SDK_ANDROID_NATIVE_API_VIDEO_WRAPPER_H_
13
14#include <jni.h>
15#include <memory>
16
17#include "api/mediastreaminterface.h"
18#include "api/video/video_frame.h"
19#include "sdk/android/native_api/jni/scoped_java_ref.h"
20
21namespace webrtc {
22
23// Creates an instance of rtc::VideoSinkInterface<VideoFrame> from Java
24// VideoSink.
25std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> JavaToNativeVideoSink(
26 JNIEnv* jni,
27 jobject video_sink);
28
Sami Kalliomäki2bde8502018-02-15 13:58:15 +010029// Creates a Java VideoFrame object from a native VideoFrame. The returned
30// object has to be released by calling release.
Jonathan Yufa6a2832018-02-12 17:32:37 -080031ScopedJavaLocalRef<jobject> NativeToJavaVideoFrame(JNIEnv* jni,
32 const VideoFrame& frame);
33
34} // namespace webrtc
35
36#endif // SDK_ANDROID_NATIVE_API_VIDEO_WRAPPER_H_