MythTV  master
HLSSegment.h
Go to the documentation of this file.
1 #ifndef HLS_SEGMENT_H
2 #define HLS_SEGMENT_H
3 
4 #include <cstdint>
5 
6 #include <QString>
7 #include <QUrl>
8 
10 
12 {
13  public:
14  friend class HLSReader;
15 
16  HLSRecSegment(void);
17  HLSRecSegment(const HLSRecSegment& rhs);
18  HLSRecSegment(int seq, std::chrono::seconds duration, QString title,
19  QUrl uri);
20  HLSRecSegment(int seq, std::chrono::seconds duration, QString title,
21  QUrl uri, const QString& current_key_path);
23 
25 
26  bool Download(QByteArray & buffer);
27 
28  int64_t Sequence(void) const { return m_sequence; }
29  QString Title(void) const { return m_title; }
30  QUrl Url(void) const { return m_url; }
31  std::chrono::seconds Duration(void) const { return m_duration; }
32 
33  QString toString(void) const;
34 
35 #ifdef USING_LIBCRYPTO
36  bool DownloadKey(void);
37  bool DecodeData(const uint8_t *IV, QByteArray& data);
38  bool HasKeyPath(void) const { return !m_psz_key_path.isEmpty(); }
39  QString KeyPath(void) const { return m_psz_key_path; }
40  void SetKeyPath(const QString& path) { m_psz_key_path = path; }
41 #endif
42 
43  protected:
44  int64_t m_sequence {0}; // unique sequence number
45  std::chrono::seconds m_duration {0s}; // segment duration
46  uint64_t m_bitrate {0}; // bitrate of segment's content (bits per second)
47  QString m_title; // human-readable informative title of
48  // the media segment
49 
50  QUrl m_url;
51 
52 #ifdef USING_LIBCRYPTO
53  QString m_psz_key_path; // URL key path
54 #endif
55 
56 };
57 
58 #endif // HLS_SEGMENT_H
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
HLSRecSegment::~HLSRecSegment
~HLSRecSegment()
Definition: HLSSegment.cpp:60
HLSRecSegment::Duration
std::chrono::seconds Duration(void) const
Definition: HLSSegment.h:31
HLSRecSegment::Title
QString Title(void) const
Definition: HLSSegment.h:29
HLSRecSegment::Url
QUrl Url(void) const
Definition: HLSSegment.h:30
HLSRecSegment::m_duration
std::chrono::seconds m_duration
Definition: HLSSegment.h:45
HLSReader
Definition: HLSReader.h:34
HLSRecSegment
Definition: HLSSegment.h:11
HLSRecSegment::HLSRecSegment
HLSRecSegment(void)
Definition: HLSSegment.cpp:10
HLSRecSegment::m_url
QUrl m_url
Definition: HLSSegment.h:50
mythchrono.h
HLSRecSegment::toString
QString toString(void) const
Definition: HLSSegment.cpp:65
HLSRecSegment::Sequence
int64_t Sequence(void) const
Definition: HLSSegment.h:28
HLSRecSegment::Download
bool Download(QByteArray &buffer)
HLSRecSegment::m_bitrate
uint64_t m_bitrate
Definition: HLSSegment.h:46