blob: a2216899c7cad736395d124fb16a06298c113937 [file] [log] [blame]
Magnus Jedvertd4b0c052017-09-14 10:24:54 +02001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_
12#define API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020013
14#include <memory>
Magnus Jedvert59ab3532018-09-03 18:07:56 +020015#include <string>
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020016#include <vector>
17
18namespace webrtc {
19
20class VideoDecoder;
21struct SdpVideoFormat;
22
23// A factory that creates VideoDecoders.
24// NOTE: This class is still under development and may change without notice.
25class VideoDecoderFactory {
26 public:
27 // Returns a list of supported video formats in order of preference, to use
28 // for signaling etc.
29 virtual std::vector<SdpVideoFormat> GetSupportedFormats() const = 0;
30
31 // Creates a VideoDecoder for the specified format.
32 virtual std::unique_ptr<VideoDecoder> CreateVideoDecoder(
33 const SdpVideoFormat& format) = 0;
34
Magnus Jedvert59ab3532018-09-03 18:07:56 +020035 // Note: Do not call or override this method! This method is a legacy
36 // workaround and is scheduled for removal without notice.
37 virtual std::unique_ptr<VideoDecoder> LegacyCreateVideoDecoder(
38 const SdpVideoFormat& format,
39 const std::string& receive_stream_id);
40
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020041 virtual ~VideoDecoderFactory() {}
42};
43
44} // namespace webrtc
45
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020046#endif // API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_