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:
16  explicit BandwidthEstimator(double target_segment_duration);
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  const double target_segment_duration_ = 0;
39  uint64_t total_size_in_bits_ = 0;
40  double total_duration_ = 0;
41  uint64_t max_bitrate_ = 0;
42 };
43 
44 } // namespace shaka
45 
46 #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)