From 165f6a50faef766ca2532b717fe27f8e335e8265 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Wed, 5 May 2010 04:23:27 +0000 Subject: Implemented ticket #1065: audiodev register/unregister feature git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3159 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/include/pjmedia-audiodev/audiodev.h | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'pjmedia/include') diff --git a/pjmedia/include/pjmedia-audiodev/audiodev.h b/pjmedia/include/pjmedia-audiodev/audiodev.h index 8f2ab783..5a523ca8 100644 --- a/pjmedia/include/pjmedia-audiodev/audiodev.h +++ b/pjmedia/include/pjmedia-audiodev/audiodev.h @@ -39,7 +39,7 @@ PJ_BEGIN_DECL * @{ */ -/** +/** * Type for device index. */ typedef pj_int32_t pjmedia_aud_dev_index; @@ -428,6 +428,11 @@ typedef struct pjmedia_aud_stream pjmedia_aud_stream; /** Forward declaration for audio device factory */ typedef struct pjmedia_aud_dev_factory pjmedia_aud_dev_factory; +/* typedef for factory creation function */ +typedef pjmedia_aud_dev_factory* +(*pjmedia_aud_dev_factory_create_func_ptr)(pj_pool_factory*); + + /** * Get string info for the specified capability. * @@ -509,6 +514,34 @@ PJ_DECL(pj_pool_factory*) pjmedia_aud_subsys_get_pool_factory(void); PJ_DECL(pj_status_t) pjmedia_aud_subsys_shutdown(void); +/** + * Register a supported audio device factory to the audio subsystem. This + * function can only be called after calling #pjmedia_aud_subsys_init(). + * + * @param adf The audio device factory. + * + * @return PJ_SUCCESS on successful operation or the appropriate + * error code. + */ +PJ_DECL(pj_status_t) +pjmedia_aud_register_factory(pjmedia_aud_dev_factory_create_func_ptr adf); + + +/** + * Unregister an audio device factory from the audio subsystem. This + * function can only be called after calling #pjmedia_aud_subsys_init(). + * Devices from this factory will be unlisted. If a device from this factory + * is currently in use, then the behavior is undefined. + * + * @param adf The audio device factory. + * + * @return PJ_SUCCESS on successful operation or the appropriate + * error code. + */ +PJ_DECL(pj_status_t) +pjmedia_aud_unregister_factory(pjmedia_aud_dev_factory_create_func_ptr adf); + + /** * Get the number of sound devices installed in the system. * -- cgit v1.2.3