epoc32/include/mw/rtp.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    28 class RRtpCSRCs;
    28 class RRtpCSRCs;
    29 class CRtpSession;
    29 class CRtpSession;
    30 class CRtpReceiveSource;
    30 class CRtpReceiveSource;
    31 class CRtpSendSource;
    31 class CRtpSendSource;
    32 class TRtpPacket;
    32 class TRtpPacket;
       
    33 class TRtpSendPacket;
    33 
    34 
    34 class RRtcpRRPart;
    35 class RRtcpRRPart;
    35 class RRtcpSRPart;
    36 class RRtcpSRPart;
       
    37 class TRtcpStatistics;
       
    38 class MPrePostProcessingCallback;
    36 
    39 
    37 /**
    40 /**
    38 @publishedAll
    41 @publishedAll
    39 @released
    42 @released
    40 
    43 
   105 	is smaller than its header.
   108 	is smaller than its header.
   106 	
   109 	
   107 	When this event occurs, the packet is deleted.
   110 	When this event occurs, the packet is deleted.
   108 	*/
   111 	*/
   109 	ERtpUndersizedPacket = 0x105,
   112 	ERtpUndersizedPacket = 0x105,
   110  
   113 	
   111  	
   114 	/* An event type that indicates that an non RTP packet has been received */
       
   115 	ENonRtpDataReceived = 0x106,
       
   116 	
       
   117 	/* An event type that indicates that an non RTCP packet has been received */
       
   118 	ENonRtcpDataReceived = 0x107,
   112 	/**
   119 	/**
   113 	Not an event type, but defines the upper limit for session event
   120 	Not an event type, but defines the upper limit for session event
   114 	type values.
   121 	type values.
   115     */
   122     */
   116 	ERtpSessionEventEnd  = 0x1ff,
   123 	ERtpSessionEventEnd  = 0x1ff,
   287 
   294 
   288 
   295 
   289 
   296 
   290 /**
   297 /**
   291 @publishedAll
   298 @publishedAll
       
   299 @released
   292 */
   300 */
   293 typedef void (*TRtpCallbackFunction)(TAny* aPtr, const TRtpEvent& aEvent);
   301 typedef void (*TRtpCallbackFunction)(TAny* aPtr, const TRtpEvent& aEvent);
   294 
   302 
   295 
   303 
   296 
   304 
   297 /**
   305 /**
   298 @internalComponent
   306 @publishedAll
   299 */
   307 */
   300 const TInt KRtpNoParameter = KRequestPending;
   308 const TInt KRtpNoParameter = KRequestPending;
   301 
   309 
   302 
   310 
   303 //Needed for recv-only option for RTP or RTCP
   311 //Needed for recv-only option for RTP or RTCP
   318 A value that can be passed as the second parameter in a call to either
   326 A value that can be passed as the second parameter in a call to either
   319 RRtpSendSource::NewSendPacketL() or RRtpSendSource::NewSendPacketLC()
   327 RRtpSendSource::NewSendPacketL() or RRtpSendSource::NewSendPacketLC()
   320 to indicate that no exension is required for the RTP send packet.
   328 to indicate that no exension is required for the RTP send packet.
   321 */
   329 */
   322 const TInt KRtpNoExtension = -1;
   330 const TInt KRtpNoExtension = -1;
   323 
       
   324 
       
   325 
   331 
   326 /**
   332 /**
   327 @publishedAll
   333 @publishedAll
   328 @released
   334 @released
   329 
   335 
   410 						TSockAddr& aRemoteAddr,
   416 						TSockAddr& aRemoteAddr,
   411 						TInt aMaxRXSize, TInt aPriority = EPriorityNormal, 
   417 						TInt aMaxRXSize, TInt aPriority = EPriorityNormal, 
   412 						const TDesC8& aCNAME = KNullDesC8);
   418 						const TDesC8& aCNAME = KNullDesC8);
   413 
   419 
   414     /**
   420     /**
   415 	@publishedPartner
   421 	@publishedAll
   416 	@released
   422 	@released
   417    	
   423    	
   418     Opens the session and initialises it.
   424     Opens the session and initialises it.
   419 
   425 
   420     No events will be generated until after control returns to the
   426     No events will be generated until after control returns to the
   434 						const TDesC8& aCNAME = KNullDesC8);
   440 						const TDesC8& aCNAME = KNullDesC8);
   435 
   441 
   436 	IMPORT_C void OpenL(RSocket& aSocket, TInt aMaxRXSize,
   442 	IMPORT_C void OpenL(RSocket& aSocket, TInt aMaxRXSize,
   437 						TInt aPriority = EPriorityNormal);
   443 						TInt aPriority = EPriorityNormal);
   438 
   444 
       
   445    
       
   446     /** 
       
   447 	@internalComponent
       
   448     
       
   449 	Opens the session and initialises it.
       
   450 
       
   451     No events will be generated until after control returns to the
       
   452     active scheduler. The client has this time to initialise the
       
   453     object by adding event callbacks.
       
   454 
       
   455 	This API uses the RTP Stack implemented as a CF Prorotocol. The SubConnection
       
   456 	which is passed to the API should be initialised with the RTP Params. 
       
   457 
       
   458     @param aServer         Socket Server. 
       
   459     @param aLocalAddr      The maximum size of a received packet.
       
   460     @param aRemoteAddr     The RTCP socket.
       
   461     @param aMaxRXSize      The maximum size of a received packet.
       
   462     @param aSubConnection  The subconnection with RTP Parametrs set on it.
       
   463     @param aCName          The CNAME. It needs to be same as the one set using the API:
       
   464     					   CSubConRTPGenericParamSet::SetCNAMEL(const TDesC8& aCName).
       
   465     					   If the descriptor is KNullDesC8,the RTCP session is not created.
       
   466                            
       
   467     */
       
   468     
       
   469     #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   470     IMPORT_C void OpenL(RSocketServ& aServer, TSockAddr& aLocalAddr,
       
   471 						TSockAddr& aRemoteAddr,
       
   472 						TInt aMaxRXSize, RSubConnection& aSubConnection, TInt aPriority = EPriorityNormal, 
       
   473 						const TDesC8& aCNAME = KNullDesC8);
       
   474 	#endif
       
   475 
       
   476 	
       
   477 
   439 	IMPORT_C void Close();
   478 	IMPORT_C void Close();
   440 
   479 
   441 	IMPORT_C void SetMaxRXSize(TInt aMaxRXSize);
   480 	IMPORT_C void SetMaxRXSize(TInt aMaxRXSize);
   442 
   481 
   443 	IMPORT_C TInt MaxRXSize();
   482 	IMPORT_C TInt MaxRXSize();
   444     
   483     
   445     
   484     
   446     /** 
   485     /** 
   447 	@publishedPartner
   486 	@publishedAll
   448 	@released
   487 	@released
   449 	
   488 	
   450     Sets the estimated bandwidth used by the session.
   489     Sets the estimated bandwidth used by the session.
   451     
   490     
   452     This is used to decide when to send RTCP status packets.
   491     This is used to decide when to send RTCP status packets.
   457     */
   496     */
   458 	IMPORT_C void SetBandwidth(TUint aBandwidth);
   497 	IMPORT_C void SetBandwidth(TUint aBandwidth);
   459 
   498 
   460 
   499 
   461     /**
   500     /**
   462 	@publishedPartner
   501 	@publishedAll
   463 	@released
   502 	@released
   464    	
   503    	
   465    	Supplies information about the profile-specific RTP
   504    	Supplies information about the profile-specific RTP
   466     timestamps. 
   505     timestamps. 
   467     
   506     
   542 				static_cast<TAny*>(aPtr));
   581 				static_cast<TAny*>(aPtr));
   543 			}
   582 			}
   544 
   583 
   545 
   584 
   546 	/**
   585 	/**
   547 	@publishedPartner
   586 	@publishedAll
   548 	@released
   587 	@released
   549 	
   588 	
   550 	Gets an array contining the most recent RR (Receiver Report) from
   589 	Gets an array contining the most recent RR (Receiver Report) from
   551 	all hosts who are reporting on our send stream.
   590 	all hosts who are reporting on our send stream.
   552 	
   591 	
   554 	*/
   593 	*/
   555 	IMPORT_C RRtcpRRPart GetRRs();
   594 	IMPORT_C RRtcpRRPart GetRRs();
   556 
   595 
   557 
   596 
   558 	/**
   597 	/**
   559 	@publishedPartner
   598 	@publishedAll
   560 	@released
   599 	@released
   561 	
   600 	
   562 	Gets the data associated with the specified RTCP SDES (Source Description)
   601 	Gets the data associated with the specified RTCP SDES (Source Description)
   563 	item.
   602 	item.
   564 
   603 
   574 	*/
   613 	*/
   575 	IMPORT_C TInt GetSDES(const TInt aType, TDes8& aValue);
   614 	IMPORT_C TInt GetSDES(const TInt aType, TDes8& aValue);
   576 
   615 
   577 	
   616 	
   578 	/**
   617 	/**
   579 	@publishedPartner
   618 	@publishedAll
   580 	@released
   619 	@released
   581 	
   620 	
   582 	Sets the data associated with the specified RTCP SDES (Source Description)
   621 	Sets the data associated with the specified RTCP SDES (Source Description)
   583 	item for sending in the next SDES packet only.
   622 	item for sending in the next SDES packet only.
   584 
   623 
   585 	The function Leaves if duplicate values are set for the same CNAME.
   624 	The function Leaves if duplicate values are set for the same CNAME.
   586 	
   625 
       
   626     The SDES Items set by this API is valid only till the stack sends the
       
   627     next RTCP Packet. The list of items(except CNAME and NONE) is flushed 
       
   628 	after every RTCP report is sent
       
   629 
   587 	Note a that the PRIV (Private Extensions) SDES item is not supported
   630 	Note a that the PRIV (Private Extensions) SDES item is not supported
   588 	by this mechanism.
   631 	by this mechanism.
   589 	
   632 	
   590 	NOTE - This call cannot be used to set a different CNAME for this session.
   633 	NOTE - This call cannot be used to set a different CNAME for this session.
   591 	The default CNAME is send with every SDES packets.
   634 	The default CNAME is send with every SDES packets.
   597 			KErrNone if the operation is successful
   640 			KErrNone if the operation is successful
   598 	*/
   641 	*/
   599 	IMPORT_C TInt SetSDESL(TInt aType, const TDesC8& aValue);
   642 	IMPORT_C TInt SetSDESL(TInt aType, const TDesC8& aValue);
   600 
   643 
   601 	/**
   644 	/**
   602 	@publishedPartner
   645 	@publishedAll
   603 	@released
   646 	@released
   604 	
   647 	
   605 	Sets the data associated with the PRIV (Private Extensions) SDES item.
   648 	Sets the data associated with the PRIV (Private Extensions) SDES item.
   606 	
   649 	
   607 	@param aPrefix The value identfying the RTCP SDES item.
   650 	@param aPrefix The value identfying the RTCP SDES item.
   613 	*/
   656 	*/
   614 	IMPORT_C TInt SetPRIVL(const TDesC8& aPrefix, const TDesC8& aValue);
   657 	IMPORT_C TInt SetPRIVL(const TDesC8& aPrefix, const TDesC8& aValue);
   615 
   658 
   616     
   659     
   617 	/**
   660 	/**
   618 	@publishedPartner
   661 	@publishedAll
   619 	@released
   662 	@released
   620 	Sends an APP (Application Defined) RTCP Packet.
   663 	Sends an APP (Application Defined) RTCP Packet.
   621 	
   664 	
   622 	The packet is sent immediately.
   665 	The packet is sent immediately.
   623 	
   666 	
   629 	*/
   672 	*/
   630 	IMPORT_C void SendAPPL(const TDesC8& aName, const TDesC8& aAppData = KNullDesC8, TUint8 aSubType = 0);
   673 	IMPORT_C void SendAPPL(const TDesC8& aName, const TDesC8& aAppData = KNullDesC8, TUint8 aSubType = 0);
   631 
   674 
   632 
   675 
   633 	/**
   676 	/**
   634 	@publishedPartner
   677 	@publishedAll
   635 	@released
   678 	@released
   636 	
   679 	
   637 	Enables or disables the automatic sending of RTCP SR (Sender Report),
   680 	Enables or disables the automatic sending of RTCP SR (Sender Report),
   638 	RR (Receiver Report), and SDES (Source Description) packets.
   681 	RR (Receiver Report), and SDES (Source Description) packets.
   639 	
   682 	
   647 	*/
   690 	*/
   648 	IMPORT_C void SetRTCPAutoSend(TBool aAutoSend);
   691 	IMPORT_C void SetRTCPAutoSend(TBool aAutoSend);
   649 
   692 
   650 
   693 
   651 	/** 
   694 	/** 
   652 	@publishedPartner
   695 	@publishedAll
   653 	@released
   696 	@released
   654 	
   697 	
   655 	Gets the RTCP Auto Send status. 
   698 	Gets the RTCP Auto Send status. 
   656 
   699 
   657 	@return True, if RTCP SR, RR and SDES packets are automatically sent,
   700 	@return True, if RTCP SR, RR and SDES packets are automatically sent,
   660 	@see RRtpSession::SetRTCPAutoSend()
   703 	@see RRtpSession::SetRTCPAutoSend()
   661 	*/
   704 	*/
   662 	IMPORT_C TBool RTCPAutoSend() const;
   705 	IMPORT_C TBool RTCPAutoSend() const;
   663 
   706 
   664 	/** 
   707 	/** 
   665 	@publishedPartner
   708 	@publishedAll
   666 	@released
   709 	@released
   667 	
   710 	
   668 	Sets the RTCP Auto Send interval.
   711 	Sets the RTCP Auto Send interval.
   669 	This disables the RFC based calculation of RTCP intervals.
   712 	This disables the RFC based calculation of RTCP intervals.
   670 	To re-enable auto calculation, set the interval to zero.
   713 	To re-enable auto calculation, set the interval to zero.
   672   	@param aInterval Time interval after which an RTCP auto-send will take place
   715   	@param aInterval Time interval after which an RTCP auto-send will take place
   673 	*/
   716 	*/
   674 	IMPORT_C void SetRtcpInterval(TTimeIntervalMicroSeconds32& aInterval);
   717 	IMPORT_C void SetRtcpInterval(TTimeIntervalMicroSeconds32& aInterval);
   675 	
   718 	
   676 	/** 
   719 	/** 
   677 	@publishedPartner
   720 	@publishedAll
   678 	@released	
   721 	@released	
   679 	Enables Receive only option for rtp or rtcp
   722 	Enables Receive only option for rtp or rtcp
   680 
   723 
   681 	@param aRtpOrRtcp Takes the values from the enum TPacketType
   724 	@param aRtpOrRtcp Takes the values from the enum TPacketType
   682 
   725 
   683 	@see RRtpSession::DontReceive()
       
   684 	*/
   726 	*/
   685 	IMPORT_C void DontReceive(TInt aRtpOrRtcp);
   727 	IMPORT_C void DontReceive(TInt aRtpOrRtcp);
   686 	
   728 	
   687 	/** 
   729 	/** 
   688 	@publishedPartner
   730 	@publishedAll
   689 	@released
   731 	@released
   690     Sends an RTCP packet now. 
   732     Sends an RTCP packet now. 
   691 
   733 
   692 	Calling this function doesn't make much sense if auto-send is
   734 	Calling this function doesn't make much sense if auto-send is
   693 	on, as it will result in packets being sent at rather
   735 	on, as it will result in packets being sent at rather
   697 	                    the TRtpSendPacketType enum. The packet sent will
   739 	                    the TRtpSendPacketType enum. The packet sent will
   698 	                    contain a SR (Sender Report) or RR (Receiver Report),
   740 	                    contain a SR (Sender Report) or RR (Receiver Report),
   699 	                    depending on whether any packets have actually been
   741 	                    depending on whether any packets have actually been
   700 	                    sent, together with all SDES (Source Description) items
   742 	                    sent, together with all SDES (Source Description) items
   701 	                    specified by this parameter.
   743 	                    specified by this parameter.
       
   744 	                    
       
   745 	                    Example:
       
   746 	                    
       
   747 	                    If every report has go with CNAME,LOC and PRIV...
       
   748 	                    then set flags as fallows..
       
   749 	                    
       
   750 	                    SDES Flags:
       
   751 	                    1  2  3  4  5  6  7 8 
       
   752 	                    1  0  0  0  1  0  0 1
       
   753 	                   
   702 
   754 
   703     @see TRtpSendPacketType
   755     @see TRtpSendPacketType
   704 	*/
   756 	*/
   705 	IMPORT_C void SendRTCPPacketL(TDesC8& aPacket);
   757 	IMPORT_C void SendRTCPPacketL(TDesC8& aPacket);
   706 
   758 
   707 	
   759 	
   708 	/**
   760 	/**
   709 	@publishedPartner
   761 	@publishedAll
   710 	@released
   762 	@released
   711 	Creates a new send stream, and returns the send stream handle.
   763 	Creates a new send stream, and returns the send stream handle.
   712 
   764 
   713 	Only one send stream per session is permitted, which means that you must not
   765 	Only one send stream per session is permitted, which means that you must not
   714 	call this function if the send stream has already been created.
   766 	call this function if the send stream has already been created.
   725 	*/
   777 	*/
   726 	IMPORT_C RRtpSendSource NewSendSourceL(); 
   778 	IMPORT_C RRtpSendSource NewSendSourceL(); 
   727 
   779 
   728 
   780 
   729 	/**
   781 	/**
   730 	@publishedPartner
   782 	@publishedAll
   731 	@released
   783 	@released
   732 	
   784 	
   733 	Gets the handle to the send stream object associated with this session.
   785 	Gets the handle to the send stream object associated with this session.
   734 
   786 
   735 	The send stream object is the one created in a previous call
   787 	The send stream object is the one created in a previous call
   742     */
   794     */
   743 	IMPORT_C RRtpSendSource SendSource(); 
   795 	IMPORT_C RRtpSendSource SendSource(); 
   744 
   796 
   745 
   797 
   746     /**
   798     /**
   747 	@publishedPartner
   799 	@publishedAll
   748 	@released
   800 	@released
   749     
   801     
   750     Sets the number of sequential packets that must be received
   802     Sets the number of sequential packets that must be received
   751 	before a stream is considered good.
   803 	before a stream is considered good.
   752 	
   804 	
   768 
   820 
   769 	inline TBool operator == (RRtpSession aThat) const;
   821 	inline TBool operator == (RRtpSession aThat) const;
   770 	inline TBool operator != (RRtpSession aThat) const;
   822 	inline TBool operator != (RRtpSession aThat) const;
   771 
   823 
   772 	/**
   824 	/**
   773 	@publishedPartner
   825 	@publishedAll
   774 	@released
   826 	@released
   775 
   827 
   776     The event manager contains a number of callback registrations, each of which 
   828     The event manager contains a number of callback registrations, each of which 
   777 	binds a function and pointer (normally an object) to a particular kind of
   829 	binds a function and pointer (normally an object) to a particular kind of
   778     event. Registrations can be bound to all events on a stream.
   830     event. Registrations can be bound to all events on a stream.
   794 										  TRtpCallbackFunction aCallback, 
   846 										  TRtpCallbackFunction aCallback, 
   795 										  TAny* aPtr, 
   847 										  TAny* aPtr, 
   796 										  TInt aParameter);
   848 										  TInt aParameter);
   797 
   849 
   798 	/**
   850 	/**
   799 	@publishedPartner
   851 	@publishedAll
   800 	@released
   852 	@released
   801 
   853 
   802     The event manager contains a number of callback registrations, each of which 
   854     The event manager contains a number of callback registrations, each of which 
   803 	binds a function and pointer (normally an object) to a particular kind of
   855 	binds a function and pointer (normally an object) to a particular kind of
   804     event. Registrations can be bound to all events on a stream.
   856     event. Registrations can be bound to all events on a stream.
   815 	@param aPtr Pointer to data that needs to be passed to the callback function
   867 	@param aPtr Pointer to data that needs to be passed to the callback function
   816 	*/
   868 	*/
   817 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
   869 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
   818 										  TRtpCallbackFunction aCallback, 
   870 										  TRtpCallbackFunction aCallback, 
   819 										  TAny* aPtr);
   871 										  TAny* aPtr);
       
   872 	
       
   873 	/**
       
   874 	@publishedAll
       
   875 	@released
       
   876  
       
   877 	Sets the sampling rate for a Particular Payloadtype
       
   878 	@param aPayloadType  PayloadType ( Should be between 96-127 ) see RFC 3551
       
   879 	@param asamplingrate Sampling rate is in rtp ticks per msecs. ( eg for AMR-NB give 8000).
       
   880 	*/	
       
   881 	IMPORT_C TInt SetSamplingRate(TInt aPayloadType, TUint aSamplingRate);
       
   882 	/**
       
   883 	@publishedAll
       
   884 	@released
       
   885 
       
   886     Gets a handle to the RTP socket; 
       
   887 	it provides a direct access to the functionality of RTP socket.
       
   888 
       
   889 	@return The RTP socket for the current session
       
   890 		
       
   891 	*/									  
       
   892     IMPORT_C RSocket* RtpSocket();
       
   893     
       
   894     /**
       
   895 	@publishedAll
       
   896 	@released
       
   897 
       
   898     Gets a handle to the RTCP socket; 
       
   899 	it provides a direct access to the functionality of RTCP socket.
       
   900 
       
   901 	@return The RTCP socket for the current session
       
   902 		
       
   903 	*/
       
   904 	IMPORT_C RSocket* RtcpSocket();
       
   905 	
       
   906 	/**
       
   907 	@publishedAll
       
   908 	@released
       
   909 
       
   910     Send a non-RTP (control) data packet asynchronously
       
   911     
       
   912     @param aSocketType SocketType that tells whether non RTP data has to go through RTP or RTCP socket
       
   913     
       
   914     @param aData Non RTP data that has to be sent
       
   915     
       
   916 	@param aStatus Tells whether the data has been sent successfully
       
   917 
       
   918 	*/
       
   919  	IMPORT_C void SendDataL(TBool aSocketType, const TDesC8& aData, TRequestStatus&  aStatus);
       
   920  	
       
   921  	/**
       
   922 	@publishedAll
       
   923 	@released
       
   924 
       
   925     Sets the remote RTP address for the current RTP session
       
   926     
       
   927     @param aRemoteAddr Remote RTP address to be set
       
   928     
       
   929     */
       
   930 	
       
   931 	IMPORT_C void SetRemoteAddress(const TSockAddr &aRemoteAddr);
       
   932 
       
   933 	/**
       
   934 	@publishedAll
       
   935 	@released
       
   936 
       
   937     Gets the last received non RTP data, If no data found function leaves
       
   938     
       
   939     @return Returns the last received non RTP data
       
   940 	*/
       
   941 	IMPORT_C const TDesC8& NonRtpDataL();
       
   942 	
       
   943 	/**
       
   944 	@publishedAll
       
   945 	@released
       
   946 
       
   947     Gets the last received non RTCP data, If no data found function leaves
       
   948     
       
   949     @return Returns the last received non RTCP data
       
   950 	*/
       
   951 	IMPORT_C TPtr8 NonRtcpDataL();
       
   952 	
       
   953 	/**
       
   954 	@publishedAll
       
   955 	@released
       
   956 
       
   957     Disables the receipt of non RTP data
       
   958     
       
   959     */
       
   960 	
       
   961 	IMPORT_C void DisableNonRtpData();
       
   962 	
       
   963 	/**
       
   964 	@publishedAll
       
   965 	@released
       
   966 
       
   967     Sets the remote RTCP port for the current active RTP session
       
   968     
       
   969     @param Remote RTCP port value to be set
       
   970 	*/
       
   971 	
       
   972 	IMPORT_C void SetRemoteRtcpPort(TUint aPort);
       
   973 	
       
   974 	/**
       
   975 	@internalComponent
       
   976 
       
   977     Gets the remote RTCP Statistics for the current RTP session
       
   978     
       
   979     @param SSRC of the sender
       
   980     @param RTCP Statistics class that stores the RTCP statistics for the 
       
   981     current RTP session
       
   982 	*/
       
   983 	#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   984     IMPORT_C TInt RtcpStatistics(TUint32 aSsrc, TRtcpStatistics &aRtcpStatistics);
       
   985     #endif
       
   986 	
       
   987 	/**
       
   988 	@internalComponent
       
   989 
       
   990     Pre and Post processing function for RTP and RTCP packets
       
   991 
       
   992 	If a function is registered for a particular event, it will be called when 
       
   993 	that event occurs. One callback function can be associated with more than 1
       
   994 	callback registration. Callback functions take a pointer argument
       
   995 	which was supplied as part of the registration
       
   996 
       
   997     @param aType Event type
       
   998 		
       
   999 	@param aCallback Callback object
       
  1000 		
       
  1001 	@param aPtr Pointer to data that needs to be passed to the callback function
       
  1002 	*/
       
  1003 	#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
  1004 	IMPORT_C void SetPrePostProcessingRegisterCallback(MPrePostProcessingCallback* aPrePostProcessingCallback);
       
  1005 	#endif
   820 
  1006 
   821  private:
  1007  private:
   822 	friend class TRtpEvent;
  1008 	friend class TRtpEvent;
       
  1009 	#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
  1010 		friend class RRtpSession_Internal;
       
  1011 	#endif
   823 	CRtpSession* iPtr;
  1012 	CRtpSession* iPtr;
       
  1013 	
   824 	// Note: Comments that start with //\ are pseudo-variables used to get
  1014 	// Note: Comments that start with //\ are pseudo-variables used to get
   825 	// Doxygen collaboration diagrams to look right. Ignore them.
  1015 	// Doxygen collaboration diagrams to look right. Ignore them.
   826 	//\ RRtpSendSource sndSource_1_01;
  1016 	//\ RRtpSendSource sndSource_1_01;
   827 	//\ RRtpReceiveSource rcvSource_1_n;
  1017 	//\ RRtpReceiveSource rcvSource_1_n;
   828 	//\ TRtpCallback callbacks_1_n;
  1018 	//\ TRtpCallback callbacks_1_n;
   899 
  1089 
   900 	IMPORT_C TBool IsSending();
  1090 	IMPORT_C TBool IsSending();
   901 	IMPORT_C void SetPayloadType(TUint aPayloadType);
  1091 	IMPORT_C void SetPayloadType(TUint aPayloadType);
   902 	IMPORT_C void SetDefaultPayloadSize(TInt aPayloadSize);
  1092 	IMPORT_C void SetDefaultPayloadSize(TInt aPayloadSize);
   903 	/**
  1093 	/**
   904 	@publishedPartner
  1094 	@publishedAll
   905 	@released
  1095 	@released
   906 	
  1096 	
   907 	Sends a Bye RTCP packet.
  1097 	Sends a Bye RTCP packet.
   908 	
  1098 	
   909 	@param aReason The reason for sending the Bye RTCP packet.
  1099 	@param aReason The reason for sending the Bye RTCP packet.
   916 
  1106 
   917 	inline TBool operator == (RRtpSendSource aThat) const;
  1107 	inline TBool operator == (RRtpSendSource aThat) const;
   918 	inline TBool operator != (RRtpSendSource aThat) const;
  1108 	inline TBool operator != (RRtpSendSource aThat) const;
   919 	
  1109 	
   920 	/**
  1110 	/**
   921 	@publishedPartner
  1111 	@publishedAll
   922 	@released
  1112 	@released
   923 
  1113 
   924     The event manager contains a number of callback registrations, each of which 
  1114     The event manager contains a number of callback registrations, each of which 
   925 	binds a function and pointer (normally an object) to a particular kind of
  1115 	binds a function and pointer (normally an object) to a particular kind of
   926     event. Registrations can be bound to all events on a stream.
  1116     event. Registrations can be bound to all events on a stream.
   942 										  TRtpCallbackFunction aCallback, 
  1132 										  TRtpCallbackFunction aCallback, 
   943 										  TAny* aPtr, 
  1133 										  TAny* aPtr, 
   944 										  TInt aParameter);
  1134 										  TInt aParameter);
   945 
  1135 
   946 	/**
  1136 	/**
   947 	@publishedPartner
  1137 	@publishedAll
   948 	@released
  1138 	@released
   949 
  1139 
   950     The event manager contains a number of callback registrations, each of which 
  1140     The event manager contains a number of callback registrations, each of which 
   951 	binds a function and pointer (normally an object) to a particular kind of
  1141 	binds a function and pointer (normally an object) to a particular kind of
   952     event. Registrations can be bound to all events on a stream.
  1142     event. Registrations can be bound to all events on a stream.
   963 	@param aPtr Pointer to data that needs to be passed to the callback function
  1153 	@param aPtr Pointer to data that needs to be passed to the callback function
   964 	*/
  1154 	*/
   965 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
  1155 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
   966 										  TRtpCallbackFunction aCallback, 
  1156 										  TRtpCallbackFunction aCallback, 
   967 										  TAny* aPtr);
  1157 										  TAny* aPtr);
       
  1158 										  
   968  private:
  1159  private:
   969 	friend class RRtpSession;
  1160 	friend class RRtpSession;
   970 	friend class TRtpEvent;
  1161 	friend class TRtpEvent;
   971 	CRtpSendSource* iPtr;
  1162 	CRtpSendSource* iPtr;
   972 	// Note: Comments that start with //\ are pseudo-variables used to get
  1163 	// Note: Comments that start with //\ are pseudo-variables used to get
  1024 				reinterpret_cast<TRtpCallbackFunction>(aCallback),
  1215 				reinterpret_cast<TRtpCallbackFunction>(aCallback),
  1025 				static_cast<TAny*>(aPtr));
  1216 				static_cast<TAny*>(aPtr));
  1026 	}
  1217 	}
  1027 
  1218 
  1028 	/**
  1219 	/**
  1029 	@publishedPartner
  1220 	@publishedAll
  1030 	@released
  1221 	@released
  1031 	
  1222 	
  1032 	Gets the data associated with the specified RTCP SDES (Source Description)
  1223 	Gets the data associated with the specified RTCP SDES (Source Description)
  1033 	item.
  1224 	item.
  1034 
  1225 
  1041 	*/
  1232 	*/
  1042 	IMPORT_C TInt GetSDES(const TInt aType, TDes8& aValue);
  1233 	IMPORT_C TInt GetSDES(const TInt aType, TDes8& aValue);
  1043 
  1234 
  1044 
  1235 
  1045 	/**
  1236 	/**
  1046 	@publishedPartner
  1237 	@publishedAll
  1047 	@released
  1238 	@released
  1048 	
  1239 	
  1049 	Gets the most recent SR ((Sender Report) from this SSRC.
  1240 	Gets the most recent SR ((Sender Report) from this SSRC.
  1050  
  1241  
  1051     @return A handle to the SR.
  1242     @return A handle to the SR.
  1052     */
  1243     */
  1053 	IMPORT_C RRtcpSRPart GetSR();
  1244 	IMPORT_C RRtcpSRPart GetSR();
  1054 
  1245 
  1055 
  1246 
  1056 	/**
  1247 	/**
  1057 	@publishedPartner
  1248 	@publishedAll
  1058 	@released
  1249 	@released
  1059 	
  1250 	
  1060 	Gets the reason for a BYE packet.
  1251 	Gets the reason for a BYE packet.
  1061 	
  1252 	
  1062 	@return A descriptor contaning the BYE message. This is
  1253 	@return A descriptor contaning the BYE message. This is
  1064     */
  1255     */
  1065 	IMPORT_C TDesC8& GetByeReason();
  1256 	IMPORT_C TDesC8& GetByeReason();
  1066 
  1257 
  1067 
  1258 
  1068 	/**
  1259 	/**
  1069 	@publishedPartner
  1260 	@publishedAll
  1070 	@released
  1261 	@released
  1071 	
  1262 	
  1072 	Parameters from the last APP (Application Defined) packet.
  1263 	Parameters from the last APP (Application Defined) packet.
  1073 
  1264 
  1074   	@param aName  Four-bytes application name
  1265   	@param aName  Four-bytes application name
  1078 	IMPORT_C void GetLastApp(TPtrC8& aName, TPtrC8& aAppData, TUint& aSubType);
  1269 	IMPORT_C void GetLastApp(TPtrC8& aName, TPtrC8& aAppData, TUint& aSubType);
  1079 
  1270 
  1080 	IMPORT_C RRtpReceivePacket Packet();
  1271 	IMPORT_C RRtpReceivePacket Packet();
  1081 
  1272 
  1082 	/**
  1273 	/**
  1083 	@publishedPartner
  1274 	@publishedAll
  1084 	@released
  1275 	@released
  1085 	
  1276 	
  1086 	Gets the SSRC of the remote end
  1277 	Gets the SSRC of the remote end
  1087 
  1278 
  1088 	@return The SSRC of the remote end
  1279 	@return The SSRC of the remote end
  1091 
  1282 
  1092 	inline TBool operator == (RRtpReceiveSource aThat) const;
  1283 	inline TBool operator == (RRtpReceiveSource aThat) const;
  1093 	inline TBool operator != (RRtpReceiveSource aThat) const;
  1284 	inline TBool operator != (RRtpReceiveSource aThat) const;
  1094 
  1285 
  1095 	/**
  1286 	/**
  1096 	@publishedPartner
  1287 	@publishedAll
  1097 	@released
  1288 	@released
  1098 
  1289 
  1099     The event manager contains a number of callback registrations, each of which 
  1290     The event manager contains a number of callback registrations, each of which 
  1100 	binds a function and pointer (normally an object) to a particular kind of
  1291 	binds a function and pointer (normally an object) to a particular kind of
  1101     event. Registrations can be bound to all events on a stream.
  1292     event. Registrations can be bound to all events on a stream.
  1116 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
  1307 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
  1117 										  TRtpCallbackFunction aCallback, 
  1308 										  TRtpCallbackFunction aCallback, 
  1118 										  TAny* aPtr, TInt aParameter);
  1309 										  TAny* aPtr, TInt aParameter);
  1119 
  1310 
  1120 	/**
  1311 	/**
  1121 	@publishedPartner
  1312 	@publishedAll
  1122 	@released
  1313 	@released
  1123 
  1314 
  1124     The event manager contains a number of callback registrations, each of which 
  1315     The event manager contains a number of callback registrations, each of which 
  1125 	binds a function and pointer (normally an object) to a particular kind of
  1316 	binds a function and pointer (normally an object) to a particular kind of
  1126     event. Registrations can be bound to all events on a stream.
  1317     event. Registrations can be bound to all events on a stream.
  1138 	*/
  1329 	*/
  1139 
  1330 
  1140 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
  1331 	IMPORT_C void PrivRegisterEventCallbackL(TUint aType, 
  1141 										  TRtpCallbackFunction aCallback, 
  1332 										  TRtpCallbackFunction aCallback, 
  1142 										  TAny* aPtr);
  1333 										  TAny* aPtr);
       
  1334 	/**
       
  1335 	@publishedAll
       
  1336 	@released
       
  1337     
       
  1338     Returns the payloadtype of the newly arrived packet. Should be called before 
       
  1339     the packet() function.
       
  1340     If an open Packet is not present the function will leave with KErrNotFound.
       
  1341  	*/
       
  1342 	IMPORT_C TUint PayLoadTypeL();
  1143  private:
  1343  private:
  1144 	friend class RRtpSession;
  1344 	friend class RRtpSession;
  1145 	friend class TRtpEvent;
  1345 	friend class TRtpEvent;
  1146 	CRtpReceiveSource* iPtr;
  1346 	CRtpReceiveSource* iPtr;
  1147 	// Note: Comments that start with //\ are pseudo-variables used to get
  1347 	// Note: Comments that start with //\ are pseudo-variables used to get
  1204 */
  1404 */
  1205 class RRtpSendPacket : public RRtpPacket
  1405 class RRtpSendPacket : public RRtpPacket
  1206 	{
  1406 	{
  1207  public:
  1407  public:
  1208 	IMPORT_C void Send();
  1408 	IMPORT_C void Send();
       
  1409 	IMPORT_C void Close();
       
  1410 	IMPORT_C TInt SendSync();
  1209 	IMPORT_C TDes8& WritePayload();
  1411 	IMPORT_C TDes8& WritePayload();
  1210 	IMPORT_C void SetTimestamp(TUint aTimestamp);
  1412 	IMPORT_C void SetTimestamp(TUint aTimestamp);
  1211 	IMPORT_C void SetMarker(TBool aMark);
  1413 	IMPORT_C void SetMarker(TBool aMark);
  1212 	IMPORT_C void SetPayloadType(TUint aPayloadType);
  1414 	IMPORT_C void SetPayloadType(TUint aPayloadType);
  1213 	IMPORT_C void SetFlags(TUint aFlags);
  1415 	IMPORT_C void SetFlags(TUint aFlags);
  1214 
  1416 
  1215 	friend class RRtpSendSource;
  1417 	friend class RRtpSendSource;
       
  1418  private:
       
  1419 	 void InitRtpPacket(TRtpSendPacket* ptr);
  1216 	};
  1420 	};
  1217 
  1421 
  1218 
  1422 
  1219 
  1423 
  1220 
  1424 
  1319 	TRtpPacket* iPtr;
  1523 	TRtpPacket* iPtr;
  1320 	};
  1524 	};
  1321 
  1525 
  1322 
  1526 
  1323 /**
  1527 /**
  1324 @publishedPartner
  1528 @publishedAll
       
  1529 @released
  1325 
  1530 
  1326 A set of panic codes.
  1531 A set of panic codes.
  1327 
  1532 
  1328 in release mode, different panic codes, such as
  1533 in release mode, different panic codes, such as
  1329 KERN-EXEC 3 may be generated instead.
  1534 KERN-EXEC 3 may be generated instead.
  1343 	ERtpSessionAlreadyOpen = 11,
  1548 	ERtpSessionAlreadyOpen = 11,
  1344 	//
  1549 	//
  1345 	ERtpCoreController = 100,
  1550 	ERtpCoreController = 100,
  1346 	};
  1551 	};
  1347 
  1552 
       
  1553 
  1348 GLREF_C void Panic(TRtpPanicCode aPanicCode);
  1554 GLREF_C void Panic(TRtpPanicCode aPanicCode);
  1349 
  1555 
  1350 #include "rtp.inl"
  1556 #include "rtp.inl"
  1351 
  1557 
  1352 #endif // RTP_H
  1558 #endif // RTP_H
       
  1559