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

DVB-NIP demux, extracting files and tables. More...

#include <tsmcastNIPDemux.h>

Inheritance diagram for ts::mcast::NIPDemux:
Collaboration diagram for ts::mcast::NIPDemux:

Classes

class  ServiceListContext
 Description of a DVB-I or DVB-NIP service list. More...
 

Public Member Functions

 NIPDemux (DuckContext &duck, NIPHandlerInterface *handler=nullptr)
 Constructor.
 
void addProtocolSession (const TransportProtocol &protocol, const FluteSessionId &session)
 Add a FLUTE or ROUTE session in the DVB-NIP analyzer.
 
void addSession (const FluteSessionId &session)
 Add a FLUTE session in the DVB-NIP analyzer.
 
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.
 
const FluteDemuxgetFluteDemux () const
 Get a constant reference to the undelying FLUTE demux.
 
template<class CONTAINER >
requires std::same_as<typename CONTAINER::value_type, ts::mcast::NIPDemux::ServiceListContext>
void getServiceLists (CONTAINER &lists) const
 Get a description of all service lists.
 
template<class CONTAINER >
requires std::same_as<typename CONTAINER::value_type, ts::mcast::NIPService>
void getServices (CONTAINER &services) const
 Get a description of all services.
 
bool isFiltered (const FluteSessionId &session) const
 Check if a UDP packet or FLUTE file is part of a filtered session.
 
bool isFiltered (const IPAddress &source, const IPSocketAddress &destination) const
 Check if a UDP packet or FLUTE file is part of a filtered session.
 
bool reset (const FluteDemuxArgs &args, bool will_get_files_status=false)
 Reset the demux.
 
void setHandler (NIPHandlerInterface *h)
 Replace the NIP handler.
 

Detailed Description

DVB-NIP demux, extracting files and tables.

Constructor & Destructor Documentation

◆ NIPDemux()

ts::mcast::NIPDemux::NIPDemux ( DuckContext duck,
NIPHandlerInterface handler = nullptr 
)
explicit

Constructor.

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

Member Function Documentation

◆ setHandler()

void ts::mcast::NIPDemux::setHandler ( NIPHandlerInterface h)
inline

Replace the NIP handler.

Parameters
[in]hThe new handler.

◆ reset()

bool ts::mcast::NIPDemux::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 FluteDemux::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.

◆ feedPacket() [1/2]

template<class Rep , class Period >
void ts::mcast::NIPDemux::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::NIPDemux::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.

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.

◆ addSession()

void ts::mcast::NIPDemux::addSession ( const FluteSessionId session)

Add a FLUTE session in the DVB-NIP analyzer.

There is normally no reason to call this from the application. The analyzer always starts with the DVB-NIP Announcement Channel on reset(). Then, all declared sessions in the DVB-NIP tables are automatically added.

Parameters
[in]sessionThe session id to add.

◆ addProtocolSession()

void ts::mcast::NIPDemux::addProtocolSession ( const TransportProtocol protocol,
const FluteSessionId session 
)

Add a FLUTE or ROUTE session in the DVB-NIP analyzer.

There is normally no reason to call this from the application. The analyzer always starts with the DVB-NIP Announcement Channel on reset(). Then, all declared sessions in the DVB-NIP tables are automatically added.

Parameters
[in]protocolThe file transport protocol.
[in]sessionThe session id to add.

◆ isFiltered() [1/2]

bool ts::mcast::NIPDemux::isFiltered ( const IPAddress source,
const IPSocketAddress destination 
) const

Check if a UDP packet or FLUTE file is part of a filtered session.

Parameters
[in]sourceSource IP address.
[in]destinationDestination IP address and UDP port.
Returns
True if the packet is part of a filtered session.

◆ isFiltered() [2/2]

bool ts::mcast::NIPDemux::isFiltered ( const FluteSessionId session) const

Check if a UDP packet or FLUTE file is part of a filtered session.

Parameters
[in]sessionFLUTE session id.
Returns
True if the packet is part of a filtered session.

◆ getServiceLists()

template<class CONTAINER >
requires std::same_as<typename CONTAINER::value_type, ts::mcast::NIPDemux::ServiceListContext>
void ts::mcast::NIPDemux::getServiceLists ( CONTAINER &  lists) const

Get a description of all service lists.

Parameters
[out]listsReturned container of service list descriptions. The list of sorted by file names of service lists.

◆ getServices()

template<class CONTAINER >
requires std::same_as<typename CONTAINER::value_type, ts::mcast::NIPService>
void ts::mcast::NIPDemux::getServices ( CONTAINER &  services) const

Get a description of all services.

Parameters
[out]servicesReturned container of service descriptions. The list of sorted by logical channel number (LCN).

◆ getFluteDemux()

const FluteDemux & ts::mcast::NIPDemux::getFluteDemux ( ) const
inline

Get a constant reference to the undelying FLUTE demux.

Because the reference is const, the FLUTE demux can only be used to get or print the status of files.

Returns
A constant reference to the undelying FLUTE demux.

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