diff options
author | Liong Sauw Ming <ming@teluu.com> | 2010-05-05 04:23:27 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2010-05-05 04:23:27 +0000 |
commit | 165f6a50faef766ca2532b717fe27f8e335e8265 (patch) | |
tree | cf9820da3385f51ad6da086a5e64a7ab1750b27a /pjmedia/include | |
parent | 810416dab92eeb54a9b01221ee9ff262305b13b5 (diff) |
Implemented ticket #1065: audiodev register/unregister feature
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3159 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r-- | pjmedia/include/pjmedia-audiodev/audiodev.h | 35 |
1 files changed, 34 insertions, 1 deletions
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. * @@ -510,6 +515,34 @@ 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. * * @return The number of sound devices installed in the system. |