video_bitrate_allocator.h (1808B)
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 <cstdint> 15 16 #include "api/units/data_rate.h" 17 #include "api/video/video_bitrate_allocation.h" 18 19 namespace webrtc { 20 21 struct VideoBitrateAllocationParameters { 22 VideoBitrateAllocationParameters(uint32_t total_bitrate_bps, 23 uint32_t framerate); 24 VideoBitrateAllocationParameters(DataRate total_bitrate, double framerate); 25 ~VideoBitrateAllocationParameters(); 26 27 DataRate total_bitrate; 28 double framerate; 29 }; 30 31 class VideoBitrateAllocator { 32 public: 33 VideoBitrateAllocator() {} 34 virtual ~VideoBitrateAllocator() {} 35 36 virtual VideoBitrateAllocation GetAllocation(uint32_t total_bitrate_bps, 37 uint32_t framerate); 38 39 virtual VideoBitrateAllocation Allocate( 40 VideoBitrateAllocationParameters parameters); 41 42 // Deprecated: Only used to work around issues with the legacy conference 43 // screenshare mode and shouldn't be needed by any subclasses. 44 virtual void SetLegacyConferenceMode(bool enabled); 45 }; 46 47 class VideoBitrateAllocationObserver { 48 public: 49 VideoBitrateAllocationObserver() {} 50 virtual ~VideoBitrateAllocationObserver() {} 51 52 virtual void OnBitrateAllocationUpdated( 53 const VideoBitrateAllocation& allocation) = 0; 54 }; 55 56 } // namespace webrtc 57 58 #endif // API_VIDEO_VIDEO_BITRATE_ALLOCATOR_H_