TSDuck v3.40-4033
MPEG Transport Stream Toolkit
|
Abstract interface to read raw data from a stream. More...
#include <tsAbstractReadStreamInterface.h>
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. | |
Abstract interface to read raw data from a stream.
|
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.
[out] | addr | Address of the buffer for the incoming data. |
[in] | max_size | Maximum size in bytes of the buffer. |
[out] | ret_size | Returned input size in bytes. If zero, end of file has been reached or an error occurred. |
[in,out] | report | Where to report errors. |
Implemented in ts::ForkPipe.
|
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.
[out] | addr | Address of the buffer for the incoming data. |
[in] | max_size | Maximum size in bytes of the buffer. |
[out] | ret_size | Returned input size in bytes. |
[in,out] | report | Where to report errors. |
|
virtual |
Read chunks of data from the stream.
[out] | addr | Address of the buffer for the incoming data. |
[in] | max_size | Maximum size in bytes of the buffer. |
[in] | chunk_size | If 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_size | Returned input size in bytes. |
[in,out] | report | Where to report errors. |
|
pure virtual |
Check if the end of stream was reached.
Implemented in ts::ForkPipe.