- Timestamp:
- Jun 20, 2006 3:39:07 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/docs/doxygen.cfg
r518 r531 346 346 # with spaces. 347 347 348 INPUT = include 348 INPUT = include ../pjsip-apps/src/samples 349 349 350 350 # If the value of the INPUT tag contains directories, you can use the … … 355 355 # *.h++ *.idl *.odl 356 356 357 FILE_PATTERNS = *.h 357 FILE_PATTERNS = *.h *.c 358 358 359 359 # The RECURSIVE tag can be used to turn specify whether or not subdirectories … … 384 384 # the \include command). 385 385 386 EXAMPLE_PATH = 386 EXAMPLE_PATH = ../pjsip-apps/src/samples 387 387 388 388 # If the value of the EXAMPLE_PATH tag contains directories, you can use the -
pjproject/trunk/pjmedia/include/pjmedia-codec.h
r411 r531 20 20 #define __PJMEDIA_CODEC_PJMEDIA_CODEC_H__ 21 21 22 /** 23 * @file pjmedia-codec.h 24 * @brief Include all codecs API in PJMEDIA-CODEC 25 */ 26 22 27 #include <pjmedia-codec/l16.h> 23 28 #include <pjmedia-codec/gsm.h> -
pjproject/trunk/pjmedia/include/pjmedia-codec/gsm.h
r518 r531 28 28 29 29 /** 30 * @defgroup PJMED_GSM GSM 06.10 30 * @defgroup PJMED_GSM GSM 06.10 Codec 31 31 * @ingroup PJMEDIA_CODEC 32 32 * @brief Implementation of GSM FR based on GSM 06.10 library -
pjproject/trunk/pjmedia/include/pjmedia-codec/l16.h
r518 r531 24 24 25 25 /** 26 * @defgroup PJMED_L16 L16 Family26 * @defgroup PJMED_L16 L16 Codec Family 27 27 * @ingroup PJMEDIA_CODEC 28 28 * @brief 16bit linear codecs (useful for debugging) -
pjproject/trunk/pjmedia/include/pjmedia-codec/speex.h
r518 r531 28 28 29 29 /** 30 * @defgroup PJMED_SPEEX Speex 30 * @defgroup PJMED_SPEEX Speex Codec Family 31 31 * @ingroup PJMEDIA_CODEC 32 32 * @brief Implementation of Speex codecs (narrow/wide/ultrawide-band). -
pjproject/trunk/pjmedia/include/pjmedia/doxygen.h
r518 r531 62 62 * 63 63 * \n 64 * @section main_page_get_start_sec Getting Started 65 * 66 * For those who likes to just get start coding, the @ref getting_started_pjmedia 67 * may be a good place to start. 68 * 69 * The @ref page_pjmedia_samples page describes some examples that are available 70 * in the source tree. 71 * 72 * 73 * \n 64 74 * @section pjmedia_lic Copying and Acknowledgements 65 75 * 66 * Please see @ref lic_stuffs page for the details. 76 * PJMEDIA and PJMEDIA-CODEC contains various parts obtained from other 77 * places, and each of these would have their own licensing terms. 78 * Please see @ref lic_stuffs page for details. 79 * 80 */ 81 82 /** 83 * @page pjmed_keywords_page Features Index 84 * @section pjmed_keywords Features Index 85 * 86 * <b>PJMEDIA features</b>, in no particular order (click to go to the relevant 87 * documentation): 88 * @ref lic_stuffs "Open Source media stack", 89 * @ref PJMEDIA_CLOCK, 90 * @ref PJMEDIA_CODEC, 91 * @ref enc_dec_codec, 92 * @ref plc_codec, 93 * @ref PJMEDIA_CONF, 94 * @ref PJMED_G711 "G711/G.711 (PCMA/PCMU) codec with PLC", 95 * @ref PJMED_GSM "GSM codec with PLC", 96 * @ref PJMED_L16 "linear codecs (multiple clockrate, stereo support, etc)", 97 * @ref PJMED_SPEEX "Speex codec (narrowband, wideband, ultra-wideband)", 98 * @ref PJMED_JBUF "portable, adaptive jitter buffer with PLC support", 99 * @ref PJMEDIA_MASTER_PORT, 100 * @ref PJMEDIA_NULL_PORT, 101 * @ref PJMED_PLC, 102 * @ref PJMEDIA_PORT_CONCEPT, 103 * @ref PJMEDIA_PORT_CLOCK, 104 * @ref PJMEDIA_RESAMPLE "high quality resampling/sampling rate conversion", 105 * @ref PJMEDIA_RESAMPLE_PORT, 106 * @ref PJMED_RTCP "small footprint, portable RTCP with media quality statistics", 107 * @ref PJMED_RTP "very small footprint, modular, DSP ready RTP implementation", 108 * @ref PJMEDIA_SDP "modular, small footprint, open source SDP implementation", 109 * @ref PJMEDIA_SDP_NEG "modular SDP negotiation/negotiator abstraction", 110 * @ref PJMED_SES "media session abstraction", 111 * @ref PJMEDIA_SILENCEDET, 112 * @ref PJMED_SND "portable audio/sound hardware/device abstraction for Linux, Unix, Windows, DirectSound, WinCE, Windows Mobile, MacOS X, etc.", 113 * @ref PJMED_SND_PORT, 114 * @ref PJMEDIA_SPLITCOMB, 115 * @ref PJMED_STRM "remote stream", 116 * @ref PJMEDIA_TRANSPORT_H "custom media transport abstraction", 117 * @ref PJMEDIA_TRANSPORT_UDP, 118 * @ref PJMEDIA_FILE_PLAY "WAV/WAVE file playback", 119 * @ref PJMEDIA_FILE_REC "WAV/WAVE file recording/capture", 120 * @ref PJMEDIA_WAVE "portable WAV/WAVE header manipulation" 67 121 */ 68 122 … … 326 380 */ 327 381 382 383 /** 384 @page getting_started_pjmedia Getting Started with PJMEDIA 385 386 @section getstart_init_setup_build Setting-up the Build System 387 388 @subsection subsec_build_pjmedia Building PJMEDIA and PJMEDIA-CODEC 389 390 The PJMEDIA and PJMEDIA-CODEC libraries are normally bundled in PJPROJECT 391 source tarball, and they are located in <tt><b>pjmedia</b></tt> sub-directory 392 tree. 393 394 Please follow the instructions in <tt><b>INSTALL.txt</b></tt> in the root 395 PJPROJECT directory to build all projects, including PJMEDIA and PJMEDIA-CODEC. 396 397 @subsection subsec_config_build Setting Up the Build Environment 398 399 In your project, you will need to configure the following. 400 - Add <tt><b>$pjproject/pjmedia/include</b></tt> in the search path for 401 include files. 402 - Add <tt><b>$pjproject/pjmedia/lib</b></tt> in the search path for 403 library files. 404 - Add PJMEDIA and PJMEDIA static libraries in the link command. 405 406 @subsection subsec_inc_pjmedia Include PJMEDIA and PJMEDIA-CODEC in Source Files 407 408 To include all features from PJMEDIA and PJMEDIA-CODEC, use the following: 409 410 \code 411 #include <pjlib.h> 412 #include <pjmedia.h> 413 #include <pjmedia-codec.h> 414 \endcode 415 416 Alternatively, you may include only specific parts of the library (for example 417 to speed up compilation by just a fraction), for example: 418 419 \code 420 #include <pjmedia/conference.h> 421 #include <pjmedia/jbuf.h> 422 #include <pjmedia-codec/speex.h> 423 \endcode 424 425 Note that you need to give <b>"pjmedia/"</b> and <b>"pjmedia-codec/"</b> 426 prefix to include specific files. 427 428 429 @section getstart_using Using PJMEDIA 430 431 I wish I could explain more, but for now, please have a look at the 432 @ref page_pjmedia_samples page on some examples. 433 */ 434 435 /** 436 @page page_pjmedia_samples PJMEDIA and PJMEDIA-CODEC Examples 437 438 @section pjmedia_samples_sec PJMEDIA and PJMEDIA-CODEC Examples 439 440 Please find below some PJMEDIA related examples that may help in giving 441 some more info: 442 443 - @ref page_pjmedia_samples_level_c\n 444 This is a good place to start learning about @ref PJMEDIA_PORT_CONCEPT, 445 as it shows that @ref PJMEDIA_PORT_CONCEPT are only "passive" objects 446 with <tt>get_frame()</tt> and <tt>put_frame()</tt> interface, and 447 someone has to call these to retrieve/store media frames. 448 449 - @ref page_pjmedia_samples_playfile_c\n 450 This example shows that when application connects a media port (in this 451 case a @ref PJMEDIA_FILE_PLAY) to @ref PJMED_SND_PORT, media will flow 452 automatically since the @ref PJMED_SND_PORT provides @ref PJMEDIA_PORT_CLOCK. 453 454 - @ref page_pjmedia_samples_recfile_c\n 455 Demonstrates how to capture audio from microphone to WAV file. 456 457 - @ref page_pjmedia_samples_playsine_c\n 458 Demonstrates how to create a custom @ref PJMEDIA_PORT_CONCEPT (in this 459 case a sine wave generator) and integrate it to PJMEDIA. 460 461 - @ref page_pjmedia_samples_confsample_c\n 462 This demonstrates how to use the @ref PJMEDIA_CONF. The sample program can 463 open multiple WAV files, and instruct the conference bridge to mix the 464 signal before playing it to the sound device. 465 466 - @ref page_pjmedia_samples_confbench_c\n 467 I use this to benchmark/optimize the conference bridge algorithm, but 468 readers may find the source useful. 469 470 - @ref page_pjmedia_samples_resampleplay_c\n 471 Demonstrates how to use @ref PJMEDIA_RESAMPLE_PORT to change the 472 sampling rate of a media port (in this case, a @ref PJMEDIA_FILE_PLAY). 473 474 - @ref page_pjmedia_samples_sndtest_c\n 475 This program performs some tests to the sound device to get some 476 quality parameters (such as sound jitter and clock drifts).\n 477 Screenshots on WinXP: \image html sndtest.jpg "sndtest screenshot on WinXP" 478 479 - @ref page_pjmedia_samples_streamutil_c\n 480 This example mainly demonstrates how to stream media (in this case a 481 @ref PJMEDIA_FILE_PLAY) to remote peer using RTP. 482 483 - @ref page_pjmedia_samples_siprtp_c\n 484 This is a useful program (integrated with PJSIP) to actively measure 485 the network quality/impairment parameters by making one or more SIP 486 calls (or receiving one or more SIP calls) and display the network 487 impairment of each stream direction at the end of the call. 488 The program is able to measure network quality parameters such as 489 jitter, packet lost/reorder/duplicate, round trip time, etc.\n 490 Note that the remote peer MUST support RTCP so that network quality 491 of each direction can be calculated. Using siprtp for both endpoints 492 is recommended.\n 493 Screenshots on WinXP: \image html siprtp.jpg "siprtp screenshot on WinXP" 494 495 */ 496 497 /** 498 * \page page_pjmedia_samples_siprtp_c Samples: Using SIP and Custom RTP/RTCP to Monitor Quality 499 * 500 * This source is an example to demonstrate using SIP and RTP/RTCP framework 501 * to measure the network quality/impairment from the SIP call. This 502 * program can be used to make calls or to receive calls from other 503 * SIP endpoint (or other siprtp program), and to display the media 504 * quality statistics at the end of the call. 505 * 506 * Note that the remote peer must support RTCP. 507 * 508 * The layout of the program has been designed so that custom reporting 509 * can be generated instead of plain human readable text. 510 * 511 * The source code of the file is pjsip-apps/src/samples/siprtp.c 512 * 513 * Screenshots on WinXP: \image html siprtp.jpg 514 * 515 * \includelineno siprtp.c 516 */ 517 328 518 #endif /* __PJMEDIA_DOXYGEN_H__ */ 519 -
pjproject/trunk/pjmedia/include/pjmedia/plc.h
r518 r531 28 28 29 29 /** 30 * @defgroup PJMED_PLC Packet Lost Concealment 30 * @defgroup PJMED_PLC Packet Lost Concealment (PLC) 31 31 * @ingroup PJMEDIA_FRAME_OP 32 32 * @{ -
pjproject/trunk/pjmedia/include/pjmedia/rtp.h
r518 r531 38 38 * The RTP module is designed to be dependent only to PJLIB, it does not depend 39 39 * on any other parts of PJMEDIA library. The RTP module does not even depend 40 * on any transports (sockets), to promote even more use. 40 * on any transports (sockets), to promote even more use, such as in DSP 41 * development (where transport may be handled by different processor). 41 42 * 42 43 * An RTCP implementation is available, in separate module. Please see -
pjproject/trunk/pjmedia/include/pjmedia/sdp_neg.h
r518 r531 26 26 */ 27 27 /** 28 * @defgroup PJMEDIA_SDP_NEG SDP Negotiat or28 * @defgroup PJMEDIA_SDP_NEG SDP Negotiation 29 29 * @ingroup PJMEDIA_SESSION 30 * @brief Abstraction to perform SDP negotiation 30 31 * @{ 31 32 * -
pjproject/trunk/pjmedia/include/pjmedia/sound.h
r518 r531 31 31 32 32 /** 33 * @defgroup PJMED_SND Sound Hardware Abstraction33 * @defgroup PJMED_SND Portable Sound Hardware Abstraction 34 34 * @ingroup PJMED_SND_PORT 35 35 * @brief PJMEDIA abstraction for sound device hardware -
pjproject/trunk/pjmedia/include/pjmedia/splitcomb.h
r488 r531 19 19 #ifndef __PJMEDIA_SPLITCOMB_H__ 20 20 #define __PJMEDIA_SPLITCOMB_H__ 21 22 23 /** 24 * @file splitcomb.h 25 * @brief Media channel splitter/combiner port. 26 */ 27 #include <pjmedia/types.h> 28 29 30 /** 31 * @addtogroup PJMEDIA_SPLITCOMB Media channel splitter/combiner 32 * @ingroup PJMEDIA_PORT 33 * @brief Split and combine media channels in media streams 34 * @{ 35 * This section describes media port to split and combine media 36 * channels in the stream. 37 */ 38 39 PJ_BEGIN_DECL 21 40 22 41 … … 108 127 109 128 129 PJ_END_DECL 130 131 /** 132 * @} 133 */ 110 134 111 135 #endif /* __PJMEDIA_SPLITCOMB_H__ */ -
pjproject/trunk/pjmedia/include/pjmedia/wav_port.h
r518 r531 32 32 33 33 /** 34 * @defgroup PJMEDIA_FILE_PLAY File Player34 * @defgroup PJMEDIA_FILE_PLAY WAV File Player 35 35 * @ingroup PJMEDIA_PORT 36 36 * @brief WAV File Player … … 78 78 79 79 /** 80 * Set the play position of WAV player.80 * Set the file play position of WAV player. 81 81 * 82 82 * @param port The file player port. 83 * @param samples Sample position (zero as start of file). 83 * @param offset Playback position in bytes, relative to the start of 84 * the payload. 84 85 * 85 86 * @return PJ_SUCCESS on success. 86 87 */ 87 88 PJ_DECL(pj_status_t) pjmedia_wav_player_port_set_pos( pjmedia_port *port, 88 pj_uint32_t samples ); 89 89 pj_uint32_t offset ); 90 91 92 /** 93 * Get the file play position of WAV player. 94 * 95 * @param port The file player port. 96 * 97 * @return PJ_SUCCESS on success. 98 */ 99 PJ_DECL(pj_ssize_t) pjmedia_wav_player_port_get_pos( pjmedia_port *port ); 100 101 102 /** 103 * Register a callback to be called when the file reading has reached the 104 * end of file. If the file is set to play repeatedly, then the callback 105 * will be called multiple times. Note that only one callback can be 106 * registered for each file port. 107 * 108 * @param port The file player port. 109 * @param user_data User data to be specified in the callback. Note that 110 * this overwrites the user data previously set when 111 * the file port is created. 112 * @param cb Callback to be called. If the callback returns non- 113 * PJ_SUCCESS, the playback will stop. Note that if 114 * application destroys the file port in the callback, 115 * it must return non-PJ_SUCCESS here. 116 * 117 * @return PJ_SUCCESS on success. 118 */ 119 PJ_DECL(pj_status_t) 120 pjmedia_wav_player_set_eof_cb( pjmedia_port *port, 121 void *user_data, 122 pj_status_t (*cb)(pjmedia_port *port, 123 void *usr_data)); 90 124 91 125 /** … … 115 149 * @param bits_per_sample Number of bits per sample (eg 16). 116 150 * @param flags Port creation flags (must be 0 at present). 117 * @param buff_size Buffer size to be allocated. If the value is zero or118 * negative, the port will use default buffer size (which119 * is about 4KB).120 * @param user_data User data to be associated with the file writerport.121 * @param p_port Pointer to receive the file port instance.122 * 123 * @return PJ_SUCCESS on success.151 * @param buff_size Buffer size to be allocated. If the value is 152 * zero or negative, the port will use default buffer 153 * size (which is about 4KB). 154 * @param user_data User data to be associated with the file port. 155 * @param p_port Pointer to receive the file port instance. 156 * 157 * @return PJ_SUCCESS on success. 124 158 */ 125 159 PJ_DECL(pj_status_t) pjmedia_wav_writer_port_create(pj_pool_t *pool, … … 135 169 136 170 171 /** 172 * Get current writing position. Note that this does not necessarily match 173 * the size written to the file, since the WAV writer employs some internal 174 * buffering. Also the value reported here only indicates the payload size 175 * (it does not include the size of the WAV header), 176 * 177 * @param port The file writer port. 178 * 179 * @return Positive value to indicate the position (in bytes), 180 * or negative value containing the error code. 181 */ 182 PJ_DECL(pj_ssize_t) pjmedia_wav_writer_port_get_pos( pjmedia_port *port ); 183 184 185 /** 186 * Register the callback to be called when the file writing has reached 187 * certain size. Application can use this callback, for example, to limit 188 * the size of the output file. 189 * 190 * @param port The file writer port. 191 * @param pos The file position on which the callback will be called. 192 * @param user_data User data to be specified in the callback. Note that 193 * this overwrites the user data previously set when 194 * the file port is created. 195 * @param cb Callback to be called. If the callback returns non- 196 * PJ_SUCCESS, the writing will stop. Note that if 197 * application destroys the port in the callback, it must 198 * return non-PJ_SUCCESS here. 199 * 200 * @return PJ_SUCCESS on success. 201 */ 202 PJ_DECL(pj_status_t) 203 pjmedia_wav_writer_port_set_cb( pjmedia_port *port, 204 pj_size_t pos, 205 void *user_data, 206 pj_status_t (*cb)(pjmedia_port *port, 207 void *usr_data)); 208 137 209 138 210 /** -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r513 r531 1056 1056 count)); 1057 1057 1058 status = (cport->port->get_frame)(cport->port, &f);1058 status = pjmedia_port_get_frame(cport->port, &f); 1059 1059 1060 1060 *type = f.type; … … 1461 1461 continue; 1462 1462 } 1463 1464 /* Check that the port is not removed when we call get_frame() */ 1465 if (conf->ports[i] == NULL) 1466 continue; 1463 1467 } 1464 1468 -
pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
r518 r531 31 31 32 32 33 #define SIGNATURE ('F'<<24|'P'<<16|'L'<<8|'Y')33 #define SIGNATURE PJMEDIA_PORT_SIGNATURE('F', 'P', 'l', 'y') 34 34 #define BYTES_PER_SAMPLE 2 35 35 … … 66 66 pj_oshandle_t fd; 67 67 68 pj_status_t (*cb)(pjmedia_port*, void*); 68 69 }; 69 70 … … 117 118 pj_status_t status; 118 119 119 if (fport->eof) { 120 /* Can't read file if EOF and loop flag is disabled */ 121 if (fport->eof) 120 122 return PJ_EEOF; 121 }122 123 123 124 while (size_left > 0) { … … 142 143 */ 143 144 if (size < (pj_ssize_t)size_to_read) { 145 /* Call callback, if any. */ 146 if (fport->cb) { 147 PJ_LOG(5,(THIS_FILE, 148 "File port %.*s EOF, calling callback", 149 (int)fport->base.info.name.slen, 150 fport->base.info.name.ptr)); 151 152 fport->eof = PJ_TRUE; 153 status = (*fport->cb)(&fport->base, fport->base.user_data); 154 if (status != PJ_SUCCESS) { 155 /* This will crash if file port is destroyed in the 156 * callback, that's why we set the eof flag before 157 * calling the callback: 158 fport->eof = PJ_TRUE; 159 */ 160 return status; 161 } 162 163 fport->eof = PJ_FALSE; 164 } 165 144 166 if (fport->options & PJMEDIA_FILE_NO_LOOP) { 145 167 PJ_LOG(5,(THIS_FILE, "File port %.*s EOF, stopping..", … … 336 358 */ 337 359 PJ_DEF(pj_status_t) pjmedia_wav_player_port_set_pos(pjmedia_port *port, 338 pj_uint32_t samples )360 pj_uint32_t bytes ) 339 361 { 340 362 struct file_port *fport; 341 363 342 PJ_ASSERT_RETURN(port, PJ_EINVAL); 364 /* Sanity check */ 365 PJ_ASSERT_RETURN(port, -PJ_EINVAL); 366 367 /* Check that this is really a player port */ 368 PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, -PJ_EINVALIDOP); 369 343 370 344 371 fport = (struct file_port*) port; 345 372 346 PJ_ASSERT_RETURN(samples*BYTES_PER_SAMPLE < fport->fsize - 347 sizeof(pjmedia_wave_hdr), PJ_EINVAL); 348 349 fport->fpos = sizeof(struct pjmedia_wave_hdr) + 350 samples * BYTES_PER_SAMPLE; 373 PJ_ASSERT_RETURN(bytes < fport->fsize - sizeof(pjmedia_wave_hdr), 374 PJ_EINVAL); 375 376 fport->fpos = sizeof(struct pjmedia_wave_hdr) + bytes; 351 377 pj_file_setpos( fport->fd, fport->fpos, PJ_SEEK_SET); 352 378 353 379 fport->eof = PJ_FALSE; 354 380 return fill_buffer(fport); 381 } 382 383 384 /* 385 * Get the file play position of WAV player. 386 */ 387 PJ_DEF(pj_ssize_t) pjmedia_wav_player_port_get_pos( pjmedia_port *port ) 388 { 389 struct file_port *fport; 390 pj_size_t payload_pos; 391 392 /* Sanity check */ 393 PJ_ASSERT_RETURN(port, -PJ_EINVAL); 394 395 /* Check that this is really a player port */ 396 PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, -PJ_EINVALIDOP); 397 398 fport = (struct file_port*) port; 399 400 payload_pos = (pj_size_t)(fport->fpos - sizeof(pjmedia_wave_hdr)); 401 if (payload_pos >= fport->bufsize) 402 return payload_pos - fport->bufsize + (fport->readpos - fport->buf); 403 else 404 return (fport->readpos - fport->buf) % payload_pos; 405 } 406 407 408 409 /* 410 * Register a callback to be called when the file reading has reached the 411 * end of file. 412 */ 413 PJ_DEF(pj_status_t) 414 pjmedia_wav_player_set_eof_cb( pjmedia_port *port, 415 void *user_data, 416 pj_status_t (*cb)(pjmedia_port *port, 417 void *usr_data)) 418 { 419 struct file_port *fport; 420 421 /* Sanity check */ 422 PJ_ASSERT_RETURN(port, -PJ_EINVAL); 423 424 /* Check that this is really a player port */ 425 PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, -PJ_EINVALIDOP); 426 427 fport = (struct file_port*) port; 428 429 fport->base.user_data = user_data; 430 fport->cb = cb; 431 432 return PJ_SUCCESS; 355 433 } 356 434 -
pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c
r411 r531 29 29 30 30 #define THIS_FILE "wav_writer.c" 31 #define SIGNATURE ('F'<<24|'W'<<16|'R'<<8|'T')31 #define SIGNATURE PJMEDIA_PORT_SIGNATURE('F', 'W', 'R', 'T') 32 32 #define BYTES_PER_SAMPLE 2 33 33 … … 39 39 char *buf; 40 40 char *writepos; 41 pj_size_t total; 41 42 42 43 pj_oshandle_t fd; 44 45 pj_size_t cb_size; 46 pj_status_t (*cb)(pjmedia_port*, void*); 43 47 }; 44 48 … … 178 182 179 183 184 185 /* 186 * Get current writing position. 187 */ 188 PJ_DEF(pj_ssize_t) pjmedia_wav_writer_port_get_pos( pjmedia_port *port ) 189 { 190 struct file_port *fport; 191 192 /* Sanity check */ 193 PJ_ASSERT_RETURN(port, -PJ_EINVAL); 194 195 /* Check that this is really a writer port */ 196 PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, -PJ_EINVALIDOP); 197 198 fport = (struct file_port*) port; 199 200 return fport->total; 201 } 202 203 204 /* 205 * Register callback. 206 */ 207 PJ_DEF(pj_status_t) 208 pjmedia_wav_writer_port_set_cb( pjmedia_port *port, 209 pj_size_t pos, 210 void *user_data, 211 pj_status_t (*cb)(pjmedia_port *port, 212 void *usr_data)) 213 { 214 struct file_port *fport; 215 216 /* Sanity check */ 217 PJ_ASSERT_RETURN(port && cb, PJ_EINVAL); 218 219 /* Check that this is really a writer port */ 220 PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, PJ_EINVALIDOP); 221 222 fport = (struct file_port*) port; 223 224 fport->cb_size = pos; 225 fport->base.user_data = user_data; 226 fport->cb = cb; 227 228 return PJ_SUCCESS; 229 } 230 231 180 232 #if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0 181 233 static void swap_samples(pj_int16_t *samples, unsigned count) … … 235 287 fport->writepos += frame->size; 236 288 289 /* Increment total written, and check if we need to call callback */ 290 fport->total += frame->size; 291 if (fport->cb && fport->total >= fport->cb_size) { 292 pj_status_t (*cb)(pjmedia_port*, void*); 293 pj_status_t status; 294 295 cb = fport->cb; 296 fport->cb = NULL; 297 298 status = (*cb)(this_port, this_port->user_data); 299 return status; 300 } 301 237 302 return PJ_SUCCESS; 238 303 } -
pjproject/trunk/pjsip-apps/src/samples/confbench.c
r513 r531 18 18 */ 19 19 20 /* 20 21 /** 22 * \page page_pjmedia_samples_confbench_c Samples: Benchmarking Conference Bridge 23 * 21 24 * Benchmarking pjmedia (conference bridge+resample). For my use only, 22 25 * and it only works in Win32. 26 * 27 * This file is pjsip-apps/src/samples/confbench.c 28 * 29 * \includelineno confbench.c 23 30 */ 31 24 32 25 33 #include <pjmedia.h> … … 39 47 * the port. 40 48 */ 41 #define TEST_SET SMALL_SET42 #define HAS_RESAMPLE 149 #define TEST_SET LARGE_SET 50 #define HAS_RESAMPLE 0 43 51 44 52 … … 266 274 } 267 275 276 printf("Resampling is %s\n", (HAS_RESAMPLE?"active":"disabled")); 277 268 278 /* Create Null ports */ 279 printf("Creating %d null ports..\n", NULL_COUNT); 269 280 for (i=0; i<NULL_COUNT; ++i) { 270 281 status = pjmedia_null_port_create(pool, CLOCK_RATE, 1, SAMPLES_PER_FRAME*2, 16, &nulls[i]); … … 276 287 277 288 /* Create sine ports. */ 289 printf("Creating %d sine generator ports..\n", SINE_COUNT); 278 290 for (i=0; i<SINE_COUNT; ++i) { 279 291 unsigned j, slot; … … 305 317 306 318 /* Create idle ports */ 319 printf("Creating %d idle ports..\n", IDLE_COUNT); 307 320 for (i=0; i<IDLE_COUNT; ++i) { 308 321 pjmedia_port *dummy; -
pjproject/trunk/pjsip-apps/src/samples/confsample.c
r513 r531 26 26 27 27 #include "util.h" 28 29 /** 30 * \page page_pjmedia_samples_confsample_c Samples: Using Conference Bridge 31 * 32 * Sample to mix multiple files in the conference bridge and play the 33 * result to sound device. 34 * 35 * This file is pjsip-apps/src/samples/confsample.c 36 * 37 * \includelineno confsample.c 38 */ 39 28 40 29 41 /* For logging purpose. */ -
pjproject/trunk/pjsip-apps/src/samples/level.c
r412 r531 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 20 21 /** 22 * \page page_pjmedia_samples_level_c Samples: Reading from WAV File 23 * 24 * This is a very simple example to use the @ref PJMEDIA_FILE_PLAY, to 25 * directly read the samples from the file. 26 * 27 * This file is pjsip-apps/src/samples/level.c 28 * 29 * \includelineno level.c 30 */ 31 19 32 20 33 static const char *desc = -
pjproject/trunk/pjsip-apps/src/samples/playfile.c
r438 r531 25 25 26 26 #include "util.h" 27 28 29 /** 30 * \page page_pjmedia_samples_playfile_c Samples: Playing WAV File to Sound Device 31 * 32 * This is a very simple example to use the @ref PJMEDIA_FILE_PLAY and 33 * @ref PJMED_SND_PORT. In this example, we open both the file and sound 34 * device, and connect the two of them, and voila! Sound will be playing 35 * the contents of the file. 36 * 37 * @see page_pjmedia_samples_recfile_c 38 * 39 * This file is pjsip-apps/src/samples/playfile.c 40 * 41 * \includelineno playfile.c 42 */ 27 43 28 44 -
pjproject/trunk/pjsip-apps/src/samples/playsine.c
r412 r531 16 16 * along with this program; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 */ 19 20 21 /** 22 * \page page_pjmedia_samples_playsine_c Samples: Using Custom Ports (Sine Wave Generator) 23 * 24 * This example demonstrate how to create a custom media port (in this case, a 25 * sine wave generator) and connect it to the sound device. 26 * 27 * This file is pjsip-apps/src/samples/playsine.c 28 * 29 * \includelineno playsine.c 18 30 */ 19 31 -
pjproject/trunk/pjsip-apps/src/samples/recfile.c
r412 r531 18 18 */ 19 19 20 /** 21 * \page page_pjmedia_samples_recfile_c Samples: Capturing Audio to WAV File 22 * 23 * In this example, we capture audio from the sound device and save it to 24 * WAVE file. 25 * 26 * @see page_pjmedia_samples_playfile_c 27 * 28 * This file is pjsip-apps/src/samples/recfile.c 29 * 30 * \includelineno recfile.c 31 */ 20 32 21 33 #include <pjmedia.h> … … 26 38 /* For logging purpose. */ 27 39 #define THIS_FILE "recfile.c" 40 28 41 29 42 /* Configs */ -
pjproject/trunk/pjsip-apps/src/samples/resampleplay.c
r518 r531 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 20 /** 21 * \page page_pjmedia_samples_resampleplay_c Samples: Using Resample Port 22 * 23 * This example demonstrates how to use @ref PJMEDIA_RESAMPLE_PORT to 24 * change the sampling rate of the media streams. 25 * 26 * This file is pjsip-apps/src/samples/resampleplay.c 27 * 28 * \includelineno resampleplay.c 29 */ 30 19 31 #include <pjmedia.h> 20 32 #include <pjlib-util.h> -
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r494 r531 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 19 20 20 21 -
pjproject/trunk/pjsip-apps/src/samples/sipstateless.c
r448 r531 104 104 /* Create global endpoint: */ 105 105 { 106 const pj_str_t *hostname;107 const char *endpt_name;108 109 106 /* Endpoint MUST be assigned a globally unique name. 110 * The name will be used as the hostname in Warning header. 107 * Ideally we should put hostname or public IP address, but 108 * we'll just use an arbitrary name here. 111 109 */ 112 110 113 /* For this implementation, we'll use hostname for simplicity */114 hostname = pj_gethostname();115 endpt_name = hostname->ptr;116 117 111 /* Create the endpoint: */ 118 119 status = pjsip_endpt_create(&cp.factory, endpt_name, 112 status = pjsip_endpt_create(&cp.factory, "sipstateless", 120 113 &sip_endpt); 121 114 PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); -
pjproject/trunk/pjsip-apps/src/samples/sndtest.c
r471 r531 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 20 /** 21 * \page page_pjmedia_samples_sndtest_c Samples: Sound Card Benchmark 22 * 23 * This example can be used to benchmark the quality of the sound card 24 * installed in the system. At the end of the test, it will report 25 * the jitter and clock drifts of the device. 26 * 27 * This file is pjsip-apps/src/samples/sndtest.c 28 * 29 * Screenshots on WinXP: \image html sndtest.jpg 30 * 31 * \includelineno sndtest.c 32 */ 33 19 34 20 35 #include <pjmedia.h> -
pjproject/trunk/pjsip-apps/src/samples/streamutil.c
r507 r531 16 16 * along with this program; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 */ 19 20 21 /** 22 * \page page_pjmedia_samples_streamutil_c Samples: Remote Streaming 23 * 24 * This example mainly demonstrates how to stream media file to remote 25 * peer using RTP. 26 * 27 * This file is pjsip-apps/src/samples/streamutil.c 28 * 29 * \includelineno streamutil.c 18 30 */ 19 31 -
pjproject/trunk/pjsip/docs/doxygen.cfg
r515 r531 385 385 # the \include command). 386 386 387 EXAMPLE_PATH = 387 EXAMPLE_PATH = ../pjsip-apps/src/samples ../pjsip-apps/src/pjsua 388 388 389 389 # If the value of the EXAMPLE_PATH tag contains directories, you can use the … … 405 405 # the \image command). 406 406 407 IMAGE_PATH = 407 IMAGE_PATH = docs ../pjmedia/docs 408 408 409 409 # The INPUT_FILTER tag can be used to specify a program that doxygen should -
pjproject/trunk/pjsip/docs/doxygen.h
r515 r531 182 182 183 183 184 /** 185 @page page_pjsip_samples PJSIP Samples 186 187 I wish I could write more samples, but for now here are some samples or 188 working applications that are available from the source tree: 189 190 - @ref page_pjsip_sample_sipstateless_c\n 191 This is about the simplest SIP application with PJSIP, all it does is 192 respond all incoming requests with 501 (Not Implemented) response 193 statelessly. 194 195 - @ref page_pjsip_sample_simple_ua_c\n 196 This is a very simple SIP User Agent application that only use PJSIP 197 (without PJSIP-UA). It's able to make and receive call, and play 198 media to the sound device. 199 200 - @ref page_pjsip_samples_pjsua\n 201 This is the reference implementation for PJSIP and PJMEDIA. 202 PJSUA is a console based application, designed to be simple enough 203 to be readble, but powerful enough to demonstrate all features 204 available in PJSIP and PJMEDIA.\n 205 Screenshot on WinXP: \image html pjsua.jpg "pjsua on WinXP" 206 207 - @ref page_pjmedia_samples_siprtp_c\n 208 This is a useful program (integrated with PJSIP) to actively measure 209 the network quality/impairment parameters by making one or more SIP 210 calls (or receiving one or more SIP calls) and display the network 211 impairment of each stream direction at the end of the call. 212 The program is able to measure network quality parameters such as 213 jitter, packet lost/reorder/duplicate, round trip time, etc.\n 214 Note that the remote peer MUST support RTCP so that network quality 215 of each direction can be calculated. Using siprtp for both endpoints 216 is recommended.\n 217 Screenshots on WinXP: \image html siprtp.jpg "siprtp screenshot on WinXP" 218 219 */ 220 221 /** 222 * \page page_pjsip_samples_pjsua PJSUA 223 * 224 * This is the reference implementation for PJSIP and PJMEDIA. 225 * PJSUA is a console based application, designed to be simple enough 226 * to be readble, but powerful enough to demonstrate all features 227 * available in PJSIP and PJMEDIA. 228 * 229 * This file is pjsip-apps/src/pjsua/pjsua_app.c 230 * 231 * Screenshot on WinXP: \image html pjsua.jpg "pjsua on WinXP" 232 * 233 * \includelineno pjsua_app.c 234 */ 235 236 /** 237 * \page page_pjsip_sample_simple_ua_c Samples: Simple UA 238 * 239 * This is a very simple SIP User Agent application that only use PJSIP 240 * (without PJSIP-UA). It's able to make and receive call, and play 241 * media to the sound device. 242 * 243 * \includelineno simpleua.c 244 */ 245 246 /** 247 * \page page_pjsip_sample_sipstateless_c Samples: Stateless SIP Endpoint 248 * 249 * This is about the simplest SIP application with PJSIP, all it does is 250 * respond all incoming requests with 501 (Not Implemented) response 251 * statelessly. 252 * 253 * \includelineno sipstateless.c 254 */ 255 256 /** 257 * \page page_pjmedia_samples_siprtp_c Samples: Using SIP and Custom RTP/RTCP to Monitor Quality 258 * 259 * This source is an example to demonstrate using SIP and RTP/RTCP framework 260 * to measure the network quality/impairment from the SIP call. This 261 * program can be used to make calls or to receive calls from other 262 * SIP endpoint (or other siprtp program), and to display the media 263 * quality statistics at the end of the call. 264 * 265 * Note that the remote peer must support RTCP. 266 * 267 * The layout of the program has been designed so that custom reporting 268 * can be generated instead of plain human readable text. 269 * 270 * The source code of the file is pjsip-apps/src/samples/siprtp.c 271 * 272 * Screenshots on WinXP: \image html siprtp.jpg 273 * 274 * \includelineno siprtp.c 275 */ 276
Note: See TracChangeset
for help on using the changeset viewer.