TSDuck Version 3.15-964 (TSDuck - The MPEG Transport Stream Toolkit)
ts::TSFileOutput Class Reference

Transport Stream file output. More...

Inheritance diagram for ts::TSFileOutput:

Public Member Functions

 TSFileOutput ()
 Default constructor.
 
virtual ~TSFileOutput ()
 Destructor.
 
bool close (Report &report)
 Close the file. More...
 
const UStringgetDisplayFileName () const
 Get the file name as a display string. More...
 
int getErrorSeverityLevel () const
 Get the severity level for error reporting. More...
 
const UStringgetFileName () const
 Get the file name. More...
 
PacketCounter getPacketCount () const
 Get the number of written packets. More...
 
bool isOpen () const
 Check if the file is open. More...
 
virtual bool open (const UString &filename, bool append, bool keep, Report &report)
 Open or create the file. More...
 
void setErrorSeverityLevel (int level)
 Set the severity level for error reporting. More...
 
bool write (const TSPacket *buffer, size_t packet_count, Report &report)
 Write TS packets to the file. More...
 

Detailed Description

Transport Stream file output.

Member Function Documentation

◆ open()

virtual bool ts::TSFileOutput::open ( const UString filename,
bool  append,
bool  keep,
Report report 
)
virtual

Open or create the file.

Parameters
[in]filenameFile name. If empty, use standard output.
[in]appendAppend packets to an existing file.
[in]keepKeep previous file with same name. Fail if it already exists.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

Reimplemented in ts::TSFileOutputResync.

◆ close()

bool ts::TSFileOutput::close ( Report report)

Close the file.

Parameters
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

◆ write()

bool ts::TSFileOutput::write ( const TSPacket buffer,
size_t  packet_count,
Report report 
)

Write TS packets to the file.

Parameters
[in]bufferAddress of first packet to write.
[in]packet_countNumber of packets to write.
[in,out]reportWhere to report errors.
Returns
True on success, false on error.

◆ isOpen()

bool ts::TSFileOutput::isOpen ( ) const
inline

Check if the file is open.

Returns
True if the file is open.

◆ getErrorSeverityLevel()

int ts::TSFileOutput::getErrorSeverityLevel ( ) const
inline

Get the severity level for error reporting.

Returns
The severity level for error reporting.

◆ setErrorSeverityLevel()

void ts::TSFileOutput::setErrorSeverityLevel ( int  level)
inline

Set the severity level for error reporting.

Parameters
[in]levelThe severity level for error reporting. The default is Error.

◆ getFileName()

const UString& ts::TSFileOutput::getFileName ( ) const
inline

Get the file name.

Returns
The file name.

◆ getDisplayFileName()

const UString& ts::TSFileOutput::getDisplayFileName ( ) const
inline

Get the file name as a display string.

Returns
The file name as a display string. Not always a valid file name. Use in error messages only.

◆ getPacketCount()

PacketCounter ts::TSFileOutput::getPacketCount ( ) const
inline

Get the number of written packets.

Returns
The number of written packets.

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