Originally committed as revision 11204 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -3321,8 +3321,8 @@ static void opt_show_formats(void) |
| 3321 | 3321 |
AVInputFormat *ifmt; |
| 3322 | 3322 |
AVOutputFormat *ofmt; |
| 3323 | 3323 |
URLProtocol *up; |
| 3324 |
- AVCodec *p, *p2; |
|
| 3325 |
- AVBitStreamFilter *bsf; |
|
| 3324 |
+ AVCodec *p=NULL, *p2; |
|
| 3325 |
+ AVBitStreamFilter *bsf=NULL; |
|
| 3326 | 3326 |
const char *last_name; |
| 3327 | 3327 |
|
| 3328 | 3328 |
printf("File formats:\n");
|
| ... | ... |
@@ -3373,7 +3373,7 @@ static void opt_show_formats(void) |
| 3373 | 3373 |
const char *type_str; |
| 3374 | 3374 |
|
| 3375 | 3375 |
p2=NULL; |
| 3376 |
- for(p = first_avcodec; p != NULL; p = p->next) {
|
|
| 3376 |
+ while(p= av_codec_next(p)) {
|
|
| 3377 | 3377 |
if((p2==NULL || strcmp(p->name, p2->name)<0) && |
| 3378 | 3378 |
strcmp(p->name, last_name)>0){
|
| 3379 | 3379 |
p2= p; |
| ... | ... |
@@ -3419,7 +3419,7 @@ static void opt_show_formats(void) |
| 3419 | 3419 |
printf("\n");
|
| 3420 | 3420 |
|
| 3421 | 3421 |
printf("Bitstream filters:\n");
|
| 3422 |
- for(bsf = first_bitstream_filter; bsf != NULL; bsf = bsf->next) |
|
| 3422 |
+ while(bsf = av_bitstream_filter_next(bsf)) |
|
| 3423 | 3423 |
printf(" %s", bsf->name);
|
| 3424 | 3424 |
printf("\n");
|
| 3425 | 3425 |
|
| ... | ... |
@@ -33,8 +33,8 @@ |
| 33 | 33 |
#define AV_STRINGIFY(s) AV_TOSTRING(s) |
| 34 | 34 |
#define AV_TOSTRING(s) #s |
| 35 | 35 |
|
| 36 |
-#define LIBAVCODEC_VERSION_INT ((51<<16)+(48<<8)+0) |
|
| 37 |
-#define LIBAVCODEC_VERSION 51.48.0 |
|
| 36 |
+#define LIBAVCODEC_VERSION_INT ((51<<16)+(49<<8)+0) |
|
| 37 |
+#define LIBAVCODEC_VERSION 51.49.0 |
|
| 38 | 38 |
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT |
| 39 | 39 |
|
| 40 | 40 |
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) |
| ... | ... |
@@ -2428,7 +2428,10 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, |
| 2428 | 2428 |
|
| 2429 | 2429 |
/* external high level API */ |
| 2430 | 2430 |
|
| 2431 |
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) |
|
| 2431 | 2432 |
extern AVCodec *first_avcodec; |
| 2433 |
+#endif |
|
| 2434 |
+AVCodec *av_codec_next(AVCodec *c); |
|
| 2432 | 2435 |
|
| 2433 | 2436 |
/* returns LIBAVCODEC_VERSION_INT constant */ |
| 2434 | 2437 |
unsigned avcodec_version(void); |
| ... | ... |
@@ -2784,7 +2787,10 @@ typedef struct AVCodecParser {
|
| 2784 | 2784 |
struct AVCodecParser *next; |
| 2785 | 2785 |
} AVCodecParser; |
| 2786 | 2786 |
|
| 2787 |
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) |
|
| 2787 | 2788 |
extern AVCodecParser *av_first_parser; |
| 2789 |
+#endif |
|
| 2790 |
+AVCodecParser *av_parser_next(AVCodecParser *c); |
|
| 2788 | 2791 |
|
| 2789 | 2792 |
void av_register_codec_parser(AVCodecParser *parser); |
| 2790 | 2793 |
AVCodecParserContext *av_parser_init(int codec_id); |
| ... | ... |
@@ -2827,7 +2833,7 @@ int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, |
| 2827 | 2827 |
const uint8_t *buf, int buf_size, int keyframe); |
| 2828 | 2828 |
void av_bitstream_filter_close(AVBitStreamFilterContext *bsf); |
| 2829 | 2829 |
|
| 2830 |
-extern AVBitStreamFilter *first_bitstream_filter; |
|
| 2830 |
+AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f); |
|
| 2831 | 2831 |
|
| 2832 | 2832 |
/* memory */ |
| 2833 | 2833 |
|
| ... | ... |
@@ -22,6 +22,11 @@ |
| 22 | 22 |
|
| 23 | 23 |
AVBitStreamFilter *first_bitstream_filter= NULL; |
| 24 | 24 |
|
| 25 |
+AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f){
|
|
| 26 |
+ if(f) return f->next; |
|
| 27 |
+ else return first_bitstream_filter; |
|
| 28 |
+} |
|
| 29 |
+ |
|
| 25 | 30 |
void av_register_bitstream_filter(AVBitStreamFilter *bsf){
|
| 26 | 31 |
bsf->next = first_bitstream_filter; |
| 27 | 32 |
first_bitstream_filter= bsf; |
| ... | ... |
@@ -24,6 +24,11 @@ |
| 24 | 24 |
|
| 25 | 25 |
AVCodecParser *av_first_parser = NULL; |
| 26 | 26 |
|
| 27 |
+AVCodecParser* av_parser_next(AVCodecParser *p){
|
|
| 28 |
+ if(p) return p->next; |
|
| 29 |
+ else return av_first_parser; |
|
| 30 |
+} |
|
| 31 |
+ |
|
| 27 | 32 |
void av_register_codec_parser(AVCodecParser *parser) |
| 28 | 33 |
{
|
| 29 | 34 |
parser->next = av_first_parser; |
| ... | ... |
@@ -126,6 +126,11 @@ static void do_free(void) |
| 126 | 126 |
/* encoder management */ |
| 127 | 127 |
AVCodec *first_avcodec = NULL; |
| 128 | 128 |
|
| 129 |
+AVCodec *av_codec_next(AVCodec *c){
|
|
| 130 |
+ if(c) return c->next; |
|
| 131 |
+ else return first_avcodec; |
|
| 132 |
+} |
|
| 133 |
+ |
|
| 129 | 134 |
void register_avcodec(AVCodec *format) |
| 130 | 135 |
{
|
| 131 | 136 |
AVCodec **p; |