Changeset 480
- Timestamp:
- May 28, 2006 2:51:21 PM (19 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/wav_port.h
r411 r480 58 58 59 59 /** 60 * Set the play position of WAV player. 61 * 62 * @param port The file player port. 63 * @param samples Sample position (zero as start of file). 64 * 65 * @return PJ_SUCCESS on success. 66 */ 67 PJ_DECL(pj_status_t) pjmedia_wav_player_port_set_pos( pjmedia_port *port, 68 pj_uint32_t samples ); 69 70 71 /** 60 72 * Create a media port to record streams to a WAV file. Note that the port 61 73 * must be closed properly (with #pjmedia_port_destroy()) so that the WAV … … 64 76 * @param pool Pool to create memory buffers for this port. 65 77 * @param filename File name. 66 * @param flags Port creation flags. 78 * @param clock_rate The sampling rate. 79 * @param channel_count Number of channels. 80 * @param samples_per_frame Number of samples per frame. 81 * @param bits_per_sampe Number of bits per sample (eg 16). 82 * @param flags Port creation flags (must be 0 at present). 67 83 * @param buf_size Buffer size to be allocated. If the value is zero or 68 84 * negative, the port will use default buffer size (which … … 73 89 * @return PJ_SUCCESS on success. 74 90 */ 75 PJ_DECL(pj_status_t) pjmedia_wav_writer_port_create( 76 77 unsigned sampling_rate,78 79 80 81 82 83 84 91 PJ_DECL(pj_status_t) pjmedia_wav_writer_port_create(pj_pool_t *pool, 92 const char *filename, 93 unsigned clock_rate, 94 unsigned channel_count, 95 unsigned samples_per_frame, 96 unsigned bits_per_sample, 97 unsigned flags, 98 pj_ssize_t buff_size, 99 void *user_data, 100 pjmedia_port **p_port ); 85 101 86 102 -
pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
r411 r480 320 320 321 321 /* 322 * Set position. 323 */ 324 PJ_DEF(pj_status_t) pjmedia_wav_player_port_set_pos(pjmedia_port *port, 325 pj_uint32_t samples ) 326 { 327 struct file_port *fport; 328 329 PJ_ASSERT_RETURN(port, PJ_EINVAL); 330 331 fport = (struct file_port*) port; 332 333 PJ_ASSERT_RETURN(samples*BYTES_PER_SAMPLE < fport->fsize - 334 sizeof(pjmedia_wave_hdr), PJ_EINVAL); 335 336 fport->fpos = sizeof(struct pjmedia_wave_hdr) + 337 samples * BYTES_PER_SAMPLE; 338 pj_file_setpos( fport->fd, fport->fpos, PJ_SEEK_SET); 339 340 return fill_buffer(fport); 341 } 342 343 344 /* 322 345 * Put frame to file. 323 346 */
Note: See TracChangeset
for help on using the changeset viewer.