blob: e4d83c24652429f052ef5f7e78e9ff3f475cc9b1 [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
Mirko Bonadei66e76792019-04-02 11:33:59 +020018#include "rtc_base/system/rtc_export.h"
19
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020020namespace webrtc {
21
22class VideoDecoder;
23struct SdpVideoFormat;
24
25// A factory that creates VideoDecoders.
26// NOTE: This class is still under development and may change without notice.
Mirko Bonadei66e76792019-04-02 11:33:59 +020027class RTC_EXPORT VideoDecoderFactory {
Magnus Jedvertd4b0c052017-09-14 10:24:54 +020028 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 Jedvert59ab3532018-09-03 18:07:56 +020037 // 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 Jedvertd4b0c052017-09-14 10:24:54 +020043 virtual ~VideoDecoderFactory() {}
44};
45
46} // namespace webrtc
47
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020048#endif // API_VIDEO_CODECS_VIDEO_DECODER_FACTORY_H_