video_decoder_factory.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_
  11. #define API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_
  12. #include <memory>
  13. #include <string>
  14. #include <vector>
  15. #include "rtc_base/system/rtc_export.h"
  16. namespace webrtc {
  17. class VideoDecoder;
  18. struct SdpVideoFormat;
  19. // A factory that creates VideoDecoders.
  20. // NOTE: This class is still under development and may change without notice.
  21. class RTC_EXPORT VideoDecoderFactory {
  22. public:
  23. // Returns a list of supported video formats in order of preference, to use
  24. // for signaling etc.
  25. virtual std::vector<SdpVideoFormat> GetSupportedFormats() const = 0;
  26. // Creates a VideoDecoder for the specified format.
  27. virtual std::unique_ptr<VideoDecoder> CreateVideoDecoder(
  28. const SdpVideoFormat& format) = 0;
  29. // Note: Do not call or override this method! This method is a legacy
  30. // workaround and is scheduled for removal without notice.
  31. virtual std::unique_ptr<VideoDecoder> LegacyCreateVideoDecoder(
  32. const SdpVideoFormat& format,
  33. const std::string& receive_stream_id);
  34. virtual ~VideoDecoderFactory() {}
  35. };
  36. } // namespace webrtc
  37. #endif // API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_