blob: 04de04c1b00e7ccacaf4dcd75cce9d46ea044a32 [file] [log] [blame]
Jiawei Ou4206a0a2018-07-20 15:49:43 -07001/*
2 * Copyright (c) 2016 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_VIDEO_BITRATE_ALLOCATOR_H_
12#define API_VIDEO_VIDEO_BITRATE_ALLOCATOR_H_
13
Florent Castelli8bbdb5b2019-08-02 15:16:28 +020014#include "api/units/data_rate.h"
Jiawei Ou4206a0a2018-07-20 15:49:43 -070015#include "api/video/video_bitrate_allocation.h"
16
17namespace webrtc {
18
Florent Castelli8bbdb5b2019-08-02 15:16:28 +020019struct VideoBitrateAllocationParameters {
20 VideoBitrateAllocationParameters(uint32_t total_bitrate_bps,
21 uint32_t framerate);
22 VideoBitrateAllocationParameters(DataRate total_bitrate, double framerate);
23 VideoBitrateAllocationParameters(DataRate total_bitrate,
24 DataRate stable_bitrate,
25 double framerate);
26 ~VideoBitrateAllocationParameters();
27
28 DataRate total_bitrate;
29 DataRate stable_bitrate;
30 double framerate;
31};
32
Jiawei Ou4206a0a2018-07-20 15:49:43 -070033class VideoBitrateAllocator {
34 public:
35 VideoBitrateAllocator() {}
36 virtual ~VideoBitrateAllocator() {}
37
38 virtual VideoBitrateAllocation GetAllocation(uint32_t total_bitrate_bps,
Florent Castelli8bbdb5b2019-08-02 15:16:28 +020039 uint32_t framerate);
40
41 virtual VideoBitrateAllocation Allocate(
42 VideoBitrateAllocationParameters parameters);
Jiawei Ou4206a0a2018-07-20 15:49:43 -070043};
44
45class VideoBitrateAllocationObserver {
46 public:
47 VideoBitrateAllocationObserver() {}
48 virtual ~VideoBitrateAllocationObserver() {}
49
50 virtual void OnBitrateAllocationUpdated(
51 const VideoBitrateAllocation& allocation) = 0;
52};
53
54} // namespace webrtc
55
56#endif // API_VIDEO_VIDEO_BITRATE_ALLOCATOR_H_