2018-11-09 16:44:01 +01:00
|
|
|
//
|
|
|
|
// Created by Grishka on 10.08.2018.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "VideoSource.h"
|
|
|
|
|
|
|
|
#ifdef __ANDROID__
|
|
|
|
#include "../os/android/VideoSourceAndroid.h"
|
2019-03-12 18:35:42 +01:00
|
|
|
#elif defined(__APPLE__) && !defined(TARGET_OSX32)
|
2019-03-10 23:12:09 +01:00
|
|
|
#include "../os/darwin/VideoToolboxEncoderSource.h"
|
2018-11-09 16:44:01 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
using namespace tgvoip;
|
|
|
|
using namespace tgvoip::video;
|
|
|
|
|
|
|
|
std::shared_ptr<VideoSource> VideoSource::Create(){
|
|
|
|
#ifdef __ANDROID__
|
|
|
|
//return std::make_shared<VideoSourceAndroid>();
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-02-05 12:41:00 +01:00
|
|
|
void VideoSource::SetCallback(std::function<void(const Buffer &, uint32_t)> callback){
|
2018-11-09 16:44:01 +01:00
|
|
|
this->callback=callback;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool VideoSource::Failed(){
|
|
|
|
return failed;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string VideoSource::GetErrorDescription(){
|
|
|
|
return error;
|
|
|
|
}
|
2019-02-05 12:41:00 +01:00
|
|
|
|
|
|
|
std::vector<uint32_t> VideoSource::GetAvailableEncoders(){
|
|
|
|
#ifdef __ANDROID__
|
|
|
|
return VideoSourceAndroid::availableEncoders;
|
2019-03-12 18:35:42 +01:00
|
|
|
#elif defined(__APPLE__) && !defined(TARGET_OSX32)
|
2019-03-10 23:12:09 +01:00
|
|
|
return VideoToolboxEncoderSource::GetAvailableEncoders();
|
2019-02-05 12:41:00 +01:00
|
|
|
#endif
|
|
|
|
return std::vector<uint32_t>();
|
|
|
|
}
|