video_source.h 1.4 KB

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