MythTV  master
HLSSegment.cpp
Go to the documentation of this file.
1 #include "HLSSegment.h"
2 
3 // C/C++
4 #include <utility>
5 
6 #include "HLSReader.h"
7 
8 #define LOC QString("HLSSegment: ")
9 
11 {
12  LOG(VB_RECORD, LOG_DEBUG, LOC + "ctor");
13 }
14 
16 {
17  LOG(VB_RECORD, LOG_DEBUG, LOC + "ctor");
18  operator=(rhs);
19 }
20 
21 HLSRecSegment::HLSRecSegment(int seq, std::chrono::seconds duration,
22  QString title, QUrl uri)
23  : m_sequence(seq),
24  m_duration(duration),
25  m_title(std::move(title)),
26  m_url(std::move(uri))
27 {
28  LOG(VB_RECORD, LOG_DEBUG, LOC + "ctor");
29 }
30 
31 HLSRecSegment::HLSRecSegment(int seq, std::chrono::seconds duration, QString title,
32  QUrl uri, [[maybe_unused]] const QString& current_key_path)
33  : m_sequence(seq),
34  m_duration(duration),
35  m_title(std::move(title)),
36  m_url(std::move(uri))
37 {
38  LOG(VB_RECORD, LOG_DEBUG, LOC + "ctor");
39 #ifdef USING_LIBCRYPTO
40  m_psz_key_path = current_key_path;
41 #endif
42 }
43 
45 {
46  if (&rhs != this)
47  {
48  m_sequence = rhs.m_sequence;
49  m_duration = rhs.m_duration;
50  m_bitrate = rhs.m_bitrate;
51  m_title = rhs.m_title;
52  m_url = rhs.m_url;
53 #ifdef USING_LIBCRYPTO
54  m_psz_key_path = rhs.m_psz_key_path;
55 #endif
56  }
57  return *this;
58 }
59 
61 {
62  LOG(VB_RECORD, LOG_DEBUG, LOC + "dtor");
63 }
64 
65 QString HLSRecSegment::toString(void) const
66 {
67  return QString("[%1] '%2' @ '%3' for %4")
68  .arg(m_sequence).arg(m_title, m_url.toString(), QString::number(m_duration.count()));
69 }
HLSRecSegment::operator=
HLSRecSegment & operator=(const HLSRecSegment &rhs)
Definition: HLSSegment.cpp:44
HLSRecSegment::m_title
QString m_title
Definition: HLSSegment.h:47
HLSRecSegment::m_sequence
int64_t m_sequence
Definition: HLSSegment.h:44
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
HLSRecSegment::~HLSRecSegment
~HLSRecSegment()
Definition: HLSSegment.cpp:60
LOC
#define LOC
Definition: HLSSegment.cpp:8
HLSRecSegment::m_duration
std::chrono::seconds m_duration
Definition: HLSSegment.h:45
HLSRecSegment
Definition: HLSSegment.h:11
HLSRecSegment::HLSRecSegment
HLSRecSegment(void)
Definition: HLSSegment.cpp:10
std
Definition: mythchrono.h:23
HLSRecSegment::m_url
QUrl m_url
Definition: HLSSegment.h:50
HLSRecSegment::toString
QString toString(void) const
Definition: HLSSegment.cpp:65
HLSSegment.h
HLSRecSegment::m_bitrate
uint64_t m_bitrate
Definition: HLSSegment.h:46
HLSReader.h