1 /*
2  *  Copyright (c) 2012 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 MODULES_VIDEO_CODING_CODECS_VP8_INCLUDE_VP8_H_
12 #define MODULES_VIDEO_CODING_CODECS_VP8_INCLUDE_VP8_H_
13 
14 #include <memory>
15 #include <vector>
16 
17 #include "api/video_codecs/video_encoder.h"
18 #include "api/video_codecs/vp8_frame_buffer_controller.h"
19 #include "modules/video_coding/include/video_codec_interface.h"
20 #include "rtc_base/deprecation.h"
21 
22 namespace webrtc {
23 
24 // TODO(brandtr): Move these interfaces to the api/ folder.
25 class VP8Encoder {
26  public:
27   struct Settings {
28     // Allows for overriding the Vp8FrameBufferController used by the encoder.
29     // If unset, a default Vp8FrameBufferController will be instantiated
30     // internally.
31     std::unique_ptr<Vp8FrameBufferControllerFactory>
32         frame_buffer_controller_factory = nullptr;
33 
34     // Allows for overriding the resolution/bitrate limits exposed through
35     // VideoEncoder::GetEncoderInfo(). No override is done if empty.
36     std::vector<VideoEncoder::ResolutionBitrateLimits>
37         resolution_bitrate_limits = {};
38   };
39 
40   static std::unique_ptr<VideoEncoder> Create();
41   static std::unique_ptr<VideoEncoder> Create(Settings settings);
42 
43   RTC_DEPRECATED static std::unique_ptr<VideoEncoder> Create(
44       std::unique_ptr<Vp8FrameBufferControllerFactory>
45           frame_buffer_controller_factory);
46 };
47 
48 class VP8Decoder {
49  public:
50   static std::unique_ptr<VideoDecoder> Create();
51 };
52 
53 }  // namespace webrtc
54 
55 #endif  // MODULES_VIDEO_CODING_CODECS_VP8_INCLUDE_VP8_H_
56