| 6 |
| #define LIBTGVOIP_VIDEOSOURCEANDROID_H |
| 7 |
| 8 | #include "../../Buffers.h" |
| 9 | #include "../../video/VideoSource.h" |
| 10 | #include <jni.h> |
| 11 | #include <vector> |
| 12 |
| 13 | namespace tgvoip |
| 14 | { |
| 15 | namespace video |
| 16 | { |
| 17 | class VideoSourceAndroid : public VideoSource |
| 18 | { |
| 19 | public: |
| 20 | VideoSourceAndroid(jobject jobj); |
| 21 | ~VideoSourceAndroid() override; |
| 22 | void Start() override; |
| 23 | void Stop() override; |
| 24 | void Reset(std::uint32_t codec, int maxResolution) override; |
| 25 | void SendFrame(Buffer frame, std::uint32_t flags); |
| 26 | void SetStreamParameters(std::vector<Buffer> m_csd, unsigned int m_width, unsigned int m_height); |
| 27 | void RequestKeyFrame() override; |
| 28 | void SetBitrate(std::uint32_t bitrate) override; |
| 29 | void SetStreamPaused(bool paused); |
| 30 |
| 31 | static std::vector<std::uint32_t> availableEncoders; |
| 32 |
| 33 | private: |
| 34 | jobject javaObject; |
| 35 | jmethodID prepareEncoderMethod; |
| 36 | jmethodID startMethod; |
| 37 | jmethodID stopMethod; |
| 38 | jmethodID requestKeyFrameMethod; |
| 39 | jmethodID setBitrateMethod; |
| 40 | }; |
| 41 | } |
| 42 | } |
| 43 |
| 44 | #endif //LIBTGVOIP_VIDEOSOURCEANDROID_H |
| 45 |