TSDuck v3.44-4554
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::mcast::FluteDemux Class Reference

This class extract files from FLUTE streams in UDP datagrams. More...

#include <tsmcastFluteDemux.h>

Classes

class  FileStatus
 Description of a file, as returned by getFilesStatus(). More...
 

Public Types

using SessionStatus = std::map< FluteSessionId, std::map< UString, FileStatus > >
 Description of all files, in all sessions, as returned by getFilesStatus().
 

Public Member Functions

 FluteDemux (DuckContext &duck, FluteHandlerInterface *handler=nullptr)
 Constructor.
 
 ~FluteDemux ()
 Destructor.
 
template<class Rep , class Period >
void feedPacket (const cn::duration< Rep, Period > &timestamp, const IPPacket &pkt)
 The following method feeds the demux with an IP packet.
 
template<class Rep , class Period >
void feedPacket (const cn::duration< Rep, Period > &timestamp, const IPSocketAddress &source, const IPSocketAddress &destination, const uint8_t *udp, size_t udp_size)
 The following method feeds the demux with a UDP packet.
 
void getFilesStatus (SessionStatus &status) const
 Get the current status of all file transfers.
 
void printFilesStatus (std::ostream &out) const
 Print a list of all received files.
 
bool reset (const FluteDemuxArgs &args, bool will_get_files_status=false)
 Reset the demux.
 
void setHandler (FluteHandlerInterface *h)
 Replace the FLUTE handler.
 

Detailed Description

This class extract files from FLUTE streams in UDP datagrams.

Member Typedef Documentation

◆ SessionStatus

Description of all files, in all sessions, as returned by getFilesStatus().

The outer map is indexed by FLUTE session id. In each session, the files are indexed by name.

See also
getFilesStatus()

Constructor & Destructor Documentation

◆ FluteDemux()

ts::mcast::FluteDemux::FluteDemux ( DuckContext duck,
FluteHandlerInterface handler = nullptr 
)
explicit

Constructor.

Parameters
[in,out]duckTSDuck execution context. The reference is kept inside the demux.
[in]handlerThe object to invoke when FLUTE information is found.

Member Function Documentation

◆ setHandler()

void ts::mcast::FluteDemux::setHandler ( FluteHandlerInterface h)
inline

Replace the FLUTE handler.

Parameters
[in]hThe new handler.

◆ reset()

bool ts::mcast::FluteDemux::reset ( const FluteDemuxArgs args,
bool  will_get_files_status = false 
)

Reset the demux.

Parameters
[in]argsDemux arguments.
[in]will_get_files_statusWe intend to call getFilesStatus() later. This means that the demux needs to keep track of all received files. Since this uses a ever-growing amount of memory, be sure to specify this option when necessary only and when the demux session, until the next reset(), is limited in time.
Returns
True on success, false on error.
See also
getFilesStatus()

◆ feedPacket() [1/2]

template<class Rep , class Period >
void ts::mcast::FluteDemux::feedPacket ( const cn::duration< Rep, Period > &  timestamp,
const IPPacket pkt 
)

The following method feeds the demux with an IP packet.

The packet is ignored if this is not a UDP packet.

Parameters
[in]timestampPacket time stamp value. This value should be taken from a monotonic clock.
[in]pktAn IP packet.

◆ feedPacket() [2/2]

template<class Rep , class Period >
void ts::mcast::FluteDemux::feedPacket ( const cn::duration< Rep, Period > &  timestamp,
const IPSocketAddress source,
const IPSocketAddress destination,
const uint8_t *  udp,
size_t  udp_size 
)
inline

The following method feeds the demux with a UDP packet.

Parameters
[in]timestampPacket time stamp value. This value should be taken from a monotonic clock.
[in]sourceSource socket address.
[in]destinationDestination socket address.
[in]udpAddress of UDP payload.
[in]udp_sizeSize in bytes of UDP payload.

◆ getFilesStatus()

void ts::mcast::FluteDemux::getFilesStatus ( SessionStatus status) const

Get the current status of all file transfers.

This method returns current transfers only if will_get_files_status was false when reset() was called.

Parameters
[out]statusA description of all sessions and files.

◆ printFilesStatus()

void ts::mcast::FluteDemux::printFilesStatus ( std::ostream &  out) const

Print a list of all received files.

This method prints current transfers only if will_get_files_status was false when reset() was called.

Parameters
[in,out]outWhere to print the summary.

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