Sami Kalliomäki | ff1de0a | 2018-05-16 12:49:47 +0200 | [diff] [blame] | 1 | /* |
| 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 Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 11 | #ifndef SDK_ANDROID_NATIVE_API_VIDEO_VIDEO_SOURCE_H_ |
| 12 | #define SDK_ANDROID_NATIVE_API_VIDEO_VIDEO_SOURCE_H_ |
Sami Kalliomäki | ff1de0a | 2018-05-16 12:49:47 +0200 | [diff] [blame] | 13 | |
| 14 | #include <jni.h> |
| 15 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 16 | #include "api/media_stream_interface.h" |
Yves Gerey | 2e00abc | 2018-10-05 15:39:24 +0200 | [diff] [blame] | 17 | #include "rtc_base/thread.h" |
Sami Kalliomäki | ff1de0a | 2018-05-16 12:49:47 +0200 | [diff] [blame] | 18 | #include "sdk/android/native_api/jni/scoped_java_ref.h" |
| 19 | |
| 20 | namespace 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. |
| 24 | class JavaVideoTrackSourceInterface : public VideoTrackSourceInterface { |
| 25 | public: |
Sami Kalliomäki | 05b552f | 2018-07-05 17:06:51 +0200 | [diff] [blame] | 26 | // Returns CapturerObserver object that can be used to feed frames to the |
| 27 | // video source. |
Sami Kalliomäki | ff1de0a | 2018-05-16 12:49:47 +0200 | [diff] [blame] | 28 | virtual ScopedJavaLocalRef<jobject> GetJavaVideoCapturerObserver( |
| 29 | JNIEnv* env) = 0; |
| 30 | }; |
| 31 | |
| 32 | // Creates an instance of JavaVideoTrackSourceInterface, |
| 33 | rtc::scoped_refptr<JavaVideoTrackSourceInterface> CreateJavaVideoSource( |
| 34 | JNIEnv* env, |
| 35 | rtc::Thread* signaling_thread, |
Magnus Jedvert | 9514071 | 2018-11-15 12:07:32 +0100 | [diff] [blame] | 36 | bool is_screencast, |
| 37 | bool align_timestamps); |
Sami Kalliomäki | ff1de0a | 2018-05-16 12:49:47 +0200 | [diff] [blame] | 38 | |
| 39 | } // namespace webrtc |
| 40 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 41 | #endif // SDK_ANDROID_NATIVE_API_VIDEO_VIDEO_SOURCE_H_ |