OLD | NEW |
1 /* | 1 /* |
2 * audio conversion | 2 * audio conversion |
3 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> | 3 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> |
4 * | 4 * |
5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
6 * | 6 * |
7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 72 } |
73 | 73 |
74 static const char* const channel_names[]={ | 74 static const char* const channel_names[]={ |
75 "FL", "FR", "FC", "LFE", "BL", "BR", "FLC", "FRC", | 75 "FL", "FR", "FC", "LFE", "BL", "BR", "FLC", "FRC", |
76 "BC", "SL", "SR", "TC", "TFL", "TFC", "TFR", "TBL", | 76 "BC", "SL", "SR", "TC", "TFL", "TFC", "TFR", "TBL", |
77 "TBC", "TBR", | 77 "TBC", "TBR", |
78 [29] = "DL", | 78 [29] = "DL", |
79 [30] = "DR", | 79 [30] = "DR", |
80 }; | 80 }; |
81 | 81 |
82 const char *get_channel_name(int channel_id) | 82 static const char *get_channel_name(int channel_id) |
83 { | 83 { |
84 if (channel_id<0 || channel_id>=FF_ARRAY_ELEMS(channel_names)) | 84 if (channel_id<0 || channel_id>=FF_ARRAY_ELEMS(channel_names)) |
85 return NULL; | 85 return NULL; |
86 return channel_names[channel_id]; | 86 return channel_names[channel_id]; |
87 } | 87 } |
88 | 88 |
89 int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, con
st char *fmt_name) | 89 int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, con
st char *fmt_name) |
90 { | 90 { |
91 switch(nb_channels) { | 91 switch(nb_channels) { |
92 case 1: return CH_LAYOUT_MONO; | 92 case 1: return CH_LAYOUT_MONO; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_FLT, *(const float*)pi) | 233 else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_FLT, *(const float*)pi) |
234 else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_DBL, lrint(*(const double*
)pi * (1<<7)) + 0x80) | 234 else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_DBL, lrint(*(const double*
)pi * (1<<7)) + 0x80) |
235 else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_DBL, lrint(*(const double*
)pi * (1<<15))) | 235 else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_DBL, lrint(*(const double*
)pi * (1<<15))) |
236 else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_DBL, lrint(*(const double*
)pi * (1<<31))) | 236 else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_DBL, lrint(*(const double*
)pi * (1<<31))) |
237 else CONV(SAMPLE_FMT_FLT, float , SAMPLE_FMT_DBL, *(const double*)pi) | 237 else CONV(SAMPLE_FMT_FLT, float , SAMPLE_FMT_DBL, *(const double*)pi) |
238 else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_DBL, *(const double*)pi) | 238 else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_DBL, *(const double*)pi) |
239 else return -1; | 239 else return -1; |
240 } | 240 } |
241 return 0; | 241 return 0; |
242 } | 242 } |
OLD | NEW |