TSDuck v3.38-3704
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::AbstractReadStreamInterface Class Referenceabstract

Abstract interface to read raw data from a stream. More...

#include <tsAbstractReadStreamInterface.h>

Inheritance diagram for ts::AbstractReadStreamInterface:

Public Member Functions

virtual bool endOfStream ()=0
 Check if the end of stream was reached.
 
virtual bool readStreamChunks (void *addr, size_t max_size, size_t chunk_size, size_t &ret_size, Report &report)
 Read chunks of data from the stream.
 
virtual bool readStreamComplete (void *addr, size_t max_size, size_t &ret_size, Report &report)
 Read complete data from the stream.
 
virtual bool readStreamPartial (void *addr, size_t max_size, size_t &ret_size, Report &report)=0
 Read partial data from the stream.
 

Detailed Description

Abstract interface to read raw data from a stream.

Member Function Documentation

◆ readStreamPartial()

virtual bool ts::AbstractReadStreamInterface::readStreamPartial ( void *  addr,
size_t  max_size,
size_t &  ret_size,
Report report 
)
pure virtual

Read partial data from the stream.

Wait and read at least one byte. Don't try to read exactly max_size bytes. If ret_size is less than max_bytes, it is possible to read more.

Parameters
[out]addrAddress of the buffer for the incoming data.
[in]max_sizeMaximum size in bytes of the buffer.
[out]ret_sizeReturned input size in bytes. If zero, end of file has been reached or an error occurred.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

Implemented in ts::ForkPipe.

◆ readStreamComplete()

virtual bool ts::AbstractReadStreamInterface::readStreamComplete ( void *  addr,
size_t  max_size,
size_t &  ret_size,
Report report 
)
virtual

Read complete data from the stream.

Wait and read exactly max_size bytes. If ret_size is less than max_bytes, it is not possible to read more. End of file has probably been reached.

Parameters
[out]addrAddress of the buffer for the incoming data.
[in]max_sizeMaximum size in bytes of the buffer.
[out]ret_sizeReturned input size in bytes.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

◆ readStreamChunks()

virtual bool ts::AbstractReadStreamInterface::readStreamChunks ( void *  addr,
size_t  max_size,
size_t  chunk_size,
size_t &  ret_size,
Report report 
)
virtual

Read chunks of data from the stream.

Parameters
[out]addrAddress of the buffer for the incoming data.
[in]max_sizeMaximum size in bytes of the buffer.
[in]chunk_sizeIf not zero, make sure that the input size is always a multiple of chunk_size. If the initial read ends in the middle of a chunk, read again and again, up to the end of the current chunk or end of file.
[out]ret_sizeReturned input size in bytes.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

◆ endOfStream()

virtual bool ts::AbstractReadStreamInterface::endOfStream ( )
pure virtual

Check if the end of stream was reached.

Returns
True on end of stream, false otherwise.

Implemented in ts::ForkPipe.


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