// // Created by Grishka on 10.08.2018. // #ifndef LIBTGVOIP_VIDEOSOURCE_H #define LIBTGVOIP_VIDEOSOURCE_H #include #include #include #include #include "../Buffers.h" namespace tgvoip{ namespace video { class VideoSource{ public: virtual ~VideoSource(){}; static std::shared_ptr Create(); static std::vector GetAvailableEncoders(); void SetCallback(std::function callback); virtual void Start()=0; virtual void Stop()=0; virtual void Reset(uint32_t codec, int maxResolution)=0; virtual void RequestKeyFrame()=0; bool Failed(); std::string GetErrorDescription(); std::vector& GetCodecSpecificData(){ return csd; } unsigned int GetFrameWidth(){ return width; } unsigned int GetFrameHeight(){ return height; } protected: std::function callback; bool failed; std::string error; unsigned int width=0; unsigned int height=0; std::vector csd; }; } } #endif //LIBTGVOIP_VIDEOSOURCE_H