QtlMovie 1.12 (A specialized FFmpeg front-end)
QtsDvdDataPull Class Reference

A class to pull data from an encrypted DVD into an asynchronous device such as QProcess. More...

Inheritance diagram for QtsDvdDataPull:
QtlDataPull

Public Member Functions

 QtsDvdDataPull (const QString &deviceName, int startSector, int sectorCount, Qts::BadSectorPolicy badSectorPolicy=Qts::SkipBadSectors, int transferSize=QTS_DEFAULT_DVD_TRANSFER_SIZE, int minBufferSize=DEFAULT_MIN_BUFFER_SIZE, QtlLogger *log=0, QObject *parent=0, bool useMaxReadSpeed=false)
 Constructor. More...
 
 QtsDvdDataPull (const QString &deviceName, const QtlRangeList sectorList, Qts::BadSectorPolicy badSectorPolicy=Qts::SkipBadSectors, int transferSize=QTS_DEFAULT_DVD_TRANSFER_SIZE, int minBufferSize=DEFAULT_MIN_BUFFER_SIZE, QtlLogger *log=0, QObject *parent=0, bool useMaxReadSpeed=false)
 Constructor. More...
 
- Public Member Functions inherited from QtlDataPull
 QtlDataPull (int minBufferSize=DEFAULT_MIN_BUFFER_SIZE, QtlLogger *log=0, QObject *parent=0)
 Constructor. More...
 
virtual ~QtlDataPull ()
 Destructor. More...
 
bool isStarted () const
 Check if the data transfer is started. More...
 
QtlLoggerlog () const
 Get the message logger. More...
 
bool progressAvailable () const
 Check if progress report is meaningful. More...
 
qint64 pulledSize () const
 Get the total size of all pulled data. More...
 
void setAutoDelete (bool on)
 Set automatic object deletion on transfer completion. More...
 
void setMaxPulledSize (qint64 size)
 Set the maximum number of bytes to pull. More...
 
void setProgressIntervalInBytes (qint64 size)
 Set the interval between two emissions of progress(). More...
 
void setProgressMaxHint (qint64 size)
 Set the probable ("hint") total size of the transfer. More...
 

Protected Member Functions

virtual void cleanupTransfer (bool clean) Q_DECL_OVERRIDE
 Cleanup the transfer. More...
 
virtual bool initializeTransfer () Q_DECL_OVERRIDE
 Initialize the transfer. More...
 
virtual bool needTransfer (qint64 maxSize) Q_DECL_OVERRIDE
 Invoked when more data is needed. More...
 
- Protected Member Functions inherited from QtlDataPull
void close ()
 Properly terminate the transfer. More...
 
bool write (const void *data, int dataSize)
 Write data to all devices. More...
 

Private Member Functions

 QtsDvdDataPull () Q_DECL_EQ_DELETE
 

Private Attributes

const Qts::BadSectorPolicy _badSectorPolicy
 How to handle bad sectors. More...
 
QtlByteBlock _buffer
 Transfer buffer. More...
 
QtlRangeList::ConstIterator _currentRange
 Current pointer in _sectorList. More...
 
const QString _deviceName
 DVD device name. More...
 
QtsDvdMedia _dvd
 Access to DVD media. More...
 
const bool _maxReadSpeed
 Set the DVD reader to maximum speed. More...
 
int _nextSector
 Next sector in _currentRange, -1 means at beginning. More...
 
QtsDvdBandwidthReport _report
 To report transfer bandwidth. More...
 
const int _sectorChunk
 Number of sectors per transfer. More...
 
const QtlRangeList _sectorList
 List of sectors to read. More...
 

Additional Inherited Members

- Public Slots inherited from QtlDataPull
bool start (QIODevice *device)
 Start to transfer data into the specified device. More...
 
bool start (const QList< QIODevice *> &devices)
 Start to transfer data into the several devices in parallel. More...
 
void stop ()
 Force a premature stop of the data transfer. More...
 
void stopCaller ()
 This slot stops the transfer on the device which sent the signal. More...
 
void stopDevice (QIODevice *device)
 Stop the transfer on the specified device. More...
 
- Signals inherited from QtlDataPull
void completed (bool success)
 Emitted when the transfer is completed on all devices. More...
 
void deviceCompleted (QIODevice *device, bool success)
 Emitted when the transfer is completed on one device. More...
 
void progress (qint64 current, qint64 maximum)
 Emitted when some progress in the data transfer is available. More...
 
void started ()
 Emitted when the transfer is started. More...
 
- Static Public Attributes inherited from QtlDataPull
static const int DEFAULT_MIN_BUFFER_SIZE = 128 * 1024
 Default minimum buffer size in bytes (128 kB). More...
 

Detailed Description

A class to pull data from an encrypted DVD into an asynchronous device such as QProcess.

See also
QtlDataPull

Constructor & Destructor Documentation

◆ QtsDvdDataPull() [1/3]

QtsDvdDataPull::QtsDvdDataPull ( const QString &  deviceName,
int  startSector,
int  sectorCount,
Qts::BadSectorPolicy  badSectorPolicy = Qts::SkipBadSectors,
int  transferSize = QTS_DEFAULT_DVD_TRANSFER_SIZE,
int  minBufferSize = DEFAULT_MIN_BUFFER_SIZE,
QtlLogger log = 0,
QObject *  parent = 0,
bool  useMaxReadSpeed = false 
)

Constructor.

Progress reporting is automatically enabled.

Parameters
[in]deviceNameDVD device name.
[in]startSectorFirst sector to read.
[in]sectorCountTotal number of sectors to read.
[in]badSectorPolicyHow to handle bad sectors.
[in]transferSizeData transfer size in bytes.
[in]minBufferSizeThe minimum buffer size is the lower limit of the buffered data. When the amount of data not yet written to the device is lower than this size, new data is pulled from the DVD.
[in]logOptional message logger.
[in]parentOptional parent object.
[in]useMaxReadSpeedIf true, try to set the DVD reader to maximum speed.
See also
QtsDvdMedia::BadSectorPolicy

◆ QtsDvdDataPull() [2/3]

QtsDvdDataPull::QtsDvdDataPull ( const QString &  deviceName,
const QtlRangeList  sectorList,
Qts::BadSectorPolicy  badSectorPolicy = Qts::SkipBadSectors,
int  transferSize = QTS_DEFAULT_DVD_TRANSFER_SIZE,
int  minBufferSize = DEFAULT_MIN_BUFFER_SIZE,
QtlLogger log = 0,
QObject *  parent = 0,
bool  useMaxReadSpeed = false 
)

Constructor.

Progress reporting is automatically enabled.

Parameters
[in]deviceNameDVD device name.
[in]sectorListList of sectors to read.
[in]badSectorPolicyHow to handle bad sectors.
[in]transferSizeData transfer size in bytes.
[in]minBufferSizeThe minimum buffer size is the lower limit of the buffered data. When the amount of data not yet written to the device is lower than this size, new data is pulled from the DVD.
[in]logOptional message logger.
[in]parentOptional parent object.
[in]useMaxReadSpeedIf true, try to set the DVD reader to maximum speed.
See also
QtsDvdMedia::BadSectorPolicy

◆ QtsDvdDataPull() [3/3]

QtsDvdDataPull::QtsDvdDataPull ( )
private

Member Function Documentation

◆ initializeTransfer()

bool QtsDvdDataPull::initializeTransfer ( )
protectedvirtual

Initialize the transfer.

Reimplemented from QtlDataPull.

Returns
True on success, false on error.

Reimplemented from QtlDataPull.

◆ needTransfer()

bool QtsDvdDataPull::needTransfer ( qint64  maxSize)
protectedvirtual

Invoked when more data is needed.

Reimplemented from QtlDataPull.

Parameters
[in]maxSizeMaximum size in bytes of the requested transfer.
Returns
True on success, false on error.

Implements QtlDataPull.

◆ cleanupTransfer()

void QtsDvdDataPull::cleanupTransfer ( bool  clean)
protectedvirtual

Cleanup the transfer.

Reimplemented from QtlDataPull.

Parameters
[in]cleanIf true, this is a clean termination.

Reimplemented from QtlDataPull.

Member Data Documentation

◆ _deviceName

const QString QtsDvdDataPull::_deviceName
private

DVD device name.

◆ _sectorList

const QtlRangeList QtsDvdDataPull::_sectorList
private

List of sectors to read.

◆ _badSectorPolicy

const Qts::BadSectorPolicy QtsDvdDataPull::_badSectorPolicy
private

How to handle bad sectors.

◆ _sectorChunk

const int QtsDvdDataPull::_sectorChunk
private

Number of sectors per transfer.

◆ _maxReadSpeed

const bool QtsDvdDataPull::_maxReadSpeed
private

Set the DVD reader to maximum speed.

◆ _currentRange

QtlRangeList::ConstIterator QtsDvdDataPull::_currentRange
private

Current pointer in _sectorList.

◆ _nextSector

int QtsDvdDataPull::_nextSector
private

Next sector in _currentRange, -1 means at beginning.

◆ _buffer

QtlByteBlock QtsDvdDataPull::_buffer
private

Transfer buffer.

◆ _dvd

QtsDvdMedia QtsDvdDataPull::_dvd
private

Access to DVD media.

◆ _report

QtsDvdBandwidthReport QtsDvdDataPull::_report
private

To report transfer bandwidth.


The documentation for this class was generated from the following files: