UnityVideoEncoderFactory.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <api/video_codecs/sdp_video_format.h>
  3. #include <api/video_codecs/video_encoder_factory.h>
  4. namespace unity
  5. {
  6. namespace webrtc
  7. {
  8. using namespace ::webrtc;
  9. class IGraphicsDevice;
  10. class ProfilerMarkerFactory;
  11. class UnityVideoEncoderFactory : public VideoEncoderFactory
  12. {
  13. public:
  14. // VideoEncoderFactory
  15. // Returns a list of supported video formats in order of preference, to use
  16. // for signaling etc.
  17. virtual std::vector<SdpVideoFormat> GetSupportedFormats() const override;
  18. // Returns information about how this format will be encoded. The specified
  19. // format must be one of the supported formats by this factory.
  20. virtual CodecInfo QueryVideoEncoder(const SdpVideoFormat& format) const override;
  21. // Creates a VideoEncoder for the specified format.
  22. virtual std::unique_ptr<VideoEncoder> CreateVideoEncoder(const SdpVideoFormat& format) override;
  23. UnityVideoEncoderFactory(IGraphicsDevice* gfxDevice, ProfilerMarkerFactory* profiler);
  24. ~UnityVideoEncoderFactory() override;
  25. private:
  26. ProfilerMarkerFactory* profiler_;
  27. std::map<std::string, std::unique_ptr<VideoEncoderFactory>> factories_;
  28. };
  29. }
  30. }