Transport Stream file input.
More...
Transport Stream file input.
◆ open() [1/2]
bool ts::TSFileInput::open |
( |
const UString & |
filename, |
|
|
size_t |
repeat_count, |
|
|
uint64_t |
start_offset, |
|
|
Report & |
report |
|
) |
| |
Open the file.
- Parameters
-
[in] | filename | File name. If empty, use standard input. Must be a regular file is repeat_count is not 1 or if start_offset is not zero. |
[in] | repeat_count | Reading packets loops back after end of file until all repeat are done. If zero, infinitely repeat. |
[in] | start_offset | Offset in bytes from the beginning of the file where to start reading packets at each iteration. |
[in,out] | report | Where to report errors. |
- Returns
- True on success, false on error.
◆ open() [2/2]
bool ts::TSFileInput::open |
( |
const UString & |
filename, |
|
|
uint64_t |
start_offset, |
|
|
Report & |
report |
|
) |
| |
Open the file in rewindable mode.
The file must be a rewindable file, eg. not a pipe. There is no repeat count, rewind must be done explicitly.
- Parameters
-
[in] | filename | File name. If empty, use standard input. |
[in] | start_offset | Offset in bytes from the beginning of the file where to start reading packets. |
[in,out] | report | Where to report errors. |
- Returns
- True on success, false on error.
- See also
- rewind()
-
seek()
◆ isOpen()
bool ts::TSFileInput::isOpen |
( |
| ) |
const |
|
inline |
Check if the file is open.
- Returns
- True if the file is open.
◆ getErrorSeverityLevel()
int ts::TSFileInput::getErrorSeverityLevel |
( |
| ) |
const |
|
inline |
Get the severity level for error reporting.
- Returns
- The severity level for error reporting.
◆ setErrorSeverityLevel()
void ts::TSFileInput::setErrorSeverityLevel |
( |
int |
level | ) |
|
|
inline |
Set the severity level for error reporting.
- Parameters
-
[in] | level | The severity level for error reporting. The default is Error. |
◆ getFileName()
UString ts::TSFileInput::getFileName |
( |
| ) |
const |
|
inline |
Get the file name.
- Returns
- The file name.
◆ close()
bool ts::TSFileInput::close |
( |
Report & |
report | ) |
|
Close the file.
- Parameters
-
[in,out] | report | Where to report errors. |
- Returns
- True on success, false on error.
◆ read()
size_t ts::TSFileInput::read |
( |
TSPacket * |
buffer, |
|
|
size_t |
max_packets, |
|
|
Report & |
report |
|
) |
| |
Read TS packets.
If the file file was opened with a repeat_count different from 1, reading packets transparently loops back at end if file.
- Parameters
-
[out] | buffer | Address of reception packet buffer. |
[in] | max_packets | Size of buffer in packets. |
[in,out] | report | Where to report errors. |
- Returns
- The actual number of read packets. Returning zero means error or end of file repetition.
◆ abortRead()
void ts::TSFileInput::abortRead |
( |
| ) |
|
Abort any currenly read operation in progress.
The file is left in a broken state and can be only closed.
◆ rewind()
bool ts::TSFileInput::rewind |
( |
Report & |
report | ) |
|
|
inline |
Rewind the file.
The file must have been opened in rewindable mode. If the file file was opened with a start_offset different from 0, rewinding the file means restarting at this start_offset.
- Parameters
-
[in,out] | report | Where to report errors. |
- Returns
- True on success, false on error.
◆ seek()
Seek the file at a specified packet index.
The file must have been opened in rewindable mode.
- Parameters
-
[in] | packet_index | Seek the file to this specified packet index (plus the previously specified start_offset). |
[in,out] | report | Where to report errors. |
- Returns
- True on success, false on error.
◆ getPacketCount()
Get the number of read packets.
- Returns
- The number of read packets.
The documentation for this class was generated from the following file: