Shaka Player Embedded
stats.h
Go to the documentation of this file.
1 // Copyright 2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // AUTO-GENERATED: DO NOT EDIT
16 
17 #ifndef SHAKA_EMBEDDED_STATS_H_
18 #define SHAKA_EMBEDDED_STATS_H_
19 
20 #include <memory>
21 #include <string>
22 #include <unordered_map>
23 #include <vector>
24 
25 #include "macros.h"
26 #include "optional.h"
27 
28 namespace shaka {
29 
30 namespace js {
31 
32 struct TrackChoice;
33 struct StateChange;
34 struct Stats;
35 
36 } // namespace js
37 
43  public:
44  TrackChoice();
45  TrackChoice(js::TrackChoice&& internal);
46  TrackChoice(const TrackChoice&);
48  ~TrackChoice();
49 
50  TrackChoice& operator=(const TrackChoice&);
51  TrackChoice& operator=(TrackChoice&&);
52 
57  double timestamp() const;
59  double id() const;
61  const std::string& type() const;
66  bool from_adaptation() const;
68  shaka::optional<double> bandwidth() const;
69 
71  js::TrackChoice GetInternal() const;
72 
73  private:
74  class Impl;
75  std::shared_ptr<Impl> impl_;
76 };
77 
83  public:
84  StateChange();
85  StateChange(js::StateChange&& internal);
86  StateChange(const StateChange&);
88  ~StateChange();
89 
90  StateChange& operator=(const StateChange&);
91  StateChange& operator=(StateChange&&);
92 
97  double timestamp() const;
102  const std::string& state() const;
108  double duration() const;
109 
111  js::StateChange GetInternal() const;
112 
113  private:
114  class Impl;
115  std::shared_ptr<Impl> impl_;
116 };
117 
125 class SHAKA_EXPORT Stats final {
126  public:
127  Stats();
128  Stats(js::Stats&& internal);
129  Stats(const Stats&);
130  Stats(Stats&&);
131  ~Stats();
132 
133  Stats& operator=(const Stats&);
134  Stats& operator=(Stats&&);
135 
137  double width() const;
139  double height() const;
141  double stream_bandwidth() const;
146  double decoded_frames() const;
151  double dropped_frames() const;
153  double estimated_bandwidth() const;
159  double load_latency() const;
161  double play_time() const;
163  double buffering_time() const;
165  const std::vector<shaka::TrackChoice>& switch_history() const;
167  const std::vector<shaka::StateChange>& state_history() const;
168 
170  js::Stats GetInternal() const;
171 
172  private:
173  class Impl;
174  std::shared_ptr<Impl> impl_;
175 };
176 
177 
178 } // namespace shaka
179 
180 #endif // SHAKA_EMBEDDED_STATS_H_
#define SHAKA_EXPORT
Definition: macros.h:30
int width
ExceptionCode type
int height