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