From 0eac1761fb3d3fb17799f1e8363f25b495094d07 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Thu, 19 Nov 2015 04:03:00 +0000 Subject: Re #1882 (misc): Configurable audio device name length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Wolfgang Wallhäuser for the original patch. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5201 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/include/pjmedia-audiodev/audiodev.h | 2 +- pjmedia/include/pjmedia-audiodev/config.h | 14 ++++++++++++++ pjmedia/include/pjmedia/sound.h | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pjmedia/include/pjmedia-audiodev/audiodev.h b/pjmedia/include/pjmedia-audiodev/audiodev.h index a314f101..b5e144f2 100644 --- a/pjmedia/include/pjmedia-audiodev/audiodev.h +++ b/pjmedia/include/pjmedia-audiodev/audiodev.h @@ -223,7 +223,7 @@ typedef struct pjmedia_aud_dev_info /** * The device name */ - char name[64]; + char name[PJMEDIA_AUD_DEV_INFO_NAME_LEN]; /** * Maximum number of input channels supported by this device. If the diff --git a/pjmedia/include/pjmedia-audiodev/config.h b/pjmedia/include/pjmedia-audiodev/config.h index b05f822d..b55aed44 100644 --- a/pjmedia/include/pjmedia-audiodev/config.h +++ b/pjmedia/include/pjmedia-audiodev/config.h @@ -42,6 +42,20 @@ PJ_BEGIN_DECL * @{ */ +/** + * This setting controls the buffer length of audio device name. + * + * Default: 128 for Windows platforms, 64 for others + */ +#ifndef PJMEDIA_AUD_DEV_INFO_NAME_LEN +# if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ + (defined(PJ_WIN64) && PJ_WIN64!=0) +# define PJMEDIA_AUD_DEV_INFO_NAME_LEN 128 +# else +# define PJMEDIA_AUD_DEV_INFO_NAME_LEN 64 +# endif +#endif + /** * This setting controls whether PortAudio support should be included. * diff --git a/pjmedia/include/pjmedia/sound.h b/pjmedia/include/pjmedia/sound.h index c1eb9211..3bedb08f 100644 --- a/pjmedia/include/pjmedia/sound.h +++ b/pjmedia/include/pjmedia/sound.h @@ -75,7 +75,8 @@ typedef struct pjmedia_snd_stream pjmedia_snd_stream; */ typedef struct pjmedia_snd_dev_info { - char name[64]; /**< Device name. */ + char name[PJMEDIA_AUD_DEV_INFO_NAME_LEN]; + /**< Device name. */ unsigned input_count; /**< Max number of input channels. */ unsigned output_count; /**< Max number of output channels. */ unsigned default_samples_per_sec;/**< Default sampling rate. */ -- cgit v1.2.3