wrapper.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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_WRAPPER_H_
  11. #define SDK_ANDROID_NATIVE_API_VIDEO_WRAPPER_H_
  12. #include <jni.h>
  13. #include <memory>
  14. #include "api/media_stream_interface.h"
  15. #include "api/video/video_frame.h"
  16. #include "sdk/android/native_api/jni/scoped_java_ref.h"
  17. namespace webrtc {
  18. // Creates an instance of rtc::VideoSinkInterface<VideoFrame> from Java
  19. // VideoSink.
  20. std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> JavaToNativeVideoSink(
  21. JNIEnv* jni,
  22. jobject video_sink);
  23. // Creates a Java VideoFrame object from a native VideoFrame. The returned
  24. // object has to be released by calling release.
  25. ScopedJavaLocalRef<jobject> NativeToJavaVideoFrame(JNIEnv* jni,
  26. const VideoFrame& frame);
  27. } // namespace webrtc
  28. #endif // SDK_ANDROID_NATIVE_API_VIDEO_WRAPPER_H_