blob: d46f3e8f533b37b1aedc15eb5b0028218ecc3558 [file] [log] [blame]
Sami Kalliomäkiff1de0a2018-05-16 12:49:47 +02001/*
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
Steve Anton10542f22019-01-11 09:11:00 -080011#ifndef SDK_ANDROID_NATIVE_API_VIDEO_VIDEO_SOURCE_H_
12#define SDK_ANDROID_NATIVE_API_VIDEO_VIDEO_SOURCE_H_
Sami Kalliomäkiff1de0a2018-05-16 12:49:47 +020013
14#include <jni.h>
15
Steve Anton10542f22019-01-11 09:11:00 -080016#include "api/media_stream_interface.h"
Yves Gerey2e00abc2018-10-05 15:39:24 +020017#include "rtc_base/thread.h"
Sami Kalliomäkiff1de0a2018-05-16 12:49:47 +020018#include "sdk/android/native_api/jni/scoped_java_ref.h"
19
20namespace webrtc {
21
22// Interface for class that implements VideoTrackSourceInterface and provides a
23// Java object that can be used to feed frames to the source.
24class JavaVideoTrackSourceInterface : public VideoTrackSourceInterface {
25 public:
Sami Kalliomäki05b552f2018-07-05 17:06:51 +020026 // Returns CapturerObserver object that can be used to feed frames to the
27 // video source.
Sami Kalliomäkiff1de0a2018-05-16 12:49:47 +020028 virtual ScopedJavaLocalRef<jobject> GetJavaVideoCapturerObserver(
29 JNIEnv* env) = 0;
30};
31
32// Creates an instance of JavaVideoTrackSourceInterface,
33rtc::scoped_refptr<JavaVideoTrackSourceInterface> CreateJavaVideoSource(
34 JNIEnv* env,
35 rtc::Thread* signaling_thread,
Magnus Jedvert95140712018-11-15 12:07:32 +010036 bool is_screencast,
37 bool align_timestamps);
Sami Kalliomäkiff1de0a2018-05-16 12:49:47 +020038
39} // namespace webrtc
40
Steve Anton10542f22019-01-11 09:11:00 -080041#endif // SDK_ANDROID_NATIVE_API_VIDEO_VIDEO_SOURCE_H_