5G-MAG Reference Tools - MBMS Middleware
HlsMediaPlaylist.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  HlsMediaPlaylist(const std::string& content);
27  HlsMediaPlaylist() = default;
28  ~HlsMediaPlaylist() = default;
29 
30  struct Segment {
31  std::string uri;
32  int seq;
33  double extinf;
34  };
35  const std::vector<Segment>& segments() const { return _segments; };
36  void add_segment(Segment segment) { _segments.push_back(std::move(segment)); };
37 
38  std::string to_string() const;
39 
40  void set_target_duration(int duration) { _targetduration = duration; };
41  int target_duration() const { return _targetduration; };
42 
43  private:
44  int _version = -1;
46  std::vector<Segment> _segments = {};
47  };
48 }
void set_target_duration(int duration)
const std::vector< Segment > & segments() const
std::string to_string() const
void add_segment(Segment segment)
std::vector< Segment > _segments