class RRtpSession |
A handle to an RTP session.
This is the interface to the socket-level RTP service, and provides additional facilities such as header parsing, re-ordering out-of-order packets, demultiplexing multiple sources etc.
The class abstracts all RTP information going to/from a RTP socket, and its corresponding RTCP data.
Each RTP endpoint on a device needs its own RTP session.
Multiple hosts streaming to a port on this device correspond to different RRtpReceiveSource objects associated with the session.
The class behaviour assumes that an active scheduler has already been created and started; the class does not function correctly if not.
Public Member Enumerations | |
---|---|
enum |
TRtpSendPacketType
{
ERtcpPacketCNAME = 1, ERtcpPacketNAME = 2, ERtcpPacketEMAIL = 4, ERtcpPacketPHONE = 8, ERtcpPacketLOC = 16, ERtcpPacketTOOL = 32, ERtcpPacketNOTE = 64, ERtcpPacketPRIV = 128 } |
Private Attributes | |
---|---|
CRtpSession * | iPtr |
IMPORT_C void | Close | ( | ) |
Closes the session.
All RRtpSendSource and RRtpReceiveSource objects associated with this session are closed.
IMPORT_C void | DisableNonRtpData | ( | ) |
Disables the receipt of non RTP data
Disables the receipt of non RTP data
IMPORT_C void | DontReceive | ( | TInt | aRtpOrRtcp | ) |
Enables Receive only option for rtp or rtcp
Enables Receive only option for rtp or rtcp
TInt aRtpOrRtcp | Takes the values from the enum TPacketType |
IMPORT_C RRtcpRRPart | GetRRs | ( | ) |
Gets an array contining the most recent RR (Receiver Report) from all hosts who are reporting on our send stream.
Gets an array contining the most recent RR (Receiver Report) from all hosts who are reporting on our send stream.
IMPORT_C TInt | GetSDES | ( | const TInt | aType, |
TDes8 & | aValue | |||
) |
Gets the data associated with the specified RTCP SDES (Source Description) item.
Note a that the PRIV (Private Extensions) SDES item is not supported by this mechanism.
Gets the data associated with the specified RTCP SDES (Source Description) item.
Note a that the PRIV (Private Extensions) SDES item is not supported by this mechanism.
TBool | IsOpen | ( | ) | const [inline] |
Tests whether the RTP session represented by this handle is open.
IMPORT_C TInt | MaxRXSize | ( | ) |
Gets the current expected maximum size of a received packet.
IMPORT_C RRtpReceiveSource | NewReceiveSourceL | ( | ) |
Creates a new receive stream, and returns the receive stream handle.
This function should only be called in response to an ERtpNewSource event.
IMPORT_C RRtpReceiveSource | NewReceiveSourceLC | ( | ) |
Creates a new receive stream, puts a pointer to the receive stream object onto the cleanup stack, and returns the receive stream handle.
This function should only be called in response to an ERtpNewSource event.
Note that the function does not put a pointer to the RRtpReceiveSource object onto the cleanup stack as you might normally expect, but puts a pointer to the receive stream object for which the returned RRtpReceiveSource is the handle.
Note also that the API does not give you access to the receive stream object for which the returned RRtpReceiveSource is the handle.
IMPORT_C RRtpSendSource | NewSendSourceL | ( | ) |
Creates a new send stream, and returns the send stream handle.
Only one send stream per session is permitted, which means that you must not call this function if the send stream has already been created.
As the send stream is an active object, it cannot handle request completion events until control returns to the active scheduler. Typically, clients will want to add event registrations before that.
The Code panics if the SendSource has alredy been opened.
This function may leave if memory is not enough.
Creates a new send stream, and returns the send stream handle.
Only one send stream per session is permitted, which means that you must not call this function if the send stream has already been created.
As the send stream is an active object, it cannot handle request completion events until control returns to the active scheduler. Typically, clients will want to add event registrations before that.
IMPORT_C TPtr8 | NonRtcpDataL | ( | ) |
Gets the last received non RTCP data, If no data found function leaves
Gets the last received non RTCP data, If no data found function leaves
IMPORT_C const TDesC8 & | NonRtpDataL | ( | ) |
Gets the last received non RTP data, If no data found function leaves
Gets the last received non RTP data, If no data found function leaves
IMPORT_C void | OpenL | ( | RSocketServ & | aServer, |
TSockAddr & | aLocalAddr, | |||
TSockAddr & | aRemoteAddr, | |||
TInt | aMaxRXSize, | |||
RConnection & | aConnection, | |||
TInt | aPriority = EPriorityNormal, | |||
const TDesC8 & | aCNAME = KNullDesC8 | |||
) |
Opens the RTP session and initialises it.
No events will be generated until after control returns to the active scheduler. After successfully opening the session, the client has the opportunity to initialise the object by adding the event callbacks, that it requires.
RSocketServ & aServer | An already opened socket server session |
TSockAddr & aLocalAddr | The socket address to bind to at this end. |
TSockAddr & aRemoteAddr | The remote socket address. |
TInt aMaxRXSize | The maximum expected size of a received packet. Note that this includes the packet header (as it is profile dependent). |
RConnection & aConnection | A started RConnection for the interface to open this session on. |
TInt aPriority = EPriorityNormal | The priority to be used for internal active objects. |
const TDesC8 & aCNAME = KNullDesC8 | The CNAME (Canonical End-Point Identifier). |
IMPORT_C void | OpenL | ( | RSocketServ & | aServer, |
TSockAddr & | aLocalAddr, | |||
TSockAddr & | aRemoteAddr, | |||
TInt | aMaxRXSize, | |||
TInt | aPriority = EPriorityNormal, | |||
const TDesC8 & | aCNAME = KNullDesC8 | |||
) |
Opens the RTP session and initialises it.
No events will be generated until after control returns to the active scheduler. After successfully opening the session, the client has the opportunity to initialise the object by adding the event callbacks, that it requires.
RSocketServ & aServer | An already opened socket server session |
TSockAddr & aLocalAddr | The socket address to bind to at this end. |
TSockAddr & aRemoteAddr | The remote socket address. |
TInt aMaxRXSize | The maximum expected size of a received packet. Note that this includes the packet header (as it is profile dependent). |
TInt aPriority = EPriorityNormal | The priority to be used for internal active objects. |
const TDesC8 & aCNAME = KNullDesC8 | The CNAME (Canonical End-Point Identifier). RTCP is used only if CNAME is provided |
IMPORT_C void | OpenL | ( | RSocket & | aSocket, |
TInt | aMaxRXSize, | |||
RSocket & | aRtcpSocket, | |||
TInt | aPriority = EPriorityNormal, | |||
const TDesC8 & | aCNAME = KNullDesC8 | |||
) |
Opens the session and initialises it.
No events will be generated until after control returns to the active scheduler. The client has this time to initialise the object by adding event callbacks.
RSocket & aSocket | The connected socket. |
TInt aMaxRXSize | The maximum size of a received packet. |
RSocket & aRtcpSocket | The RTCP socket. |
TInt aPriority = EPriorityNormal | The priority to be used for internal active objects |
const TDesC8 & aCNAME = KNullDesC8 | The CNAME. A sensible default is supplied if none is provided. |
IMPORT_C void | OpenL | ( | RSocket & | aSocket, |
TInt | aMaxRXSize, | |||
TInt | aPriority = EPriorityNormal | |||
) |
Opens the session and initialises it without RTCP.
No events will be generated until after control returns to the active scheduler. After successfully opening the session, the client has the opportunity to initialise the object by adding the event callbacks, that it requires.
IMPORT_C void | OpenL | ( | RSocketServ & | aServer, |
TSockAddr & | aLocalAddr, | |||
TSockAddr & | aRemoteAddr, | |||
TInt | aMaxRXSize, | |||
RSubConnection & | aSubConnection, | |||
TInt | aPriority = EPriorityNormal, | |||
const TDesC8 & | aCNAME = KNullDesC8 | |||
) |
Opens the session and initialises it.
No events will be generated until after control returns to the active scheduler. The client has this time to initialise the object by adding event callbacks.
This API uses the RTP Stack implemented as a CF Prorotocol. The SubConnection which is passed to the API should be initialised with the RTP Params.
Opens the RTP session and initialises it.
No events will be generated until after control returns to the active scheduler. After successfully opening the session, the client has the opportunity to initialise the object by adding the event callbacks, that it requires.
RSocketServ & aServer | An already opened socket server session |
TSockAddr & aLocalAddr | The socket address to bind to at this end. |
TSockAddr & aRemoteAddr | The remote socket address. |
TInt aMaxRXSize | The maximum expected size of a received packet. Note that this includes the packet header (as it is profile dependent). |
RSubConnection & aSubConnection | The subconnection with RTP Parametrs set on it. |
TInt aPriority = EPriorityNormal | The priority to be used for internal active objects. |
const TDesC8 & aCNAME = KNullDesC8 | The CNAME (Canonical End-Point Identifier). RTCP is used only if CNAME is provided |
IMPORT_C void | PrivRegisterEventCallbackL | ( | TUint | aType, |
TRtpCallbackFunction | aCallback, | |||
TAny * | aPtr, | |||
TInt | aParameter | |||
) |
The event manager contains a number of callback registrations, each of which binds a function and pointer (normally an object) to a particular kind of event. Registrations can be bound to all events on a stream.
If a function is registered for a particular event, it will be called when that event occurs. One callback function can be associated with more than 1 callback registration. Callback functions take a pointer argument which was supplied as part of the registration
TUint aType | Event type |
TRtpCallbackFunction aCallback | Callback object |
TAny * aPtr | Pointer to data that needs to be passed to the callback function |
TInt aParameter | Parameter to be passed to internal callback subsystem |
IMPORT_C void | PrivRegisterEventCallbackL | ( | TUint | aType, |
TRtpCallbackFunction | aCallback, | |||
TAny * | aPtr | |||
) |
The event manager contains a number of callback registrations, each of which binds a function and pointer (normally an object) to a particular kind of event. Registrations can be bound to all events on a stream.
If a function is registered for a particular event, it will be called when that event occurs. One callback function can be associated with more than 1 callback registration. Callback functions take a pointer argument which was supplied as part of the registration
TUint aType | Event type |
TRtpCallbackFunction aCallback | Callback object |
TAny * aPtr | Pointer to data that needs to be passed to the callback function |
void | RegisterEventCallbackL | ( | TRtpEventType | aType, |
void(*)(T *, const TRtpEvent &) | aCallback, | |||
T * | aPtr, | |||
TRtpOneShotness | aOneShot, | |||
TInt | aParameter | |||
) | [inline] |
Registers a callback for the specified event.
Some compilers may not support templated member functions. A static version of this function is available that offers the same behaviour: RegisterEventCallbackL( RRtpSession ,TRtpEventType,void (*aCallback)(T*, const TRtpEvent &),T*,TRtpOneShotness,TInt)
TRtpEventType aType | The type of event. |
void(*)(T *, const TRtpEvent &) aCallback | The callback function. The function is templated, and is prototyped to take a pointer to an object of the template type and a const reference to a TRtpEvent. The function returns void. |
T * aPtr | A pointer that is passed to the callback function when that function is called. |
TRtpOneShotness aOneShot | Indicates whether the callback function is only called once, or can be called more than once. |
TInt aParameter | A parameter to be passed to the registration function. The meaning of this depends entirely on the event type. The parameter is optional - the other overload of this function is available for registrations that don't need to pass a parameter. |
void | RegisterEventCallbackL | ( | TRtpEventType | aType, |
void(*)(T *, const TRtpEvent &) | aCallback, | |||
T * | aPtr, | |||
TRtpOneShotness | aOneShot = ERtpNotOneShot | |||
) | [inline] |
Registers a callback for the specified event.
Some compilers may not support templated member functions. A static version of this function is available that offers the same behaviour: RegisterEventCallbackL( RRtpSession ,TRtpEventType,void (*aCallback)(T*, const TRtpEvent &),T*,TRtpOneShotness)
TRtpEventType aType | The type of event. |
void(*)(T *, const TRtpEvent &) aCallback | The callback function. The function is templated, and is prototyped to take a pointer to an object of the template type and a const reference to a TRtpEvent. The function returns void. |
T * aPtr | A pointer that is passed to the callback function when that function is called. |
TRtpOneShotness aOneShot = ERtpNotOneShot | Indicates whether the callback function is only called once, or can be called more than once. If not specified, the default is to allow the callback function to be called more than once. |
IMPORT_C RSocket * | RtcpSocket | ( | ) |
Gets a handle to the RTCP socket; it provides a direct access to the functionality of RTCP socket.
Gets a handle to the RTCP socket; it provides a direct access to the functionality of RTCP socket.
IMPORT_C TInt | RtcpStatistics | ( | TUint32 | aSsrc, |
TRtcpStatistics & | aRtcpStatistics | |||
) |
Gets the remote RTCP Statistics for the current RTP session
Gets the remote RTCP Staistics for the current RTP session
TUint32 aSsrc | |
TRtcpStatistics & aRtcpStatistics |
IMPORT_C RSocket * | RtpSocket | ( | ) |
Gets a handle to the RTP socket; it provides a direct access to the functionality of RTP socket.
Gets a handle to the RTP socket; it provides a direct access to the functionality of RTP socket.
IMPORT_C void | SendAPPL | ( | const TDesC8 & | aName, |
const TDesC8 & | aAppData = KNullDesC8 , | |||
TUint8 | aSubType = 0 | |||
) |
Sends an APP (Application Defined) RTCP Packet.
The packet is sent immediately.
If used with RTCP auto-send, the function disrupts the auto-send intervals. Note however that Symbian reserves the right to fix this.
Sends an RTCP APP packet.
const TDesC8 & aName | Application name(4-bytes) |
const TDesC8 & aAppData = KNullDesC8 | Application specific data |
TUint8 aSubType = 0 | Application defined subtype |
IMPORT_C void | SendDataL | ( | TBool | aSocketType, |
const TDesC8 & | aData, | |||
TRequestStatus & | aStatus | |||
) |
Send a non-RTP (control) data packet asynchronously
Send a non-RTP (control) data packet asynchronously
TBool aSocketType | SocketType that tells whether non RTP data has to go through RTP or RTCP socket |
const TDesC8 & aData | Non RTP data that has to be sent |
TRequestStatus & aStatus | Tells whether the data has been sent successfully |
IMPORT_C void | SendRTCPPacketL | ( | TDesC8 & | aPacket | ) |
Sends an RTCP packet now.
Calling this function doesn't make much sense if auto-send is on, as it will result in packets being sent at rather incoherent intervals.
Example:
If every report has go with CNAME,LOC and PRIV... then set flags as fallows..
SDES Flags: 1 2 3 4 5 6 7 8 1 0 0 0 1 0 0 1
TRtpSendPacketType Sends an RTCP packet now.
Calling this function doesn't make much sense if auto-send is on, as it will result in packets being sent at rather incoherent intervals.
TDesC8 & aPacket | The RTCP packet to be sent |
IMPORT_C RRtpSendSource | SendSource | ( | ) |
Gets the handle to the send stream object associated with this session.
The send stream object is the one created in a previous call to NewSendSourceL() . If the send stream object has not been created, then the returned handle will refer to a closed send stream.
RRtpSendSource NewSendSourceL() Returns the existing send stream handle.
As the send stream is an active object, it cannot handle request completion events until control returns to the active scheduler. Typically, clients will want to add event registrations before that.
IMPORT_C void | SetBandwidth | ( | TUint | aBandwidth | ) |
Sets the estimated bandwidth used by the session.
This is used to decide when to send RTCP status packets. The default value is read from a resource file and should be a reasonably sensible default based on the maximum bandwidth of the handset.
Sets the estimated bandwidth used by the session.
This is used to decide when to send RTCP status packets. The default value is read from a resource file and should be a reasonably sensible default based on the maximum bandwidth of the handset.
TUint aBandwidth | The bandwidth in bps. |
IMPORT_C void | SetMaxRXSize | ( | TInt | aMaxRXSize | ) |
Sets the expected maximum size of a received packet.
This does not affect the packet that is being downloaded or is being waited for, so it is entirely possible that the first packet received after correctly setting the receive packet size will still overflow.
TInt aMaxRXSize | The new expected maximum size. |
IMPORT_C TInt | SetPRIVL | ( | const TDesC8 & | aPrefix, |
const TDesC8 & | aValue | |||
) |
Sets the data associated with the PRIV (Private Extensions) SDES item.
Stores an SDES PRIV packet information to be sent in the impending timer-exprity event.
IMPORT_C void | SetPrePostProcessingRegisterCallback | ( | MPrePostProcessingCallback * | aPrePostProcessingCallback | ) |
Pre and Post processing function for RTP and RTCP packets
If a function is registered for a particular event, it will be called when that event occurs. One callback function can be associated with more than 1 callback registration. Callback functions take a pointer argument which was supplied as part of the registration
MPrePostProcessingCallback * aPrePostProcessingCallback |
IMPORT_C void | SetRTCPAutoSend | ( | TBool | aAutoSend | ) |
Enables or disables the automatic sending of RTCP SR (Sender Report), RR (Receiver Report), and SDES (Source Description) packets.
Note that if automatic sending is not enabled and RTCP sending is required, then explicit calls to SendRTCPPacketL() will be required.
RRtpSession::SendRTCPPacketL() Enables or disables the automatic sending of RTCP SR (Sender Report), RR (Receiver Report), and SDES (Source Description) packets.
Note that if automatic sending is not enabled and RTCP sending is required, then explicit calls to SendRTCPPacketL() will be required.
TBool aAutoSend | ETrue, if RTCP packets need to be send automatically EFalse otherwise. |
IMPORT_C void | SetRTPTimeConversion | ( | TUint | aNow, |
TUint | aConversion | |||
) |
Supplies information about the profile-specific RTP timestamps.
This is used to generate the RTP timestamps in RTCP packets. It is not used to generate timestamps in RTP packets as they must accurately relate to the time of the sample.
Supplies information about the profile-specific RTP timestamps.
This is used to generate the RTP timestamps in RTCP packets. It is not used to generate timestamps in RTP packets as they must accurately relate to the time of the sample.
IMPORT_C void | SetRemoteAddress | ( | const TSockAddr & | aRemoteAddr | ) |
Sets the remote RTP address for the current RTP session
Sets the remote RTP address for the current active session
const TSockAddr & aRemoteAddr | Remote RTP address to be set |
IMPORT_C void | SetRemoteRtcpPort | ( | TUint | aPort | ) |
Sets the remote RTCP port for the current active RTP session
Sets the remote RTCP port for the current active RTP session
TUint aPort |
IMPORT_C void | SetRtcpInterval | ( | TTimeIntervalMicroSeconds32 & | aInterval | ) |
Sets the RTCP Auto Send interval. This disables the RFC based calculation of RTCP intervals. To re-enable auto calculation, set the interval to zero.
Sets the RTCP Auto Send interval. This disables the RFC based calculation of RTCP intervals. To re-enable auto calculation, set the interval to zero.
TTimeIntervalMicroSeconds32 & aInterval | Time interval after which an RTCP auto-send will take place |
IMPORT_C void | SetRtpStreamParameters | ( | TInt | aMinSequential, |
TInt | aMaxMisorder, | |||
TInt | aMaxDropout | |||
) |
Sets the number of sequential packets that must be received before a stream is considered good.
Sets the maximum number of dropped packets to be considered a dropout, as opposed to an ended and restarted stream.
Sets the maximum number of packets by which a packet can be delayed before it is considered dropped.
Sets the maximum number of dropped packets to be considered a dropout, as opposed to an ended and restarted stream.
Sets the maximum number of packets by which a packet can be delayed before it is considered dropped.
IMPORT_C TInt | SetSDESL | ( | TInt | aType, |
const TDesC8 & | aValue | |||
) |
Sets the data associated with the specified RTCP SDES (Source Description) item for sending in the next SDES packet only.
The function Leaves if duplicate values are set for the same CNAME.
The SDES Items set by this API is valid only till the stack sends the next RTCP Packet. The list of items(except CNAME and NONE) is flushed after every RTCP report is sent
Note a that the PRIV (Private Extensions) SDES item is not supported by this mechanism.
NOTE - This call cannot be used to set a different CNAME for this session. The default CNAME is send with every SDES packets.
Stores an SDES packet information to be sent in the impending timer-exprity event.
IMPORT_C TInt | SetSamplingRate | ( | TInt | aPayloadType, |
TUint | aSamplingRate | |||
) |
Sets the sampling rate for a Particular Payloadtype Sets the sampling rate for a Particular Payloadtype
TBool | operator!= | ( | RRtpSession | aThat | ) | const [inline] |
Tests whether this session handle represents a different session to the one represented by the specified handle.
RRtpSession aThat | The handle of the session to be compared. |
TBool | operator== | ( | RRtpSession | aThat | ) | const [inline] |
Tests whether this session handle represents the same session as the one represented by the specified handle.
RRtpSession aThat | The handle of the session to be compared. |
A set of bit values passed as a parameter to RRtpSession::SendRTCPPacketL() to specify the SDES (Source Description) items that are to be sent with the packet. One or more of these may be set.
ERtcpPacketCNAME = 1 |
Canonical End-Point Identifier SDES Item. |
ERtcpPacketNAME = 2 |
User Name SDES Item. |
ERtcpPacketEMAIL = 4 |
Electronic Mail Address SDES Item. |
ERtcpPacketPHONE = 8 |
Phone Number SDES Item. |
ERtcpPacketLOC = 16 |
Geographic User Location SDES Item. |
ERtcpPacketTOOL = 32 |
Application or Tool Name SDES Item |
ERtcpPacketNOTE = 64 |
Notice/Status SDES Item |
ERtcpPacketPRIV = 128 |
Private Extensions SDES Item |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.