jrtplib  3.8.2
Public Types | Public Member Functions | Protected Member Functions | List of all members
RTPTransmitter Class Referenceabstract

Abstract class from which actual transmission components should be derived. More...

#include <rtptransmitter.h>

Inheritance diagram for RTPTransmitter:
Inheritance graph
[legend]

Public Types

enum  TransmissionProtocol { IPv4UDPProto, IPv6UDPProto, UserDefinedProto }
 Used to identify a specific transmitter. More...
 
enum  ReceiveMode { AcceptAll, AcceptSome, IgnoreSome }
 Three kind of receive modes can be specified. More...
 

Public Member Functions

virtual int Init (bool threadsafe)=0
 This function must be called before the transmission component can be used. More...
 
virtual int Create (size_t maxpacksize, const RTPTransmissionParams *transparams)=0
 Prepares the component to be used. More...
 
virtual void Destroy ()=0
 By calling this function, buffers are cleared and the component cannot be used anymore. More...
 
virtual RTPTransmissionInfoGetTransmissionInfo ()=0
 Returns additional information about the transmitter. More...
 
virtual int GetLocalHostName (uint8_t *buffer, size_t *bufferlength)=0
 Looks up the local host name. More...
 
virtual bool ComesFromThisTransmitter (const RTPAddress *addr)=0
 Returns true if the address specified by addr is one of the addresses of the transmitter. More...
 
virtual size_t GetHeaderOverhead ()=0
 Returns the amount of bytes that will be added to the RTP packet by the underlying layers (excluding the link layer). More...
 
virtual int Poll ()=0
 Checks for incoming data and stores it. More...
 
virtual int WaitForIncomingData (const RTPTime &delay, bool *dataavailable=0)=0
 Waits until incoming data is detected. More...
 
virtual int AbortWait ()=0
 If the previous function has been called, this one aborts the waiting. More...
 
virtual int SendRTPData (const void *data, size_t len)=0
 Send a packet with length len containing data to all RTP addresses of the current destination list. More...
 
virtual int SendRTCPData (const void *data, size_t len)=0
 Send a packet with length len containing data to all RTCP addresses of the current destination list. More...
 
virtual int AddDestination (const RTPAddress &addr)=0
 Adds the address specified by addr to the list of destinations. More...
 
virtual int DeleteDestination (const RTPAddress &addr)=0
 Deletes the address specified by addr from the list of destinations. More...
 
virtual void ClearDestinations ()=0
 Clears the list of destinations. More...
 
virtual bool SupportsMulticasting ()=0
 Returns true if the transmission component supports multicasting. More...
 
virtual int JoinMulticastGroup (const RTPAddress &addr)=0
 Joins the multicast group specified by addr. More...
 
virtual int LeaveMulticastGroup (const RTPAddress &addr)=0
 Leaves the multicast group specified by addr. More...
 
virtual void LeaveAllMulticastGroups ()=0
 Leaves all the multicast groups that have been joined. More...
 
virtual int SetReceiveMode (RTPTransmitter::ReceiveMode m)=0
 Sets the receive mode. More...
 
virtual int AddToIgnoreList (const RTPAddress &addr)=0
 Adds addr to the list of addresses to ignore. More...
 
virtual int DeleteFromIgnoreList (const RTPAddress &addr)=0
 Deletes addr from the list of addresses to accept. More...
 
virtual void ClearIgnoreList ()=0
 Clears the list of addresses to ignore. More...
 
virtual int AddToAcceptList (const RTPAddress &addr)=0
 Adds addr to the list of addresses to accept. More...
 
virtual int DeleteFromAcceptList (const RTPAddress &addr)=0
 Deletes addr from the list of addresses to accept. More...
 
virtual void ClearAcceptList ()=0
 Clears the list of addresses to accept. More...
 
virtual int SetMaximumPacketSize (size_t s)=0
 Sets the maximum packet size which the transmitter should allow to s. More...
 
virtual bool NewDataAvailable ()=0
 Returns true if packets can be obtained using the GetNextPacket member function. More...
 
virtual RTPRawPacketGetNextPacket ()=0
 Returns the raw data of a received RTP packet (received during the Poll function) in an RTPRawPacket instance. More...
 

Protected Member Functions

 RTPTransmitter (RTPMemoryManager *mgr)
 Constructor in which you can specify a memory manager to use. More...
 

Detailed Description

Abstract class from which actual transmission components should be derived. The abstract class RTPTransmitter specifies the interface for actual transmission components. Currently, two implementations exist: an UDP over IPv4 transmitter and an UDP over IPv6 transmitter.

Member Enumeration Documentation

Enumerator
AcceptAll 

All incoming data is accepted, no matter where it originated from.

AcceptSome 

Only data coming from specific sources will be accepted.

IgnoreSome 

All incoming data is accepted, except for data coming from a specific set of sources.

If UserDefinedProto is used in the RTPSession::Create function, the RTPSession virtual member function NewUserDefinedTransmitter will be called to create a transmission component.

Enumerator
IPv4UDPProto 

Specifies the internal UDP over IPv4 transmitter.

IPv6UDPProto 

Specifies the internal UDP over IPv6 transmitter.

UserDefinedProto 

Specifies a user defined, external transmitter.

Constructor & Destructor Documentation

RTPTransmitter::RTPTransmitter ( RTPMemoryManager mgr)
inlineprotected

Member Function Documentation

virtual int RTPTransmitter::AbortWait ( )
pure virtual
virtual int RTPTransmitter::AddDestination ( const RTPAddress addr)
pure virtual
virtual int RTPTransmitter::AddToAcceptList ( const RTPAddress addr)
pure virtual
virtual int RTPTransmitter::AddToIgnoreList ( const RTPAddress addr)
pure virtual
virtual void RTPTransmitter::ClearAcceptList ( )
pure virtual
virtual void RTPTransmitter::ClearDestinations ( )
pure virtual
virtual void RTPTransmitter::ClearIgnoreList ( )
pure virtual
virtual bool RTPTransmitter::ComesFromThisTransmitter ( const RTPAddress addr)
pure virtual
virtual int RTPTransmitter::Create ( size_t  maxpacksize,
const RTPTransmissionParams transparams 
)
pure virtual

Prepares the component to be used. The parameter maxpacksize specifies the maximum size a packet can have: if the packet is larger it will not be transmitted. The transparams parameter specifies a pointer to an RTPTransmissionParams instance. This is also an abstract class and each actual component will define its own parameters by inheriting a class from RTPTransmissionParams. If transparams is NULL, the default transmission parameters for the component will be used.

virtual int RTPTransmitter::DeleteDestination ( const RTPAddress addr)
pure virtual
virtual int RTPTransmitter::DeleteFromAcceptList ( const RTPAddress addr)
pure virtual
virtual int RTPTransmitter::DeleteFromIgnoreList ( const RTPAddress addr)
pure virtual
virtual void RTPTransmitter::Destroy ( )
pure virtual

By calling this function, buffers are cleared and the component cannot be used anymore. Only when the Create function is called again can the component be used again.

virtual size_t RTPTransmitter::GetHeaderOverhead ( )
pure virtual
virtual int RTPTransmitter::GetLocalHostName ( uint8_t *  buffer,
size_t *  bufferlength 
)
pure virtual

Looks up the local host name based upon internal information about the local host's addresses. This function might take some time since a DNS query might be done. bufferlength should initially contain the number of bytes that may be stored in buffer. If the function succeeds, bufferlength is set to the number of bytes stored in buffer. Note that the data in buffer is not NULL-terminated. If the function fails because the buffer isn't large enough, it returns ERR_RTP_TRANS_BUFFERLENGTHTOOSMALL and stores the number of bytes needed in bufferlength.

virtual RTPRawPacket* RTPTransmitter::GetNextPacket ( )
pure virtual
virtual RTPTransmissionInfo* RTPTransmitter::GetTransmissionInfo ( )
pure virtual

This function returns an instance of a subclass of RTPTransmissionInfo which will give some additional information about the transmitter (a list of local IP addresses for example). Currently, either an instance of RTPUDPv4TransmissionInfo or RTPUDPv6TransmissionInfo is returned, depending on the type of the transmitter. The user has to deallocate the returned instance when it is no longer needed.

virtual int RTPTransmitter::Init ( bool  threadsafe)
pure virtual

This function must be called before the transmission component can be used. Depending on the value of threadsafe, the component will be created for thread-safe usage or not.

virtual int RTPTransmitter::JoinMulticastGroup ( const RTPAddress addr)
pure virtual
virtual void RTPTransmitter::LeaveAllMulticastGroups ( )
pure virtual
virtual int RTPTransmitter::LeaveMulticastGroup ( const RTPAddress addr)
pure virtual
virtual bool RTPTransmitter::NewDataAvailable ( )
pure virtual
virtual int RTPTransmitter::Poll ( )
pure virtual
virtual int RTPTransmitter::SendRTCPData ( const void *  data,
size_t  len 
)
pure virtual
virtual int RTPTransmitter::SendRTPData ( const void *  data,
size_t  len 
)
pure virtual
virtual int RTPTransmitter::SetMaximumPacketSize ( size_t  s)
pure virtual
virtual int RTPTransmitter::SetReceiveMode ( RTPTransmitter::ReceiveMode  m)
pure virtual

Sets the receive mode to m, which is one of the following: RTPTransmitter::AcceptAll, RTPTransmitter::AcceptSome or RTPTransmitter::IgnoreSome. Note that if the receive mode is changed, all information about the addresses to ignore to accept is lost.

virtual bool RTPTransmitter::SupportsMulticasting ( )
pure virtual
virtual int RTPTransmitter::WaitForIncomingData ( const RTPTime delay,
bool *  dataavailable = 0 
)
pure virtual

Waits at most a time delay until incoming data has been detected. If dataavailable is not NULL, it should be set to true if data was actually read and to false otherwise.


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