jrtplib
3.8.2
|
Abstract class from which actual transmission components should be derived. More...
#include <rtptransmitter.h>
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 RTPTransmissionInfo * | GetTransmissionInfo ()=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 RTPRawPacket * | GetNextPacket ()=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... | |
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.
If UserDefinedProto is used in the RTPSession::Create function, the RTPSession virtual member function NewUserDefinedTransmitter will be called to create a transmission component.
|
inlineprotected |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
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.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
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.
|
pure virtual |
|
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
.
|
pure virtual |
|
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.
|
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.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
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.
|
pure virtual |
|
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.