Changeset 4443 for pjproject/trunk
- Timestamp:
- Mar 20, 2013 6:56:19 AM (12 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r4240 r4443 60 60 # define PJMEDIA_CONF_USE_SWITCH_BOARD 0 61 61 #endif 62 63 /** 64 * Specify buffer size for audio switch board, in bytes. This buffer will 65 * be used for transmitting/receiving audio frame data (and some overheads, 66 * i.e: pjmedia_frame structure) among conference ports in the audio 67 * switch board. For example, if a port uses PCM format @44100Hz mono 68 * and frame time 20ms, the PCM audio data will require 1764 bytes, 69 * so with overhead, a safe buffer size will be ~1900 bytes. 70 * 71 * Default: PJMEDIA_MAX_MTU 72 */ 73 #ifndef PJMEDIA_CONF_SWITCH_BOARD_BUF_SIZE 74 # define PJMEDIA_CONF_SWITCH_BOARD_BUF_SIZE PJMEDIA_MAX_MTU 75 #endif 76 62 77 63 78 /* -
pjproject/trunk/pjmedia/src/pjmedia/conf_switch.c
r4122 r4443 51 51 #define SLOT_TYPE unsigned 52 52 #define INVALID_SLOT ((SLOT_TYPE)-1) 53 #define BUFFER_SIZE PJMEDIA_ MAX_MTU53 #define BUFFER_SIZE PJMEDIA_CONF_SWITCH_BOARD_BUF_SIZE 54 54 #define MAX_LEVEL (32767) 55 55 #define MIN_LEVEL (-32768) … … 144 144 145 145 PJ_ASSERT_RETURN(pool && conf && port && name && p_conf_port, PJ_EINVAL); 146 147 /* Check port's buffer size */ 148 if (port->info.fmt.id == PJMEDIA_FORMAT_PCM && 149 PJMEDIA_PIA_SPF(&port->info)*2 > BUFFER_SIZE - sizeof(pjmedia_frame)) 150 { 151 pj_assert(!"Too small buffer size for audio switchboard. " 152 "Try increase PJMEDIA_CONF_SWITCH_BOARD_BUF_SIZE"); 153 return PJ_ETOOSMALL; 154 } 146 155 147 156 /* Create port. */
Note: See TracChangeset
for help on using the changeset viewer.