| 6 |
| 7 | #ifdef __ANDROID__ |
| 8 | #include "../os/android/VideoSourceAndroid.h" |
| 9 | #elif defined(__APPLE__) && !defined(TARGET_OSX32) |
| 10 | #include "../os/darwin/VideoToolboxEncoderSource.h" |
| 11 | #endif |
| 12 |
| 13 | using namespace tgvoip; |
| 14 | using namespace tgvoip::video; |
| 15 |
| 16 | std::shared_ptr<VideoSource> VideoSource::Create(){ |
| 17 | #ifdef __ANDROID__ |
| 18 | //return std::make_shared<VideoSourceAndroid>(); |
| 19 | return nullptr; |
| 20 | #endif |
| 21 | return nullptr; |
| 22 | } |
| 23 |
| 24 |
| 25 | void VideoSource::SetCallback(std::function<void(const Buffer &, uint32_t, uint32_t)> callback){ |
| 26 | this->callback=callback; |
| 27 | } |
| 28 |
| 29 | bool VideoSource::Failed(){ |
| 30 | return failed; |
| 31 | } |
| 32 |
| 33 | std::string VideoSource::GetErrorDescription(){ |
| 34 | return error; |
| 35 | } |
| 36 |
| 37 | std::vector<uint32_t> VideoSource::GetAvailableEncoders(){ |
| 38 | #ifdef __ANDROID__ |
| 39 | return VideoSourceAndroid::availableEncoders; |
| 40 | #elif defined(__APPLE__) && !defined(TARGET_OSX32) |
| 41 | return VideoToolboxEncoderSource::GetAvailableEncoders(); |
| 42 | #endif |
| 43 | return std::vector<uint32_t>(); |
| 44 | } |
| 45 |