[FFmpeg-cvslog] r11204 - in trunk: ffmpeg.c libavcodec/avcodec.h libavcodec/bitstream_filter.c libavcodec/parser.c libavcodec/utils.c

michael subversion
Wed Dec 12 19:40:11 CET 2007


Author: michael
Date: Wed Dec 12 19:40:11 2007
New Revision: 11204

Log:
av_*_next() API for libavcodec


Modified:
   trunk/ffmpeg.c
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/bitstream_filter.c
   trunk/libavcodec/parser.c
   trunk/libavcodec/utils.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	(original)
+++ trunk/ffmpeg.c	Wed Dec 12 19:40:11 2007
@@ -3321,8 +3321,8 @@ static void opt_show_formats(void)
     AVInputFormat *ifmt;
     AVOutputFormat *ofmt;
     URLProtocol *up;
-    AVCodec *p, *p2;
-    AVBitStreamFilter *bsf;
+    AVCodec *p=NULL, *p2;
+    AVBitStreamFilter *bsf=NULL;
     const char *last_name;
 
     printf("File formats:\n");
@@ -3373,7 +3373,7 @@ static void opt_show_formats(void)
         const char *type_str;
 
         p2=NULL;
-        for(p = first_avcodec; p != NULL; p = p->next) {
+        while(p= av_codec_next(p)) {
             if((p2==NULL || strcmp(p->name, p2->name)<0) &&
                 strcmp(p->name, last_name)>0){
                 p2= p;
@@ -3419,7 +3419,7 @@ static void opt_show_formats(void)
     printf("\n");
 
     printf("Bitstream filters:\n");
-    for(bsf = first_bitstream_filter; bsf != NULL; bsf = bsf->next)
+    while(bsf = av_bitstream_filter_next(bsf))
         printf(" %s", bsf->name);
     printf("\n");
 

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	(original)
+++ trunk/libavcodec/avcodec.h	Wed Dec 12 19:40:11 2007
@@ -33,8 +33,8 @@
 #define AV_STRINGIFY(s)         AV_TOSTRING(s)
 #define AV_TOSTRING(s) #s
 
-#define LIBAVCODEC_VERSION_INT  ((51<<16)+(48<<8)+0)
-#define LIBAVCODEC_VERSION      51.48.0
+#define LIBAVCODEC_VERSION_INT  ((51<<16)+(49<<8)+0)
+#define LIBAVCODEC_VERSION      51.49.0
 #define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
 
 #define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
@@ -2428,7 +2428,10 @@ int avpicture_deinterlace(AVPicture *dst
 
 /* external high level API */
 
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
 extern AVCodec *first_avcodec;
+#endif
+AVCodec *av_codec_next(AVCodec *c);
 
 /* returns LIBAVCODEC_VERSION_INT constant */
 unsigned avcodec_version(void);
@@ -2784,7 +2787,10 @@ typedef struct AVCodecParser {
     struct AVCodecParser *next;
 } AVCodecParser;
 
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
 extern AVCodecParser *av_first_parser;
+#endif
+AVCodecParser *av_parser_next(AVCodecParser *c);
 
 void av_register_codec_parser(AVCodecParser *parser);
 AVCodecParserContext *av_parser_init(int codec_id);
@@ -2827,7 +2833,7 @@ int av_bitstream_filter_filter(AVBitStre
                                const uint8_t *buf, int buf_size, int keyframe);
 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
 
-extern AVBitStreamFilter *first_bitstream_filter;
+AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
 
 /* memory */
 

Modified: trunk/libavcodec/bitstream_filter.c
==============================================================================
--- trunk/libavcodec/bitstream_filter.c	(original)
+++ trunk/libavcodec/bitstream_filter.c	Wed Dec 12 19:40:11 2007
@@ -22,6 +22,11 @@
 
 AVBitStreamFilter *first_bitstream_filter= NULL;
 
+AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f){
+    if(f) return f->next;
+    else  return first_bitstream_filter;
+}
+
 void av_register_bitstream_filter(AVBitStreamFilter *bsf){
     bsf->next = first_bitstream_filter;
     first_bitstream_filter= bsf;

Modified: trunk/libavcodec/parser.c
==============================================================================
--- trunk/libavcodec/parser.c	(original)
+++ trunk/libavcodec/parser.c	Wed Dec 12 19:40:11 2007
@@ -24,6 +24,11 @@
 
 AVCodecParser *av_first_parser = NULL;
 
+AVCodecParser* av_parser_next(AVCodecParser *p){
+    if(p) return p->next;
+    else  return av_first_parser;
+}
+
 void av_register_codec_parser(AVCodecParser *parser)
 {
     parser->next = av_first_parser;

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	(original)
+++ trunk/libavcodec/utils.c	Wed Dec 12 19:40:11 2007
@@ -126,6 +126,11 @@ static void do_free(void)
 /* encoder management */
 AVCodec *first_avcodec = NULL;
 
+AVCodec *av_codec_next(AVCodec *c){
+    if(c) return c->next;
+    else  return first_avcodec;
+}
+
 void register_avcodec(AVCodec *format)
 {
     AVCodec **p;




More information about the ffmpeg-cvslog mailing list