JRTPLIB
3.11.1
|
High level class for using RTP. More...
#include <rtpsession.h>
Public Member Functions | |
RTPSession (RTPRandom *rnd=0, RTPMemoryManager *mgr=0) | |
Constructs an RTPSession instance, optionally using a specific instance of a random number generator, and optionally installing a memory manager. More... | |
int | Create (const RTPSessionParams &sessparams, const RTPTransmissionParams *transparams=0, RTPTransmitter::TransmissionProtocol proto=RTPTransmitter::IPv4UDPProto) |
Creates an RTP session. More... | |
int | Create (const RTPSessionParams &sessparams, RTPTransmitter *transmitter) |
Creates an RTP session using transmitter as transmission component. More... | |
void | Destroy () |
Leaves the session without sending a BYE packet. More... | |
void | BYEDestroy (const RTPTime &maxwaittime, const void *reason, size_t reasonlength) |
Sends a BYE packet and leaves the session. More... | |
bool | IsActive () |
Returns whether the session has been created or not. More... | |
uint32_t | GetLocalSSRC () |
Returns our own SSRC. More... | |
int | AddDestination (const RTPAddress &addr) |
Adds addr to the list of destinations. More... | |
int | DeleteDestination (const RTPAddress &addr) |
Deletes addr from the list of destinations. More... | |
void | ClearDestinations () |
Clears the list of destinations. More... | |
bool | SupportsMulticasting () |
Returns true if multicasting is supported. More... | |
int | JoinMulticastGroup (const RTPAddress &addr) |
Joins the multicast group specified by addr . More... | |
int | LeaveMulticastGroup (const RTPAddress &addr) |
Leaves the multicast group specified by addr . More... | |
void | LeaveAllMulticastGroups () |
Leaves all multicast groups. More... | |
int | SendPacket (const void *data, size_t len) |
Sends the RTP packet with payload data which has length len . More... | |
int | SendPacket (const void *data, size_t len, uint8_t pt, bool mark, uint32_t timestampinc) |
Sends the RTP packet with payload data which has length len . More... | |
int | SendPacketEx (const void *data, size_t len, uint16_t hdrextID, const void *hdrextdata, size_t numhdrextwords) |
Sends the RTP packet with payload data which has length len . More... | |
int | SendPacketEx (const void *data, size_t len, uint8_t pt, bool mark, uint32_t timestampinc, uint16_t hdrextID, const void *hdrextdata, size_t numhdrextwords) |
Sends the RTP packet with payload data which has length len . More... | |
int | SendRTCPAPPPacket (uint8_t subtype, const uint8_t name[4], const void *appdata, size_t appdatalen) |
If sending of RTCP APP packets was enabled at compile time, this function creates a compound packet containing an RTCP APP packet and sends it immediately. More... | |
int | SendUnknownPacket (bool sr, uint8_t payload_type, uint8_t subtype, const void *data, size_t len) |
Tries to send an Unknown packet immediately. More... | |
int | SendRawData (const void *data, size_t len, bool usertpchannel) |
With this function raw data can be sent directly over the RTP or RTCP channel (if they are different); the data is not passed through the RTPSession::OnChangeRTPOrRTCPData function. More... | |
int | SetDefaultPayloadType (uint8_t pt) |
Sets the default payload type for RTP packets to pt . More... | |
int | SetDefaultMark (bool m) |
Sets the default marker for RTP packets to m . More... | |
int | SetDefaultTimestampIncrement (uint32_t timestampinc) |
Sets the default value to increment the timestamp with to timestampinc . More... | |
int | IncrementTimestamp (uint32_t inc) |
This function increments the timestamp with the amount given by inc . More... | |
int | IncrementTimestampDefault () |
This function increments the timestamp with the amount given set by the SetDefaultTimestampIncrement member function. More... | |
int | SetPreTransmissionDelay (const RTPTime &delay) |
This function allows you to inform the library about the delay between sampling the first sample of a packet and sending the packet. More... | |
RTPTransmissionInfo * | GetTransmissionInfo () |
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). More... | |
void | DeleteTransmissionInfo (RTPTransmissionInfo *inf) |
Frees the memory used by the transmission information inf . More... | |
int | Poll () |
If you're not using the poll thread, this function must be called regularly to process incoming data and to send RTCP data when necessary. | |
int | WaitForIncomingData (const RTPTime &delay, bool *dataavailable=0) |
Waits at most a time delay until incoming data has been detected. More... | |
int | AbortWait () |
If the previous function has been called, this one aborts the waiting (only works when you're not using the poll thread). | |
RTPTime | GetRTCPDelay () |
Returns the time interval after which an RTCP compound packet may have to be sent (only works when you're not using the poll thread. | |
int | BeginDataAccess () |
The following member functions (till EndDataAccess}) need to be accessed between a call to BeginDataAccess and EndDataAccess. More... | |
bool | GotoFirstSource () |
Starts the iteration over the participants by going to the first member in the table. More... | |
bool | GotoNextSource () |
Sets the current source to be the next source in the table. More... | |
bool | GotoPreviousSource () |
Sets the current source to be the previous source in the table. More... | |
bool | GotoFirstSourceWithData () |
Sets the current source to be the first source in the table which has RTPPacket instances that we haven't extracted yet. More... | |
bool | GotoNextSourceWithData () |
Sets the current source to be the next source in the table which has RTPPacket instances that we haven't extracted yet. More... | |
bool | GotoPreviousSourceWithData () |
Sets the current source to be the previous source in the table which has RTPPacket instances that we haven't extracted yet. More... | |
RTPSourceData * | GetCurrentSourceInfo () |
Returns the RTPSourceData instance for the currently selected participant. More... | |
RTPSourceData * | GetSourceInfo (uint32_t ssrc) |
Returns the RTPSourceData instance for the participant identified by ssrc , or NULL if no such entry exists. | |
RTPPacket * | GetNextPacket () |
Extracts the next packet from the received packets queue of the current participant, or NULL if no more packets are available. More... | |
uint16_t | GetNextSequenceNumber () const |
Returns the Sequence Number that will be used in the next SendPacket function call. More... | |
void | DeletePacket (RTPPacket *p) |
Frees the memory used by p . More... | |
int | EndDataAccess () |
See BeginDataAccess. More... | |
int | SetReceiveMode (RTPTransmitter::ReceiveMode m) |
Sets the receive mode to m . More... | |
int | AddToIgnoreList (const RTPAddress &addr) |
Adds addr to the list of addresses to ignore. More... | |
int | DeleteFromIgnoreList (const RTPAddress &addr) |
Deletes addr from the list of addresses to ignore. More... | |
void | ClearIgnoreList () |
Clears the list of addresses to ignore. More... | |
int | AddToAcceptList (const RTPAddress &addr) |
Adds addr to the list of addresses to accept. More... | |
int | DeleteFromAcceptList (const RTPAddress &addr) |
Deletes addr from the list of addresses to accept. More... | |
void | ClearAcceptList () |
Clears the list of addresses to accept. More... | |
int | SetMaximumPacketSize (size_t s) |
Sets the maximum allowed packet size to s . More... | |
int | SetSessionBandwidth (double bw) |
Sets the session bandwidth to bw , which is specified in bytes per second. More... | |
int | SetTimestampUnit (double u) |
Sets the timestamp unit for our own data. More... | |
void | SetNameInterval (int count) |
Sets the RTCP interval for the SDES name item. More... | |
void | SetEMailInterval (int count) |
Sets the RTCP interval for the SDES e-mail item. More... | |
void | SetLocationInterval (int count) |
Sets the RTCP interval for the SDES location item. More... | |
void | SetPhoneInterval (int count) |
Sets the RTCP interval for the SDES phone item. More... | |
void | SetToolInterval (int count) |
Sets the RTCP interval for the SDES tool item. More... | |
void | SetNoteInterval (int count) |
Sets the RTCP interval for the SDES note item. More... | |
int | SetLocalName (const void *s, size_t len) |
Sets the SDES name item for the local participant to the value s with length len . More... | |
int | SetLocalEMail (const void *s, size_t len) |
Sets the SDES e-mail item for the local participant to the value s with length len . More... | |
int | SetLocalLocation (const void *s, size_t len) |
Sets the SDES location item for the local participant to the value s with length len . More... | |
int | SetLocalPhone (const void *s, size_t len) |
Sets the SDES phone item for the local participant to the value s with length len . More... | |
int | SetLocalTool (const void *s, size_t len) |
Sets the SDES tool item for the local participant to the value s with length len . More... | |
int | SetLocalNote (const void *s, size_t len) |
Sets the SDES note item for the local participant to the value s with length len . More... | |
Protected Member Functions | |
virtual RTPTransmitter * | NewUserDefinedTransmitter () |
Allocate a user defined transmitter. More... | |
virtual void | OnRTPPacket (RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress) |
Is called when an incoming RTP packet is about to be processed. More... | |
virtual void | OnRTCPCompoundPacket (RTCPCompoundPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress) |
Is called when an incoming RTCP packet is about to be processed. More... | |
virtual void | OnSSRCCollision (RTPSourceData *srcdat, const RTPAddress *senderaddress, bool isrtp) |
Is called when an SSRC collision was detected. More... | |
virtual void | OnCNAMECollision (RTPSourceData *srcdat, const RTPAddress *senderaddress, const uint8_t *cname, size_t cnamelength) |
Is called when another CNAME was received than the one already present for source srcdat . More... | |
virtual void | OnNewSource (RTPSourceData *srcdat) |
Is called when a new entry srcdat is added to the source table. More... | |
virtual void | OnRemoveSource (RTPSourceData *srcdat) |
Is called when the entry srcdat is about to be deleted from the source table. More... | |
virtual void | OnTimeout (RTPSourceData *srcdat) |
Is called when participant srcdat is timed out. More... | |
virtual void | OnBYETimeout (RTPSourceData *srcdat) |
Is called when participant srcdat is timed after having sent a BYE packet. More... | |
virtual void | OnAPPPacket (RTCPAPPPacket *apppacket, const RTPTime &receivetime, const RTPAddress *senderaddress) |
Is called when an RTCP APP packet apppacket has been received at time receivetime from address senderaddress . | |
virtual void | OnUnknownPacketType (RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress) |
Is called when an unknown RTCP packet type was detected. More... | |
virtual void | OnUnknownPacketFormat (RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress) |
Is called when an unknown packet format for a known packet type was detected. More... | |
virtual void | OnNoteTimeout (RTPSourceData *srcdat) |
Is called when the SDES NOTE item for source srcdat has been timed out. More... | |
virtual void | OnRTCPSenderReport (RTPSourceData *srcdat) |
Is called when an RTCP sender report has been processed for this source. More... | |
virtual void | OnRTCPReceiverReport (RTPSourceData *srcdat) |
Is called when an RTCP receiver report has been processed for this source. More... | |
virtual void | OnRTCPSDESItem (RTPSourceData *srcdat, RTCPSDESPacket::ItemType t, const void *itemdata, size_t itemlength) |
Is called when a specific SDES item was received for this source. More... | |
virtual void | OnRTCPSDESPrivateItem (RTPSourceData *srcdat, const void *prefixdata, size_t prefixlen, const void *valuedata, size_t valuelen) |
Is called when a specific SDES item of 'private' type was received for this source. More... | |
virtual void | OnBYEPacket (RTPSourceData *srcdat) |
Is called when a BYE packet has been processed for source srcdat . More... | |
virtual void | OnSendRTCPCompoundPacket (RTCPCompoundPacket *pack) |
Is called when an RTCP compound packet has just been sent (useful to inspect outgoing RTCP data). More... | |
virtual void | OnPollThreadError (int errcode) |
Is called when error errcode was detected in the poll thread. More... | |
virtual void | OnPollThreadStep () |
Is called each time the poll thread loops. More... | |
virtual void | OnPollThreadStart (bool &stop) |
Is called when the poll thread is started. More... | |
virtual void | OnPollThreadStop () |
Is called when the poll thread is going to stop. More... | |
void | SetChangeOutgoingData (bool change) |
If this is set to true, outgoing data will be passed through RTPSession::OnChangeRTPOrRTCPData and RTPSession::OnSentRTPOrRTCPData, allowing you to modify the data (e.g. More... | |
void | SetChangeIncomingData (bool change) |
If this is set to true, incoming data will be passed through RTPSession::OnChangeIncomingData, allowing you to modify the data (e.g. More... | |
virtual int | OnChangeRTPOrRTCPData (const void *origdata, size_t origlen, bool isrtp, void **senddata, size_t *sendlen) |
If RTPSession::SetChangeOutgoingData was sent to true, overriding this you can change the data packet that will actually be sent, for example adding encryption. More... | |
virtual void | OnSentRTPOrRTCPData (void *senddata, size_t sendlen, bool isrtp) |
This function is called when an RTP or RTCP packet was sent, it can be helpful when data was allocated in RTPSession::OnChangeRTPOrRTCPData to deallocate it here. More... | |
virtual bool | OnChangeIncomingData (RTPRawPacket *rawpack) |
By overriding this function, the raw incoming data can be inspected and modified (e.g. More... | |
virtual void | OnValidatedRTPPacket (RTPSourceData *srcdat, RTPPacket *rtppack, bool isonprobation, bool *ispackethandled) |
Allows you to use an RTP packet from the specified source directly. More... | |
For most RTP based applications, the RTPSession class will probably be the one to use. It handles the RTCP part completely internally, so the user can focus on sending and receiving the actual data. In case you want to use SRTP, you should create an RTPSecureSession derived class.
jrtplib::RTPSession::RTPSession | ( | RTPRandom * | rnd = 0 , |
RTPMemoryManager * | mgr = 0 |
||
) |
Constructs an RTPSession instance, optionally using a specific instance of a random number generator, and optionally installing a memory manager. If no random number generator is specified, the RTPSession object will try to use either a RTPRandomURandom or RTPRandomRandS instance. If neither is available on the current platform, a RTPRandomRand48 instance will be used instead. By specifying a random number generator yourself, it is possible to use the same generator in several RTPSession instances.
int jrtplib::RTPSession::AddDestination | ( | const RTPAddress & | addr | ) |
int jrtplib::RTPSession::AddToAcceptList | ( | const RTPAddress & | addr | ) |
int jrtplib::RTPSession::AddToIgnoreList | ( | const RTPAddress & | addr | ) |
int jrtplib::RTPSession::BeginDataAccess | ( | ) |
The BeginDataAccess function makes sure that the poll thread won't access the source table at the same time that you're using it. When the EndDataAccess is called, the lock on the source table is freed again.
void jrtplib::RTPSession::BYEDestroy | ( | const RTPTime & | maxwaittime, |
const void * | reason, | ||
size_t | reasonlength | ||
) |
Sends a BYE packet and leaves the session. At most a time maxwaittime
will be waited to send the BYE packet. If this time expires, the session will be left without sending a BYE packet. The BYE packet will contain as reason for leaving reason
with length reasonlength
.
void jrtplib::RTPSession::ClearAcceptList | ( | ) |
void jrtplib::RTPSession::ClearDestinations | ( | ) |
void jrtplib::RTPSession::ClearIgnoreList | ( | ) |
int jrtplib::RTPSession::Create | ( | const RTPSessionParams & | sessparams, |
const RTPTransmissionParams * | transparams = 0 , |
||
RTPTransmitter::TransmissionProtocol | proto = RTPTransmitter::IPv4UDPProto |
||
) |
This function creates an RTP session with parameters sessparams
, which will use a transmitter corresponding to proto
. Parameters for this transmitter can be specified as well. If proto
is of type RTPTransmitter::UserDefinedProto, the NewUserDefinedTransmitter function must be implemented.
int jrtplib::RTPSession::Create | ( | const RTPSessionParams & | sessparams, |
RTPTransmitter * | transmitter | ||
) |
This function creates an RTP session with parameters sessparams
, which will use the transmission component transmitter
. Initialization and destruction of the transmitter will not be done by the RTPSession class if this Create function is used. This function can be useful if you which to reuse the transmission component in another RTPSession instance, once the original RTPSession isn't using the transmitter anymore.
int jrtplib::RTPSession::DeleteDestination | ( | const RTPAddress & | addr | ) |
int jrtplib::RTPSession::DeleteFromAcceptList | ( | const RTPAddress & | addr | ) |
int jrtplib::RTPSession::DeleteFromIgnoreList | ( | const RTPAddress & | addr | ) |
void jrtplib::RTPSession::DeletePacket | ( | RTPPacket * | p | ) |
void jrtplib::RTPSession::DeleteTransmissionInfo | ( | RTPTransmissionInfo * | inf | ) |
void jrtplib::RTPSession::Destroy | ( | ) |
int jrtplib::RTPSession::EndDataAccess | ( | ) |
RTPSourceData* jrtplib::RTPSession::GetCurrentSourceInfo | ( | ) |
uint32_t jrtplib::RTPSession::GetLocalSSRC | ( | ) |
RTPPacket* jrtplib::RTPSession::GetNextPacket | ( | ) |
Extracts the next packet from the received packets queue of the current participant, or NULL if no more packets are available. When the packet is no longer needed, its memory should be freed using the DeletePacket member function.
uint16_t jrtplib::RTPSession::GetNextSequenceNumber | ( | ) | const |
RTPTransmissionInfo* jrtplib::RTPSession::GetTransmissionInfo | ( | ) |
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). The user has to free the returned instance when it is no longer needed, preferably using the DeleteTransmissionInfo function.
bool jrtplib::RTPSession::GotoFirstSource | ( | ) |
Starts the iteration over the participants by going to the first member in the table. If a member was found, the function returns true
, otherwise it returns false
.
bool jrtplib::RTPSession::GotoFirstSourceWithData | ( | ) |
Sets the current source to be the first source in the table which has RTPPacket instances that we haven't extracted yet. If no such member was found, the function returns false
, otherwise it returns true
.
bool jrtplib::RTPSession::GotoNextSource | ( | ) |
Sets the current source to be the next source in the table. If we're already at the last source, the function returns false
, otherwise it returns true
.
bool jrtplib::RTPSession::GotoNextSourceWithData | ( | ) |
Sets the current source to be the next source in the table which has RTPPacket instances that we haven't extracted yet. If no such member was found, the function returns false
, otherwise it returns true
.
bool jrtplib::RTPSession::GotoPreviousSource | ( | ) |
Sets the current source to be the previous source in the table. If we're at the first source, the function returns false
, otherwise it returns true
.
bool jrtplib::RTPSession::GotoPreviousSourceWithData | ( | ) |
Sets the current source to be the previous source in the table which has RTPPacket instances that we haven't extracted yet. If no such member was found, the function returns false
, otherwise it returns true
.
int jrtplib::RTPSession::IncrementTimestamp | ( | uint32_t | inc | ) |
This function increments the timestamp with the amount given by inc
. This can be useful if, for example, a packet was not sent because it contained only silence. Then, this function should be called to increment the timestamp with the appropriate amount so that the next packets will still be played at the correct time at other hosts.
int jrtplib::RTPSession::IncrementTimestampDefault | ( | ) |
This function increments the timestamp with the amount given set by the SetDefaultTimestampIncrement member function. This can be useful if, for example, a packet was not sent because it contained only silence. Then, this function should be called to increment the timestamp with the appropriate amount so that the next packets will still be played at the correct time at other hosts.
bool jrtplib::RTPSession::IsActive | ( | ) |
int jrtplib::RTPSession::JoinMulticastGroup | ( | const RTPAddress & | addr | ) |
void jrtplib::RTPSession::LeaveAllMulticastGroups | ( | ) |
int jrtplib::RTPSession::LeaveMulticastGroup | ( | const RTPAddress & | addr | ) |
|
inlineprotectedvirtual |
In case you specified in the Create function that you want to use a user defined transmitter, you should override this function. The RTPTransmitter instance returned by this function will then be used to send and receive RTP and RTCP packets. Note that when the session is destroyed, this RTPTransmitter instance will be destroyed as well.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
for encryption). By overriding this function, the raw incoming data can be inspected and modified (e.g. for encryption). If the function returns false
, the packet is discarded.
|
inlineprotectedvirtual |
If RTPSession::SetChangeOutgoingData was sent to true, overriding this you can change the data packet that will actually be sent, for example adding encryption. Note that no memory management will be performed on the senddata
pointer you fill in, so if it needs to be deleted at some point you need to take care of this in some way yourself, a good way may be to do this in RTPSession::OnSentRTPOrRTCPData. If senddata
is set to 0, no packet will be sent out. This also provides a way to turn off sending RTCP packets if desired.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Is called when the poll thread is started. This happens just before entering the thread main loop.
stop | This can be used to stop the thread immediately without entering the loop. |
|
inlineprotectedvirtual |
Is called each time the poll thread loops. This happens when incoming data was detected or when it's time to send an RTCP compound packet.
|
inlineprotectedvirtual |
Is called when the poll thread is going to stop. This happens just before termitating the thread.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Is called when an incoming RTP packet is about to be processed. This is not a good function to process an RTP packet in, in case you want to avoid iterating over the sources using the GotoFirst/GotoNext functions. In that case, the RTPSession::OnValidatedRTPPacket function should be used.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Is called when an SSRC collision was detected. The instance srcdat
is the one present in the table, the address senderaddress
is the one that collided with one of the addresses and isrtp
indicates against which address of srcdat
the check failed.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Allows you to use an RTP packet from the specified source directly. If ispackethandled
is set to true
, the packet will no longer be stored in this source's packet list. Note that if you do set this flag, you'll need to deallocate the packet yourself at an appropriate time.
The difference with RTPSession::OnRTPPacket is that that function will always process the RTP packet further and is therefore not really suited to actually do something with the data.
int jrtplib::RTPSession::SendPacket | ( | const void * | data, |
size_t | len | ||
) |
Sends the RTP packet with payload data
which has length len
. The used payload type, marker and timestamp increment will be those that have been set using the SetDefault
member functions.
int jrtplib::RTPSession::SendPacket | ( | const void * | data, |
size_t | len, | ||
uint8_t | pt, | ||
bool | mark, | ||
uint32_t | timestampinc | ||
) |
It will use payload type pt
, marker mark
and after the packet has been built, the timestamp will be incremented by timestampinc
.
int jrtplib::RTPSession::SendPacketEx | ( | const void * | data, |
size_t | len, | ||
uint16_t | hdrextID, | ||
const void * | hdrextdata, | ||
size_t | numhdrextwords | ||
) |
The packet will contain a header extension with identifier hdrextID
and containing data hdrextdata
. The length of this data is given by numhdrextwords
and is specified in a number of 32-bit words. The used payload type, marker and timestamp increment will be those that have been set using the SetDefault
member functions.
int jrtplib::RTPSession::SendPacketEx | ( | const void * | data, |
size_t | len, | ||
uint8_t | pt, | ||
bool | mark, | ||
uint32_t | timestampinc, | ||
uint16_t | hdrextID, | ||
const void * | hdrextdata, | ||
size_t | numhdrextwords | ||
) |
It will use payload type pt
, marker mark
and after the packet has been built, the timestamp will be incremented by timestampinc
. The packet will contain a header extension with identifier hdrextID
and containing data hdrextdata
. The length of this data is given by numhdrextwords
and is specified in a number of 32-bit words.
int jrtplib::RTPSession::SendRawData | ( | const void * | data, |
size_t | len, | ||
bool | usertpchannel | ||
) |
int jrtplib::RTPSession::SendRTCPAPPPacket | ( | uint8_t | subtype, |
const uint8_t | name[4], | ||
const void * | appdata, | ||
size_t | appdatalen | ||
) |
If sending of RTCP APP packets was enabled at compile time, this function creates a compound packet containing an RTCP APP packet and sends it immediately. If successful, the function returns the number of bytes in the RTCP compound packet. Note that this immediate sending is not compliant with the RTP specification, so use with care.
int jrtplib::RTPSession::SendUnknownPacket | ( | bool | sr, |
uint8_t | payload_type, | ||
uint8_t | subtype, | ||
const void * | data, | ||
size_t | len | ||
) |
Tries to send an Unknown packet immediately. If successful, the function returns the number of bytes in the RTCP compound packet. Note that this immediate sending is not compliant with the RTP specification, so use with care. Can send message along with a receiver report or a sender report
|
inlineprotected |
to decrypt it).
|
inlineprotected |
to encrypt it).
int jrtplib::RTPSession::SetDefaultMark | ( | bool | m | ) |
int jrtplib::RTPSession::SetDefaultPayloadType | ( | uint8_t | pt | ) |
int jrtplib::RTPSession::SetDefaultTimestampIncrement | ( | uint32_t | timestampinc | ) |
void jrtplib::RTPSession::SetEMailInterval | ( | int | count | ) |
After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES e-mail item will be added after the sources in the source table have been processed count
times.
int jrtplib::RTPSession::SetLocalEMail | ( | const void * | s, |
size_t | len | ||
) |
int jrtplib::RTPSession::SetLocalLocation | ( | const void * | s, |
size_t | len | ||
) |
int jrtplib::RTPSession::SetLocalName | ( | const void * | s, |
size_t | len | ||
) |
int jrtplib::RTPSession::SetLocalNote | ( | const void * | s, |
size_t | len | ||
) |
int jrtplib::RTPSession::SetLocalPhone | ( | const void * | s, |
size_t | len | ||
) |
int jrtplib::RTPSession::SetLocalTool | ( | const void * | s, |
size_t | len | ||
) |
void jrtplib::RTPSession::SetLocationInterval | ( | int | count | ) |
After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES location item will be added after the sources in the source table have been processed count
times.
int jrtplib::RTPSession::SetMaximumPacketSize | ( | size_t | s | ) |
void jrtplib::RTPSession::SetNameInterval | ( | int | count | ) |
After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES name item will be added after the sources in the source table have been processed count
times.
void jrtplib::RTPSession::SetNoteInterval | ( | int | count | ) |
After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES note item will be added after the sources in the source table have been processed count
times.
void jrtplib::RTPSession::SetPhoneInterval | ( | int | count | ) |
After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES phone item will be added after the sources in the source table have been processed count
times.
int jrtplib::RTPSession::SetPreTransmissionDelay | ( | const RTPTime & | delay | ) |
This function allows you to inform the library about the delay between sampling the first sample of a packet and sending the packet. This delay is taken into account when calculating the relation between RTP timestamp and wallclock time, used for inter-media synchronization.
int jrtplib::RTPSession::SetReceiveMode | ( | RTPTransmitter::ReceiveMode | m | ) |
Sets the receive mode to m
. Note that when the receive mode is changed, the list of addresses to be ignored ot accepted will be cleared.
int jrtplib::RTPSession::SetSessionBandwidth | ( | double | bw | ) |
int jrtplib::RTPSession::SetTimestampUnit | ( | double | u | ) |
Sets the timestamp unit for our own data. The timestamp unit is defined as a time interval in seconds divided by the corresponding timestamp interval. For example, for 8000 Hz audio, the timestamp unit would typically be 1/8000. Since this value is initially set to an illegal value, the user must set this to an allowed value to be able to create a session.
void jrtplib::RTPSession::SetToolInterval | ( | int | count | ) |
After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count
is zero or negative, nothing will happen. If count
is positive, an SDES tool item will be added after the sources in the source table have been processed count
times.
bool jrtplib::RTPSession::SupportsMulticasting | ( | ) |
int jrtplib::RTPSession::WaitForIncomingData | ( | const RTPTime & | delay, |
bool * | dataavailable = 0 |
||
) |
Waits at most a time delay
until incoming data has been detected. Only works when you're not using the poll thread. If dataavailable
is not NULL
, it should be set to true
if data was actually read and to false
otherwise.