Shaka Packager SDK
bandwidth_estimator.h
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef MPD_BASE_BANDWIDTH_ESTIMATOR_H_
8 #define MPD_BASE_BANDWIDTH_ESTIMATOR_H_
9 
10 #include <stdint.h>
11 
12 namespace shaka {
13 
15  public:
18 
21  void AddBlock(uint64_t size_in_bytes, double duration);
22 
27  uint64_t Estimate() const;
28 
32  uint64_t Max() const;
33 
34  private:
35  BandwidthEstimator(const BandwidthEstimator&) = delete;
36  BandwidthEstimator& operator=(const BandwidthEstimator&) = delete;
37 
38  uint64_t total_size_in_bits_ = 0;
39  double total_duration_ = 0;
40  uint64_t max_bitrate_ = 0;
41 };
42 
43 } // namespace shaka
44 
45 #endif // MPD_BASE_BANDWIDTH_ESTIMATOR_H_
All the methods that are virtual are virtual for mocking.
void AddBlock(uint64_t size_in_bytes, double duration)