blob: 7c42304440e08d898c930d83cc06c0396efabd53 [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
11#ifndef SDK_ANDROID_NATIVE_API_VIDEO_VIDEOSOURCE_H_
12#define SDK_ANDROID_NATIVE_API_VIDEO_VIDEOSOURCE_H_
13
14#include <jni.h>
15
16#include "api/mediastreaminterface.h"
17#include "sdk/android/native_api/jni/scoped_java_ref.h"
18
19namespace webrtc {
20
21// Interface for class that implements VideoTrackSourceInterface and provides a
22// Java object that can be used to feed frames to the source.
23class JavaVideoTrackSourceInterface : public VideoTrackSourceInterface {
24 public:
25 // Returns VideoCapturer.CapturerObserver object that can be used to feed
26 // frames to the video source.
27 virtual ScopedJavaLocalRef<jobject> GetJavaVideoCapturerObserver(
28 JNIEnv* env) = 0;
29};
30
31// Creates an instance of JavaVideoTrackSourceInterface,
32rtc::scoped_refptr<JavaVideoTrackSourceInterface> CreateJavaVideoSource(
33 JNIEnv* env,
34 rtc::Thread* signaling_thread,
35 bool is_screencast);
36
37} // namespace webrtc
38
39#endif // SDK_ANDROID_NATIVE_API_VIDEO_VIDEOSOURCE_H_