| 6 |
| 7 | #ifdef __ANDROID__ |
| 8 | #include "../os/android/VideoSourceAndroid.h" |
| 9 | #elif defined(__APPLE__) && !defined(TARGET_OSX) |
| 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 | { |
| 18 | #ifdef __ANDROID__ |
| 19 | //return std::make_shared<VideoSourceAndroid>(); |
| 20 | return nullptr; |
| 21 | #endif |
| 22 | return nullptr; |
| 23 | } |
| 24 |
| 25 | void VideoSource::SetCallback(CallbackType callback) |
| 26 | { |
| 27 | m_callback = std::move(callback); |
| 28 | } |
| 29 | void VideoSource::SetStreamStateCallback(std::function<void(bool)> callback) |
| 30 | { |
| 31 | m_streamStateCallback = std::move(callback); |
| 32 | } |
| 33 |
| 34 | bool VideoSource::Failed() const |
| 35 | { |
| 36 | return m_failed; |
| 37 | } |
| 38 |
| 39 | std::string VideoSource::GetErrorDescription() const |
| 40 | { |
| 41 | return m_error; |
| 42 | } |
| 43 |
| 44 | std::vector<Buffer>& VideoSource::GetCodecSpecificData() |
| 45 | { |
| 46 | return m_csd; |
| 47 | } |
| 48 | unsigned int VideoSource::GetFrameWidth() const |
| 49 | { |
| 50 | return m_width; |
| 51 | } |
| 52 | unsigned int VideoSource::GetFrameHeight() const |
| 53 | { |
| 54 | return m_height; |
| 55 | } |
| 56 | void VideoSource::SetRotation(unsigned int rotation) |
| 57 | { |
| 58 | m_rotation = rotation; |
| 59 | } |
| 60 |
| 61 | std::vector<std::uint32_t> VideoSource::GetAvailableEncoders() |
| 62 | { |
| 63 | #ifdef __ANDROID__ |
| 64 | return VideoSourceAndroid::availableEncoders; |
| 65 | #elif defined(__APPLE__) && !defined(TARGET_OSX) |
| 66 | return VideoToolboxEncoderSource::GetAvailableEncoders(); |
| 67 | #endif |
| 68 | return std::vector<std::uint32_t>(); |
| 69 | } |
| 70 |