VideoSource.cpp 970 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // Created by Grishka on 10.08.2018.
  3. //
  4. #include "VideoSource.h"
  5. #ifdef __ANDROID__
  6. #include "../os/android/VideoSourceAndroid.h"
  7. #elif defined(__APPLE__) && !defined(TARGET_OSX)
  8. #include "../os/darwin/VideoToolboxEncoderSource.h"
  9. #endif
  10. using namespace tgvoip;
  11. using namespace tgvoip::video;
  12. std::shared_ptr<VideoSource> VideoSource::Create(){
  13. #ifdef __ANDROID__
  14. //return std::make_shared<VideoSourceAndroid>();
  15. return nullptr;
  16. #endif
  17. return nullptr;
  18. }
  19. void VideoSource::SetCallback(std::function<void(const Buffer &, uint32_t)> callback){
  20. this->callback=callback;
  21. }
  22. bool VideoSource::Failed(){
  23. return failed;
  24. }
  25. std::string VideoSource::GetErrorDescription(){
  26. return error;
  27. }
  28. std::vector<uint32_t> VideoSource::GetAvailableEncoders(){
  29. #ifdef __ANDROID__
  30. return VideoSourceAndroid::availableEncoders;
  31. #elif defined(__APPLE__) && !defined(TARGET_OSX)
  32. return VideoToolboxEncoderSource::GetAvailableEncoders();
  33. #endif
  34. return std::vector<uint32_t>();
  35. }