Revision 764ef400

View differences:

libavcodec/adpcm.c
107 107

  
108 108
/* XXX: implement encoding */
109 109

  
110
#ifdef CONFIG_ENCODERS
110 111
static int adpcm_encode_init(AVCodecContext *avctx)
111 112
{
112 113
    if (avctx->channels > 2)
......
265 266
    }
266 267
    return dst - frame;
267 268
}
269
#endif //CONFIG_ENCODERS
268 270

  
269 271
static int adpcm_decode_init(AVCodecContext * avctx)
270 272
{
......
685 687
    return src - buf;
686 688
}
687 689

  
688
#define ADPCM_CODEC(id, name)                   \
690

  
691

  
692
#ifdef CONFIG_ENCODERS
693
#define ADPCM_ENCODER(id,name)                  \
689 694
AVCodec name ## _encoder = {                    \
690 695
    #name,                                      \
691 696
    CODEC_TYPE_AUDIO,                           \
......
695 700
    adpcm_encode_frame,                         \
696 701
    adpcm_encode_close,                         \
697 702
    NULL,                                       \
698
};                                              \
703
};
704
#else
705
#define ADPCM_ENCODER(id,name)
706
#endif
707

  
708
#ifdef CONFIG_DECODERS
709
#define ADPCM_DECODER(id,name)                  \
699 710
AVCodec name ## _decoder = {                    \
700 711
    #name,                                      \
701 712
    CODEC_TYPE_AUDIO,                           \
......
706 717
    NULL,                                       \
707 718
    adpcm_decode_frame,                         \
708 719
};
720
#else
721
#define ADPCM_DECODER(id,name)
722
#endif
723

  
724
#define ADPCM_CODEC(id, name)                   \
725
ADPCM_ENCODER(id,name) ADPCM_DECODER(id,name)
709 726

  
710 727
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
711 728
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
libavcodec/i386/dsputil_mmx.c
171 171
/***********************************/
172 172
/* standard MMX */
173 173

  
174
#ifdef CONFIG_ENCODERS
174 175
static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size)
175 176
{
176 177
    asm volatile(
......
227 228
        : "%eax"
228 229
    );
229 230
}
231
#endif //CONFIG_ENCODERS
230 232

  
231 233
void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
232 234
{
......
401 403
        );
402 404
}
403 405

  
406
#ifdef CONFIG_ENCODERS
404 407
static int pix_sum16_mmx(uint8_t * pix, int line_size){
405 408
    const int h=16;
406 409
    int sum;
......
438 441

  
439 442
        return sum;
440 443
}
444
#endif //CONFIG_ENCODERS
441 445

  
442 446
static void add_bytes_mmx(uint8_t *dst, uint8_t *src, int w){
443 447
    int i=0;
......
461 465
        dst[i+0] += src[i+0];
462 466
}
463 467

  
468
#ifdef CONFIG_ENCODERS
464 469
static int pix_norm1_mmx(uint8_t *pix, int line_size) {
465 470
    int tmp;
466 471
  asm volatile (
......
856 861

  
857 862
WARPER88_1616(hadamard8_diff_mmx, hadamard8_diff16_mmx)
858 863
WARPER88_1616(hadamard8_diff_mmx2, hadamard8_diff16_mmx2)
864
#endif //CONFIG_ENCODERS
859 865

  
860 866
#define put_no_rnd_pixels8_mmx(a,b,c,d) put_pixels8_mmx(a,b,c,d)
861 867
#define put_no_rnd_pixels16_mmx(a,b,c,d) put_pixels16_mmx(a,b,c,d)
......
1619 1625
            c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
1620 1626
        }
1621 1627
        
1628
#ifdef CONFIG_ENCODERS
1622 1629
        c->get_pixels = get_pixels_mmx;
1623 1630
        c->diff_pixels = diff_pixels_mmx;
1631
#endif //CONFIG_ENCODERS
1624 1632
        c->put_pixels_clamped = put_pixels_clamped_mmx;
1625 1633
        c->add_pixels_clamped = add_pixels_clamped_mmx;
1626 1634
        c->clear_blocks = clear_blocks_mmx;
1635
#ifdef CONFIG_ENCODERS
1627 1636
        c->pix_sum = pix_sum16_mmx;
1637
#endif //CONFIG_ENCODERS
1628 1638

  
1629 1639
        c->put_pixels_tab[0][0] = put_pixels16_mmx;
1630 1640
        c->put_pixels_tab[0][1] = put_pixels16_x2_mmx;
......
1667 1677
        c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels8_xy2_mmx;
1668 1678
                
1669 1679
        c->add_bytes= add_bytes_mmx;
1680
#ifdef CONFIG_ENCODERS
1670 1681
        c->diff_bytes= diff_bytes_mmx;
1671 1682
        
1672 1683
        c->hadamard8_diff[0]= hadamard8_diff16_mmx;
......
1674 1685
        
1675 1686
	c->pix_norm1 = pix_norm1_mmx;
1676 1687
	c->sse[0] = sse16_mmx;
1688
#endif //CONFIG_ENCODERS
1677 1689
        
1678 1690
        if (mm_flags & MM_MMXEXT) {
1679 1691
            c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2;
......
1690 1702
            c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx2;
1691 1703
            c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx2;
1692 1704

  
1705
#ifdef CONFIG_ENCODERS
1693 1706
            c->hadamard8_diff[0]= hadamard8_diff16_mmx2;
1694 1707
            c->hadamard8_diff[1]= hadamard8_diff_mmx2;
1708
#endif //CONFIG_ENCODERS
1695 1709

  
1696 1710
            if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
1697 1711
                c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2;
......
1797 1811
        }
1798 1812
    }
1799 1813
        
1814
#ifdef CONFIG_ENCODERS
1800 1815
    dsputil_init_pix_mmx(c, avctx);
1816
#endif //CONFIG_ENCODERS
1801 1817
#if 0
1802 1818
    // for speed testing
1803 1819
    get_pixels = just_return;
libavcodec/mjpeg.c
243 243
    }
244 244
}
245 245

  
246
#ifdef CONFIG_ENCODERS
246 247
int mjpeg_init(MpegEncContext *s)
247 248
{
248 249
    MJpegContext *m;
......
280 281
{
281 282
    av_free(s->mjpeg_ctx);
282 283
}
284
#endif //CONFIG_ENCODERS
283 285

  
284 286
#define PREDICT(ret, topleft, top, left, predictor)\
285 287
    switch(predictor){\
libavcodec/mpeg12.c
48 48
#define MB_BTYPE_VLC_BITS 6
49 49
#define TEX_VLC_BITS 9
50 50

  
51
#ifdef CONFIG_ENCODERS
51 52
static void mpeg1_encode_block(MpegEncContext *s, 
52 53
                         DCTELEM *block, 
53 54
                         int component);
54 55
static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code);    // RAL: f_code parameter added
56
#endif //CONFIG_ENCODERS
55 57
static void mpeg1_skip_picture(MpegEncContext *s, int pict_num);
56 58
static inline int mpeg1_decode_block_inter(MpegEncContext *s, 
57 59
                              DCTELEM *block, 
......
85 87

  
86 88
static uint8_t mpeg1_index_run[2][64];
87 89
static int8_t mpeg1_max_level[2][64];
88
#endif
90
#endif //CONFIG_ENCODERS
89 91

  
90 92
static void init_2d_vlc_rl(RLTable *rl)
91 93
{
......
361 363
    put_bits(&s->pb, 1, 1); 
362 364
    put_bits(&s->pb, 1, 1); 
363 365
}
364
#endif
366
#endif //CONFIG_ENCODERS
365 367

  
366 368
static void common_init(MpegEncContext *s)
367 369
{
libavcodec/mpegvideo.c
173 173
    }
174 174
}
175 175

  
176
#ifdef CONFIG_ENCODERS
176 177
void ff_write_quant_matrix(PutBitContext *pb, int16_t *matrix){
177 178
    int i;
178 179

  
......
184 185
    }else
185 186
        put_bits(pb, 1, 0);
186 187
}
188
#endif //CONFIG_ENCODERS
187 189

  
188 190
/* init common dct for both encoder and decoder */
189 191
int DCT_common_init(MpegEncContext *s)
libavformat/allformats.c
31 31

  
32 32
    mpegps_init();
33 33
    mpegts_init();
34
#ifdef CONFIG_ENCODERS
34 35
    crc_init();
35 36
    img_init();
37
#endif //CONFIG_ENCODERS
36 38
    raw_init();
37 39
    mp3_init();
38 40
    rm_init();
39 41
#ifdef CONFIG_RISKY
40 42
    asf_init();
41 43
#endif
44
#ifdef CONFIG_ENCODERS
42 45
    avienc_init();
46
#endif //CONFIG_ENCODERS
43 47
    avidec_init();
44 48
    wav_init();
45 49
    swf_init();
46 50
    au_init();
51
#ifdef CONFIG_ENCODERS
47 52
    gif_init();
53
#endif //CONFIG_ENCODERS
48 54
    mov_init();
55
#ifdef CONFIG_ENCODERS
49 56
    movenc_init();
50 57
    jpeg_init();
58
#endif //CONFIG_ENCODERS
51 59
    dv_init();
52 60
    fourxm_init();
61
#ifdef CONFIG_ENCODERS
53 62
    flvenc_init();
63
#endif //CONFIG_ENCODERS
54 64
    flvdec_init();
55 65
    str_init();
56 66
    roq_init();
......
59 69
    westwood_init();
60 70
    film_init();
61 71
    idcin_init();
72
    vmd_init();
62 73

  
63 74
#if defined(AMR_NB) || defined(AMR_NB_FIXED) || defined(AMR_WB)
64 75
    amr_init();
......
85 96

  
86 97
    nut_init();
87 98

  
99
#ifdef CONFIG_ENCODERS
88 100
    /* image formats */
89 101
    av_register_image_format(&pnm_image_format);
90 102
    av_register_image_format(&pbm_image_format);
......
98 110
#endif
99 111
    av_register_image_format(&jpeg_image_format);
100 112
    av_register_image_format(&gif_image_format);
113
#endif //CONFIG_ENCODERS
101 114

  
102 115
    /* file protocols */
103 116
    register_protocol(&file_protocol);
libavformat/asf.c
182 182
    0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 },
183 183
};
184 184

  
185
#ifdef CONFIG_ENCODERS
185 186
static void put_guid(ByteIOContext *s, const GUID *g)
186 187
{
187 188
    int i;
......
661 662
    put_flush_packet(&s->pb);
662 663
    return 0;
663 664
}
665
#endif //CONFIG_ENCODERS
664 666

  
665 667
/**********************************/
666 668
/* decoding */
......
1245 1247
    asf_read_seek,
1246 1248
};
1247 1249

  
1250
#ifdef CONFIG_ENCODERS
1248 1251
static AVOutputFormat asf_oformat = {
1249 1252
    "asf",
1250 1253
    "asf format",
......
1278 1281
    asf_write_packet,
1279 1282
    asf_write_trailer,
1280 1283
};
1284
#endif //CONFIG_ENCODERS
1281 1285

  
1282 1286
int asf_init(void)
1283 1287
{
1284 1288
    av_register_input_format(&asf_iformat);
1289
#ifdef CONFIG_ENCODERS
1285 1290
    av_register_output_format(&asf_oformat);
1286 1291
    av_register_output_format(&asf_stream_oformat);
1292
#endif //CONFIG_ENCODERS
1287 1293
    return 0;
1288 1294
}
libavformat/au.c
39 39
    { 0, 0 },
40 40
};
41 41

  
42
#ifdef CONFIG_ENCODERS
42 43
/* AUDIO_FILE header */
43 44
static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
44 45
{
......
97 98

  
98 99
    return 0;
99 100
}
101
#endif //CONFIG_ENCODERS
100 102

  
101 103
static int au_probe(AVProbeData *p)
102 104
{
......
187 189
    au_read_close,
188 190
};
189 191

  
192
#ifdef CONFIG_ENCODERS
190 193
static AVOutputFormat au_oformat = {
191 194
    "au",
192 195
    "SUN AU Format",
......
199 202
    au_write_packet,
200 203
    au_write_trailer,
201 204
};
205
#endif //CONFIG_ENCODERS
202 206

  
203 207
int au_init(void)
204 208
{
205 209
    av_register_input_format(&au_iformat);
210
#ifdef CONFIG_ENCODERS
206 211
    av_register_output_format(&au_oformat);
212
#endif //CONFIG_ENCODERS
207 213
    return 0;
208 214
}
libavformat/avienc.c
24 24
 *  - fill all fields if non streamed (nb_frames for example)
25 25
 */
26 26

  
27
#ifdef CONFIG_ENCODERS
27 28
typedef struct AVIIentry {
28 29
    unsigned int flags, pos, len;
29 30
} AVIIentry;
......
69 70
    put_le32(pb, (uint32_t)(pos - start));
70 71
    url_fseek(pb, pos, SEEK_SET);
71 72
}
73
#endif //CONFIG_ENCODERS
72 74

  
73 75
/* Note: when encoding, the first matching tag is used, so order is
74 76
   important if multiple tags possible for a given codec. */
......
206 208
    return codec_get_id(codec_wav_tags, tag);
207 209
}
208 210

  
211
#ifdef CONFIG_ENCODERS
209 212
/* BITMAPINFOHEADER header */
210 213
void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const CodecTag *tags, int for_asf)
211 214
{
......
720 723
    av_register_output_format(&avi_oformat);
721 724
    return 0;
722 725
}
726
#endif //CONFIG_ENCODERS
libavformat/avio.c
100 100
    return ret;
101 101
}
102 102

  
103
#ifdef CONFIG_ENCODERS
103 104
int url_write(URLContext *h, unsigned char *buf, int size)
104 105
{
105 106
    int ret;
......
111 112
    ret = h->prot->url_write(h, buf, size);
112 113
    return ret;
113 114
}
115
#endif //CONFIG_ENCODERS
114 116

  
115 117
offset_t url_seek(URLContext *h, offset_t pos, int whence)
116 118
{
libavformat/aviobuf.c
52 52
}
53 53
                  
54 54

  
55
#ifdef CONFIG_ENCODERS
55 56
static void flush_buffer(ByteIOContext *s)
56 57
{
57 58
    if (s->buf_ptr > s->buffer) {
......
93 94
    flush_buffer(s);
94 95
    s->must_flush = 0;
95 96
}
97
#endif //CONFIG_ENCODERS
96 98

  
97 99
offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)
98 100
{
......
101 103
    if (whence != SEEK_CUR && whence != SEEK_SET)
102 104
        return -EINVAL;
103 105
    
106
#ifdef CONFIG_ENCODERS
104 107
    if (s->write_flag) {
105 108
        if (whence == SEEK_CUR) {
106 109
            offset1 = s->pos + (s->buf_ptr - s->buffer);
......
122 125
            s->seek(s->opaque, offset, SEEK_SET);
123 126
            s->pos = offset;
124 127
        }
125
    } else {
128
    } else 
129
#endif //CONFIG_ENCODERS
130
    {
126 131
        if (whence == SEEK_CUR) {
127 132
            offset1 = s->pos - (s->buf_end - s->buffer) + (s->buf_ptr - s->buffer);
128 133
            if (offset == 0)
......
161 166
    return s->eof_reached;
162 167
}
163 168

  
169
#ifdef CONFIG_ENCODERS
164 170
void put_le32(ByteIOContext *s, unsigned int val)
165 171
{
166 172
    put_byte(s, val);
......
226 232
        put_byte(s, *tag++);
227 233
    }
228 234
}
235
#endif //CONFIG_ENCODERS
229 236

  
230 237
/* Input stream */
231 238

  
......
382 389

  
383 390
/* link with avio functions */
384 391

  
392
#ifdef CONFIG_ENCODERS
385 393
static void url_write_packet(void *opaque, uint8_t *buf, int buf_size)
386 394
{
387 395
    URLContext *h = opaque;
388 396
    url_write(h, buf, buf_size);
389 397
}
398
#else
399
#define	url_write_packet NULL
400
#endif //CONFIG_ENCODERS
390 401

  
391 402
static int url_read_packet(void *opaque, uint8_t *buf, int buf_size)
392 403
{
......
479 490
    return s->opaque;
480 491
}
481 492

  
493
#ifdef CONFIG_ENCODERS
482 494
/* XXX: currently size is limited */
483 495
int url_fprintf(ByteIOContext *s, const char *fmt, ...)
484 496
{
......
492 504
    put_buffer(s, buf, strlen(buf));
493 505
    return ret;
494 506
}
507
#endif //CONFIG_ENCODERS
495 508

  
496 509
/* note: unlike fgets, the EOL character is not returned and a whole
497 510
   line is parsed. return NULL if first char read was EOF */
......
529 542
    return s->max_packet_size;
530 543
}
531 544

  
545
#ifdef CONFIG_ENCODERS
532 546
/* buffer handling */
533 547
int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags)
534 548
{
......
682 696
    av_free(d);
683 697
    return size;
684 698
}
699
#endif //CONFIG_ENCODERS
libavformat/ffm.c
54 54
/* disable pts hack for testing */
55 55
int ffm_nopts = 0;
56 56

  
57
#ifdef CONFIG_ENCODERS
57 58
static void flush_packet(AVFormatContext *s)
58 59
{
59 60
    FFMContext *ffm = s->priv_data;
......
273 274
        av_freep(&s->streams[i]->priv_data);
274 275
    return 0;
275 276
}
277
#endif //CONFIG_ENCODERS
276 278

  
277 279
/* ffm demux */
278 280

  
......
663 665
    ffm_seek,
664 666
};
665 667

  
668
#ifdef CONFIG_ENCODERS
666 669
static AVOutputFormat ffm_oformat = {
667 670
    "ffm",
668 671
    "ffm format",
......
676 679
    ffm_write_packet,
677 680
    ffm_write_trailer,
678 681
};
682
#endif //CONFIG_ENCODERS
679 683

  
680 684
int ffm_init(void)
681 685
{
682 686
    av_register_input_format(&ffm_iformat);
687
#ifdef CONFIG_ENCODERS
683 688
    av_register_output_format(&ffm_oformat);
689
#endif //CONFIG_ENCODERS
684 690
    return 0;
685 691
}
libavformat/mp3.c
316 316
    return 0;
317 317
}
318 318

  
319
#ifdef CONFIG_ENCODERS
319 320
/* simple formats */
320 321
static int mp3_write_header(struct AVFormatContext *s)
321 322
{
......
342 343
    }
343 344
    return 0;
344 345
}
346
#endif //CONFIG_ENCODERS
345 347

  
346 348
AVInputFormat mp3_iformat = {
347 349
    "mp3",
......
354 356
    .extensions = "mp2,mp3", /* XXX: use probe */
355 357
};
356 358

  
359
#ifdef CONFIG_ENCODERS
357 360
AVOutputFormat mp2_oformat = {
358 361
    "mp2",
359 362
    "MPEG audio layer 2",
......
385 388
    mp3_write_trailer,
386 389
};
387 390
#endif
391
#endif //CONFIG_ENCODERS
388 392

  
389 393
int mp3_init(void)
390 394
{
391 395
    av_register_input_format(&mp3_iformat);
396
#ifdef CONFIG_ENCODERS
392 397
    av_register_output_format(&mp2_oformat);
393 398
#ifdef CONFIG_MP3LAME
394 399
    av_register_output_format(&mp3_oformat);
395 400
#endif    
401
#endif //CONFIG_ENCODERS
396 402
    return 0;
397 403
}
libavformat/mpeg.c
61 61
#define AUDIO_ID 0xc0
62 62
#define VIDEO_ID 0xe0
63 63

  
64
#ifdef CONFIG_ENCODERS
64 65
extern AVOutputFormat mpeg1system_mux;
65 66
extern AVOutputFormat mpeg1vcd_mux;
66 67
extern AVOutputFormat mpeg2vob_mux;
......
396 397

  
397 398
    return 0;
398 399
}
400
#endif //CONFIG_ENCODERS
399 401

  
400 402
/*********************************************/
401 403
/* demux code */
......
650 652
    return 0;
651 653
}
652 654

  
655
#ifdef CONFIG_ENCODERS
653 656
static AVOutputFormat mpeg1system_mux = {
654 657
    "mpeg",
655 658
    "MPEG1 System format",
......
688 691
    mpeg_mux_write_packet,
689 692
    mpeg_mux_end,
690 693
};
694
#endif //CONFIG_ENCODERS
691 695

  
692 696
AVInputFormat mpegps_demux = {
693 697
    "mpeg",
......
702 706

  
703 707
int mpegps_init(void)
704 708
{
709
#ifdef CONFIG_ENCODERS
705 710
    av_register_output_format(&mpeg1system_mux);
706 711
    av_register_output_format(&mpeg1vcd_mux);
707 712
    av_register_output_format(&mpeg2vob_mux);
713
#endif //CONFIG_ENCODERS
708 714
    av_register_input_format(&mpegps_demux);
709 715
    return 0;
710 716
}
libavformat/mpegts.c
1047 1047
int mpegts_init(void)
1048 1048
{
1049 1049
    av_register_input_format(&mpegts_demux);
1050
#ifdef CONFIG_ENCODERS
1050 1051
    av_register_output_format(&mpegts_mux);
1052
#endif
1051 1053
    return 0;
1052 1054
}
libavformat/mpjpeg.c
22 22

  
23 23
#define BOUNDARY_TAG "ffserver"
24 24

  
25
#ifdef CONFIG_ENCODERS
25 26
static int mpjpeg_write_header(AVFormatContext *s)
26 27
{
27 28
    uint8_t buf1[256];
......
106 107
    av_register_output_format(&single_jpeg_format);
107 108
    return 0;
108 109
}
110
#endif //CONFIG_ENCODERS
libavformat/nut.c
133 133
    return 7; //not reached
134 134
}
135 135

  
136
#ifdef CONFIG_ENCODERS
136 137
static int put_v(ByteIOContext *bc, uint64_t val)
137 138
{
138 139
    int i;
......
393 394

  
394 395
    return 0;
395 396
}
397
#endif //CONFIG_ENCODERS
396 398

  
397 399
static int nut_probe(AVProbeData *p)
398 400
{
......
561 563
    .extensions = "nut",
562 564
};
563 565

  
566
#ifdef CONFIG_ENCODERS
564 567
static AVOutputFormat nut_oformat = {
565 568
    "nut",
566 569
    "nut format",
......
579 582
    nut_write_packet,
580 583
    nut_write_trailer,
581 584
};
585
#endif //CONFIG_ENCODERS
582 586

  
583 587
int nut_init(void)
584 588
{
585 589
    av_register_input_format(&nut_iformat);
590
#ifdef CONFIG_ENCODERS
586 591
    av_register_output_format(&nut_oformat);
592
#endif //CONFIG_ENCODERS
587 593
    return 0;
588 594
}
libavformat/ogg.c
30 30
} OggContext ;
31 31

  
32 32

  
33
#ifdef CONFIG_ENCODERS
33 34
static int ogg_write_header(AVFormatContext *avfcontext) 
34 35
{
35 36
    OggContext *context = avfcontext->priv_data;
......
162 163
    ogg_write_packet,
163 164
    ogg_write_trailer,
164 165
} ;
166
#endif //CONFIG_ENCODERS
165 167

  
166 168

  
167 169
static int next_packet(AVFormatContext *avfcontext, ogg_packet *op) {
......
257 259

  
258 260

  
259 261
int ogg_init(void) {
262
#ifdef CONFIG_ENCODERS
260 263
    av_register_output_format(&ogg_oformat) ;
264
#endif
261 265
    av_register_input_format(&ogg_iformat);
262 266
    return 0 ;
263 267
}
libavformat/raw.c
18 18
 */
19 19
#include "avformat.h"
20 20

  
21
#ifdef CONFIG_ENCODERS
21 22
/* simple formats */
22 23
static int raw_write_header(struct AVFormatContext *s)
23 24
{
......
36 37
{
37 38
    return 0;
38 39
}
40
#endif //CONFIG_ENCODERS
39 41

  
40 42
/* raw input */
41 43
static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
......
204 206
    .extensions = "ac3",
205 207
};
206 208

  
209
#ifdef CONFIG_ENCODERS
207 210
AVOutputFormat ac3_oformat = {
208 211
    "ac3",
209 212
    "raw ac3",
......
216 219
    raw_write_packet,
217 220
    raw_write_trailer,
218 221
};
222
#endif //CONFIG_ENCODERS
219 223

  
220 224
AVInputFormat h263_iformat = {
221 225
    "h263",
......
229 233
    .value = CODEC_ID_H263,
230 234
};
231 235

  
236
#ifdef CONFIG_ENCODERS
232 237
AVOutputFormat h263_oformat = {
233 238
    "h263",
234 239
    "raw h263",
......
241 246
    raw_write_packet,
242 247
    raw_write_trailer,
243 248
};
249
#endif //CONFIG_ENCODERS
244 250

  
245 251
AVInputFormat m4v_iformat = {
246 252
    "m4v",
......
254 260
    .value = CODEC_ID_MPEG4,
255 261
};
256 262

  
263
#ifdef CONFIG_ENCODERS
257 264
AVOutputFormat m4v_oformat = {
258 265
    "m4v",
259 266
    "raw MPEG4 video format",
......
266 273
    raw_write_packet,
267 274
    raw_write_trailer,
268 275
};
276
#endif //CONFIG_ENCODERS
269 277

  
270 278
AVInputFormat h264_iformat = {
271 279
    "h264",
......
279 287
    .value = CODEC_ID_H264,
280 288
};
281 289

  
290
#ifdef CONFIG_ENCODERS
282 291
AVOutputFormat h264_oformat = {
283 292
    "h264",
284 293
    "raw H264 video format",
......
291 300
    raw_write_packet,
292 301
    raw_write_trailer,
293 302
};
303
#endif //CONFIG_ENCODERS
294 304

  
295 305
AVInputFormat mpegvideo_iformat = {
296 306
    "mpegvideo",
......
303 313
    .value = CODEC_ID_MPEG1VIDEO,
304 314
};
305 315

  
316
#ifdef CONFIG_ENCODERS
306 317
AVOutputFormat mpeg1video_oformat = {
307 318
    "mpeg1video",
308 319
    "MPEG video",
......
315 326
    raw_write_packet,
316 327
    raw_write_trailer,
317 328
};
329
#endif //CONFIG_ENCODERS
318 330

  
319 331
AVInputFormat mjpeg_iformat = {
320 332
    "mjpeg",
......
328 340
    .value = CODEC_ID_MJPEG,
329 341
};
330 342

  
343
#ifdef CONFIG_ENCODERS
331 344
AVOutputFormat mjpeg_oformat = {
332 345
    "mjpeg",
333 346
    "MJPEG video",
......
340 353
    raw_write_packet,
341 354
    raw_write_trailer,
342 355
};
356
#endif //CONFIG_ENCODERS
343 357

  
344 358
/* pcm formats */
359
#if !defined(CONFIG_ENCODERS) && defined(CONFIG_DECODERS)
360

  
361
#define PCMDEF(name, long_name, ext, codec) \
362
AVInputFormat pcm_ ## name ## _iformat = {\
363
    #name,\
364
    long_name,\
365
    0,\
366
    NULL,\
367
    raw_read_header,\
368
    raw_read_packet,\
369
    raw_read_close,\
370
    .extensions = ext,\
371
    .value = codec,\
372
};
373

  
374
#else
345 375

  
346 376
#define PCMDEF(name, long_name, ext, codec) \
347 377
AVInputFormat pcm_ ## name ## _iformat = {\
......
368 398
    raw_write_packet,\
369 399
    raw_write_trailer,\
370 400
};
401
#endif //CONFIG_ENCODERS
371 402

  
372 403
#ifdef WORDS_BIGENDIAN
373 404
#define BE_DEF(s) s
......
444 475
    .value = CODEC_ID_RAWVIDEO,
445 476
};
446 477

  
478
#ifdef CONFIG_ENCODERS
447 479
AVOutputFormat rawvideo_oformat = {
448 480
    "rawvideo",
449 481
    "raw video format",
......
456 488
    raw_write_packet,
457 489
    raw_write_trailer,
458 490
};
491
#endif //CONFIG_ENCODERS
459 492

  
493
#ifdef CONFIG_ENCODERS
460 494
static int null_write_packet(struct AVFormatContext *s, 
461 495
                             int stream_index,
462 496
                             const uint8_t *buf, int size, int64_t pts)
......
481 515
    raw_write_trailer,
482 516
    .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
483 517
};
518
#endif //CONFIG_ENCODERS
519

  
520
#ifndef CONFIG_ENCODERS
521
#define av_register_output_format(format)
522
#endif
523
#ifndef CONFIG_DECODERS
524
#define av_register_input_format(format)
525
#endif
484 526

  
485 527
int raw_init(void)
486 528
{
libavformat/rm.c
42 42
    int old_format;
43 43
} RMContext;
44 44

  
45
#ifdef CONFIG_ENCODERS
45 46
static void put_str(ByteIOContext *s, const char *tag)
46 47
{
47 48
    put_be16(s,strlen(tag));
......
435 436
    put_flush_packet(pb);
436 437
    return 0;
437 438
}
439
#endif //CONFIG_ENCODERS
438 440

  
439 441
/***************************************************/
440 442

  
......
834 836
    rm_read_close,
835 837
};
836 838

  
839
#ifdef CONFIG_ENCODERS
837 840
static AVOutputFormat rm_oformat = {
838 841
    "rm",
839 842
    "rm format",
......
846 849
    rm_write_packet,
847 850
    rm_write_trailer,
848 851
};
852
#endif //CONFIG_ENCODERS
849 853

  
850 854
int rm_init(void)
851 855
{
852 856
    av_register_input_format(&rm_iformat);
857
#ifdef CONFIG_ENCODERS
853 858
    av_register_output_format(&rm_oformat);
859
#endif //CONFIG_ENCODERS
854 860
    return 0;
855 861
}
libavformat/swf.c
49 49
    int tag;
50 50
} SWFContext;
51 51

  
52
#ifdef CONFIG_ENCODERS
52 53
static void put_swf_tag(AVFormatContext *s, int tag)
53 54
{
54 55
    SWFContext *swf = s->priv_data;
......
418 419
    }
419 420
    return 0;
420 421
}
422
#endif //CONFIG_ENCODERS
421 423

  
422 424
/***********************************/
423 425
/* just to extract MP3 from swf */
......
551 553
    swf_read_close,
552 554
};
553 555

  
556
#ifdef CONFIG_ENCODERS
554 557
static AVOutputFormat swf_oformat = {
555 558
    "swf",
556 559
    "Flash format",
......
563 566
    swf_write_packet,
564 567
    swf_write_trailer,
565 568
};
569
#endif //CONFIG_ENCODERS
566 570

  
567 571
int swf_init(void)
568 572
{
569 573
    av_register_input_format(&swf_iformat);
574
#ifdef CONFIG_ENCODERS
570 575
    av_register_output_format(&swf_oformat);
576
#endif //CONFIG_ENCODERS
571 577
    return 0;
572 578
}
libavformat/wav.c
36 36
    { 0, 0 },
37 37
};
38 38

  
39
#ifdef CONFIG_ENCODERS
39 40
/* WAVEFORMATEX header */
40 41
/* returns the size or -1 on error */
41 42
int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
......
106 107

  
107 108
    return hdrsize;
108 109
}
110
#endif //CONFIG_ENCODERS
109 111

  
110 112
/* We could be given one of the three possible structures here:
111 113
 * WAVEFORMAT, PCMWAVEFORMAT or WAVEFORMATEX. Each structure
......
160 162
    return id;
161 163
}
162 164

  
165
#ifdef CONFIG_ENCODERS
163 166
typedef struct {
164 167
    offset_t data;
165 168
} WAVContext;
......
217 220
    }
218 221
    return 0;
219 222
}
223
#endif //CONFIG_ENCODERS
220 224

  
221 225
/* return the size of the found tag */
222 226
/* XXX: > 2GB ? */
......
325 329
    wav_read_close,
326 330
};
327 331

  
332
#ifdef CONFIG_ENCODERS
328 333
static AVOutputFormat wav_oformat = {
329 334
    "wav",
330 335
    "wav format",
......
337 342
    wav_write_packet,
338 343
    wav_write_trailer,
339 344
};
345
#endif //CONFIG_ENCODERS
340 346

  
341 347
int wav_init(void)
342 348
{
343 349
    av_register_input_format(&wav_iformat);
350
#ifdef CONFIG_ENCODERS
344 351
    av_register_output_format(&wav_oformat);
352
#endif //CONFIG_ENCODERS
345 353
    return 0;
346 354
}
libavformat/yuv4mpeg.c
22 22
#define Y4M_FRAME_MAGIC "FRAME"
23 23
#define Y4M_LINE_MAX 256
24 24

  
25
#ifdef CONFIG_ENCODERS
25 26
static int yuv4_write_header(AVFormatContext *s)
26 27
{
27 28
    AVStream *st;
......
172 173
    yuv4_write_trailer,
173 174
    .flags = AVFMT_RAWPICTURE,
174 175
};
176
#endif //CONFIG_ENCODERS
175 177

  
176 178
/* Header size increased to allow room for optional flags */
177 179
#define MAX_YUV4_HEADER 80
......
268 270
int yuv4mpeg_init(void)
269 271
{
270 272
    av_register_input_format(&yuv4mpegpipe_iformat);
273
#ifdef CONFIG_ENCODERS
271 274
    av_register_output_format(&yuv4mpegpipe_oformat);
275
#endif //CONFIG_ENCODERS
272 276
    return 0;
273 277
}
274 278

  

Also available in: Unified diff