Browse code

Replace remaining occurrences of deprecated CH_* with AV_CH_*

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>

Anton Khirnov authored on 2011/02/03 22:26:09
Showing 14 changed files
... ...
@@ -24,6 +24,7 @@
24 24
 #include "ac3_parser.h"
25 25
 #include "aac_ac3_parser.h"
26 26
 #include "get_bits.h"
27
+#include "libavcore/audioconvert.h"
27 28
 
28 29
 
29 30
 #define AC3_HEADER_SIZE 7
... ...
@@ -123,7 +124,7 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
123 123
     }
124 124
     hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];
125 125
     if (hdr->lfe_on)
126
-        hdr->channel_layout |= CH_LOW_FREQUENCY;
126
+        hdr->channel_layout |= AV_CH_LOW_FREQUENCY;
127 127
 
128 128
     return 0;
129 129
 }
... ...
@@ -25,6 +25,7 @@
25 25
 #include "dsputil.h"
26 26
 #include "get_bits.h"
27 27
 #include "bytestream.h"
28
+#include "libavcore/audioconvert.h"
28 29
 
29 30
 /**
30 31
  * @file
... ...
@@ -199,7 +200,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx)
199 199
 
200 200
     dsputil_init(&s->dsp, avctx);
201 201
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
202
-    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
202
+    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
203 203
     return 0;
204 204
 }
205 205
 
... ...
@@ -31,6 +31,7 @@
31 31
 
32 32
 #include "libavutil/cpu.h"
33 33
 #include "avcodec.h"
34
+#include "libavcore/audioconvert.h"
34 35
 
35 36
 #if FF_API_OLD_SAMPLE_FMT
36 37
 /**
... ...
@@ -53,6 +53,7 @@
53 53
 #include "dsputil.h"
54 54
 #include "bytestream.h"
55 55
 #include "fft.h"
56
+#include "libavcore/audioconvert.h"
56 57
 
57 58
 #include "cookdata.h"
58 59
 
... ...
@@ -1274,7 +1275,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1274 1274
     if (channel_mask)
1275 1275
         avctx->channel_layout = channel_mask;
1276 1276
     else
1277
-        avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
1277
+        avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
1278 1278
 
1279 1279
 #ifdef COOKDEBUG
1280 1280
     dump_cook_context(q);
... ...
@@ -106,7 +106,7 @@ enum DCAExtensionMask {
106 106
  * L = left, R = right, C = center, S = surround, F = front, R = rear, T = total, OV = overhead.
107 107
  * S  -> side, when both rear and back are configured move one of them to the side channel
108 108
  * OV -> center back
109
- * All 2 channel configurations -> CH_LAYOUT_STEREO
109
+ * All 2 channel configurations -> AV_CH_LAYOUT_STEREO
110 110
  */
111 111
 
112 112
 static const int64_t dca_core_channel_layout[] = {
... ...
@@ -117,7 +117,7 @@ static const int64_t dca_core_channel_layout[] = {
117 117
     AV_CH_LAYOUT_STEREO,                                                     ///< 2, LT +RT (left and right total)
118 118
     AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER,                                  ///< 3, C+L+R
119 119
     AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER,                                   ///< 3, L+R+S
120
-    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|CH_BACK_CENTER,                   ///< 4, C + L + R+ S
120
+    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|AV_CH_BACK_CENTER,                ///< 4, C + L + R+ S
121 121
     AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,                    ///< 4, L + R +SL+ SR
122 122
     AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 5, C + L + R+ SL+SR
123 123
     AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER,                    ///< 6, CL + CR + L + R + SL + SR
... ...
@@ -40,6 +40,7 @@
40 40
 #include "get_bits.h"
41 41
 #include "dsputil.h"
42 42
 #include "fft.h"
43
+#include "libavcore/audioconvert.h"
43 44
 
44 45
 #include "imcdata.h"
45 46
 
... ...
@@ -157,7 +158,7 @@ static av_cold int imc_decode_init(AVCodecContext * avctx)
157 157
     ff_fft_init(&q->fft, 7, 1);
158 158
     dsputil_init(&q->dsp, avctx);
159 159
     avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
160
-    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
160
+    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
161 161
     return 0;
162 162
 }
163 163
 
... ...
@@ -30,6 +30,7 @@
30 30
 #include "get_bits.h"
31 31
 #include "dsputil.h"
32 32
 #include "mpegaudio.h"
33
+#include "libavcore/audioconvert.h"
33 34
 
34 35
 #include "mpc.h"
35 36
 #include "mpc7data.h"
... ...
@@ -86,7 +87,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
86 86
     c->frames_to_skip = 0;
87 87
 
88 88
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
89
-    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
89
+    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
90 90
 
91 91
     if(vlc_initialized) return 0;
92 92
     av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
... ...
@@ -30,6 +30,7 @@
30 30
 #include "get_bits.h"
31 31
 #include "dsputil.h"
32 32
 #include "mpegaudio.h"
33
+#include "libavcore/audioconvert.h"
33 34
 
34 35
 #include "mpc.h"
35 36
 #include "mpcdata.h"
... ...
@@ -135,7 +136,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
135 135
     c->frames = 1 << (get_bits(&gb, 3) * 2);
136 136
 
137 137
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
138
-    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
138
+    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
139 139
 
140 140
     if(vlc_initialized) return 0;
141 141
     av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
... ...
@@ -32,6 +32,7 @@
32 32
 #include <stdlib.h>
33 33
 
34 34
 #include "avcodec.h"
35
+#include "libavcore/audioconvert.h"
35 36
 
36 37
 #define ALT_BITSTREAM_READER_LE
37 38
 #include "get_bits.h"
... ...
@@ -554,7 +555,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
554 554
 
555 555
 static av_cold int smka_decode_init(AVCodecContext *avctx)
556 556
 {
557
-    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
557
+    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
558 558
     avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? AV_SAMPLE_FMT_U8 : AV_SAMPLE_FMT_S16;
559 559
     return 0;
560 560
 }
... ...
@@ -20,6 +20,7 @@
20 20
 
21 21
 #include "dsputil.h"
22 22
 #include "vorbis.h"
23
+#include "libavcore/audioconvert.h"
23 24
 
24 25
 const uint8_t ff_vorbis_channel_layout_offsets[8][8] = {
25 26
     { 0 },
... ...
@@ -44,14 +45,14 @@ const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = {
44 44
 };
45 45
 
46 46
 const int64_t ff_vorbis_channel_layouts[9] = {
47
-    CH_LAYOUT_MONO,
48
-    CH_LAYOUT_STEREO,
49
-    CH_LAYOUT_SURROUND,
50
-    CH_LAYOUT_QUAD,
51
-    CH_LAYOUT_5POINT0_BACK,
52
-    CH_LAYOUT_5POINT1_BACK,
53
-    CH_LAYOUT_5POINT1|CH_BACK_CENTER,
54
-    CH_LAYOUT_7POINT1,
47
+    AV_CH_LAYOUT_MONO,
48
+    AV_CH_LAYOUT_STEREO,
49
+    AV_CH_LAYOUT_SURROUND,
50
+    AV_CH_LAYOUT_QUAD,
51
+    AV_CH_LAYOUT_5POINT0_BACK,
52
+    AV_CH_LAYOUT_5POINT1_BACK,
53
+    AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER,
54
+    AV_CH_LAYOUT_7POINT1,
55 55
     0
56 56
 };
57 57
 
... ...
@@ -22,6 +22,7 @@
22 22
 #include "avcodec.h"
23 23
 #include "get_bits.h"
24 24
 #include "unary.h"
25
+#include "libavcore/audioconvert.h"
25 26
 
26 27
 /**
27 28
  * @file
... ...
@@ -706,7 +707,7 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
706 706
     else
707 707
         avctx->sample_fmt = AV_SAMPLE_FMT_S32;
708 708
     if(avctx->channels <= 2 && !avctx->channel_layout)
709
-        avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
709
+        avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
710 710
 
711 711
     s->multichannel = avctx->channels > 2;
712 712
     /* lavf demuxer does not provide extradata, Matroska stores 0x403
... ...
@@ -23,6 +23,7 @@
23 23
 #include "avformat.h"
24 24
 #include "pcm.h"
25 25
 #include "libavutil/intreadwrite.h"
26
+#include "libavcore/audioconvert.h"
26 27
 
27 28
 #define AT1_SU_SIZE     212
28 29
 
... ...
@@ -76,7 +77,7 @@ static int aea_read_header(AVFormatContext *s,
76 76
         return -1;
77 77
     }
78 78
 
79
-    st->codec->channel_layout = (st->codec->channels == 1) ? CH_LAYOUT_MONO : CH_LAYOUT_STEREO;
79
+    st->codec->channel_layout = (st->codec->channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
80 80
 
81 81
     st->codec->block_align = AT1_SU_SIZE * st->codec->channels;
82 82
     return 0;
... ...
@@ -33,6 +33,7 @@
33 33
 
34 34
 #include "libavutil/intreadwrite.h"
35 35
 #include "avformat.h"
36
+#include "libavcore/audioconvert.h"
36 37
 
37 38
 #define FLIC_FILE_MAGIC_1 0xAF11
38 39
 #define FLIC_FILE_MAGIC_2 0xAF12
... ...
@@ -160,7 +161,7 @@ static int flic_read_header(AVFormatContext *s,
160 160
         ast->codec->sample_fmt = AV_SAMPLE_FMT_U8;
161 161
         ast->codec->bit_rate = st->codec->sample_rate * 8;
162 162
         ast->codec->bits_per_coded_sample = 8;
163
-        ast->codec->channel_layout = CH_LAYOUT_MONO;
163
+        ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
164 164
         ast->codec->extradata_size = 0;
165 165
 
166 166
         /* Since the header information is incorrect we have to figure out the
... ...
@@ -23,6 +23,7 @@
23 23
 #include "avformat.h"
24 24
 #include "apetag.h"
25 25
 #include "id3v1.h"
26
+#include "libavcore/audioconvert.h"
26 27
 
27 28
 // specs say that maximum block size is 1Mb
28 29
 #define WV_BLOCK_LIMIT 1047576
... ...
@@ -111,7 +112,7 @@ static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb, int app
111 111
     //parse flags
112 112
     bpp = ((wc->flags & 3) + 1) << 3;
113 113
     chan = 1 + !(wc->flags & WV_MONO);
114
-    chmask = wc->flags & WV_MONO ? CH_LAYOUT_MONO : CH_LAYOUT_STEREO;
114
+    chmask = wc->flags & WV_MONO ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
115 115
     rate = wv_rates[(wc->flags >> 23) & 0xF];
116 116
     wc->multichannel = !!((wc->flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK);
117 117
     if(wc->multichannel){