Shaka Player Embedded
player_externs.cc
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 #include "shaka/player_externs.h"
18 
19 #include "src/js/player_externs.h"
20 
21 namespace shaka {
22 
24  public:
25  const double start{};
26  const double end{};
27 
28  Impl() {}
29  Impl(js::BufferedRange&& internal)
30  : start(std::move(internal.start)),
31  end(std::move(internal.end)) {}
32 };
33 
35 BufferedRange::BufferedRange(js::BufferedRange&& internal) : impl_(new Impl{std::move(internal)}) {}
39 
42 
43 double BufferedRange::start() const {
44  return impl_->start;
45 }
46 
47 double BufferedRange::end() const {
48  return impl_->end;
49 }
50 
51 
54  ret.start = impl_->start;
55  ret.end = impl_->end;
56  return ret;
57 }
58 
59 
61  public:
62  const std::vector<shaka::BufferedRange> total{};
63  const std::vector<shaka::BufferedRange> audio{};
64  const std::vector<shaka::BufferedRange> video{};
65  const std::vector<shaka::BufferedRange> text{};
66 
67  Impl() {}
68  Impl(js::BufferedInfo&& internal)
69  : total(std::make_move_iterator(internal.total.begin()), std::make_move_iterator(internal.total.end())),
70  audio(std::make_move_iterator(internal.audio.begin()), std::make_move_iterator(internal.audio.end())),
71  video(std::make_move_iterator(internal.video.begin()), std::make_move_iterator(internal.video.end())),
72  text(std::make_move_iterator(internal.text.begin()), std::make_move_iterator(internal.text.end())) {}
73 };
74 
76 BufferedInfo::BufferedInfo(js::BufferedInfo&& internal) : impl_(new Impl{std::move(internal)}) {}
80 
83 
84 const std::vector<shaka::BufferedRange>& BufferedInfo::total() const {
85  return impl_->total;
86 }
87 
88 const std::vector<shaka::BufferedRange>& BufferedInfo::audio() const {
89  return impl_->audio;
90 }
91 
92 const std::vector<shaka::BufferedRange>& BufferedInfo::video() const {
93  return impl_->video;
94 }
95 
96 const std::vector<shaka::BufferedRange>& BufferedInfo::text() const {
97  return impl_->text;
98 }
99 
100 
102  js::BufferedInfo ret;
103  for (const auto& item : impl_->total) {
104  ret.total.emplace_back(item.GetInternal());
105  }
106  for (const auto& item : impl_->audio) {
107  ret.audio.emplace_back(item.GetInternal());
108  }
109  for (const auto& item : impl_->video) {
110  ret.video.emplace_back(item.GetInternal());
111  }
112  for (const auto& item : impl_->text) {
113  ret.text.emplace_back(item.GetInternal());
114  }
115  return ret;
116 }
117 
118 
120  public:
121  const std::string language{};
122  const std::string role{};
123 
124  Impl() {}
125  Impl(js::LanguageRole&& internal)
126  : language(std::move(internal.language)),
127  role(std::move(internal.role)) {}
128 };
129 
131 LanguageRole::LanguageRole(js::LanguageRole&& internal) : impl_(new Impl{std::move(internal)}) {}
132 LanguageRole::LanguageRole(const LanguageRole&) = default;
135 
138 
139 const std::string& LanguageRole::language() const {
140  return impl_->language;
141 }
142 
143 const std::string& LanguageRole::role() const {
144  return impl_->role;
145 }
146 
147 
149  js::LanguageRole ret;
150  ret.language = impl_->language;
151  ret.role = impl_->role;
152  return ret;
153 }
154 
155 
156 
157 } // namespace shaka
js::BufferedInfo GetInternal() const
BufferedInfo & operator=(const BufferedInfo &)
Impl(js::LanguageRole &&internal)
js::LanguageRole GetInternal() const
Impl(js::BufferedRange &&internal)
js::BufferedRange GetInternal() const
const std::vector< shaka::BufferedRange > & total() const
double end() const
const std::vector< shaka::BufferedRange > & audio() const
double start() const
const std::string & language() const
const std::vector< shaka::BufferedRange > & text() const
Impl(js::BufferedInfo &&internal)
LanguageRole & operator=(const LanguageRole &)
BufferedRange & operator=(const BufferedRange &)
const std::vector< shaka::BufferedRange > & video() const
const std::string & role() const