Repo created
This commit is contained in:
parent
81b91f4139
commit
f8c34fa5ee
22732 changed files with 4815320 additions and 2 deletions
54
TMessagesProj/jni/voip/libtgvoip/video/VideoSource.h
Normal file
54
TMessagesProj/jni/voip/libtgvoip/video/VideoSource.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
//
|
||||
// Created by Grishka on 10.08.2018.
|
||||
//
|
||||
|
||||
#ifndef LIBTGVOIP_VIDEOSOURCE_H
|
||||
#define LIBTGVOIP_VIDEOSOURCE_H
|
||||
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "../Buffers.h"
|
||||
|
||||
namespace tgvoip{
|
||||
namespace video {
|
||||
class VideoSource{
|
||||
public:
|
||||
virtual ~VideoSource(){};
|
||||
static std::shared_ptr<VideoSource> Create();
|
||||
static std::vector<uint32_t> GetAvailableEncoders();
|
||||
void SetCallback(std::function<void(const Buffer& buffer, uint32_t flags, uint32_t rotation)> callback);
|
||||
virtual void Start()=0;
|
||||
virtual void Stop()=0;
|
||||
virtual void Reset(uint32_t codec, int maxResolution)=0;
|
||||
virtual void RequestKeyFrame()=0;
|
||||
virtual void SetBitrate(uint32_t bitrate)=0;
|
||||
bool Failed();
|
||||
std::string GetErrorDescription();
|
||||
std::vector<Buffer>& GetCodecSpecificData(){
|
||||
return csd;
|
||||
}
|
||||
unsigned int GetFrameWidth(){
|
||||
return width;
|
||||
}
|
||||
unsigned int GetFrameHeight(){
|
||||
return height;
|
||||
}
|
||||
void SetRotation(unsigned int rotation){
|
||||
this->rotation=rotation;
|
||||
}
|
||||
|
||||
protected:
|
||||
std::function<void(const Buffer &, uint32_t, uint32_t)> callback;
|
||||
bool failed;
|
||||
std::string error;
|
||||
unsigned int width=0;
|
||||
unsigned int height=0;
|
||||
unsigned int rotation=0;
|
||||
std::vector<Buffer> csd;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif //LIBTGVOIP_VIDEOSOURCE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue