MythTV  master
mythdvdstream.h
Go to the documentation of this file.
1 /* DVD stream
2  * Copyright 2011 Lawrence Rust <lvr at softsystem dot co dot uk>
3  */
4 #ifndef DVDSTREAM_H
5 #define DVDSTREAM_H
6 
7 // Qt
8 #include <QString>
9 #include <QList>
10 
11 // MythTV
12 #include "io/mythmediabuffer.h"
13 
14 // Std
15 #include <cstdint>
16 
17 using dvd_reader_t = struct dvd_reader_s;
18 
20 {
21  public:
22  class BlockRange;
23 
24  explicit MythDVDStream(const QString &Filename);
25  ~MythDVDStream() override;
26 
27  long long GetReadPosition (void) const override;
28  bool IsOpen (void) const override;
29  bool OpenFile (const QString &Filename, std::chrono::milliseconds Retry = 0ms) override;
30 
31  protected:
32  int SafeRead (void *Buffer, uint Size) override;
33  long long SeekInternal (long long Position, int Whence) override;
34 
35  private:
36  Q_DISABLE_COPY(MythDVDStream)
37 
38  dvd_reader_t *m_reader { nullptr };
39  uint32_t m_start { 0 };
40  QList<BlockRange> m_blocks; // List of possibly encrypted block ranges
41  uint32_t m_pos { 0 }; // Current read position (blocks)
42  int m_title { -1 }; // Last title decrypted
43 };
44 #endif
MythMediaBuffer::SafeRead
virtual int SafeRead(void *Buffer, uint Size)=0
MythDVDStream::BlockRange
Definition: mythdvdstream.cpp:28
MythMediaBuffer
Definition: mythmediabuffer.h:50
MythDVDStream
Definition: mythdvdstream.h:19
MythMediaBuffer::SeekInternal
virtual long long SeekInternal(long long Position, int Whence)=0
uint
unsigned int uint
Definition: compat.h:81
dvd_reader_t
struct dvd_reader_s dvd_reader_t
Definition: mythdvdstream.h:17
mythmediabuffer.h
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
Buffer
Definition: MythExternControl.h:36
MythMediaBuffer::OpenFile
virtual bool OpenFile(const QString &Filename, std::chrono::milliseconds Retry=kDefaultOpenTimeout)=0
MythMediaBuffer::GetReadPosition
virtual long long GetReadPosition(void) const =0
MythDVDStream::m_blocks
QList< BlockRange > m_blocks
Definition: mythdvdstream.h:40
MythMediaBuffer::IsOpen
virtual bool IsOpen(void) const =0