• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
14 #include "api/units/data_rate.h"
15 #include "api/video/video_bitrate_allocation.h"
16 
17 namespace webrtc {
18 
19 struct 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 
33 class VideoBitrateAllocator {
34  public:
VideoBitrateAllocator()35   VideoBitrateAllocator() {}
~VideoBitrateAllocator()36   virtual ~VideoBitrateAllocator() {}
37 
38   virtual VideoBitrateAllocation GetAllocation(uint32_t total_bitrate_bps,
39                                                uint32_t framerate);
40 
41   virtual VideoBitrateAllocation Allocate(
42       VideoBitrateAllocationParameters parameters);
43 };
44 
45 class VideoBitrateAllocationObserver {
46  public:
VideoBitrateAllocationObserver()47   VideoBitrateAllocationObserver() {}
~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_
57