5G-MAG Reference Tools - MBMS Middleware
HlsPrimaryPlaylist.h
Go to the documentation of this file.
1 // 5G-MAG Reference Tools
2 // MBMS Middleware Process
3 //
4 // Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
5 //
6 // Licensed under the License terms and conditions for use, reproduction, and
7 // distribution of 5G-MAG software (the “License”). You may not use this file
8 // except in compliance with the License. You may obtain a copy of the License at
9 // https://www.5g-mag.com/reference-tools. Unless required by applicable law or
10 // agreed to in writing, software distributed under the License is distributed on
11 // an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 // or implied.
13 //
14 // See the License for the specific language governing permissions and limitations
15 // under the License.
16 //
17 
18 #pragma once
19 
20 #include <string>
21 #include <vector>
22 
23 namespace MBMS_RT {
25  public:
26  HlsPrimaryPlaylist(const std::string& content, const std::string& base_path);
27  HlsPrimaryPlaylist() = default;
28  ~HlsPrimaryPlaylist() = default;
29 
30  struct Stream {
31  std::string uri;
32  std::string resolution;
33  std::string codecs;
34  unsigned long bandwidth;
35  double frame_rate;
36  };
37  const std::vector<Stream>& streams() const { return _streams; };
38  void add_stream(Stream stream) { _streams.push_back(std::move(stream)); };
39 
40  std::string to_string() const;
41  private:
42  std::vector<std::pair<std::string, std::string>> parse_parameters(const std::string& line) const;
43  int _version = -1;
44  std::vector<Stream> _streams = {};
45  };
46 }
std::vector< std::pair< std::string, std::string > > parse_parameters(const std::string &line) const
void add_stream(Stream stream)
const std::vector< Stream > & streams() const
std::vector< Stream > _streams