Changeset 321 for pjproject/trunk
- Timestamp:
- Mar 16, 2006 6:52:55 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/build/pjmedia.dsp
r320 r321 169 169 # Begin Source File 170 170 171 SOURCE=..\src\pjmedia\sound_port.c 172 # End Source File 173 # Begin Source File 174 171 175 SOURCE=..\src\pjmedia\stream.c 172 176 # End Source File … … 254 258 255 259 SOURCE=..\include\pjmedia\sound.h 260 # End Source File 261 # Begin Source File 262 263 SOURCE=..\include\pjmedia\sound_port.h 256 264 # End Source File 257 265 # Begin Source File -
pjproject/trunk/pjmedia/include/pjmedia/errno.h
r319 r321 416 416 */ 417 417 #define PJMEDIA_ENCBYTES (PJMEDIA_ERRNO_START+165) /* 220165 */ 418 /** 419 * @hideinitializer 420 * Incompatible number of channels 421 */ 422 #define PJMEDIA_ENCCHANNEL (PJMEDIA_ERRNO_START+166) /* 220166 */ 418 423 419 424 -
pjproject/trunk/pjmedia/include/pjmedia/port.h
r205 r321 79 79 pj_str_t encoding_name; /**< Encoding name. */ 80 80 unsigned sample_rate; /**< Sampling rate. */ 81 unsigned channel_count; /**< Number of channels. */ 81 82 unsigned bits_per_sample; /**< Bits/sample */ 82 83 unsigned samples_per_frame; /**< No of samples per frame. */ -
pjproject/trunk/pjmedia/include/pjmedia/rtcp.h
r188 r321 40 40 * RTCP sender report. 41 41 */ 42 struct pj _rtcp_sr42 struct pjmedia_rtcp_sr 43 43 { 44 44 pj_uint32_t ssrc; /**< SSRC identification. */ … … 51 51 52 52 /** 53 * @see pj _rtcp_sr54 */ 55 typedef struct pj _rtcp_sr pj_rtcp_sr;53 * @see pjmedia_rtcp_sr 54 */ 55 typedef struct pjmedia_rtcp_sr pjmedia_rtcp_sr; 56 56 57 57 /** 58 58 * RTCP receiver report. 59 59 */ 60 struct pj _rtcp_rr60 struct pjmedia_rtcp_rr 61 61 { 62 62 pj_uint32_t ssrc; /**< SSRC identification. */ … … 79 79 80 80 /** 81 * @see pj _rtcp_rr82 */ 83 typedef struct pj _rtcp_rr pj_rtcp_rr;81 * @see pjmedia_rtcp_rr 82 */ 83 typedef struct pjmedia_rtcp_rr pjmedia_rtcp_rr; 84 84 85 85 … … 87 87 * RTCP common header. 88 88 */ 89 struct pj _rtcp_common89 struct pjmedia_rtcp_common 90 90 { 91 91 #if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0 … … 104 104 105 105 /** 106 * @see pj _rtcp_common107 */ 108 typedef struct pj _rtcp_common pj_rtcp_common;106 * @see pjmedia_rtcp_common 107 */ 108 typedef struct pjmedia_rtcp_common pjmedia_rtcp_common; 109 109 110 110 /** 111 111 * RTCP packet. 112 112 */ 113 struct pj _rtcp_pkt114 { 115 pj _rtcp_common common; /**< Common header. */116 pj _rtcp_srsr; /**< Sender report. */117 pj _rtcp_rrrr; /**< variable-length list */118 }; 119 120 /** 121 * @see pj _rtcp_pkt122 */ 123 typedef struct pj _rtcp_pkt pj_rtcp_pkt;113 struct pjmedia_rtcp_pkt 114 { 115 pjmedia_rtcp_common common; /**< Common header. */ 116 pjmedia_rtcp_sr sr; /**< Sender report. */ 117 pjmedia_rtcp_rr rr; /**< variable-length list */ 118 }; 119 120 /** 121 * @see pjmedia_rtcp_pkt 122 */ 123 typedef struct pjmedia_rtcp_pkt pjmedia_rtcp_pkt; 124 124 125 125 … … 127 127 * NTP time representation. 128 128 */ 129 struct pj _rtcp_ntp_rec129 struct pjmedia_rtcp_ntp_rec 130 130 { 131 131 pj_uint32_t hi; /**< High order 32-bit part. */ … … 134 134 135 135 /** 136 * @see pj _rtcp_ntp_rec137 */ 138 typedef struct pj _rtcp_ntp_rec pj_rtcp_ntp_rec;136 * @see pjmedia_rtcp_ntp_rec 137 */ 138 typedef struct pjmedia_rtcp_ntp_rec pjmedia_rtcp_ntp_rec; 139 139 140 140 … … 143 143 * RTCP session. 144 144 */ 145 struct pj _rtcp_session146 { 147 pj _rtcp_pkt rtcp_pkt; /**< Cached RTCP packet.*/145 struct pjmedia_rtcp_session 146 { 147 pjmedia_rtcp_pkt rtcp_pkt; /**< Cached RTCP packet. */ 148 148 149 149 pjmedia_rtp_seq_session seq_ctrl; /**< RTCP sequence number control. */ … … 155 155 pj_uint32_t jitter; /**< Estimated jitter */ 156 156 157 pj _rtcp_ntp_rec rtcp_lsr; /**< NTP ts in last SR received*/158 unsigned rtcp_lsr_time; /**< Time when last SR is received.*/159 pj_uint32_t peer_ssrc;/**< Peer SSRC */157 pjmedia_rtcp_ntp_rec rtcp_lsr; /**< NTP ts in last SR received */ 158 unsigned rtcp_lsr_time; /**< Time when last SR is received.*/ 159 pj_uint32_t peer_ssrc; /**< Peer SSRC */ 160 160 161 161 }; 162 162 163 163 /** 164 * @see pj _rtcp_session165 */ 166 typedef struct pj _rtcp_session pj_rtcp_session;164 * @see pjmedia_rtcp_session 165 */ 166 typedef struct pjmedia_rtcp_session pjmedia_rtcp_session; 167 167 168 168 … … 173 173 * @param ssrc The SSRC used in to identify the session. 174 174 */ 175 PJ_DECL(void) pj_rtcp_init( pj_rtcp_session *session, pj_uint32_t ssrc ); 175 PJ_DECL(void) pjmedia_rtcp_init( pjmedia_rtcp_session *session, 176 pj_uint32_t ssrc ); 176 177 177 178 … … 181 182 * @param session The session. 182 183 */ 183 PJ_DECL(void) pj _rtcp_fini( pj_rtcp_session *session);184 PJ_DECL(void) pjmedia_rtcp_fini( pjmedia_rtcp_session *session); 184 185 185 186 … … 192 193 * @param ts The RTP packet timestamp, in host byte order. 193 194 */ 194 PJ_DECL(void) pj_rtcp_rx_rtp( pj_rtcp_session *session, pj_uint16_t seq, 195 pj_uint32_t ts ); 195 PJ_DECL(void) pjmedia_rtcp_rx_rtp( pjmedia_rtcp_session *session, 196 pj_uint16_t seq, 197 pj_uint32_t ts ); 196 198 197 199 … … 204 206 * RTP header) in bytes. 205 207 */ 206 PJ_DECL(void) pj_rtcp_tx_rtp( pj_rtcp_session *session, pj_uint16_t ptsize ); 208 PJ_DECL(void) pjmedia_rtcp_tx_rtp( pjmedia_rtcp_session *session, 209 pj_uint16_t ptsize ); 207 210 208 211 … … 216 219 * the RTCP packet. 217 220 */ 218 PJ_DECL(void) pj _rtcp_build_rtcp( pj_rtcp_session *session,219 pj_rtcp_pkt **rtcp_pkt,220 int *len );221 PJ_DECL(void) pjmedia_rtcp_build_rtcp( pjmedia_rtcp_session *session, 222 pjmedia_rtcp_pkt **rtcp_pkt, 223 int *len ); 221 224 222 225 -
pjproject/trunk/pjmedia/include/pjmedia/sound.h
r320 r321 37 37 38 38 /** Opaque data type for audio stream. */ 39 typedef struct pj _snd_stream pj_snd_stream;40 41 /** 42 * Device information structure returned by #pj _snd_get_dev_info.43 */ 44 typedef struct pj _snd_dev_info39 typedef struct pjmedia_snd_stream pjmedia_snd_stream; 40 41 /** 42 * Device information structure returned by #pjmedia_snd_get_dev_info. 43 */ 44 typedef struct pjmedia_snd_dev_info 45 45 { 46 46 char name[64]; /**< Device name. */ … … 48 48 unsigned output_count; /**< Max number of output channels. */ 49 49 unsigned default_samples_per_sec;/**< Default sampling rate. */ 50 } pj _snd_dev_info;50 } pjmedia_snd_dev_info; 51 51 52 52 /** … … 63 63 * @return Non-zero to stop the stream. 64 64 */ 65 typedef pj_status_t (*pj _snd_play_cb)(/* in */ void *user_data,65 typedef pj_status_t (*pjmedia_snd_play_cb)(/* in */ void *user_data, 66 66 /* in */ pj_uint32_t timestamp, 67 67 /* out */ void *output, … … 79 79 * @return Non-zero to stop the stream. 80 80 */ 81 typedef pj_status_t (*pj _snd_rec_cb)(/* in */ void *user_data,81 typedef pj_status_t (*pjmedia_snd_rec_cb)(/* in */ void *user_data, 82 82 /* in */ pj_uint32_t timestamp, 83 83 /* in */ const void *input, … … 91 91 * @return Zero on success. 92 92 */ 93 PJ_DECL(pj_status_t) pj _snd_init(pj_pool_factory *factory);93 PJ_DECL(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory); 94 94 95 95 … … 99 99 * @return Number of devices. 100 100 */ 101 PJ_DECL(int) pj _snd_get_dev_count(void);101 PJ_DECL(int) pjmedia_snd_get_dev_count(void); 102 102 103 103 … … 106 106 * 107 107 * @param index The index of the device, which should be in the range 108 * from zero to #pj _snd_get_dev_count - 1.109 */ 110 PJ_DECL(const pj _snd_dev_info*) pj_snd_get_dev_info(unsigned index);108 * from zero to #pjmedia_snd_get_dev_count - 1. 109 */ 110 PJ_DECL(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index); 111 111 112 112 … … 114 114 * Create a new audio stream for audio capture purpose. 115 115 * 116 * @param index Device index, or -1 to let the library choose the first 117 * available device, or -2 to use NULL device. 118 * @param param Stream parameters. 119 * @param rec_cb Callback to handle captured audio samples. 120 * @param user_data User data to be associated with the stream. 121 * 122 * @return Audio stream, or NULL if failed. 123 */ 124 PJ_DECL(pj_status_t) pj_snd_open_recorder( int index, 116 * @param index Device index, or -1 to let the library choose the 117 * first available device. 118 * @param clock_rate Sound device's clock rate to set. 119 * @param channel_count Set number of channels, 1 for mono, or 2 for 120 * stereo. The channel count determines the format 121 * of the frame. 122 * @param samples_per_frame Number of samples per frame. 123 * @param bits_per_sample Set the number of bits per sample. The normal 124 * value for this parameter is 16 bits per sample. 125 * @param rec_cb Callback to handle captured audio samples. 126 * @param user_data User data to be associated with the stream. 127 * @param p_snd_strm Pointer to receive the stream instance. 128 * 129 * @return PJ_SUCCESS on success. 130 */ 131 PJ_DECL(pj_status_t) pjmedia_snd_open_recorder( int index, 125 132 unsigned clock_rate, 126 133 unsigned channel_count, 127 134 unsigned samples_per_frame, 128 135 unsigned bits_per_sample, 129 pj _snd_rec_cb rec_cb,136 pjmedia_snd_rec_cb rec_cb, 130 137 void *user_data, 131 pj _snd_stream **p_snd_strm);138 pjmedia_snd_stream **p_snd_strm); 132 139 133 140 /** 134 141 * Create a new audio stream for playing audio samples. 135 142 * 136 * @param index Device index, or -1 to let the library choose the first 137 * available device, or -2 to use NULL device. 138 * @param param Stream parameters. 139 * @param play_cb Callback to supply audio samples. 140 * @param user_data User data to be associated with the stream. 141 * 142 * @return Audio stream, or NULL if failed. 143 */ 144 PJ_DECL(pj_status_t) pj_snd_open_player( int index, 143 * @param index Device index, or -1 to let the library choose the 144 * first available device. 145 * @param clock_rate Sound device's clock rate to set. 146 * @param channel_count Set number of channels, 1 for mono, or 2 for 147 * stereo. The channel count determines the format 148 * of the frame. 149 * @param samples_per_frame Number of samples per frame. 150 * @param bits_per_sample Set the number of bits per sample. The normal 151 * value for this parameter is 16 bits per sample. 152 * @param play_cb Callback to be called when the sound player needs 153 * more audio samples to play. 154 * @param user_data User data to be associated with the stream. 155 * @param p_snd_strm Pointer to receive the stream instance. 156 * 157 * @return PJ_SUCCESS on success. 158 */ 159 PJ_DECL(pj_status_t) pjmedia_snd_open_player( int index, 145 160 unsigned clock_rate, 146 161 unsigned channel_count, 147 162 unsigned samples_per_frame, 148 163 unsigned bits_per_sample, 149 pj _snd_play_cb play_cb,164 pjmedia_snd_play_cb play_cb, 150 165 void *user_data, 151 pj _snd_stream **p_snd_strm );166 pjmedia_snd_stream **p_snd_strm ); 152 167 153 168 /** … … 158 173 * @return Zero on success. 159 174 */ 160 PJ_DECL(pj_status_t) pj _snd_stream_start(pj_snd_stream *stream);175 PJ_DECL(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream); 161 176 162 177 /** … … 167 182 * @return Zero on success. 168 183 */ 169 PJ_DECL(pj_status_t) pj _snd_stream_stop(pj_snd_stream *stream);184 PJ_DECL(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream); 170 185 171 186 /** … … 176 191 * @return Zero on success. 177 192 */ 178 PJ_DECL(pj_status_t) pj _snd_stream_close(pj_snd_stream *stream);193 PJ_DECL(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream); 179 194 180 195 /** … … 183 198 * @return Zero on success. 184 199 */ 185 PJ_DECL(pj_status_t) pj _snd_deinit(void);200 PJ_DECL(pj_status_t) pjmedia_snd_deinit(void); 186 201 187 202 -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r319 r321 132 132 unsigned port_cnt; /**< Current number of ports. */ 133 133 unsigned connect_cnt; /**< Total number of connections */ 134 pj _snd_stream *snd_rec; /**< Sound recorder stream. */135 pj _snd_stream *snd_player; /**< Sound player stream. */134 pjmedia_snd_stream *snd_rec; /**< Sound recorder stream. */ 135 pjmedia_snd_stream *snd_player; /**< Sound player stream. */ 136 136 pj_mutex_t *mutex; /**< Conference mutex. */ 137 137 struct conf_port **ports; /**< Array of ports. */ … … 383 383 /* Open recorder only if mic is not disabled. */ 384 384 if ((conf->options & PJMEDIA_CONF_NO_MIC) == 0) { 385 status = pj _snd_open_recorder(-1, conf->clock_rate, 1,385 status = pjmedia_snd_open_recorder(-1, conf->clock_rate, 1, 386 386 conf->samples_per_frame, 387 387 conf->bits_per_sample, … … 394 394 395 395 /* Open player */ 396 status = pj _snd_open_player(-1, conf->clock_rate, 1,396 status = pjmedia_snd_open_player(-1, conf->clock_rate, 1, 397 397 conf->samples_per_frame, 398 398 conf->bits_per_sample, … … 400 400 if (status != PJ_SUCCESS) { 401 401 if (conf->snd_rec) { 402 pj _snd_stream_close(conf->snd_rec);402 pjmedia_snd_stream_close(conf->snd_rec); 403 403 conf->snd_rec = NULL; 404 404 } … … 416 416 { 417 417 if (conf->snd_rec) { 418 pj _snd_stream_close(conf->snd_rec);418 pjmedia_snd_stream_close(conf->snd_rec); 419 419 conf->snd_rec = NULL; 420 420 } 421 421 if (conf->snd_player) { 422 pj _snd_stream_close(conf->snd_player);422 pjmedia_snd_stream_close(conf->snd_player); 423 423 conf->snd_player = NULL; 424 424 } … … 442 442 /* Start recorder. */ 443 443 if (conf->snd_rec) { 444 status = pj _snd_stream_start(conf->snd_rec);444 status = pjmedia_snd_stream_start(conf->snd_rec); 445 445 if (status != PJ_SUCCESS) 446 446 goto on_error; … … 449 449 /* Start player. */ 450 450 if (conf->snd_player) { 451 status = pj _snd_stream_start(conf->snd_player);451 status = pjmedia_snd_stream_start(conf->snd_player); 452 452 if (status != PJ_SUCCESS) 453 453 goto on_error; -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r278 r321 107 107 108 108 /* Sound */ 109 pj _snd_init(pf);109 pjmedia_snd_init(pf); 110 110 111 111 /* Init codec manager. */ 112 112 status = pjmedia_codec_mgr_init(&endpt->codec_mgr); 113 113 if (status != PJ_SUCCESS) { 114 pj _snd_deinit();114 pjmedia_snd_deinit(); 115 115 goto on_error; 116 116 } … … 123 123 status = g711_init_factory (factory, endpt->pool); 124 124 if (status != PJ_SUCCESS) { 125 pj _snd_deinit();125 pjmedia_snd_deinit(); 126 126 goto on_error; 127 127 } … … 129 129 status = pjmedia_codec_mgr_register_factory (&endpt->codec_mgr, factory); 130 130 if (status != PJ_SUCCESS) { 131 pj _snd_deinit();131 pjmedia_snd_deinit(); 132 132 goto on_error; 133 133 } … … 159 159 endpt->pf = NULL; 160 160 161 pj _snd_deinit();161 pjmedia_snd_deinit(); 162 162 pj_pool_release (endpt->pool); 163 163 -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r319 r321 114 114 { PJMEDIA_ENCBITS, "Media ports have incompatible bits per sample" }, 115 115 { PJMEDIA_ENCBYTES, "Media ports have incompatible bytes per frame" }, 116 { PJMEDIA_ENCCHANNEL, "Media ports have incompatible number of channels" }, 116 117 117 118 /* Media file errors: */ -
pjproject/trunk/pjmedia/src/pjmedia/nullsound.c
r320 r321 22 22 #if defined(PJMEDIA_HAS_NULL_SOUND) && PJMEDIA_HAS_NULL_SOUND!=0 23 23 24 static pj _snd_dev_info null_info =24 static pjmedia_snd_dev_info null_info = 25 25 { 26 26 "Null Device", … … 31 31 32 32 33 PJ_DEF(pj_status_t) pj _snd_init(pj_pool_factory *factory)33 PJ_DEF(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory) 34 34 { 35 35 PJ_UNUSED_ARG(factory); … … 37 37 } 38 38 39 PJ_DEF(int) pj _snd_get_dev_count(void)39 PJ_DEF(int) pjmedia_snd_get_dev_count(void) 40 40 { 41 41 return 1; 42 42 } 43 43 44 PJ_DEF(const pj _snd_dev_info*) pj_snd_get_dev_info(unsigned index)44 PJ_DEF(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index) 45 45 { 46 46 PJ_ASSERT_RETURN(index==0, NULL); … … 48 48 } 49 49 50 PJ_DEF(pj_status_t) pj _snd_open_recorder( int index,50 PJ_DEF(pj_status_t) pjmedia_snd_open_recorder( int index, 51 51 unsigned clock_rate, 52 52 unsigned channel_count, 53 53 unsigned samples_per_frame, 54 54 unsigned bits_per_sample, 55 pj _snd_rec_cb rec_cb,55 pjmedia_snd_rec_cb rec_cb, 56 56 void *user_data, 57 pj _snd_stream **p_snd_strm)57 pjmedia_snd_stream **p_snd_strm) 58 58 { 59 59 PJ_UNUSED_ARG(index); … … 70 70 } 71 71 72 PJ_DEF(pj_status_t) pj _snd_open_player( int index,72 PJ_DEF(pj_status_t) pjmedia_snd_open_player( int index, 73 73 unsigned clock_rate, 74 74 unsigned channel_count, 75 75 unsigned samples_per_frame, 76 76 unsigned bits_per_sample, 77 pj _snd_play_cb play_cb,77 pjmedia_snd_play_cb play_cb, 78 78 void *user_data, 79 pj _snd_stream **p_snd_strm )79 pjmedia_snd_stream **p_snd_strm ) 80 80 { 81 81 PJ_UNUSED_ARG(index); … … 92 92 } 93 93 94 PJ_DEF(pj_status_t) pj _snd_stream_start(pj_snd_stream *stream)94 PJ_DEF(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream) 95 95 { 96 96 PJ_UNUSED_ARG(stream); … … 98 98 } 99 99 100 PJ_DEF(pj_status_t) pj _snd_stream_stop(pj_snd_stream *stream)100 PJ_DEF(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream) 101 101 { 102 102 PJ_UNUSED_ARG(stream); … … 104 104 } 105 105 106 PJ_DEF(pj_status_t) pj _snd_stream_close(pj_snd_stream *stream)106 PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream) 107 107 { 108 108 PJ_UNUSED_ARG(stream); … … 110 110 } 111 111 112 PJ_DEF(pj_status_t) pj _snd_deinit(void)112 PJ_DEF(pj_status_t) pjmedia_snd_deinit(void) 113 113 { 114 114 return PJ_SUCCESS; -
pjproject/trunk/pjmedia/src/pjmedia/pasound.c
r320 r321 33 33 } snd_mgr; 34 34 35 struct pj _snd_stream35 struct pjmedia_snd_stream 36 36 { 37 37 pj_pool_t *pool; … … 46 46 pj_uint32_t overflow; 47 47 void *user_data; 48 pj _snd_rec_cb rec_cb;49 pj _snd_play_cb play_cb;48 pjmedia_snd_rec_cb rec_cb; 49 pjmedia_snd_play_cb play_cb; 50 50 pj_bool_t quit_flag; 51 51 pj_bool_t thread_has_exited; … … 63 63 void *userData ) 64 64 { 65 pj _snd_stream *stream = userData;65 pjmedia_snd_stream *stream = userData; 66 66 pj_status_t status; 67 67 … … 103 103 void *userData ) 104 104 { 105 pj _snd_stream *stream = userData;105 pjmedia_snd_stream *stream = userData; 106 106 pj_status_t status; 107 107 unsigned size = frameCount * stream->bytes_per_sample; … … 141 141 * Init sound library. 142 142 */ 143 PJ_DEF(pj_status_t) pj _snd_init(pj_pool_factory *factory)143 PJ_DEF(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory) 144 144 { 145 145 int err; … … 152 152 Pa_GetHostApiCount())); 153 153 PJ_LOG(4,(THIS_FILE, "Sound device count=%d", 154 pj _snd_get_dev_count()));155 156 return err ;154 pjmedia_snd_get_dev_count())); 155 156 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 157 157 } 158 158 … … 161 161 * Get device count. 162 162 */ 163 PJ_DEF(int) pj _snd_get_dev_count(void)163 PJ_DEF(int) pjmedia_snd_get_dev_count(void) 164 164 { 165 165 return Pa_GetDeviceCount(); … … 170 170 * Get device info. 171 171 */ 172 PJ_DEF(const pj _snd_dev_info*) pj_snd_get_dev_info(unsigned index)173 { 174 static pj _snd_dev_info info;172 PJ_DEF(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index) 173 { 174 static pjmedia_snd_dev_info info; 175 175 const PaDeviceInfo *pa_info; 176 176 … … 193 193 * Open stream. 194 194 */ 195 PJ_DEF(pj_status_t) pj _snd_open_recorder( int index,195 PJ_DEF(pj_status_t) pjmedia_snd_open_recorder( int index, 196 196 unsigned clock_rate, 197 197 unsigned channel_count, 198 198 unsigned samples_per_frame, 199 199 unsigned bits_per_sample, 200 pj _snd_rec_cb rec_cb,200 pjmedia_snd_rec_cb rec_cb, 201 201 void *user_data, 202 pj _snd_stream **p_snd_strm)202 pjmedia_snd_stream **p_snd_strm) 203 203 { 204 204 pj_pool_t *pool; 205 pj _snd_stream *stream;205 pjmedia_snd_stream *stream; 206 206 PaStreamParameters inputParam; 207 207 int sampleFormat; … … 278 278 279 279 280 PJ_DEF(pj_status_t) pj _snd_open_player( int index,280 PJ_DEF(pj_status_t) pjmedia_snd_open_player( int index, 281 281 unsigned clock_rate, 282 282 unsigned channel_count, 283 283 unsigned samples_per_frame, 284 284 unsigned bits_per_sample, 285 pj _snd_play_cb play_cb,285 pjmedia_snd_play_cb play_cb, 286 286 void *user_data, 287 pj _snd_stream **p_snd_strm)287 pjmedia_snd_stream **p_snd_strm) 288 288 { 289 289 pj_pool_t *pool; 290 pj _snd_stream *stream;290 pjmedia_snd_stream *stream; 291 291 PaStreamParameters outputParam; 292 292 int sampleFormat; … … 367 367 * Start stream. 368 368 */ 369 PJ_DEF(pj_status_t) pj _snd_stream_start(pj_snd_stream *stream)370 { 371 pj_status_t status;369 PJ_DEF(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream) 370 { 371 pj_status_t err; 372 372 373 373 PJ_LOG(5,(THIS_FILE, "Starting %s stream..", stream->name.ptr)); 374 374 375 status= Pa_StartStream(stream->stream);376 377 PJ_LOG(5,(THIS_FILE, "Done, status=%d", status));378 379 return status;375 err = Pa_StartStream(stream->stream); 376 377 PJ_LOG(5,(THIS_FILE, "Done, status=%d", err)); 378 379 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 380 380 } 381 381 … … 383 383 * Stop stream. 384 384 */ 385 PJ_DEF(pj_status_t) pj _snd_stream_stop(pj_snd_stream *stream)385 PJ_DEF(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream) 386 386 { 387 387 int i, err; … … 399 399 PJ_LOG(5,(THIS_FILE, "Done, status=%d", err)); 400 400 401 return err ;401 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 402 402 } 403 403 … … 405 405 * Destroy stream. 406 406 */ 407 PJ_DEF(pj_status_t) pj _snd_stream_close(pj_snd_stream *stream)407 PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream) 408 408 { 409 409 int i, err; … … 424 424 err = Pa_CloseStream(stream->stream); 425 425 pj_pool_release(stream->pool); 426 return err; 426 427 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 427 428 } 428 429 … … 430 431 * Deinitialize sound library. 431 432 */ 432 PJ_DEF(pj_status_t) pj_snd_deinit(void) 433 { 433 PJ_DEF(pj_status_t) pjmedia_snd_deinit(void) 434 { 435 int err; 436 434 437 PJ_LOG(4,(THIS_FILE, "PortAudio sound library shutting down..")); 435 438 436 return Pa_Terminate(); 439 err = Pa_Terminate(); 440 441 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 437 442 } 438 443 -
pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
r188 r321 32 32 * Get NTP time. 33 33 */ 34 static void rtcp_get_ntp_time(struct pj _rtcp_ntp_rec *ntp)34 static void rtcp_get_ntp_time(struct pjmedia_rtcp_ntp_rec *ntp) 35 35 { 36 36 pj_time_val tv; … … 45 45 46 46 47 PJ_DEF(void) pj_rtcp_init(pj_rtcp_session *s, pj_uint32_t ssrc) 48 { 49 pj_rtcp_pkt *rtcp_pkt = &s->rtcp_pkt; 50 51 pj_memset(rtcp_pkt, 0, sizeof(pj_rtcp_pkt)); 47 PJ_DEF(void) pjmedia_rtcp_init(pjmedia_rtcp_session *s, 48 pj_uint32_t ssrc) 49 { 50 pjmedia_rtcp_pkt *rtcp_pkt = &s->rtcp_pkt; 51 52 pj_memset(rtcp_pkt, 0, sizeof(pjmedia_rtcp_pkt)); 52 53 53 54 /* Init time */ … … 67 68 } 68 69 69 PJ_DEF(void) pj _rtcp_fini(pj_rtcp_session *session)70 PJ_DEF(void) pjmedia_rtcp_fini(pjmedia_rtcp_session *session) 70 71 { 71 72 /* Nothing to do. */ … … 73 74 } 74 75 75 static void rtcp_init_seq(pj _rtcp_session *s, pj_uint16_t seq)76 static void rtcp_init_seq(pjmedia_rtcp_session *s, pj_uint16_t seq) 76 77 { 77 78 s->received = 0; … … 84 85 } 85 86 86 PJ_DEF(void) pj_rtcp_rx_rtp(pj_rtcp_session *s, pj_uint16_t seq, pj_uint32_t rtp_ts) 87 PJ_DEF(void) pjmedia_rtcp_rx_rtp(pjmedia_rtcp_session *s, 88 pj_uint16_t seq, 89 pj_uint32_t rtp_ts) 87 90 { 88 91 pj_uint32_t arrival; … … 130 133 } 131 134 132 PJ_DEF(void) pj_rtcp_tx_rtp(pj_rtcp_session *s, pj_uint16_t bytes_payload_size) 133 { 134 pj_rtcp_pkt *rtcp_pkt = &s->rtcp_pkt; 135 PJ_DEF(void) pjmedia_rtcp_tx_rtp(pjmedia_rtcp_session *s, 136 pj_uint16_t bytes_payload_size) 137 { 138 pjmedia_rtcp_pkt *rtcp_pkt = &s->rtcp_pkt; 135 139 rtcp_pkt->sr.sender_pcount = pj_htonl( pj_ntohl(rtcp_pkt->sr.sender_pcount) + 1); 136 140 rtcp_pkt->sr.sender_bcount = pj_htonl( pj_ntohl(rtcp_pkt->sr.sender_bcount) + bytes_payload_size ); 137 141 } 138 142 139 static void rtcp_build_rtcp(pj_rtcp_session *s, pj_uint32_t receiver_ssrc) 143 static void rtcp_build_rtcp(pjmedia_rtcp_session *s, 144 pj_uint32_t receiver_ssrc) 140 145 { 141 146 pj_uint32_t expected; 142 147 pj_uint32_t u32; 143 148 pj_uint32_t expected_interval, received_interval, lost_interval; 144 pj _rtcp_pkt *rtcp_pkt = &s->rtcp_pkt;149 pjmedia_rtcp_pkt *rtcp_pkt = &s->rtcp_pkt; 145 150 146 151 /* SSRC and last_seq */ … … 176 181 } 177 182 178 PJ_DEF(void) pj_rtcp_build_rtcp(pj_rtcp_session *session, pj_rtcp_pkt **ret_p_pkt, int *len) 179 { 180 pj_rtcp_pkt *rtcp_pkt = &session->rtcp_pkt; 181 pj_rtcp_ntp_rec ntp; 183 PJ_DEF(void) pjmedia_rtcp_build_rtcp(pjmedia_rtcp_session *session, 184 pjmedia_rtcp_pkt **ret_p_pkt, 185 int *len) 186 { 187 pjmedia_rtcp_pkt *rtcp_pkt = &session->rtcp_pkt; 188 pjmedia_rtcp_ntp_rec ntp; 182 189 pj_time_val now; 183 190 … … 214 221 /* Return pointer. */ 215 222 *ret_p_pkt = rtcp_pkt; 216 *len = sizeof(pj _rtcp_pkt);217 } 218 223 *len = sizeof(pjmedia_rtcp_pkt); 224 } 225 -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r319 r321 100 100 unsigned rem_src_cnt; /**< if different, # of pkt rcv */ 101 101 102 pj _rtcp_sessionrtcp; /**< RTCP for incoming RTP. */102 pjmedia_rtcp_session rtcp; /**< RTCP for incoming RTP. */ 103 103 104 104 pj_bool_t quit_flag; /**< To signal thread exit. */ … … 521 521 continue; 522 522 } 523 pj _rtcp_rx_rtp(&stream->rtcp, pj_ntohs(hdr->seq), pj_ntohl(hdr->ts));523 pjmedia_rtcp_rx_rtp(&stream->rtcp, pj_ntohs(hdr->seq), pj_ntohl(hdr->ts)); 524 524 525 525 /* Update stat */ … … 721 721 /* Init RTCP session: */ 722 722 723 pj _rtcp_init(&stream->rtcp, info->ssrc);723 pjmedia_rtcp_init(&stream->rtcp, info->ssrc); 724 724 725 725 … … 790 790 if (stream->enc && stream->enc->snd_stream) { 791 791 792 pj _snd_stream_stop(stream->enc->snd_stream);793 pj _snd_stream_close(stream->enc->snd_stream);792 pjmedia_snd_stream_stop(stream->enc->snd_stream); 793 pjmedia_snd_stream_close(stream->enc->snd_stream); 794 794 stream->enc->snd_stream = NULL; 795 795 … … 802 802 if (stream->dec && stream->dec->snd_stream) { 803 803 804 pj _snd_stream_stop(stream->dec->snd_stream);805 pj _snd_stream_close(stream->dec->snd_stream);804 pjmedia_snd_stream_stop(stream->dec->snd_stream); 805 pjmedia_snd_stream_close(stream->dec->snd_stream); 806 806 stream->dec->snd_stream = NULL; 807 807 … … 858 858 if (stream->enc && (stream->dir & PJMEDIA_DIR_ENCODING)) { 859 859 stream->enc->paused = 0; 860 //pj _snd_stream_start(stream->enc->snd_stream);860 //pjmedia_snd_stream_start(stream->enc->snd_stream); 861 861 PJ_LOG(4,(THIS_FILE, "Encoder stream started")); 862 862 } else { … … 866 866 if (stream->dec && (stream->dir & PJMEDIA_DIR_DECODING)) { 867 867 stream->dec->paused = 0; 868 //pj _snd_stream_start(stream->dec->snd_stream);868 //pjmedia_snd_stream_start(stream->dec->snd_stream); 869 869 PJ_LOG(4,(THIS_FILE, "Decoder stream started")); 870 870 } else { -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r320 r321 1085 1085 1086 1086 1087 /* Destroy sound framework:1088 * (this should be done in pjmedia_shutdown())1089 */1090 pj_snd_deinit();1091 1092 1087 /* Shutdown all codecs: */ 1093 1088 for (i = pjsua.codec_cnt-1; i >= 0; --i) {
Note: See TracChangeset
for help on using the changeset viewer.