xref: /aosp_15_r20/external/webrtc/modules/video_coding/codecs/vp9/include/vp9.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2014 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 
12 #ifndef MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_H_
13 #define MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_H_
14 
15 #include <memory>
16 #include <vector>
17 
18 #include "api/video_codecs/scalability_mode.h"
19 #include "api/video_codecs/sdp_video_format.h"
20 #include "media/base/codec.h"
21 #include "modules/video_coding/include/video_codec_interface.h"
22 
23 namespace webrtc {
24 
25 // Returns a vector with all supported internal VP9 profiles that we can
26 // negotiate in SDP, in order of preference.
27 std::vector<SdpVideoFormat> SupportedVP9Codecs(
28     bool add_scalability_modes = false);
29 
30 // Returns a vector with all supported internal VP9 decode profiles in order of
31 // preference. These will be availble for receive-only connections.
32 std::vector<SdpVideoFormat> SupportedVP9DecoderCodecs();
33 
34 class VP9Encoder : public VideoEncoder {
35  public:
36   // Deprecated. Returns default implementation using VP9 Profile 0.
37   // TODO(emircan): Remove once this is no longer used.
38   static std::unique_ptr<VP9Encoder> Create();
39   // Parses VP9 Profile from `codec` and returns the appropriate implementation.
40   static std::unique_ptr<VP9Encoder> Create(const cricket::VideoCodec& codec);
41   static bool SupportsScalabilityMode(ScalabilityMode scalability_mode);
42 
~VP9Encoder()43   ~VP9Encoder() override {}
44 };
45 
46 class VP9Decoder : public VideoDecoder {
47  public:
48   static std::unique_ptr<VP9Decoder> Create();
49 
~VP9Decoder()50   ~VP9Decoder() override {}
51 };
52 }  // namespace webrtc
53 
54 #endif  // MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_H_
55