Magnus Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_ |
| 12 | #define API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_ |
Magnus Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 13 | |
| 14 | #include <memory> |
Magnus Jedvert | 59ab353 | 2018-09-03 18:07:56 +0200 | [diff] [blame] | 15 | #include <string> |
Magnus Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 16 | #include <vector> |
| 17 | |
Mirko Bonadei | 66e7679 | 2019-04-02 11:33:59 +0200 | [diff] [blame] | 18 | #include "rtc_base/system/rtc_export.h" |
| 19 | |
Magnus Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 20 | namespace webrtc { |
| 21 | |
| 22 | class VideoDecoder; |
| 23 | struct SdpVideoFormat; |
| 24 | |
| 25 | // A factory that creates VideoDecoders. |
| 26 | // NOTE: This class is still under development and may change without notice. |
Mirko Bonadei | 66e7679 | 2019-04-02 11:33:59 +0200 | [diff] [blame] | 27 | class RTC_EXPORT VideoDecoderFactory { |
Magnus Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 28 | public: |
| 29 | // Returns a list of supported video formats in order of preference, to use |
| 30 | // for signaling etc. |
| 31 | virtual std::vector<SdpVideoFormat> GetSupportedFormats() const = 0; |
| 32 | |
| 33 | // Creates a VideoDecoder for the specified format. |
| 34 | virtual std::unique_ptr<VideoDecoder> CreateVideoDecoder( |
| 35 | const SdpVideoFormat& format) = 0; |
| 36 | |
Magnus Jedvert | 59ab353 | 2018-09-03 18:07:56 +0200 | [diff] [blame] | 37 | // Note: Do not call or override this method! This method is a legacy |
| 38 | // workaround and is scheduled for removal without notice. |
| 39 | virtual std::unique_ptr<VideoDecoder> LegacyCreateVideoDecoder( |
| 40 | const SdpVideoFormat& format, |
| 41 | const std::string& receive_stream_id); |
| 42 | |
Magnus Jedvert | d4b0c05 | 2017-09-14 10:24:54 +0200 | [diff] [blame] | 43 | virtual ~VideoDecoderFactory() {} |
| 44 | }; |
| 45 | |
| 46 | } // namespace webrtc |
| 47 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 48 | #endif // API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_ |