| #include "api/media_stream_interface.h" |
| 6 | #include "modules/video_capture/video_capture.h" |
| 7 | #include "sdk/android/native_api/jni/scoped_java_ref.h" |
| 8 | #include "sdk/android/native_api/video/video_source.h" |
| 9 | #include "VideoCaptureInterface.h" |
| 10 |
| 11 | #include <memory> |
| 12 | #include <vector> |
| 13 | #include <stddef.h> |
| 14 | #include <jni.h> |
| 15 |
| 16 | namespace tgcalls { |
| 17 |
| 18 | class VideoCameraCapturer; |
| 19 |
| 20 | class VideoCameraCapturer { |
| 21 |
| 22 | public: |
| 23 | VideoCameraCapturer(rtc::scoped_refptr<webrtc::JavaVideoTrackSourceInterface> source, std::string deviceId, std::function<void(VideoState)> stateUpdated, std::shared_ptr<PlatformContext> platformContext); |
| 24 |
| 25 | void setState(VideoState state); |
| 26 | void setPreferredCaptureAspectRatio(float aspectRatio); |
| 27 | void setUncroppedSink(std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink); |
| 28 |
| 29 | webrtc::ScopedJavaLocalRef<jobject> GetJavaVideoCapturerObserver(JNIEnv* env); |
| 30 |
| 31 | private: |
| 32 | rtc::scoped_refptr<webrtc::JavaVideoTrackSourceInterface> _source; |
| 33 |
| 34 | std::function<void(VideoState)> _stateUpdated; |
| 35 | VideoState _state; |
| 36 |
| 37 | std::shared_ptr<PlatformContext> _platformContext; |
| 38 |
| 39 | float _aspectRatio; |
| 40 | std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> _uncroppedSink; |
| 41 | }; |
| 42 |
| 43 | } // namespace tgcalls |
| 44 |
| 45 | #endif |
| 46 |