Index: pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia-audiodev/audiodev.h
===================================================================
--- pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia-audiodev/audiodev.h	(revision 2466)
+++ pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia-audiodev/audiodev.h	(revision 2468)
@@ -18,6 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
-#ifndef __AUDIODEV_H__
-#define __AUDIODEV_H__
+#ifndef __PJMEDIA_AUDIODEV_AUDIODEV_H__
+#define __PJMEDIA_AUDIODEV_AUDIODEV_H__
 
 /**
@@ -52,9 +52,19 @@
  */
 
-/** Device identifier */
-typedef pj_int32_t pjmedia_aud_dev_id;
-
-/** Constant to denote default ID */
-#define PJMEDIA_AUD_DEV_DEFAULT_ID  (-1)
+/** 
+ * Type for device index.
+ */
+typedef pj_int32_t pjmedia_aud_dev_index;
+
+/** 
+ * Constant to denote default device 
+ */
+#define PJMEDIA_AUD_DEV_DEFAULT  (-1)
+
+/** 
+ * Type for device unique identifier. The unique device ID can be used to save
+ * a reference to a particular device across software reboots.
+ */
+typedef pj_uint32_t pjmedia_aud_dev_uid;
 
 
@@ -67,5 +77,5 @@
  *
  * Application can also set the specific features/capabilities when opening
- * the audio stream by setting the \a flags member of #pjmedia_aud_dev_param
+ * the audio stream by setting the \a flags member of #pjmedia_aud_param
  * structure.
  *
@@ -118,5 +128,5 @@
      * the audio volume in percent.
      */
-    PJMEDIA_AUD_DEV_CAP_INPUT_SIGNAL_VOLUME = 32,
+    PJMEDIA_AUD_DEV_CAP_INPUT_SIGNAL_METER = 32,
 
     /** 
@@ -125,5 +135,5 @@
      * the audio volume in percent.
      */
-    PJMEDIA_AUD_DEV_CAP_OUTPUT_SIGNAL_VOLUME = 64,
+    PJMEDIA_AUD_DEV_CAP_OUTPUT_SIGNAL_METER = 64,
 
     /** 
@@ -142,5 +152,5 @@
     /** 
      * The audio device has echo cancellation feature. The value of this
-     * capability is an integer containing boolean PJ_TRUE or PJ_FALSE.
+     * capability is a pj_bool_t containing boolean PJ_TRUE or PJ_FALSE.
      */
     PJMEDIA_AUD_DEV_CAP_EC = 512,
@@ -155,5 +165,5 @@
     /** 
      * The audio device has voice activity detection feature. The value
-     * of this capability is an integer containing boolean PJ_TRUE or 
+     * of this capability is a pj_bool_t containing boolean PJ_TRUE or 
      * PJ_FALSE.
      */
@@ -162,5 +172,5 @@
     /** 
      * The audio device has comfort noise generation feature. The value
-     * of this capability is an integer containing boolean PJ_TRUE or 
+     * of this capability is a pj_bool_t containing boolean PJ_TRUE or 
      * PJ_FALSE.
      */
@@ -169,5 +179,5 @@
     /** 
      * The audio device has packet loss concealment feature. The value
-     * of this capability is an integer containing boolean PJ_TRUE or 
+     * of this capability is a pj_bool_t containing boolean PJ_TRUE or 
      * PJ_FALSE.
      */
@@ -226,5 +236,5 @@
      * The underlying driver name 
      */
-    char driver[128];
+    char driver[32];
 
     /** 
@@ -290,7 +300,7 @@
 
 /**
- * This structure specifies the parameters to open the audio device stream.
- */
-typedef struct pjmedia_aud_dev_param
+ * This structure specifies the parameters to open the audio stream.
+ */
+typedef struct pjmedia_aud_param
 {
     /**
@@ -303,5 +313,5 @@
      * direction includes input/capture direction.
      */
-    pjmedia_aud_dev_id rec_id;
+    pjmedia_aud_dev_index rec_id;
 
     /**
@@ -309,5 +319,5 @@
      * direction includes output/playback direction.
      */
-    pjmedia_aud_dev_id play_id;
+    pjmedia_aud_dev_index play_id;
 
     /** 
@@ -387,5 +397,5 @@
     pj_bool_t cng_enabled;
 
-} pjmedia_aud_dev_param;
+} pjmedia_aud_param;
 
 
@@ -432,4 +442,17 @@
 
 /**
+ * Get string info for the specified capability.
+ *
+ * @param cap		The capability ID.
+ * @param p_desc	Optional pointer which will be filled with longer 
+ *			description about the capability.
+ *
+ * @return		Capability name.
+ */
+PJ_DECL(const char*) pjmedia_aud_dev_cap_name(pjmedia_aud_dev_cap cap,
+					      const char **p_desc);
+
+
+/**
  * Get the number of sound devices installed in the system.
  *
@@ -438,15 +461,4 @@
 PJ_DECL(unsigned) pjmedia_aud_dev_count(void);
 
-
-/**
- * Enumerate device ID's.
- *
- * @param max_count	Maximum number of device id's to retrieve.
- * @param ids		Array to receive the device id's.
- *
- * @return		The actual number of device id's filled in.
- */
-PJ_DECL(unsigned) pjmedia_aud_dev_enum(unsigned max_count,
-				       pjmedia_aud_dev_id ids[]);
 
 /**
@@ -460,6 +472,19 @@
  *			error code.
  */
-PJ_DECL(pj_status_t) pjmedia_aud_dev_get_info(pjmedia_aud_dev_id id,
+PJ_DECL(pj_status_t) pjmedia_aud_dev_get_info(pjmedia_aud_dev_index id,
 					      pjmedia_aud_dev_info *info);
+
+
+/**
+ * Lookup device index based on the driver and device name.
+ *
+ * @param drv_name	The driver name.
+ * @param dev_name	The device name.
+ *
+ * @return		PJ_SUCCESS if the device can be found.
+ */
+PJ_DECL(pj_status_t) pjmedia_aud_dev_lookup(const char *drv_name,
+					    const char *dev_name,
+					    pjmedia_aud_dev_index *id);
 
 
@@ -475,6 +500,6 @@
  *			error code.
  */
-PJ_DECL(pj_status_t) pjmedia_aud_dev_default_param(pjmedia_aud_dev_id id,
-						   pjmedia_aud_dev_param *param);
+PJ_DECL(pj_status_t) pjmedia_aud_dev_default_param(pjmedia_aud_dev_index id,
+						   pjmedia_aud_param *param);
 
 
@@ -493,9 +518,9 @@
  *			error code.
  */
-PJ_DECL(pj_status_t) pjmedia_aud_stream_create(const pjmedia_aud_dev_param *param,
+PJ_DECL(pj_status_t) pjmedia_aud_stream_create(const pjmedia_aud_param *param,
 					       pjmedia_aud_rec_cb rec_cb,
 					       pjmedia_aud_play_cb play_cb,
 					       void *user_data,
-					       pjmedia_aud_stream **p_aud_strm);
+					       pjmedia_aud_stream **p_strm);
 
 /**
@@ -510,5 +535,5 @@
  */
 PJ_DECL(pj_status_t) pjmedia_aud_stream_get_param(pjmedia_aud_stream *strm,
-						  pjmedia_aud_dev_param *param);
+						  pjmedia_aud_param *param);
 
 /**
@@ -581,4 +606,7 @@
 #define PJMEDIA_EAUD_NOTREADY	-1
 
+/* Invalid audio capability or audio capability not supported */
+#define PJMEDIA_EAUD_INVCAP	-1
+
 /* Unknown system error */
 #define PJMEDIA_EAUD_SYSERR	-1
@@ -592,4 +620,4 @@
 
 
-#endif	/* __AUDIODEV_H__ */
-
+#endif	/* __PJMEDIA_AUDIODEV_AUDIODEV_H__ */
+
