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 
11 #ifndef API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_
12 #define API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_
13 
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
18 #include "rtc_base/system/rtc_export.h"
19 
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.
27 class RTC_EXPORT VideoDecoderFactory {
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 
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 
~VideoDecoderFactory()43   virtual ~VideoDecoderFactory() {}
44 };
45 
46 }  // namespace webrtc
47 
48 #endif  // API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_
49