1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-12-04 10:37:49 +01:00
libtgvoip/os/android/VideoSourceAndroid.h

42 lines
1.1 KiB
C
Raw Normal View History

//
// Created by Grishka on 12.08.2018.
//
#ifndef LIBTGVOIP_VIDEOSOURCEANDROID_H
#define LIBTGVOIP_VIDEOSOURCEANDROID_H
#include "../../video/VideoSource.h"
2020-01-22 12:43:51 +01:00
#include "../../tools/Buffers.h"
#include <jni.h>
#include <vector>
namespace tgvoip{
namespace video{
class VideoSourceAndroid : public VideoSource{
public:
VideoSourceAndroid(jobject jobj);
virtual ~VideoSourceAndroid();
2019-02-05 12:41:00 +01:00
virtual void Start() override;
virtual void Stop() override;
virtual void Reset(uint32_t codec, int maxResolution) override;
void SendFrame(Buffer frame, uint32_t flags);
void SetStreamParameters(std::vector<Buffer> csd, unsigned int width, unsigned int height);
2019-02-05 12:41:00 +01:00
virtual void RequestKeyFrame() override;
virtual void SetBitrate(uint32_t bitrate) override;
2019-04-24 18:36:32 +02:00
void SetStreamPaused(bool paused);
2019-02-05 12:41:00 +01:00
static std::vector<uint32_t> availableEncoders;
private:
jobject javaObject;
2019-02-05 12:41:00 +01:00
jmethodID prepareEncoderMethod;
jmethodID startMethod;
jmethodID stopMethod;
jmethodID requestKeyFrameMethod;
jmethodID setBitrateMethod;
};
}
}
#endif //LIBTGVOIP_VIDEOSOURCEANDROID_H