#include <ContentStream.h>
Definition at line 29 of file ContentStream.h.
◆ StreamType
◆ ContentStream()
MBMS_RT::ContentStream::ContentStream |
( |
std::string |
base, |
|
|
std::string |
flute_if, |
|
|
boost::asio::io_service & |
io_service, |
|
|
CacheManagement & |
cache, |
|
|
DeliveryProtocol |
protocol, |
|
|
const libconfig::Config & |
cfg |
|
) |
| |
Definition at line 26 of file ContentStream.cpp.
std::thread _flute_thread
const libconfig::Config & _cfg
DeliveryProtocol _delivery_protocol
boost::asio::io_service & _io_service
const std::string & base() const
std::string _5gbc_stream_iface
static Config cfg
Global configuration object.
◆ ~ContentStream()
MBMS_RT::ContentStream::~ContentStream |
( |
| ) |
|
|
virtual |
Definition at line 32 of file ContentStream.cpp.
33 spdlog::debug(
"Destroying content stream at base {}",
_base);
std::unique_ptr< LibFlute::Receiver > _flute_receiver
◆ bandwidth()
unsigned long MBMS_RT::ContentStream::bandwidth |
( |
| ) |
const |
|
inline |
◆ base()
const std::string& MBMS_RT::ContentStream::base |
( |
| ) |
const |
|
inline |
◆ base_path()
std::string MBMS_RT::ContentStream::base_path |
( |
| ) |
const |
|
inline |
◆ codecs()
const std::string& MBMS_RT::ContentStream::codecs |
( |
| ) |
const |
|
inline |
◆ configure_5gbc_delivery_from_sdp()
auto MBMS_RT::ContentStream::configure_5gbc_delivery_from_sdp |
( |
const std::string & |
sdp | ) |
|
Definition at line 40 of file ContentStream.cpp.
41 spdlog::debug(
"ContentStream parsing SDP");
42 std::istringstream iss(sdp);
43 for (std::string line; std::getline(iss, line);) {
44 const std::regex sdp_line_regex(
"^([a-z])\\=(.+)$");
46 if (std::regex_match(line, match, sdp_line_regex)) {
47 if (match.size() == 3) {
48 auto field = match[1].str();
49 auto value = match[2].str();
50 spdlog::debug(
"SDP line {}: {}", field, value);
53 const std::regex value_regex(
"^IN (IP.) ([0-9\\.]+).*$");
55 if (std::regex_match(value, cmatch, value_regex)) {
56 if (cmatch.size() == 3) {
60 }
else if (field ==
"m") {
61 const std::regex value_regex(
"^application (.+) (.+)$");
63 if (std::regex_match(value, cmatch, value_regex)) {
64 if (cmatch.size() == 3) {
69 const std::regex value_regex2(
"^application (.+) (.+) (.+)$");
70 if (std::regex_match(value, cmatch, value_regex2)) {
71 if (cmatch.size() == 4) {
76 }
else if (field ==
"a") {
77 const std::regex value_regex(
"^flute-tsi:(.+)$");
79 if (std::regex_match(value, cmatch, value_regex)) {
80 if (cmatch.size() == 2) {
90 spdlog::info(
"ContentStream SDP parsing complete. Stream type {}, TSI {}, MCast at {}:{}",
unsigned long long _5gbc_stream_flute_tsi
std::string _5gbc_stream_mcast_port
std::string _5gbc_stream_mcast_addr
std::string _5gbc_stream_type
◆ delivery_protocol()
◆ delivery_protocol_string()
std::string MBMS_RT::ContentStream::delivery_protocol_string |
( |
| ) |
const |
|
inline |
◆ flute_file_received()
auto MBMS_RT::ContentStream::flute_file_received |
( |
std::shared_ptr< LibFlute::File > |
file | ) |
|
|
virtual |
Definition at line 97 of file ContentStream.cpp.
98 spdlog::info(
"ContentStream: {} (TOI {}, MIME type {}) has been received at {}",
99 file->meta().content_location, file->meta().toi, file->meta().content_type, file->received_at());
100 if (file->meta().content_location !=
"index.m3u8") {
101 std::string content_location = file->meta().content_location;
104 content_location =
_base_path + content_location;
108 if (file->meta().content_location.find(
".mpd") != std::string::npos) {
110 _base_path +
"manifest.mpd", file->received_at(), std::move(file))
114 content_location, file->received_at(), std::move(file))
void add_item(std::shared_ptr< CacheItem > item)
◆ flute_info()
auto MBMS_RT::ContentStream::flute_info |
( |
| ) |
const |
◆ frame_rate()
double MBMS_RT::ContentStream::frame_rate |
( |
| ) |
const |
|
inline |
◆ playlist_path()
const std::string& MBMS_RT::ContentStream::playlist_path |
( |
| ) |
const |
|
inline |
◆ read_master_manifest()
auto MBMS_RT::ContentStream::read_master_manifest |
( |
const std::string & |
manifest | ) |
|
Definition at line 136 of file ContentStream.cpp.
138 auto pl = HlsPrimaryPlaylist(manifest,
"");
139 if (pl.streams().size() == 1) {
140 auto stream = pl.streams()[0];
143 spdlog::error(
"Error: HLS primary playlist for stream contains more than one stream definitions. Ignoring.");
◆ resolution()
const std::string& MBMS_RT::ContentStream::resolution |
( |
| ) |
const |
|
inline |
◆ set_bandwidth()
void MBMS_RT::ContentStream::set_bandwidth |
( |
unsigned long |
b | ) |
|
|
inline |
◆ set_base_path()
void MBMS_RT::ContentStream::set_base_path |
( |
std::string |
p | ) |
|
|
inline |
◆ set_codecs()
void MBMS_RT::ContentStream::set_codecs |
( |
std::string |
c | ) |
|
|
inline |
◆ set_frame_rate()
void MBMS_RT::ContentStream::set_frame_rate |
( |
double |
f | ) |
|
|
inline |
◆ set_resolution()
void MBMS_RT::ContentStream::set_resolution |
( |
std::string |
r | ) |
|
|
inline |
◆ start()
auto MBMS_RT::ContentStream::start |
( |
| ) |
|
Definition at line 121 of file ContentStream.cpp.
122 spdlog::info(
"ContentStream starting");
virtual void flute_file_received(std::shared_ptr< LibFlute::File > file)
◆ stream_type()
virtual StreamType MBMS_RT::ContentStream::stream_type |
( |
| ) |
const |
|
inlinevirtual |
◆ stream_type_string()
virtual std::string MBMS_RT::ContentStream::stream_type_string |
( |
| ) |
const |
|
inlinevirtual |
◆ _5gbc_stream_flute_tsi
unsigned long long MBMS_RT::ContentStream::_5gbc_stream_flute_tsi = 0 |
|
protected |
◆ _5gbc_stream_iface
std::string MBMS_RT::ContentStream::_5gbc_stream_iface |
|
protected |
◆ _5gbc_stream_mcast_addr
std::string MBMS_RT::ContentStream::_5gbc_stream_mcast_addr = {} |
|
protected |
◆ _5gbc_stream_mcast_port
std::string MBMS_RT::ContentStream::_5gbc_stream_mcast_port = {} |
|
protected |
◆ _5gbc_stream_type
std::string MBMS_RT::ContentStream::_5gbc_stream_type = "none" |
|
protected |
◆ _bandwidth
unsigned long MBMS_RT::ContentStream::_bandwidth |
|
protected |
◆ _base
std::string MBMS_RT::ContentStream::_base = "" |
|
protected |
◆ _base_path
std::string MBMS_RT::ContentStream::_base_path |
|
protected |
◆ _cache
◆ _cfg
const libconfig::Config& MBMS_RT::ContentStream::_cfg |
|
protected |
◆ _codecs
std::string MBMS_RT::ContentStream::_codecs |
|
protected |
◆ _delivery_protocol
◆ _flute_receiver
std::unique_ptr<LibFlute::Receiver> MBMS_RT::ContentStream::_flute_receiver |
|
protected |
◆ _flute_thread
std::thread MBMS_RT::ContentStream::_flute_thread |
|
protected |
◆ _frame_rate
double MBMS_RT::ContentStream::_frame_rate |
|
protected |
◆ _io_service
boost::asio::io_service& MBMS_RT::ContentStream::_io_service |
|
protected |
◆ _playlist_path
std::string MBMS_RT::ContentStream::_playlist_path |
|
protected |
◆ _resolution
std::string MBMS_RT::ContentStream::_resolution |
|
protected |
The documentation for this class was generated from the following files: