Index: pjproject/branches/projects/pjsua2/pjsip-apps/build/Makefile
===================================================================
--- pjproject/branches/projects/pjsua2/pjsip-apps/build/Makefile	(revision 4675)
+++ pjproject/branches/projects/pjsua2/pjsip-apps/build/Makefile	(revision 4676)
@@ -64,5 +64,5 @@
 #  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x
 #TARGETS := swig pjsua pjsystest samples
-TARGETS := swig samples
+TARGETS := swig pjsua pjsystest samples
 
 .PHONY: $(TARGETS)
Index: pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/media.hpp
===================================================================
--- pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/media.hpp	(revision 4675)
+++ pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/media.hpp	(revision 4676)
@@ -473,7 +473,14 @@
      * created, it is possible that the function returns -1 as device IDs.
      *
-     * @return 	Device ID of the capture device.
+     * @return 			Device ID of the capture device.
      */
     int getCaptureDev() const throw(Error);
+
+    /**
+     * Get the AudioMedia of the capture audio device.
+     *
+     * @return			Audio media for the capture device.
+     */
+    AudioMedia &getCaptureDevMedia() throw(Error);
 
     /**
@@ -481,7 +488,14 @@
      * been created, it is possible that the function returns -1 as device IDs.
      *
-     * @return 	Device ID of the playback device.
+     * @return 			Device ID of the playback device.
      */
     int getPlaybackDev() const throw(Error);
+
+    /**
+     * Get the AudioMedia of the speaker/playback audio device.
+     *
+     * @return			Audio media for the speaker/playback device.
+     */
+    AudioMedia &getPlaybackDevMedia() throw(Error);
 
     /**
@@ -504,5 +518,5 @@
      * Enum all audio devices installed in the system.
      *
-     * @return		The list of audio device info.
+     * @return			The list of audio device info.
      */
     const AudioDevInfoVector &enumDev() throw(Error);
@@ -520,7 +534,7 @@
      * application connect the bridge to it's own sound device/master port.
      *
-     * @return		The port interface of the conference bridge,
-     *			so that application can connect this to it's own
-     *			sound device or master port.
+     * @return			The port interface of the conference bridge,
+     *				so that application can connect this to it's
+     *				own sound device or master port.
      */
     MediaPort *setNoDev();
@@ -555,6 +569,6 @@
      * Get current echo canceller tail length.
      *
-     * @return		The EC tail length in milliseconds,
-     *			If AEC is disabled, the value will be zero.
+     * @return			The EC tail length in milliseconds,
+     *				If AEC is disabled, the value will be zero.
      */
     unsigned getEcTail() const throw(Error);
@@ -582,5 +596,6 @@
      * Get the number of sound devices installed in the system.
      *
-     * @return 	The number of sound devices installed in the system.
+     * @return 			The number of sound devices installed in the
+     * 				system.
      *
      */
@@ -600,10 +615,9 @@
      * Lookup device index based on the driver and device name.
      *
-     * @param drv_name	The driver name.
-     * @param dev_name	The device name.
-     *
-     * @return		The device ID. If the device is not found, Error will be
-     * 			thrown.
-     *
+     * @param drv_name		The driver name.
+     * @param dev_name		The device name.
+     *
+     * @return			The device ID. If the device is not found,
+     * 				Error will be thrown.
      */
     int lookupDev(const string &drv_name,
@@ -633,7 +647,7 @@
      * used.
      *
-     * @param format	The audio format.
-     * @param keep	Specify whether the setting is to be kept for
-     * 			future use.
+     * @param format		The audio format.
+     * @param keep		Specify whether the setting is to be kept for
+     * 				future use.
      *
      */
@@ -653,5 +667,5 @@
      * otherwise Error will be thrown.
      *
-     * @return	    The audio format.
+     * @return	    		The audio format.
      *
      */
@@ -672,8 +686,7 @@
      * used.
      *
-     * @param latency_msec	    The input latency.
-     * @param keep		    Specify whether the setting is to be kept
-     *				    for future use.
-     *
+     * @param latency_msec	The input latency.
+     * @param keep		Specify whether the setting is to be kept
+     *				for future use.
      */
     void
@@ -692,5 +705,5 @@
      * otherwise Error will be thrown.
      *
-     * @return	    The audio input latency.
+     * @return	    		The audio input latency.
      *
      */
@@ -731,5 +744,5 @@
      * otherwise Error will be thrown.
      *
-     * @return	    The audio output latency.
+     * @return	    		The audio output latency.
      *
      */
@@ -751,7 +764,7 @@
      * used.
      *
-     * @param volume	The input volume level, in percent.
-     * @param keep	Specify whether the setting is to be kept for future
-     * 			use.
+     * @param volume		The input volume level, in percent.
+     * @param keep		Specify whether the setting is to be kept for
+     * 				future use.
      *
      */
@@ -770,5 +783,5 @@
      * flags, otherwise Error will be thrown.     *
 
-     * @return	    The audio input volume level, in percent.
+     * @return	    		The audio input volume level, in percent.
      *
      */
@@ -789,7 +802,7 @@
      * used.
      *
-     * @param volume	The output volume level, in percent.
-     * @param keep	Specify whether the setting is to be kept
-     * 			for future use.
+     * @param volume		The output volume level, in percent.
+     * @param keep		Specify whether the setting is to be kept
+     * 				for future use.
      *
      */
@@ -808,5 +821,5 @@
      * flags, otherwise Error will be thrown.
      *
-     * @return	    The audio output volume level, in percent.
+     * @return	    		The audio output volume level, in percent.
      *
      */
@@ -825,5 +838,5 @@
      * flags, otherwise Error will be thrown.
      *
-     * @return	    The audio input signal level, in percent.
+     * @return	    		The audio input signal level, in percent.
      *
      */
@@ -842,5 +855,5 @@
      * flags, otherwise Error will be thrown.
      *
-     * @return	    The audio output signal level, in percent.
+     * @return	    		The audio output signal level, in percent.
      *
      */
@@ -861,7 +874,7 @@
      * used.
      *
-     * @param route	The audio input route.
-     * @param keep	Specify whether the setting is to be kept
-     * 			for future use.
+     * @param route		The audio input route.
+     * @param keep		Specify whether the setting is to be kept
+     * 				for future use.
      *
      */
@@ -881,5 +894,5 @@
      * flags, otherwise Error will be thrown.
      *
-     * @return	    The audio input route.
+     * @return	    		The audio input route.
      *
      */
@@ -900,7 +913,7 @@
      * used.
      *
-     * @param route	The audio output route.
-     * @param keep	Specify whether the setting is to be kept
-     * 			for future use.
+     * @param route		The audio output route.
+     * @param keep		Specify whether the setting is to be kept
+     * 				for future use.
      *
      */
@@ -920,5 +933,5 @@
      * flags, otherwise Error will be thrown.
      *
-     * @return	    The audio output route.
+     * @return	    		The audio output route.
      *
      */
@@ -957,5 +970,5 @@
      * capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
      *
-     * @return	    The audio voice activity detection feature.
+     * @return	    		The audio voice activity detection feature.
      *
      */
@@ -994,5 +1007,5 @@
      * capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
      *
-     * @return	    The audio comfort noise generation feature.
+     * @return	    		The audio comfort noise generation feature.
      *
      */
@@ -1031,5 +1044,5 @@
      * capability in AudioDevInfo.caps flags, otherwise Error will be thrown.
      *
-     * @return	    The audio packet loss concealment feature.
+     * @return	    		The audio packet loss concealment feature.
      *
      */
@@ -1038,4 +1051,5 @@
 private:
     AudioDevInfoVector		 audioDevList;
+    AudioMedia			*devMedia;
 
     /**
Index: pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp
===================================================================
--- pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp	(revision 4675)
+++ pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp	(revision 4676)
@@ -356,7 +356,35 @@
     extFmt.clear();
 }
+
+///////////////////////////////////////////////////////////////////////////////
+/*
+ * Simple AudioMedia class for sound device.
+ */
+class DevAudioMedia : public AudioMedia
+{
+public:
+    DevAudioMedia();
+};
+
+DevAudioMedia::DevAudioMedia()
+{
+    this->id = 0;
+    registerMediaPort(NULL);
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 /* Audio device operations. */
 
+AudDevManager::AudDevManager()
+{
+    devMedia = new DevAudioMedia;
+}
+
+AudDevManager::~AudDevManager()
+{
+    delete devMedia;
+    clearAudioDevList();
+}
+
 int AudDevManager::getCaptureDev() const throw(Error)
 {
@@ -364,7 +392,17 @@
 }
 
+AudioMedia &AudDevManager::getCaptureDevMedia() throw(Error)
+{
+    return *devMedia;
+}
+
 int AudDevManager::getPlaybackDev() const throw(Error)
 {
     return getActiveDev(false);
+}
+
+AudioMedia &AudDevManager::getPlaybackDevMedia() throw(Error)
+{
+    return *devMedia;
 }
 
@@ -682,15 +720,4 @@
 }
 
-AudDevManager::AudDevManager()
-{
-
-
-}
-
-AudDevManager::~AudDevManager()
-{
-    clearAudioDevList();
-}
-
 void AudDevManager::clearAudioDevList()
 {
