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_INTERNAL_STATS_H_
18 #define SHAKA_EMBEDDED_INTERNAL_STATS_H_
19 
20 #include <string>
21 #include <vector>
22 
23 #include "shaka/optional.h"
24 #include "shaka/stats.h"
25 #include "src/mapping/convert_js.h"
26 #include "src/mapping/struct.h"
27 
28 namespace shaka {
29 
30 namespace js {
31 
32 struct TrackChoice : Struct {
34 
35  ADD_DICT_FIELD(timestamp, double);
36  ADD_DICT_FIELD(id, double);
37  ADD_DICT_FIELD(type, std::string);
38  ADD_DICT_FIELD(fromAdaptation, bool);
40 };
41 
42 struct StateChange : Struct {
44 
45  ADD_DICT_FIELD(timestamp, double);
46  ADD_DICT_FIELD(state, std::string);
47  ADD_DICT_FIELD(duration, double);
48 };
49 
50 struct Stats : Struct {
52 
53  ADD_DICT_FIELD(width, double);
54  ADD_DICT_FIELD(height, double);
55  ADD_DICT_FIELD(streamBandwidth, double);
56  ADD_DICT_FIELD(decodedFrames, double);
57  ADD_DICT_FIELD(droppedFrames, double);
58  ADD_DICT_FIELD(estimatedBandwidth, double);
59  ADD_DICT_FIELD(loadLatency, double);
60  ADD_DICT_FIELD(playTime, double);
61  ADD_DICT_FIELD(bufferingTime, double);
62  ADD_DICT_FIELD(switchHistory, std::vector<shaka::js::TrackChoice>);
63  ADD_DICT_FIELD(stateHistory, std::vector<shaka::js::StateChange>);
64 };
65 
66 
67 } // namespace js
68 
69 template <>
71  static bool FromJsValue(Handle<JsValue> source, shaka::TrackChoice* dest) {
74  return false;
75  }
76  *dest = shaka::TrackChoice(std::move(temp));
77  return true;
78  }
79 };
80 
81 template <>
83  static bool FromJsValue(Handle<JsValue> source, shaka::StateChange* dest) {
86  return false;
87  }
88  *dest = shaka::StateChange(std::move(temp));
89  return true;
90  }
91 };
92 
93 template <>
95  static bool FromJsValue(Handle<JsValue> source, shaka::Stats* dest) {
96  shaka::js::Stats temp;
98  return false;
99  }
100  *dest = shaka::Stats(std::move(temp));
101  return true;
102  }
103 };
104 
105 
106 } // namespace shaka
107 
108 #endif // SHAKA_EMBEDDED_INTERNAL_STATS_H_
const char * dest
Definition: media_utils.cc:31
static bool FromJsValue(Handle< JsValue > source, shaka::Stats *dest)
Definition: stats.h:95
int width
const char * source
Definition: media_utils.cc:30
static bool FromJsValue(Handle< JsValue > source, shaka::StateChange *dest)
Definition: stats.h:83
static bool FromJsValue(Handle< JsValue > source, shaka::TrackChoice *dest)
Definition: stats.h:71
ExceptionCode type
DECLARE_STRUCT_SPECIAL_METHODS_MOVE_ONLY(TrackChoice)
int height
ADD_DICT_FIELD(timestamp, double)