planar formats are now chosen like any other parameter.
Showing the changes to libswresample (1 of 1 file). Show all
Unified · Split
| @@ -202,11 +202,11 @@ int main(int argc, char **argv){ · 201 unmodified lines | ||
| 202 | 202 | in_layout_string, out_layout_string, |
| 203 | 203 | in_sample_rate, out_sample_rate, |
| 204 | 204 | av_get_sample_fmt_name(in_sample_fmt), av_get_sample_fmt_name(out_sample_fmt)); |
| 205 | − forw_ctx = swr_alloc_set_opts(forw_ctx, out_ch_layout, av_get_alt_sample_fmt(out_sample_fmt, 1), out_sample_rate, | |
| 206 | − in_ch_layout, av_get_alt_sample_fmt( in_sample_fmt, 1), in_sample_rate, | |
| 205 | + forw_ctx = swr_alloc_set_opts(forw_ctx, out_ch_layout, out_sample_fmt, out_sample_rate, | |
| 206 | + in_ch_layout, in_sample_fmt, in_sample_rate, | |
| 207 | 207 | 0, 0); |
| 208 | 208 | backw_ctx = swr_alloc_set_opts(backw_ctx, in_ch_layout, in_sample_fmt, in_sample_rate, |
| 209 | − out_ch_layout, av_get_alt_sample_fmt(out_sample_fmt, 1), out_sample_rate, | |
| 209 | + out_ch_layout, out_sample_fmt, out_sample_rate, | |
| 210 | 210 | 0, 0); |
| 211 | 211 | if(swr_init( forw_ctx) < 0) |
| 212 | 212 | fprintf(stderr, "swr_init(->) failed\n"); |
| @@ -217,12 +217,12 @@ int main(int argc, char **argv){ · 4 unmodified lines | ||
| 217 | 217 | if(!backw_ctx) |
| 218 | 218 | fprintf(stderr, "Failed to init backw_ctx\n"); |
| 219 | 219 | //FIXME test planar |
| 220 | − setup_array(ain , array_in , av_get_alt_sample_fmt( in_sample_fmt, 1), SAMPLES); | |
| 221 | − setup_array(amid, array_mid, av_get_alt_sample_fmt(out_sample_fmt, 1), 3*SAMPLES); | |
| 220 | + setup_array(ain , array_in , in_sample_fmt, SAMPLES); | |
| 221 | + setup_array(amid, array_mid, out_sample_fmt, 3*SAMPLES); | |
| 222 | 222 | setup_array(aout, array_out, in_sample_fmt , SAMPLES); |
| 223 | 223 | for(ch=0; ch<in_ch_count; ch++){ |
| 224 | 224 | for(i=0; i<SAMPLES; i++) |
| 225 | − set(ain, ch, i, in_ch_count, av_get_alt_sample_fmt(in_sample_fmt, 1), sin(i*i*3/SAMPLES)); | |
| 225 | + set(ain, ch, i, in_ch_count, in_sample_fmt, sin(i*i*3/SAMPLES)); | |
| 226 | 226 | } |
| 227 | 227 | mode++; |
| 228 | 228 | mode%=3; |
| @@ -235,17 +235,17 @@ int main(int argc, char **argv){ · 6 unmodified lines | ||
| 235 | 235 | int tmp_count; |
| 236 | 236 | mid_count= swr_convert(forw_ctx, amid, 0, ain, 1); |
| 237 | 237 | av_assert0(mid_count==0); |
| 238 | − shift(ain, 1, in_ch_count, av_get_alt_sample_fmt(in_sample_fmt, 1)); | |
| 238 | + shift(ain, 1, in_ch_count, in_sample_fmt); | |
| 239 | 239 | mid_count+=swr_convert(forw_ctx, amid, 3*SAMPLES, ain, 0); |
| 240 | − shift(amid, mid_count, out_ch_count, av_get_alt_sample_fmt(out_sample_fmt, 1)); tmp_count = mid_count; | |
| 240 | + shift(amid, mid_count, out_ch_count, out_sample_fmt); tmp_count = mid_count; | |
| 241 | 241 | mid_count+=swr_convert(forw_ctx, amid, 2, ain, 2); |
| 242 | − shift(amid, mid_count-tmp_count, out_ch_count, av_get_alt_sample_fmt(out_sample_fmt, 1)); tmp_count = mid_count; | |
| 243 | − shift(ain, 2, in_ch_count, av_get_alt_sample_fmt(in_sample_fmt, 1)); | |
| 242 | + shift(amid, mid_count-tmp_count, out_ch_count, out_sample_fmt); tmp_count = mid_count; | |
| 243 | + shift(ain, 2, in_ch_count, in_sample_fmt); | |
| 244 | 244 | mid_count+=swr_convert(forw_ctx, amid, 1, ain, SAMPLES-3); |
| 245 | − shift(amid, mid_count-tmp_count, out_ch_count, av_get_alt_sample_fmt(out_sample_fmt, 1)); tmp_count = mid_count; | |
| 246 | − shift(ain, -3, in_ch_count, av_get_alt_sample_fmt(in_sample_fmt, 1)); | |
| 245 | + shift(amid, mid_count-tmp_count, out_ch_count, out_sample_fmt); tmp_count = mid_count; | |
| 246 | + shift(ain, -3, in_ch_count, in_sample_fmt); | |
| 247 | 247 | mid_count+=swr_convert(forw_ctx, amid, 3*SAMPLES, ain, 0); |
| 248 | − shift(amid, -tmp_count, out_ch_count, av_get_alt_sample_fmt(out_sample_fmt, 1)); | |
| 248 | + shift(amid, -tmp_count, out_ch_count, out_sample_fmt); | |
| 249 | 249 | } |
| 250 | 250 | out_count= swr_convert(backw_ctx,aout, SAMPLES, amid, mid_count); |
| 251 | 251 | |
| @@ -257,7 +257,7 @@ int main(int argc, char **argv){ · 5 unmodified lines | ||
| 257 | 257 | double sum_bb= 0; |
| 258 | 258 | double sum_ab= 0; |
| 259 | 259 | for(i=0; i<out_count; i++){ |
| 260 | − double a= get(ain , ch, i, in_ch_count, av_get_alt_sample_fmt(in_sample_fmt, 1)); | |
| 260 | + double a= get(ain , ch, i, in_ch_count, in_sample_fmt); | |
| 261 | 261 | double b= get(aout, ch, i, in_ch_count, in_sample_fmt); |
| 262 | 262 | sum_a += a; |
| 263 | 263 | sum_b += b; |
| @@ -286,7 +286,7 @@ int main(int argc, char **argv){ · 22 unmodified lines | ||
| 286 | 286 | double sum_bb= 0; |
| 287 | 287 | double sum_ab= 0; |
| 288 | 288 | for(i=0; i<flush_count; i++){ |
| 289 | − double a= get(ain , ch, i+out_count, in_ch_count, av_get_alt_sample_fmt(in_sample_fmt, 1)); | |
| 289 | + double a= get(ain , ch, i+out_count, in_ch_count, in_sample_fmt); | |
| 290 | 290 | double b= get(aout, ch, i, in_ch_count, in_sample_fmt); |
| 291 | 291 | sum_a += a; |
| 292 | 292 | sum_b += b; |