r3508 - in trunk/libminisip: . include include/libminisip/media source/subsystem_media

erik at minisip.org erik at minisip.org
Thu Nov 22 16:58:39 CET 2007


Author: erik
Date: 2007-11-22 16:58:38 +0100 (Thu, 22 Nov 2007)
New Revision: 3508

Added:
   trunk/libminisip/include/libminisip/media/MediaStream.h
   trunk/libminisip/include/libminisip/media/RtpReceiver.h
Removed:
   trunk/libminisip/source/subsystem_media/MediaStream.h
   trunk/libminisip/source/subsystem_media/RtpReceiver.h
Modified:
   trunk/libminisip/Makefile.am
   trunk/libminisip/include/Makefile.am
   trunk/libminisip/include/libminisip/media/CallRecorder.h
   trunk/libminisip/source/subsystem_media/AudioMedia.cxx
   trunk/libminisip/source/subsystem_media/DtmfSender.cxx
   trunk/libminisip/source/subsystem_media/Media.cxx
   trunk/libminisip/source/subsystem_media/MediaHandler.cxx
   trunk/libminisip/source/subsystem_media/MediaStream.cxx
   trunk/libminisip/source/subsystem_media/RtpReceiver.cxx
   trunk/libminisip/source/subsystem_media/Session.cxx
   trunk/libminisip/source/subsystem_media/Session.h
   trunk/libminisip/source/subsystem_media/SessionRegistry.cxx
Log:

libminisip:
 * Moved RtpReceiver and MediaStream back to "include"
   and made them part of the libminisip API again. This
   is to make minisip compile in MSVC again. It is 
   more picky about having class definitions available.

   To make the API smaller, it is necessary to 
   do some bigger changes to the API, and introduce
   some new interfaces.



Modified: trunk/libminisip/Makefile.am
===================================================================
--- trunk/libminisip/Makefile.am	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/Makefile.am	2007-11-22 15:58:38 UTC (rev 3508)
@@ -75,10 +75,8 @@
 			source/subsystem_media/Session.cxx \
 			source/subsystem_media/Session.h \
 			source/subsystem_media/MediaStream.cxx \
-			source/subsystem_media/MediaStream.h \
 			source/subsystem_media/Media.cxx \
 			source/subsystem_media/RtpReceiver.cxx \
-			source/subsystem_media/RtpReceiver.h \
 			source/subsystem_media/MediaCommandString.cxx \
 			source/subsystem_media/AudioMedia.cxx \
 			source/subsystem_media/AudioPlugin.cxx \

Modified: trunk/libminisip/include/Makefile.am
===================================================================
--- trunk/libminisip/include/Makefile.am	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/include/Makefile.am	2007-11-22 15:58:38 UTC (rev 3508)
@@ -10,6 +10,8 @@
 			libminisip/media/AudioMedia.h \
 			libminisip/media/SubsystemMedia.h \
 			libminisip/media/Media.h \
+			libminisip/media/MediaStream.h \
+			libminisip/media/RtpReceiver.h \
 			libminisip/media/CallRecorder.h \
 			libminisip/signaling/p2t/SipDialogP2Tuser.h \
 			libminisip/signaling/p2t/SipDialogP2T.h \

Modified: trunk/libminisip/include/libminisip/media/CallRecorder.h
===================================================================
--- trunk/libminisip/include/libminisip/media/CallRecorder.h	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/include/libminisip/media/CallRecorder.h	2007-11-22 15:58:38 UTC (rev 3508)
@@ -27,7 +27,7 @@
 
 #define CALLREC_BUFF_SIZE 16000
 
-#include"../../../source/subsystem_media/MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 #include<libminisip/media/soundcard/SoundRecorderCallback.h>
 #include<libminisip/media/soundcard/FileSoundDevice.h>
 

Copied: trunk/libminisip/include/libminisip/media/MediaStream.h (from rev 3507, trunk/libminisip/source/subsystem_media/MediaStream.h)
===================================================================
--- trunk/libminisip/include/libminisip/media/MediaStream.h	                        (rev 0)
+++ trunk/libminisip/include/libminisip/media/MediaStream.h	2007-11-22 15:58:38 UTC (rev 3508)
@@ -0,0 +1,492 @@
+/*
+ Copyright (C) 2004-2006 the Minisip Team
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+/* Copyright (C) 2004, 2005
+ *
+ * Authors: Erik Eliasson <eliasson at it.kth.se>
+ *          Johan Bilien <jobi at via.ecp.fr>
+*/
+
+#ifndef MEDIA_STREAM_H
+#define MEDIA_STREAM_H
+
+#include<libminisip/libminisip_config.h>
+
+#include<libmutil/MemObject.h>
+
+#include<libminisip/media/rtp/CryptoContext.h>
+#include<libminisip/media/Media.h>
+#include"RtpReceiver.h"
+#include<libminisip/media/rtp/SRtpPacket.h>
+
+#include<libmikey/KeyAgreement.h>
+#ifdef ZRTP_SUPPORT
+#include <libminisip/media/zrtp/ZrtpHostBridgeMinisip.h>
+#include <time.h>
+class ZrtpHostBridgeMinisip;
+#endif
+
+class UDPSocket;
+class SdpHeaderM;
+class IpProvider;
+class Media;
+
+/**
+ * Abstract class that implements common functions to a
+ * MediaStreamSender and MediaStreamReceiver
+ */
+
+class LIBMINISIP_API MediaStream : public MObject{
+	public:
+		/**
+		 * Starts the transmission or reception of a the stream.
+		 */
+		virtual void start() = 0;
+
+		/**
+		 * Stops the transmission or reception of a the stream.
+		 */
+		virtual void stop() = 0;
+
+#ifdef DEBUG_OUTPUT
+		virtual std::string getDebugString();
+#endif
+
+		/**
+		 * Returns the media type corresponding to this stream
+		 * (video, audio...) as it appears in the session
+		 * description (SDP).
+		 * @returns the type as a string
+		 */
+		std::string getSdpMediaType();/* audio, video, application... */
+
+		/**
+		 * Returns additional media attributes that are to appear
+		 * in the session description (SDP) as a: header.
+		 * @returns the attributes as a list of string, each
+		 * of them should go into a a: header
+		 */
+		std::list<std::string> getSdpAttributes();
+
+		virtual std::string getMemObjectType() const {return "MediaStream";}
+		bool disabled;
+
+		std::string getCallId(){return callId;}
+
+		/**
+		 * Used to query the port on which the media is received for
+		 * a receiver, respectively where it is sent to for a sender
+		 * @returns the port.
+		 */
+		virtual uint16_t getPort()=0;
+
+		/**
+		 * Used to check a m: header in a session description
+		 * against the media stream for compatibility
+		 * @param m a reference to the object representing the m:
+		 * SDP header
+		 * @param formatIndex is the index of the CODEC
+		 * in the m: header against which we should compare the
+		 * MediaStream
+		 * @returns whether or not this media stream corresponds
+		 * to the description in the m: header.
+		 */
+		virtual bool matches( MRef<SdpHeaderM *> m,
+					uint32_t formatIndex );
+
+		/**
+		 * Used by the media session to pass the result of
+		 * the key exchange performed during the session
+		 * initiaton.
+		 * @param ka a reference to the KeyAgreement object.
+		 */
+		void setKeyAgreement( MRef<KeyAgreement *> ka );
+
+		/**
+		Returns an MRef to the Media object used by this media stream.
+		Use with care.
+		*/
+		MRef<Media *> getMedia() { return media; }
+#ifdef ZRTP_SUPPORT
+		/**
+		 * Set the ZRTP implementation host brigde for this media stream.
+		 *
+		 * The ZRTP host bridge implements the Minisip specific functions
+		 * to connect Minisip to the ZRTP protocol / key agreement. Please
+		 * note that the same host bridge instance must be used for a pair
+		 * of sender/receiver objects that form a RTP session.
+		 *
+		 * @param zsb
+		 *    The pointer to the host bridge object for this RTP session.
+		 *
+		 * TODO: make it a list because the receiver may have several hostbridges
+		 * in case of e.g. conferences.
+		 */
+		virtual void setZrtpHostBridge(MRef<ZrtpHostBridgeMinisip *> zsb);
+
+		/**
+		 * Get the ZRTP implementation host brigde for this media stream.
+		 *
+		 * @return zsb
+		 *    The pointer to the host bridge object for this RTP session.
+		 */
+		virtual MRef<ZrtpHostBridgeMinisip *> getZrtpHostBridge();
+
+		/**
+		 * Used by ZRTP host bridge to set the crypto context for this RTP session.
+		 *
+		 * @param cx
+		 *    The initialized CryptoContext to use for this RTP session.
+		 * @param ssrc
+		 *    The ssrc of this RTP stream (sender or receiver)
+		 */
+		void setKeyAgreementZrtp(MRef<CryptoContext *>cx);
+#endif
+
+	protected:
+		MRef<CryptoContext *> getCryptoContext( uint32_t ssrc, uint16_t seq_no );
+		MediaStream( std::string callId, MRef<Media *> );
+		std::string callId;
+		MRef<Media *> media;
+		uint32_t csbId;
+
+		uint8_t localPayloadType;
+
+		MRef<CryptoContext *> initCrypto( uint32_t ssrc, uint16_t seq_no );
+		MRef<KeyAgreement *> ka;
+		Mutex kaLock;
+		std::list< MRef<CryptoContext *> > cryptoContexts;
+#ifdef ZRTP_SUPPORT
+		MRef<ZrtpHostBridgeMinisip *> zrtpBridge;
+#endif
+};
+
+/**
+ * The MediaStreamReceiver receives media for a given medium on a
+ * given session. It is responsible for decryption and replay protection
+ * in the case of SRTP.
+ */
+class LIBMINISIP_API MediaStreamReceiver : public MediaStream{
+	public:
+		/**
+		 * Constructor, called by the MediaHandler when creating
+		 * a new media session.
+		 * @param media a reference to the Media object
+		 * that will process
+		 * incoming data on this receiver.
+		 * @param rtpReceiver a reference to the RtpReceiver object
+		 * to which this MediaStreamReceiver should register when
+		 * the session starts
+		 * @param ipProvider reference to the IpProvider object,
+		 * used to obtain contact IP address and port in NAT
+		 * traversal mechanism
+		 */
+		MediaStreamReceiver( std::string callId,
+				MRef<Media *> media,
+				MRef<RtpReceiver *> rtpReceiver,
+				MRef<RtpReceiver *> rtp6Receiver = NULL );
+
+#ifdef DEBUG_OUTPUT
+		virtual std::string getDebugString();
+#endif
+
+		virtual std::string getMemObjectType() const {return "MediaStreamReceiver";}
+
+		/**
+		 * Starts the reception of a the stream, by subscribing to
+		 * the RtpReceiver.
+		 */
+		virtual void start();
+
+		/**
+		 * Stops the reception of a stream, by unsubscribing to
+		 * the RtpReceiver.
+		 */
+		virtual void stop();
+
+		/**
+		 * Used to query which port should be advertised as
+		 * the contact port in the session description.
+		 * @returns the port to use
+		 */
+		virtual uint16_t getPort();
+
+		/**
+		 * Used to query which port should be advertised as
+		 * the contact port in the session description.
+		 * @param addrType IP4 or IP6
+		 * @returns the port to use
+		 */
+		uint16_t getPort( const std::string &addrType );
+
+		/**
+		 * Handles incoming RTP packets, decrypts them
+		 * and send them to the corresponding media for
+		 * playback.
+		 * @param packet the (S)RTP packet to handle
+		 */
+		virtual void handleRtpPacket( MRef<SRtpPacket *> packet, std::string callId, MRef<IPAddress *> from );
+
+		/**
+		 * Returns a unique identifier for this Receiver. Used
+		 * to register or unregister receivers to RtpReceiver objects.
+		 * @returns the identifier
+		 */
+		uint32_t getId();
+
+		/**
+		 * Used to query the available CODECs for this media type,
+		 * during this session. Used by the Session to create
+		 * the session description (SDP).
+		 *
+		 * @returns a list of references to Codec objects, sorted
+		 * according to the user's preference, first being preferred
+		 */
+		std::list<MRef<Codec *> > getAvailableCodecs();
+
+		std::list<uint32_t> getSsrcList() {
+			return ssrcList;
+		}
+
+#ifdef ZRTP_SUPPORT
+		/**
+		 * Process a received packet with an extension header
+		 * and unknown payload type.
+		 *
+		 * This packet has an extension header and does not
+		 * contain payload data to process. The method checks
+		 * if it is a ZRTP packet, if yes process
+		 * it. Otherwise just return to the caller.  Because
+		 * the payload type is unknown the caller usually
+		 * dismisses the packet.
+		 *
+		 * <p/>
+		 *
+		 * This method is called only if a ZRTP host bridge is
+		 * enabled.
+		 *
+		 * @param packet
+		 *   A (S)Rtp packet to process
+		 */
+		virtual void handleRtpPacketExt(MRef<SRtpPacket *> packet);
+#endif
+	protected:
+		std::list<MRef<Codec *> > codecList;
+		MRef<RtpReceiver *> rtpReceiver;
+		MRef<RtpReceiver *> rtp6Receiver;
+		uint32_t id;
+		uint16_t externalPort;
+
+		void gotSsrc( uint32_t ssrc, std::string callId );
+
+		std::list<uint32_t> ssrcList;
+		Mutex ssrcListLock;
+
+		bool running;
+
+};
+
+/**
+ * The MediaStreamSender is used to send media to a specific peer, during
+ * a specific media Session. It holds the CODEC instance selected for
+ * this peer, and is responsible for encryption.
+ */
+class LIBMINISIP_API MediaStreamSender : public MediaStream{
+	public:
+		/**
+		 * Constructor, used by the MediaHandler during the
+		 * creation of the media Session.
+		 * @param media a reference to the Media object from
+		 * which the MediaStreamSender is receiving data
+		 * @param senderSock a reference to the UDPSocket object
+		 * to which the data should be sent. If NULL a new one
+		 * is created
+		 */
+		MediaStreamSender( std::string callId,
+				   MRef<Media *> media,
+				   MRef<UDPSocket *> senderSock=NULL,
+				   MRef<UDPSocket *> sender6Sock=NULL );
+
+#ifdef DEBUG_OUTPUT
+		virtual std::string getDebugString();
+#endif
+
+		virtual std::string getMemObjectType() const {return "MediaStreamSender";}
+
+		/**
+		 * Returns the CODEC instance currently selected for
+		 * this peer.
+		 * @returns a reference to the CodecState object
+		 */
+		MRef<CodecState *> getSelectedCodec(){return selectedCodec;};
+
+		/**
+		 * Starts the transmission of the stream, by
+		 * subscribing to the Media for data.
+		 */
+		virtual void start();
+
+		/**
+		 * Stops the transmission, by unsubscribing to the
+		 * Media.
+		 */
+		virtual void stop();
+
+		/**
+		 * Used by the Session to set the port on which the
+		 * the peer is expecting to receive the data. This
+		 * is extracted from the received session description
+		 * (SDP).
+		 * @param port the port to which the MediaStreamSender should
+		 * send
+		 */
+		virtual void setPort( uint16_t port );
+
+		/**
+		 * Returns the port to which data is sent.
+		 * @retunrs the port to which the MediaStreamSender is sending
+		 * data, or 0 if it was not set
+		 */
+		virtual uint16_t getPort();
+
+		/**
+		 * Used by the Media to send data, if the MediaStreamSender
+		 * has subscribed to the Media. The data will be encrypted
+		 * if required, and encapsulated in an RTP packet.
+		 * @param data a pointer to the data to send
+		 * @param length the lenght of the data to send
+		 * @param ts the timestamp to use in RTP header, or
+		 * NULL if the MediaStreamSender should decide it
+		 * @param marker whether or not the marker should be set
+		 * in the RTP header
+		 * @param dtmf whether or not the data is a DTMF signal
+		 */
+		void send( byte_t * data, uint32_t length, uint32_t * ts, bool marker = false, bool dtmf = false );
+
+#ifdef ZRTP_SUPPORT
+		/**
+		 * Used by the ZRTP host bridge to send ZRTP data.
+		 *
+		 * This method sets up a ZRTP packet with a specific
+		 * payload type and sends the data to our peer. These
+		 * packets shall not go into normal payload processing
+		 * at the receiver because of the specific payload
+		 * type setting.
+		 *
+		 * @param data
+		 *    The pointer to the extension header to send.
+		 * @param length
+		 *    Length of the extension header in bytes.
+                 * @param payload
+                 *    Pointer to the payload or NULL if no payload required
+                 * @param payLen
+                 *    Length of payload in bytes
+		 */
+		void sendZrtp(unsigned char* data, int length,
+                              unsigned char* payload, int payLen);
+
+		/**
+		 * Get the current Seq number of this packet
+		 *
+		 * @return
+		 *     The sender current sequence number.
+		 */
+		uint16_t getSeqNo() { return seqNo; };
+#endif
+
+		/**
+		 * Used by the Session to specify the IP address
+		 * on which the data should be sent to the peer. This
+		 * information is extracted from the received session
+		 * description (SDP)
+		 * @param remoteAddress a pointer to the IPAddress object
+		 * which represents the peer's contact IP address
+		 */
+		void setRemoteAddress( MRef<IPAddress *> remoteAddress );
+
+		/**
+		 * Used to mute or unmute this sender, resulting
+		 * in it sending or not sending the data it receives
+		 * from the Media.
+		 * @param mute whether or not this MediaStreamSender should
+		 * be muted
+		 */
+		void setMuted( bool mute ) { muted = mute;}
+
+		/**
+		 * Queries the muted state of this MediaStreamSender
+		 * @returns whether or not this MediaStreamSender is muted
+		 */
+		bool isMuted() { return muted;}
+
+		/**
+		 * Used to know whether or not a packet should be sent
+		 * even if the MediaStreamSender is muted, for the
+		 * Session to be kept alive.
+		 * @param max specifies after how many muted packets a
+		 * keep alive packet should be sent
+		 */
+		bool muteKeepAlive( uint32_t max);
+
+		/**
+		 * Used to check a m: header in a session description
+		 * against the media stream for compatibility. In
+		 * case the MediaStreamSender is compatible, the
+		 * CODEC is selected, if it wasn't already.
+		 * @param m a reference to the object representing the m:
+		 * SDP header
+		 * @param formatIndex is the index of the CODEC
+		 * in the m: header against which we should compare the
+		 * MediaStream
+		 * @returns whether or not this media stream corresponds
+		 * to the description in the m: header.
+		 */
+		virtual bool matches( MRef<SdpHeaderM *> m,
+					uint32_t formatIndex );
+
+		/**
+		 * Used to query the SSRC identifier used in RTP headers.
+		 * It is created randomly upon creation of the
+		 * MediaStreamSender.
+		 * @returns the SSRC identifier used by this MediaStreamSender
+		 */
+		uint32_t getSsrc();
+
+		void increaseLastTs( ) { lastTs += 160; };
+		uint32_t getLastTs() { return lastTs; };
+
+	private:
+		uint32_t ssrc;
+		MRef<UDPSocket *> senderSock;
+		MRef<UDPSocket *> sender6Sock;
+		uint16_t remotePort;
+		uint16_t seqNo;
+		uint32_t lastTs;
+		MRef<IPAddress *> remoteAddress;
+		Mutex senderLock;
+
+		uint8_t payloadType;
+		MRef<CodecState *> selectedCodec;
+
+		//Cesc -- does it conflict with bool disabled???
+		bool muted;
+		uint32_t muteCounter;
+
+};
+
+#endif

Copied: trunk/libminisip/include/libminisip/media/RtpReceiver.h (from rev 3507, trunk/libminisip/source/subsystem_media/RtpReceiver.h)
===================================================================
--- trunk/libminisip/include/libminisip/media/RtpReceiver.h	                        (rev 0)
+++ trunk/libminisip/include/libminisip/media/RtpReceiver.h	2007-11-22 15:58:38 UTC (rev 3508)
@@ -0,0 +1,124 @@
+/*
+ Copyright (C) 2004-2006 the Minisip Team
+ 
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ 
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+ 
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+/* Copyright (C) 2004, 2005 
+ *
+ * Authors: Erik Eliasson <eliasson at it.kth.se>
+ *          Johan Bilien <jobi at via.ecp.fr>
+*/
+
+#ifndef RTPRECEIVER_H
+#define RTPRECEIVER_H
+
+#include<libminisip/libminisip_config.h>
+
+#include<libmutil/Mutex.h>
+#include<libmutil/MemObject.h>
+#include<libmutil/Thread.h>
+
+#include<libminisip/ipprovider/IpProvider.h>
+
+class UDPSocket;
+class MediaStreamReceiver;
+class CryptoContext;
+
+/**
+ * The RtpReceiver is used to listen on a UDPSocket and demultiplex
+ * several incoming streams, depending on their payload type.
+ * MediaStreamReceiver objects register to it when they are ready
+ * to receive a specific media type.
+ */
+class LIBMINISIP_API RtpReceiver : public Runnable{
+	public:
+		/**
+		 * Constructor, called by the MediaHandler upon
+		 * creation of a media Session.
+		 * @param ipprovider reference to an IpProvider object,
+		 * used to query the external IP address and UDP port
+		 * on which the peer should send data (used by
+		 * NAT traversal mechanisms).
+		 */
+		RtpReceiver( MRef<IpProvider *> ipProvider, std::string callId );
+
+		/**
+		 * Used for a MediaStreamReceiver to subscribe to data
+		 * incoming on this RtpReceiver. If the payload type
+		 * is handled by the MediaStreamReceiver, the data
+		 * is sent to it.
+		 * @param mediaStream a reference to the MediaStreamReceiver
+		 * object to subscribe
+		 */
+		void registerMediaStream( MRef<MediaStreamReceiver *> mediaStream );
+
+		/**
+		 * Used to signify that a MediaStreamReceiver should no
+		 * longer receive data from this RtpReceiver. Used
+		 * when the media Session is stopped.
+		 * @param mediaStream a reference to the MediaStreamReceiver
+		 * object that should be unsubscribed
+		 */
+		void unregisterMediaStream( MRef<MediaStreamReceiver *> mediaStream);
+
+		/**
+		 * Listening thread main loop.
+		 */
+		virtual void run();
+
+		void stop();
+
+		void join();
+
+		/**
+		 * Used to query the port that should be given as contact
+		 * information to the peer in the session description (SDP).
+		 * It may be different from the local port of the UDPSocket,
+		 * in case of NAT traversal mechanisms.
+		 * @returns the port number to use as contact information
+		 */
+		uint16_t getPort();
+
+		/**
+		 * Destructor. Will wait for the running thread
+		 * to be terminated.
+		 */
+		~RtpReceiver();
+
+		/**
+		 * Used to query the UDPSocket on which the RtpReceiver is
+		 * listening.
+		 * @returns a reference to the UDPSocket object
+		 */
+		MRef<UDPSocket *> getSocket();
+
+		virtual std::string getMemObjectType() const {return "RtpReceiver";}
+
+	private:
+		MRef<UDPSocket *> socket;
+		uint16_t externalPort;
+		bool kill;
+
+		std::list< MRef<MediaStreamReceiver *> > mediaStreams;
+
+		Mutex mediaStreamsLock;
+
+		Thread * thread;
+
+		std::string callId;
+};
+
+#endif

Modified: trunk/libminisip/source/subsystem_media/AudioMedia.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/AudioMedia.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/AudioMedia.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -27,7 +27,7 @@
 #include<libminisip/media/AudioMedia.h>
 
 #include<libminisip/media/rtp/RtpHeader.h>
-#include"MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 #include<libminisip/media/soundcard/FileSoundSource.h>
 
 #include<libminisip/media/soundcard/Resampler.h>

Modified: trunk/libminisip/source/subsystem_media/DtmfSender.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/DtmfSender.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/DtmfSender.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -27,7 +27,7 @@
 #include<libminisip/media/DtmfSender.h>
 
 #include"Session.h"
-#include"MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 
 #ifdef _WIN32_WCE
 #	include"../include/minisip_wce_extra_includes.h"

Modified: trunk/libminisip/source/subsystem_media/Media.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/Media.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/Media.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -29,12 +29,11 @@
 #include<libminisip/media/codecs/Codec.h>
 #include<libminisip/media/soundcard/SoundIO.h>
 #include<libminisip/ipprovider/IpProvider.h>
-#include"MediaStream.h"
-#include"RtpReceiver.h"
+#include<libminisip/media/MediaStream.h>
 #include<libmutil/stringutils.h>
 #include<libminisip/signaling/sdp/SdpHeaderM.h>
 #include<libminisip/signaling/sdp/SdpHeaderA.h>
-//#include"MediaHandler.h"
+#include<libmikey/KeyAgreement.h>
 
 #ifdef _WIN32_WCE
 #	include"../include/minisip_wce_extra_includes.h"

Modified: trunk/libminisip/source/subsystem_media/MediaHandler.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/MediaHandler.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/MediaHandler.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -33,11 +33,11 @@
 #include<libminisip/ipprovider/IpProvider.h>
 #include<libminisip/media/codecs/Codec.h>
 #include"Session.h"
-#include"MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 
 #include<libminisip/media/zrtp/ZrtpHostBridgeMinisip.h>
 #include<libminisip/media/Media.h>
-#include"RtpReceiver.h"
+#include<libminisip/media/RtpReceiver.h>
 #include<libminisip/media/MediaCommandString.h>
 #include<libmnetutil/UDPSocket.h>
 

Modified: trunk/libminisip/source/subsystem_media/MediaStream.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/MediaStream.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/MediaStream.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -25,7 +25,7 @@
 
 #include <config.h>
 
-#include"MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 
 #include<libmikey/MikeyPayloadSP.h>
 #include<libmikey/KeyAgreement.h>
@@ -36,7 +36,7 @@
 #include<libmutil/stringutils.h>
 #include<libmutil/Timestamp.h>
 #include<libminisip/media/Media.h>
-#include"RtpReceiver.h"
+#include<libminisip/media/RtpReceiver.h>
 #include<libminisip/media/codecs/Codec.h>
 #include<libminisip/ipprovider/IpProvider.h>
 #include<iostream>

Deleted: trunk/libminisip/source/subsystem_media/MediaStream.h
===================================================================
--- trunk/libminisip/source/subsystem_media/MediaStream.h	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/MediaStream.h	2007-11-22 15:58:38 UTC (rev 3508)
@@ -1,493 +0,0 @@
-/*
- Copyright (C) 2004-2006 the Minisip Team
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- */
-
-/* Copyright (C) 2004, 2005
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- *          Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef MEDIA_STREAM_H
-#define MEDIA_STREAM_H
-
-#include<libminisip/libminisip_config.h>
-
-#include<libmutil/MemObject.h>
-
-#include<libminisip/media/rtp/CryptoContext.h>
-#include<libminisip/media/Media.h>
-#include"Session.h"
-#include"RtpReceiver.h"
-#include<libminisip/media/rtp/SRtpPacket.h>
-
-#ifdef ZRTP_SUPPORT
-#include <libminisip/media/zrtp/ZrtpHostBridgeMinisip.h>
-#include <time.h>
-class ZrtpHostBridgeMinisip;
-#endif
-
-class KeyAgreement;
-class UDPSocket;
-class SdpHeaderM;
-class IpProvider;
-class Media;
-
-/**
- * Abstract class that implements common functions to a
- * MediaStreamSender and MediaStreamReceiver
- */
-
-class LIBMINISIP_API MediaStream : public MObject{
-	public:
-		/**
-		 * Starts the transmission or reception of a the stream.
-		 */
-		virtual void start() = 0;
-
-		/**
-		 * Stops the transmission or reception of a the stream.
-		 */
-		virtual void stop() = 0;
-
-#ifdef DEBUG_OUTPUT
-		virtual std::string getDebugString();
-#endif
-
-		/**
-		 * Returns the media type corresponding to this stream
-		 * (video, audio...) as it appears in the session
-		 * description (SDP).
-		 * @returns the type as a string
-		 */
-		std::string getSdpMediaType();/* audio, video, application... */
-
-		/**
-		 * Returns additional media attributes that are to appear
-		 * in the session description (SDP) as a: header.
-		 * @returns the attributes as a list of string, each
-		 * of them should go into a a: header
-		 */
-		std::list<std::string> getSdpAttributes();
-
-		virtual std::string getMemObjectType() const {return "MediaStream";}
-		bool disabled;
-
-		std::string getCallId(){return callId;}
-
-		/**
-		 * Used to query the port on which the media is received for
-		 * a receiver, respectively where it is sent to for a sender
-		 * @returns the port.
-		 */
-		virtual uint16_t getPort()=0;
-
-		/**
-		 * Used to check a m: header in a session description
-		 * against the media stream for compatibility
-		 * @param m a reference to the object representing the m:
-		 * SDP header
-		 * @param formatIndex is the index of the CODEC
-		 * in the m: header against which we should compare the
-		 * MediaStream
-		 * @returns whether or not this media stream corresponds
-		 * to the description in the m: header.
-		 */
-		virtual bool matches( MRef<SdpHeaderM *> m,
-					uint32_t formatIndex );
-
-		/**
-		 * Used by the media session to pass the result of
-		 * the key exchange performed during the session
-		 * initiaton.
-		 * @param ka a reference to the KeyAgreement object.
-		 */
-		void setKeyAgreement( MRef<KeyAgreement *> ka );
-
-		/**
-		Returns an MRef to the Media object used by this media stream.
-		Use with care.
-		*/
-		MRef<Media *> getMedia() { return media; }
-#ifdef ZRTP_SUPPORT
-		/**
-		 * Set the ZRTP implementation host brigde for this media stream.
-		 *
-		 * The ZRTP host bridge implements the Minisip specific functions
-		 * to connect Minisip to the ZRTP protocol / key agreement. Please
-		 * note that the same host bridge instance must be used for a pair
-		 * of sender/receiver objects that form a RTP session.
-		 *
-		 * @param zsb
-		 *    The pointer to the host bridge object for this RTP session.
-		 *
-		 * TODO: make it a list because the receiver may have several hostbridges
-		 * in case of e.g. conferences.
-		 */
-		virtual void setZrtpHostBridge(MRef<ZrtpHostBridgeMinisip *> zsb);
-
-		/**
-		 * Get the ZRTP implementation host brigde for this media stream.
-		 *
-		 * @return zsb
-		 *    The pointer to the host bridge object for this RTP session.
-		 */
-		virtual MRef<ZrtpHostBridgeMinisip *> getZrtpHostBridge();
-
-		/**
-		 * Used by ZRTP host bridge to set the crypto context for this RTP session.
-		 *
-		 * @param cx
-		 *    The initialized CryptoContext to use for this RTP session.
-		 * @param ssrc
-		 *    The ssrc of this RTP stream (sender or receiver)
-		 */
-		void setKeyAgreementZrtp(MRef<CryptoContext *>cx);
-#endif
-
-	protected:
-		MRef<CryptoContext *> getCryptoContext( uint32_t ssrc, uint16_t seq_no );
-		MediaStream( std::string callId, MRef<Media *> );
-		std::string callId;
-		MRef<Media *> media;
-		uint32_t csbId;
-
-		uint8_t localPayloadType;
-
-		MRef<CryptoContext *> initCrypto( uint32_t ssrc, uint16_t seq_no );
-		MRef<KeyAgreement *> ka;
-		Mutex kaLock;
-		std::list< MRef<CryptoContext *> > cryptoContexts;
-#ifdef ZRTP_SUPPORT
-		MRef<ZrtpHostBridgeMinisip *> zrtpBridge;
-#endif
-};
-
-/**
- * The MediaStreamReceiver receives media for a given medium on a
- * given session. It is responsible for decryption and replay protection
- * in the case of SRTP.
- */
-class LIBMINISIP_API MediaStreamReceiver : public MediaStream{
-	public:
-		/**
-		 * Constructor, called by the MediaHandler when creating
-		 * a new media session.
-		 * @param media a reference to the Media object
-		 * that will process
-		 * incoming data on this receiver.
-		 * @param rtpReceiver a reference to the RtpReceiver object
-		 * to which this MediaStreamReceiver should register when
-		 * the session starts
-		 * @param ipProvider reference to the IpProvider object,
-		 * used to obtain contact IP address and port in NAT
-		 * traversal mechanism
-		 */
-		MediaStreamReceiver( std::string callId,
-				MRef<Media *> media,
-				MRef<RtpReceiver *> rtpReceiver,
-				MRef<RtpReceiver *> rtp6Receiver = NULL );
-
-#ifdef DEBUG_OUTPUT
-		virtual std::string getDebugString();
-#endif
-
-		virtual std::string getMemObjectType() const {return "MediaStreamReceiver";}
-
-		/**
-		 * Starts the reception of a the stream, by subscribing to
-		 * the RtpReceiver.
-		 */
-		virtual void start();
-
-		/**
-		 * Stops the reception of a stream, by unsubscribing to
-		 * the RtpReceiver.
-		 */
-		virtual void stop();
-
-		/**
-		 * Used to query which port should be advertised as
-		 * the contact port in the session description.
-		 * @returns the port to use
-		 */
-		virtual uint16_t getPort();
-
-		/**
-		 * Used to query which port should be advertised as
-		 * the contact port in the session description.
-		 * @param addrType IP4 or IP6
-		 * @returns the port to use
-		 */
-		uint16_t getPort( const std::string &addrType );
-
-		/**
-		 * Handles incoming RTP packets, decrypts them
-		 * and send them to the corresponding media for
-		 * playback.
-		 * @param packet the (S)RTP packet to handle
-		 */
-		virtual void handleRtpPacket( MRef<SRtpPacket *> packet, std::string callId, MRef<IPAddress *> from );
-
-		/**
-		 * Returns a unique identifier for this Receiver. Used
-		 * to register or unregister receivers to RtpReceiver objects.
-		 * @returns the identifier
-		 */
-		uint32_t getId();
-
-		/**
-		 * Used to query the available CODECs for this media type,
-		 * during this session. Used by the Session to create
-		 * the session description (SDP).
-		 *
-		 * @returns a list of references to Codec objects, sorted
-		 * according to the user's preference, first being preferred
-		 */
-		std::list<MRef<Codec *> > getAvailableCodecs();
-
-		std::list<uint32_t> getSsrcList() {
-			return ssrcList;
-		}
-
-#ifdef ZRTP_SUPPORT
-		/**
-		 * Process a received packet with an extension header
-		 * and unknown payload type.
-		 *
-		 * This packet has an extension header and does not
-		 * contain payload data to process. The method checks
-		 * if it is a ZRTP packet, if yes process
-		 * it. Otherwise just return to the caller.  Because
-		 * the payload type is unknown the caller usually
-		 * dismisses the packet.
-		 *
-		 * <p/>
-		 *
-		 * This method is called only if a ZRTP host bridge is
-		 * enabled.
-		 *
-		 * @param packet
-		 *   A (S)Rtp packet to process
-		 */
-		virtual void handleRtpPacketExt(MRef<SRtpPacket *> packet);
-#endif
-	protected:
-		std::list<MRef<Codec *> > codecList;
-		MRef<RtpReceiver *> rtpReceiver;
-		MRef<RtpReceiver *> rtp6Receiver;
-		uint32_t id;
-		uint16_t externalPort;
-
-		void gotSsrc( uint32_t ssrc, std::string callId );
-
-		std::list<uint32_t> ssrcList;
-		Mutex ssrcListLock;
-
-		bool running;
-
-};
-
-/**
- * The MediaStreamSender is used to send media to a specific peer, during
- * a specific media Session. It holds the CODEC instance selected for
- * this peer, and is responsible for encryption.
- */
-class LIBMINISIP_API MediaStreamSender : public MediaStream{
-	public:
-		/**
-		 * Constructor, used by the MediaHandler during the
-		 * creation of the media Session.
-		 * @param media a reference to the Media object from
-		 * which the MediaStreamSender is receiving data
-		 * @param senderSock a reference to the UDPSocket object
-		 * to which the data should be sent. If NULL a new one
-		 * is created
-		 */
-		MediaStreamSender( std::string callId,
-				   MRef<Media *> media,
-				   MRef<UDPSocket *> senderSock=NULL,
-				   MRef<UDPSocket *> sender6Sock=NULL );
-
-#ifdef DEBUG_OUTPUT
-		virtual std::string getDebugString();
-#endif
-
-		virtual std::string getMemObjectType() const {return "MediaStreamSender";}
-
-		/**
-		 * Returns the CODEC instance currently selected for
-		 * this peer.
-		 * @returns a reference to the CodecState object
-		 */
-		MRef<CodecState *> getSelectedCodec(){return selectedCodec;};
-
-		/**
-		 * Starts the transmission of the stream, by
-		 * subscribing to the Media for data.
-		 */
-		virtual void start();
-
-		/**
-		 * Stops the transmission, by unsubscribing to the
-		 * Media.
-		 */
-		virtual void stop();
-
-		/**
-		 * Used by the Session to set the port on which the
-		 * the peer is expecting to receive the data. This
-		 * is extracted from the received session description
-		 * (SDP).
-		 * @param port the port to which the MediaStreamSender should
-		 * send
-		 */
-		virtual void setPort( uint16_t port );
-
-		/**
-		 * Returns the port to which data is sent.
-		 * @retunrs the port to which the MediaStreamSender is sending
-		 * data, or 0 if it was not set
-		 */
-		virtual uint16_t getPort();
-
-		/**
-		 * Used by the Media to send data, if the MediaStreamSender
-		 * has subscribed to the Media. The data will be encrypted
-		 * if required, and encapsulated in an RTP packet.
-		 * @param data a pointer to the data to send
-		 * @param length the lenght of the data to send
-		 * @param ts the timestamp to use in RTP header, or
-		 * NULL if the MediaStreamSender should decide it
-		 * @param marker whether or not the marker should be set
-		 * in the RTP header
-		 * @param dtmf whether or not the data is a DTMF signal
-		 */
-		void send( byte_t * data, uint32_t length, uint32_t * ts, bool marker = false, bool dtmf = false );
-
-#ifdef ZRTP_SUPPORT
-		/**
-		 * Used by the ZRTP host bridge to send ZRTP data.
-		 *
-		 * This method sets up a ZRTP packet with a specific
-		 * payload type and sends the data to our peer. These
-		 * packets shall not go into normal payload processing
-		 * at the receiver because of the specific payload
-		 * type setting.
-		 *
-		 * @param data
-		 *    The pointer to the extension header to send.
-		 * @param length
-		 *    Length of the extension header in bytes.
-                 * @param payload
-                 *    Pointer to the payload or NULL if no payload required
-                 * @param payLen
-                 *    Length of payload in bytes
-		 */
-		void sendZrtp(unsigned char* data, int length,
-                              unsigned char* payload, int payLen);
-
-		/**
-		 * Get the current Seq number of this packet
-		 *
-		 * @return
-		 *     The sender current sequence number.
-		 */
-		uint16_t getSeqNo() { return seqNo; };
-#endif
-
-		/**
-		 * Used by the Session to specify the IP address
-		 * on which the data should be sent to the peer. This
-		 * information is extracted from the received session
-		 * description (SDP)
-		 * @param remoteAddress a pointer to the IPAddress object
-		 * which represents the peer's contact IP address
-		 */
-		void setRemoteAddress( MRef<IPAddress *> remoteAddress );
-
-		/**
-		 * Used to mute or unmute this sender, resulting
-		 * in it sending or not sending the data it receives
-		 * from the Media.
-		 * @param mute whether or not this MediaStreamSender should
-		 * be muted
-		 */
-		void setMuted( bool mute ) { muted = mute;}
-
-		/**
-		 * Queries the muted state of this MediaStreamSender
-		 * @returns whether or not this MediaStreamSender is muted
-		 */
-		bool isMuted() { return muted;}
-
-		/**
-		 * Used to know whether or not a packet should be sent
-		 * even if the MediaStreamSender is muted, for the
-		 * Session to be kept alive.
-		 * @param max specifies after how many muted packets a
-		 * keep alive packet should be sent
-		 */
-		bool muteKeepAlive( uint32_t max);
-
-		/**
-		 * Used to check a m: header in a session description
-		 * against the media stream for compatibility. In
-		 * case the MediaStreamSender is compatible, the
-		 * CODEC is selected, if it wasn't already.
-		 * @param m a reference to the object representing the m:
-		 * SDP header
-		 * @param formatIndex is the index of the CODEC
-		 * in the m: header against which we should compare the
-		 * MediaStream
-		 * @returns whether or not this media stream corresponds
-		 * to the description in the m: header.
-		 */
-		virtual bool matches( MRef<SdpHeaderM *> m,
-					uint32_t formatIndex );
-
-		/**
-		 * Used to query the SSRC identifier used in RTP headers.
-		 * It is created randomly upon creation of the
-		 * MediaStreamSender.
-		 * @returns the SSRC identifier used by this MediaStreamSender
-		 */
-		uint32_t getSsrc();
-
-		void increaseLastTs( ) { lastTs += 160; };
-		uint32_t getLastTs() { return lastTs; };
-
-	private:
-		uint32_t ssrc;
-		MRef<UDPSocket *> senderSock;
-		MRef<UDPSocket *> sender6Sock;
-		uint16_t remotePort;
-		uint16_t seqNo;
-		uint32_t lastTs;
-		MRef<IPAddress *> remoteAddress;
-		Mutex senderLock;
-
-		uint8_t payloadType;
-		MRef<CodecState *> selectedCodec;
-
-		//Cesc -- does it conflict with bool disabled???
-		bool muted;
-		uint32_t muteCounter;
-
-};
-
-#endif

Modified: trunk/libminisip/source/subsystem_media/RtpReceiver.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/RtpReceiver.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/RtpReceiver.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -24,7 +24,7 @@
 
 #include <config.h>
 
-#include"RtpReceiver.h"
+#include<libminisip/media/RtpReceiver.h>
 
 #include<libmnetutil/UDPSocket.h>
 #include<libmnetutil/NetworkException.h>
@@ -33,7 +33,7 @@
 #include<libminisip/media/rtp/SRtpPacket.h>
 #include<libminisip/media/codecs/Codec.h>
 #include<iostream>
-#include"MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 #include<libminisip/ipprovider/IpProvider.h>
 
 #include<stdio.h>

Deleted: trunk/libminisip/source/subsystem_media/RtpReceiver.h
===================================================================
--- trunk/libminisip/source/subsystem_media/RtpReceiver.h	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/RtpReceiver.h	2007-11-22 15:58:38 UTC (rev 3508)
@@ -1,124 +0,0 @@
-/*
- Copyright (C) 2004-2006 the Minisip Team
- 
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- 
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Lesser General Public License for more details.
- 
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- */
-
-/* Copyright (C) 2004, 2005 
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- *          Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef RTPRECEIVER_H
-#define RTPRECEIVER_H
-
-#include<libminisip/libminisip_config.h>
-
-#include<libmutil/Mutex.h>
-#include<libmutil/MemObject.h>
-#include<libmutil/Thread.h>
-
-#include<libminisip/ipprovider/IpProvider.h>
-
-class UDPSocket;
-class MediaStreamReceiver;
-class CryptoContext;
-
-/**
- * The RtpReceiver is used to listen on a UDPSocket and demultiplex
- * several incoming streams, depending on their payload type.
- * MediaStreamReceiver objects register to it when they are ready
- * to receive a specific media type.
- */
-class LIBMINISIP_API RtpReceiver : public Runnable{
-	public:
-		/**
-		 * Constructor, called by the MediaHandler upon
-		 * creation of a media Session.
-		 * @param ipprovider reference to an IpProvider object,
-		 * used to query the external IP address and UDP port
-		 * on which the peer should send data (used by
-		 * NAT traversal mechanisms).
-		 */
-		RtpReceiver( MRef<IpProvider *> ipProvider, std::string callId );
-
-		/**
-		 * Used for a MediaStreamReceiver to subscribe to data
-		 * incoming on this RtpReceiver. If the payload type
-		 * is handled by the MediaStreamReceiver, the data
-		 * is sent to it.
-		 * @param mediaStream a reference to the MediaStreamReceiver
-		 * object to subscribe
-		 */
-		void registerMediaStream( MRef<MediaStreamReceiver *> mediaStream );
-
-		/**
-		 * Used to signify that a MediaStreamReceiver should no
-		 * longer receive data from this RtpReceiver. Used
-		 * when the media Session is stopped.
-		 * @param mediaStream a reference to the MediaStreamReceiver
-		 * object that should be unsubscribed
-		 */
-		void unregisterMediaStream( MRef<MediaStreamReceiver *> mediaStream);
-
-		/**
-		 * Listening thread main loop.
-		 */
-		virtual void run();
-
-		void stop();
-
-		void join();
-
-		/**
-		 * Used to query the port that should be given as contact
-		 * information to the peer in the session description (SDP).
-		 * It may be different from the local port of the UDPSocket,
-		 * in case of NAT traversal mechanisms.
-		 * @returns the port number to use as contact information
-		 */
-		uint16_t getPort();
-
-		/**
-		 * Destructor. Will wait for the running thread
-		 * to be terminated.
-		 */
-		~RtpReceiver();
-
-		/**
-		 * Used to query the UDPSocket on which the RtpReceiver is
-		 * listening.
-		 * @returns a reference to the UDPSocket object
-		 */
-		MRef<UDPSocket *> getSocket();
-
-		virtual std::string getMemObjectType() const {return "RtpReceiver";}
-
-	private:
-		MRef<UDPSocket *> socket;
-		uint16_t externalPort;
-		bool kill;
-
-		std::list< MRef<MediaStreamReceiver *> > mediaStreams;
-
-		Mutex mediaStreamsLock;
-
-		Thread * thread;
-
-		std::string callId;
-};
-
-#endif

Modified: trunk/libminisip/source/subsystem_media/Session.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/Session.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/Session.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -29,10 +29,9 @@
 #include"Session.h"
 
 #include<libminisip/media/CallRecorder.h>
-#include"MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 #include<libminisip/media/Media.h>
 #include<libminisip/media/AudioMedia.h>
-#include"RtpReceiver.h"
 #include<libminisip/media/DtmfSender.h>
 #include<libminisip/media/codecs/Codec.h>
 #include<libminisip/signaling/sdp/SdpPacket.h>

Modified: trunk/libminisip/source/subsystem_media/Session.h
===================================================================
--- trunk/libminisip/source/subsystem_media/Session.h	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/Session.h	2007-11-22 15:58:38 UTC (rev 3508)
@@ -34,7 +34,7 @@
 
 #include<libminisip/media/DtmfSender.h>
 #include<libminisip/signaling/sdp/SdpPacket.h>
-#include"MediaStream.h"
+#include<libminisip/media/MediaStream.h>
 #include<libmsip/SipDialogConfig.h>
 
 class MediaStreamReceiver;

Modified: trunk/libminisip/source/subsystem_media/SessionRegistry.cxx
===================================================================
--- trunk/libminisip/source/subsystem_media/SessionRegistry.cxx	2007-11-22 14:29:25 UTC (rev 3507)
+++ trunk/libminisip/source/subsystem_media/SessionRegistry.cxx	2007-11-22 15:58:38 UTC (rev 3508)
@@ -27,7 +27,6 @@
 #include"SessionRegistry.h"
 
 #include"Session.h"
-#include"MediaStream.h"
 
 #ifdef _WIN32_WCE
 #	include"../include/minisip_wce_extra_includes.h"



More information about the Minisip-devel mailing list