wrapper.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_CODECS_WRAPPER_H_
  11. #define SDK_ANDROID_NATIVE_API_CODECS_WRAPPER_H_
  12. #include <jni.h>
  13. #include <memory>
  14. #include <vector>
  15. #include "api/video_codecs/sdp_video_format.h"
  16. #include "api/video_codecs/video_decoder_factory.h"
  17. #include "api/video_codecs/video_encoder.h"
  18. #include "api/video_codecs/video_encoder_factory.h"
  19. namespace webrtc {
  20. // Creates an instance of webrtc::SdpVideoFormat from Java VideoCodecInfo.
  21. SdpVideoFormat JavaToNativeVideoCodecInfo(JNIEnv* jni, jobject codec_info);
  22. // Creates an instance of webrtc::VideoDecoderFactory from Java
  23. // VideoDecoderFactory.
  24. std::unique_ptr<VideoDecoderFactory> JavaToNativeVideoDecoderFactory(
  25. JNIEnv* jni,
  26. jobject decoder_factory);
  27. // Creates an instance of webrtc::VideoEncoderFactory from Java
  28. // VideoEncoderFactory.
  29. std::unique_ptr<VideoEncoderFactory> JavaToNativeVideoEncoderFactory(
  30. JNIEnv* jni,
  31. jobject encoder_factory);
  32. // Creates an array of VideoEncoder::ResolutionBitrateLimits from Java array
  33. // of ResolutionBitrateLimits.
  34. std::vector<VideoEncoder::ResolutionBitrateLimits>
  35. JavaToNativeResolutionBitrateLimits(JNIEnv* jni,
  36. const jobjectArray j_bitrate_limits_array);
  37. } // namespace webrtc
  38. #endif // SDK_ANDROID_NATIVE_API_CODECS_WRAPPER_H_