Changeset 1493 for pjproject/trunk
- Timestamp:
- Oct 12, 2007 5:24:32 AM (17 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/build/Makefile
r1202 r1493 46 46 g711.o jbuf.o master_port.o mem_capture.o mem_player.o \ 47 47 null_port.o plc_common.o port.o splitcomb.o \ 48 resample_resample.o \48 resample_resample.o resample_libsamplerate.o \ 49 49 resample_port.o rtcp.o rtp.o sdp.o sdp_cmp.o sdp_neg.o \ 50 50 session.o silencedet.o sound_port.o stream.o \ -
pjproject/trunk/pjmedia/build/pjmedia.dsp
r1177 r1493 182 182 # Begin Source File 183 183 184 SOURCE=..\src\pjmedia\resample_libsamplerate.c 185 # End Source File 186 # Begin Source File 187 184 188 SOURCE=..\src\pjmedia\resample_port.c 185 189 # End Source File -
pjproject/trunk/pjmedia/include/pjmedia/config.h
r1486 r1493 128 128 129 129 /* 130 * ** THIS MACRO IS DEPRECATED in 0.6. ** 131 * ** See libresample for configuring this ** 132 * 133 * Include small filter table in resample. 134 * This adds about 9KB in rdata. 135 */ 136 /* 137 #ifndef PJMEDIA_HAS_SMALL_FILTER 138 # define PJMEDIA_HAS_SMALL_FILTER 1 139 #endif 140 */ 141 142 /* 143 * ** THIS MACRO IS DEPRECATED in 0.6. ** 144 * ** See libresample for configuring this ** 145 * 146 * Include large filter table in resample. 147 * This adds about 32KB in rdata. 148 */ 149 /* 150 #ifndef PJMEDIA_HAS_LARGE_FILTER 151 # define PJMEDIA_HAS_LARGE_FILTER 1 152 #endif 153 */ 154 155 /** 156 * Specify whether libresample should be used for the sampling 157 * rate conversion. This macro and PJMEDIA_HAS_SPEEX_RESAMPLE 158 * are mutually exclusive. 159 * 160 * Default: 1 (Yes) 161 */ 162 #ifndef PJMEDIA_HAS_LIBRESAMPLE 163 # define PJMEDIA_HAS_LIBRESAMPLE 1 164 #endif 165 166 167 /** 168 * Specify whether Speex sample rate convertor should be used for the 169 * sampling rate conversion. This macro and PJMEDIA_HAS_LIBRESAMPLE 170 * are mutually exclusive. 171 * 172 * Default: 0 173 */ 174 #ifndef PJMEDIA_HAS_SPEEX_RESAMPLE 175 # define PJMEDIA_HAS_SPEEX_RESAMPLE 0 176 #endif 177 130 * Warn about obsolete macros. 131 * 132 * PJMEDIA_HAS_SMALL_FILTER has been deprecated in 0.7. 133 */ 134 #if defined(PJMEDIA_HAS_SMALL_FILTER) 135 # ifdef _MSC_VER 136 # pragma message("Warning: PJMEDIA_HAS_SMALL_FILTER macro is deprecated"\ 137 " and has no effect") 138 # else 139 # warning "PJMEDIA_HAS_SMALL_FILTER macro is deprecated and has no effect" 140 # endif 141 #endif 142 143 144 /* 145 * Warn about obsolete macros. 146 * 147 * PJMEDIA_HAS_LARGE_FILTER has been deprecated in 0.7. 148 */ 149 #if defined(PJMEDIA_HAS_LARGE_FILTER) 150 # ifdef _MSC_VER 151 # pragma message("Warning: PJMEDIA_HAS_LARGE_FILTER macro is deprecated"\ 152 " and has no effect") 153 # else 154 # warning "PJMEDIA_HAS_LARGE_FILTER macro is deprecated" 155 # endif 156 #endif 157 158 159 /* 160 * These macros are obsolete in 0.7.1 so it will trigger compilation error. 161 * Please use PJMEDIA_RESAMPLE_IMP to select the resample implementation 162 * to use. 163 */ 164 #ifdef PJMEDIA_HAS_LIBRESAMPLE 165 # error "PJMEDIA_HAS_LIBRESAMPLE macro is deprecated. Use '#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE'" 166 #endif 167 168 #ifdef PJMEDIA_HAS_SPEEX_RESAMPLE 169 # error "PJMEDIA_HAS_SPEEX_RESAMPLE macro is deprecated. Use '#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_SPEEX'" 170 #endif 171 172 173 /* 174 * Sample rate conversion backends. 175 * Select one of these backends in PJMEDIA_RESAMPLE_IMP. 176 */ 177 #define PJMEDIA_RESAMPLE_NONE 1 /**< No resampling. */ 178 #define PJMEDIA_RESAMPLE_LIBRESAMPLE 2 /**< Sample rate conversion 179 using libresample. */ 180 #define PJMEDIA_RESAMPLE_SPEEX 3 /**< Sample rate conversion 181 using Speex. */ 182 #define PJMEDIA_RESAMPLE_LIBSAMPLERATE 4 /**< Sample rate conversion 183 using libsamplerate 184 (a.k.a Secret Rabbit Code) 185 */ 186 187 /** 188 * Select which resample implementation to use. Currently pjmedia supports: 189 * - #PJMEDIA_RESAMPLE_LIBRESAMPLE, to use libresample-1.7, this is the default 190 * implementation to be used. 191 * - #PJMEDIA_RESAMPLE_LIBSAMPLERATE, to use libsamplerate implementation 192 * (a.k.a. Secret Rabbit Code). 193 * - #PJMEDIA_RESAMPLE_SPEEX, to use experimental sample rate conversion in 194 * Speex library. 195 * - #PJMEDIA_RESAMPLE_NONE, to disable sample rate conversion. Any calls to 196 * resample function will return error. 197 * 198 * Default is PJMEDIA_RESAMPLE_LIBRESAMPLE 199 */ 200 #ifndef PJMEDIA_RESAMPLE_IMP 201 # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE 202 #endif 203 204 205 /** 206 * Specify whether libsamplerate, when used, should be linked statically 207 * into the application. This option is only useful for Visual Studio 208 * projects, and when this static linking is enabled 209 */ 178 210 179 211 -
pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c
r1266 r1493 26 26 27 27 28 #if defined(PJMEDIA_HAS_LIBRESAMPLE) && PJMEDIA_HAS_LIBRESAMPLE != 028 #if PJMEDIA_RESAMPLE_IMP==PJMEDIA_RESAMPLE_LIBRESAMPLE 29 29 30 30 #include <third_party/resample/include/resamplesubs.h> … … 216 216 217 217 218 #el se /* PJMEDIA_HAS_LIBRESAMPLE */218 #elif PJMEDIA_RESAMPLE_IMP==PJMEDIA_RESAMPLE_NONE 219 219 220 220 /* 221 221 * This is the configuration when sample rate conversion is disabled. 222 222 */ 223 struct pjmedia_resample224 {225 unsigned samples_per_frame;226 };227 228 223 PJ_DEF(pj_status_t) pjmedia_resample_create( pj_pool_t *pool, 229 224 pj_bool_t high_quality, … … 235 230 pjmedia_resample **p_resample) 236 231 { 237 pjmedia_resample *resample; 238 239 PJ_ASSERT_RETURN(rate_in == rate_out, PJ_EINVALIDOP); 240 241 PJ_UNUSED_ARG(high_quality); 242 PJ_UNUSED_ARG(large_filter); 243 PJ_UNUSED_ARG(channel_count); 244 PJ_UNUSED_ARG(rate_in); 245 PJ_UNUSED_ARG(rate_out); 246 247 resample = PJ_POOL_ZALLOC_T(pool, pjmedia_resample); 248 resample->samples_per_frame = samples_per_frame; 249 250 *p_resample = resample; 251 252 return PJ_SUCCESS; 232 PJ_UNUSED_ARG(pool); 233 PJ_UNUSED_ARG(high_quality); 234 PJ_UNUSED_ARG(large_filter); 235 PJ_UNUSED_ARG(channel_count); 236 PJ_UNUSED_ARG(rate_in); 237 PJ_UNUSED_ARG(rate_out); 238 PJ_UNUSED_ARG(samples_per_frame); 239 PJ_UNUSED_ARG(p_resample); 240 241 return PJ_EINVALIDOP; 253 242 } 254 243 … … 257 246 pj_int16_t *output ) 258 247 { 259 pjmedia_copy_samples(output, input, resample->samples_per_frame); 248 PJ_UNUSED_ARG(resample); 249 PJ_UNUSED_ARG(input); 250 PJ_UNUSED_ARG(output); 260 251 } 261 252 262 253 PJ_DEF(unsigned) pjmedia_resample_get_input_size(pjmedia_resample *resample) 263 254 { 264 return resample->samples_per_frame; 255 PJ_UNUSED_ARG(resample); 256 return 0; 265 257 } 266 258 267 259 PJ_DEF(void) pjmedia_resample_destroy(pjmedia_resample *resample) 268 260 { 269 270 } 271 272 #endif /* PJMEDIA_ HAS_LIBRESAMPLE*/273 261 PJ_UNUSED_ARG(resample); 262 } 263 264 #endif /* PJMEDIA_RESAMPLE_IMP */ 265 -
pjproject/trunk/pjmedia/src/pjmedia/resample_speex.c
r1177 r1493 23 23 #include <pj/pool.h> 24 24 25 #if defined(PJMEDIA_HAS_SPEEX_RESAMPLE) && PJMEDIA_HAS_SPEEX_RESAMPLE != 025 #if PJMEDIA_RESAMPLE_IMP==PJMEDIA_RESAMPLE_SPEEX 26 26 27 27 #include <speex/speex_resampler.h> … … 119 119 } 120 120 121 #else /* PJMEDIA_ HAS_SPEEX_RESAMPLE*/121 #else /* PJMEDIA_RESAMPLE_IMP==PJMEDIA_RESAMPLE_SPEEX */ 122 122 123 123 int pjmedia_resample_speex_excluded; 124 124 125 #endif /* PJMEDIA_ HAS_SPEEX_RESAMPLE*/125 #endif /* PJMEDIA_RESAMPLE_IMP==PJMEDIA_RESAMPLE_SPEEX */ 126 126
Note: See TracChangeset
for help on using the changeset viewer.