Changeset 341
- Timestamp:
- Mar 20, 2006 4:58:43 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/build/os-darwinos.mak
r338 r341 3 3 export OS_CXXFLAGS := 4 4 5 export OS_LDFLAGS := $(CC_LIB)pthread$(LIBEXT2) 5 export OS_LDFLAGS := $(CC_LIB)pthread$(LIBEXT2) -framework CoreAudio 6 6 7 7 export OS_SOURCES := -
pjproject/trunk/pjmedia/build/Makefile
r328 r341 66 66 export PJMEDIA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 67 67 codec.o conference.o endpoint.o errno.o file_port.o \ 68 g711.o jbuf.o null_port.o p asound.o port.o resample.o rtcp.o \68 g711.o jbuf.o null_port.o port.o resample.o rtcp.o \ 69 69 rtp.o sdp.o sdp_cmp.o sdp_neg.o session.o silencedet.o \ 70 70 sound_port.o stream.o $(SOUND_OBJS) $(NULLSOUND_OBJS) -
pjproject/trunk/pjmedia/build/os-linux.mak
r173 r341 1 1 # 2 # OS specific configuration for Win32OS target.2 # OS specific configuration for Linux OS target. 3 3 # 4 4 -
pjproject/trunk/pjmedia/include/pjmedia/wave.h
r222 r341 30 30 PJ_BEGIN_DECL 31 31 32 #if PJ_IS_BIG_ENDIAN 33 # define PJMEDIA_RIFF_TAG ('R'<<24|'I'<<16|'F'<<8|'F') 34 # define PJMEDIA_WAVE_TAG ('W'<<24|'A'<<16|'V'<<8|'E') 35 # define PJMEDIA_FMT_TAG ('f'<<24|'m'<<16|'t'<<8|' ') 36 #else 37 # define PJMEDIA_RIFF_TAG ('F'<<24|'F'<<16|'I'<<8|'R') 38 # define PJMEDIA_WAVE_TAG ('E'<<24|'V'<<16|'A'<<8|'W') 39 # define PJMEDIA_FMT_TAG (' '<<24|'t'<<16|'m'<<8|'f') 40 #endif 32 #define PJMEDIA_RIFF_TAG ('F'<<24|'F'<<16|'I'<<8|'R') 33 #define PJMEDIA_WAVE_TAG ('E'<<24|'V'<<16|'A'<<8|'W') 34 #define PJMEDIA_FMT_TAG (' '<<24|'t'<<16|'m'<<8|'f') 41 35 42 36 … … 79 73 80 74 #endif /* __PJMEDIA_WAVE_H__ */ 75 -
pjproject/trunk/pjmedia/src/pjmedia/file_port.c
r334 r341 38 38 #define SIGNATURE ('F'<<24|'I'<<16|'L'<<8|'E') 39 39 40 #if 1 41 # define TRACE_(x) PJ_LOG(4,x) 42 #else 43 # define TRACE_(x) 44 #endif 45 46 #if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0 47 PJ_INLINE(pj_int16_t) swap16(pj_int16_t val) 48 { 49 pj_uint8_t *p = (pj_uint8_t*)&val; 50 pj_uint8_t tmp = *p; 51 *p = *(p+1); 52 *(p+1) = tmp; 53 return val; 54 } 55 PJ_INLINE(pj_int32_t) swap32(pj_int32_t val) 56 { 57 pj_uint8_t *p = (pj_uint8_t*)&val; 58 pj_uint8_t tmp = *p; 59 *p = *(p+3); 60 *(p+3) = tmp; 61 tmp = *(p+1); 62 *(p+1) = *(p+2); 63 *(p+2) = tmp; 64 return val; 65 } 66 # define SWAP16(val16) swap16(val16) 67 # define SWAP32(val32) swap32(val32) 68 static void samples_to_host(pj_int16_t *samples, unsigned count) 69 { 70 unsigned i; 71 for (i=0; i<count; ++i) { 72 samples[i] = SWAP16(samples[i]); 73 } 74 } 75 #else 76 # define SWAP16(val16) (val16) 77 # define SWAP32(val32) (val32) 78 # define samples_to_host(samples,count) 79 #endif 80 40 81 struct file_port 41 82 { … … 129 170 } 130 171 172 /* Convert samples to host rep */ 173 samples_to_host((pj_int16_t*)fport->buf, fport->bufsize/2); 174 131 175 return PJ_SUCCESS; 132 176 } 177 178 179 /* 180 * Change the endianness of WAVE header fields. 181 */ 182 void pjmedia_wave_hdr_swap_bytes( pjmedia_wave_hdr *hdr ) 183 { 184 hdr->riff_hdr.riff = SWAP32(hdr->riff_hdr.riff); 185 hdr->riff_hdr.file_len = SWAP32(hdr->riff_hdr.file_len); 186 hdr->riff_hdr.wave = SWAP32(hdr->riff_hdr.wave); 187 188 hdr->fmt_hdr.fmt = SWAP32(hdr->fmt_hdr.fmt); 189 hdr->fmt_hdr.len = SWAP32(hdr->fmt_hdr.len); 190 hdr->fmt_hdr.fmt_tag = SWAP16(hdr->fmt_hdr.fmt_tag); 191 hdr->fmt_hdr.nchan = SWAP16(hdr->fmt_hdr.nchan); 192 hdr->fmt_hdr.sample_rate = SWAP32(hdr->fmt_hdr.sample_rate); 193 hdr->fmt_hdr.bytes_per_sec = SWAP32(hdr->fmt_hdr.bytes_per_sec); 194 hdr->fmt_hdr.block_align = SWAP16(hdr->fmt_hdr.block_align); 195 hdr->fmt_hdr.bits_per_sample = SWAP16(hdr->fmt_hdr.bits_per_sample); 196 197 hdr->data_hdr.data = SWAP32(hdr->data_hdr.data); 198 hdr->data_hdr.len = SWAP32(hdr->data_hdr.len); 199 } 200 201 202 #if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0 203 # define normalize_wave_hdr(hdr) pjmedia_wave_hdr_swap_bytes(hdr) 204 #endif 205 133 206 134 207 /* … … 191 264 } 192 265 266 /* Normalize WAVE header fields value (only used in big-endian hosts) */ 267 normalize_wave_hdr(&wave_hdr); 268 193 269 /* Validate WAVE file. */ 194 270 if (wave_hdr.riff_hdr.riff != PJMEDIA_RIFF_TAG || … … 197 273 { 198 274 pj_file_close(fport->fd); 275 TRACE_((THIS_FILE, 276 "actual value|expected riff=%x|%x, wave=%x|%x fmt=%x|%x", 277 wave_hdr.riff_hdr.riff, PJMEDIA_RIFF_TAG, 278 wave_hdr.riff_hdr.wave, PJMEDIA_WAVE_TAG, 279 wave_hdr.fmt_hdr.fmt, PJMEDIA_FMT_TAG)); 199 280 return PJMEDIA_ENOTVALIDWAVE; 200 281 } -
pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_lib.c
r339 r341 50 50 51 51 #include "portaudio.h" 52 #include "pa_host.h"52 //#include "pa_host.h" 53 53 #include "pa_trace.h" 54 55 typedef PaDeviceIndex PaDeviceID; 56 typedef PaStream PortAudioStream; 57 #define DLL_API 54 58 55 59 /* The reason we might NOT want to validate the rate before opening the stream -
pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_mac_core.c
r339 r341 149 149 case kAudioHardwareBadStreamError: 150 150 result = paBadStreamPtr; break; 151 case kAudioHardwareUnsupportedOperationError:152 result = paInternalError; break;151 // case kAudioHardwareUnsupportedOperationError: 152 // result = paInternalError; break; 153 153 case kAudioDeviceUnsupportedFormatError: 154 154 result = paSampleFormatNotSupported; break; … … 411 411 portAudioBuffer += Pa_GetSampleSize(destination->inputSampleFormat) * channelSpacing; 412 412 } 413 return 0; 413 414 } 414 415 … … 440 441 portAudioBuffer += Pa_GetSampleSize(source->outputSampleFormat) * channelSpacing; 441 442 } 443 return 0; 442 444 } 443 445 … … 471 473 Pa_StopStream(clientData->stream); 472 474 } 475 return 0; 473 476 } 474 477 … … 495 498 496 499 PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); 500 return 0; 497 501 } 498 502 … … 519 523 520 524 PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); 525 return 0; 521 526 } 522 527
Note: See TracChangeset
for help on using the changeset viewer.