5G-MAG Reference Tools - MBMS Middleware
src
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
{
24
class
HlsMediaPlaylist
{
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;
45
int
_targetduration
;
46
std::vector<Segment>
_segments
= {};
47
};
48
}
MBMS_RT::HlsMediaPlaylist
Definition:
HlsMediaPlaylist.h:24
MBMS_RT::HlsMediaPlaylist::target_duration
int target_duration() const
Definition:
HlsMediaPlaylist.h:41
MBMS_RT::HlsMediaPlaylist::set_target_duration
void set_target_duration(int duration)
Definition:
HlsMediaPlaylist.h:40
MBMS_RT::HlsMediaPlaylist::HlsMediaPlaylist
HlsMediaPlaylist()=default
MBMS_RT::HlsMediaPlaylist::segments
const std::vector< Segment > & segments() const
Definition:
HlsMediaPlaylist.h:35
MBMS_RT::HlsMediaPlaylist::to_string
std::string to_string() const
Definition:
HlsMediaPlaylist.cpp:74
MBMS_RT::HlsMediaPlaylist::_targetduration
int _targetduration
Definition:
HlsMediaPlaylist.h:45
MBMS_RT::HlsMediaPlaylist::~HlsMediaPlaylist
~HlsMediaPlaylist()=default
MBMS_RT::HlsMediaPlaylist::add_segment
void add_segment(Segment segment)
Definition:
HlsMediaPlaylist.h:36
MBMS_RT::HlsMediaPlaylist::_segments
std::vector< Segment > _segments
Definition:
HlsMediaPlaylist.h:46
MBMS_RT::HlsMediaPlaylist::_version
int _version
Definition:
HlsMediaPlaylist.h:44
MBMS_RT
Definition:
CacheItems.h:25
MBMS_RT::HlsMediaPlaylist::Segment
Definition:
HlsMediaPlaylist.h:30
MBMS_RT::HlsMediaPlaylist::Segment::extinf
double extinf
Definition:
HlsMediaPlaylist.h:33
MBMS_RT::HlsMediaPlaylist::Segment::seq
int seq
Definition:
HlsMediaPlaylist.h:32
MBMS_RT::HlsMediaPlaylist::Segment::uri
std::string uri
Definition:
HlsMediaPlaylist.h:31
Generated by
1.9.1