[FFmpeg-soc] [soc]: r5416 - in libavfilter: diffs/01_ffplay_filters.diff diffs/02_ffmpeg_filters.diff vf_drawbox.c vf_hflip.c vf_negate.c vf_rotate.c vf_transpose.c vsrc_buffer.c vsrc_movie.c

stefano subversion at mplayerhq.hu
Mon Oct 19 01:23:24 CEST 2009


Author: stefano
Date: Mon Oct 19 01:23:24 2009
New Revision: 5416

Log:
Prefer avfilter_make_format_list2() over avfilter_make_format_list(),
the latter interface is going to be removed.

Modified:
   libavfilter/diffs/01_ffplay_filters.diff
   libavfilter/diffs/02_ffmpeg_filters.diff
   libavfilter/vf_drawbox.c
   libavfilter/vf_hflip.c
   libavfilter/vf_negate.c
   libavfilter/vf_rotate.c
   libavfilter/vf_transpose.c
   libavfilter/vsrc_buffer.c
   libavfilter/vsrc_movie.c

Modified: libavfilter/diffs/01_ffplay_filters.diff
==============================================================================
--- libavfilter/diffs/01_ffplay_filters.diff	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/diffs/01_ffplay_filters.diff	Mon Oct 19 01:23:24 2009	(r5416)
@@ -208,7 +208,7 @@ Index: ffplay.c
          /* update the bitmap content */
          SDL_UnlockYUVOverlay(vp->bmp);
  
-@@ -1313,54 +1384,269 @@
+@@ -1313,54 +1384,273 @@
      return queue_picture(is, src_frame, pts);
  }
  
@@ -306,8 +306,11 @@ Index: ffplay.c
 +static int input_query_formats(AVFilterContext *ctx)
 +{
 +    FilterPriv *priv = ctx->priv;
-+    avfilter_set_common_formats(ctx,
-+            avfilter_make_format_list(1, priv->is->video_st->codec->pix_fmt));
++    enum PixelFormat pix_fmts[] = {
++        priv->is->video_st->codec->pix_fmt, PIX_FMT_NONE
++    };
++
++    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
 +    return 0;
 +}
 +
@@ -347,8 +350,9 @@ Index: ffplay.c
 +
 +static int output_query_formats(AVFilterContext *ctx)
 +{
-+    avfilter_set_common_formats(ctx,
-+        avfilter_make_format_list(1, PIX_FMT_YUV420P));
++    enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
++
++    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
 +    return 0;
 +}
 +
@@ -509,7 +513,7 @@ Index: ffplay.c
      av_free(frame);
      return 0;
  }
-@@ -2136,6 +2422,12 @@
+@@ -2136,6 +2426,12 @@
      /* free all pictures */
      for(i=0;i<VIDEO_PICTURE_QUEUE_SIZE; i++) {
          vp = &is->pictq[i];
@@ -522,7 +526,7 @@ Index: ffplay.c
          if (vp->bmp) {
              SDL_FreeYUVOverlay(vp->bmp);
              vp->bmp = NULL;
-@@ -2145,8 +2437,10 @@
+@@ -2145,8 +2441,10 @@
      SDL_DestroyCond(is->pictq_cond);
      SDL_DestroyMutex(is->subpq_mutex);
      SDL_DestroyCond(is->subpq_cond);
@@ -533,7 +537,7 @@ Index: ffplay.c
      av_free(is);
  }
  
-@@ -2238,6 +2532,9 @@
+@@ -2238,6 +2536,9 @@
          av_free(avcodec_opts[i]);
      av_free(avformat_opts);
      av_free(sws_opts);
@@ -543,7 +547,7 @@ Index: ffplay.c
      if (show_status)
          printf("\n");
      SDL_Quit();
-@@ -2486,6 +2783,9 @@
+@@ -2486,6 +2787,9 @@
      { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_concealment}, "set error concealment options",  "bit_mask" },
      { "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
      { "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
@@ -553,7 +557,7 @@ Index: ffplay.c
      { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
      { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
      { NULL, },
-@@ -2535,7 +2835,9 @@
+@@ -2535,7 +2839,9 @@
          avcodec_opts[i]= avcodec_alloc_context2(i);
      }
      avformat_opts = avformat_alloc_context();

Modified: libavfilter/diffs/02_ffmpeg_filters.diff
==============================================================================
--- libavfilter/diffs/02_ffmpeg_filters.diff	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/diffs/02_ffmpeg_filters.diff	Mon Oct 19 01:23:24 2009	(r5416)
@@ -41,7 +41,7 @@ Index: ffmpeg.c
  } AVInputStream;
  
  typedef struct AVInputFile {
-@@ -314,6 +332,185 @@
+@@ -314,6 +332,186 @@
  static struct termios oldtty;
  #endif
  
@@ -69,8 +69,9 @@ Index: ffmpeg.c
 +static int output_query_formats(AVFilterContext *ctx)
 +{
 +    FilterOutPriv *priv = ctx->priv;
-+    avfilter_set_common_formats(ctx,
-+           avfilter_make_format_list(1, priv->pix_fmt));
++    enum PixelFormat pix_fmts[] = { priv->pix_fmt, PIX_FMT_NONE };
++
++    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
 +    return 0;
 +}
 +
@@ -227,7 +228,7 @@ Index: ffmpeg.c
  static void term_exit(void)
  {
  #if HAVE_TERMIOS_H
-@@ -454,6 +651,10 @@
+@@ -454,6 +652,10 @@
      av_free(audio_out2);
      av_free(samples);
  
@@ -238,7 +239,7 @@ Index: ffmpeg.c
      if (received_sigterm) {
          fprintf(stderr,
              "Received signal %d: terminating.\n",
-@@ -868,7 +1069,9 @@
+@@ -868,7 +1070,9 @@
                           int *frame_size)
  {
      int nb_frames, i, ret;
@@ -248,7 +249,7 @@ Index: ffmpeg.c
      AVFrame *final_picture, *formatted_picture, *resampling_dst, *padding_src;
      AVFrame picture_crop_temp, picture_pad_temp;
      AVCodecContext *enc, *dec;
-@@ -914,6 +1117,9 @@
+@@ -914,6 +1118,9 @@
      if (nb_frames <= 0)
          return;
  
@@ -258,7 +259,7 @@ Index: ffmpeg.c
      if (ost->video_crop) {
          if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture *)in_picture, dec->pix_fmt, ost->topBand, ost->leftBand) < 0) {
              fprintf(stderr, "error cropping picture\n");
-@@ -925,6 +1131,7 @@
+@@ -925,6 +1132,7 @@
      } else {
          formatted_picture = in_picture;
      }
@@ -266,7 +267,7 @@ Index: ffmpeg.c
  
      final_picture = formatted_picture;
      padding_src = formatted_picture;
-@@ -942,6 +1149,7 @@
+@@ -942,6 +1150,7 @@
          }
      }
  
@@ -274,7 +275,7 @@ Index: ffmpeg.c
      if (ost->video_resample) {
          padding_src = NULL;
          final_picture = &ost->pict_tmp;
-@@ -990,6 +1198,7 @@
+@@ -990,6 +1199,7 @@
          sws_scale(ost->img_resample_ctx, formatted_picture->data, formatted_picture->linesize,
                0, ost->resample_height, resampling_dst->data, resampling_dst->linesize);
      }
@@ -282,7 +283,7 @@ Index: ffmpeg.c
  
      if (ost->video_pad) {
          av_picture_pad((AVPicture*)final_picture, (AVPicture *)padding_src,
-@@ -1256,6 +1465,10 @@
+@@ -1256,6 +1466,10 @@
      static unsigned int samples_size= 0;
      AVSubtitle subtitle, *subtitle_to_free;
      int got_subtitle;
@@ -293,7 +294,7 @@ Index: ffmpeg.c
      AVPacket avpkt;
      int bps = av_get_bits_per_sample_format(ist->st->codec->sample_fmt)>>3;
  
-@@ -1378,6 +1591,15 @@
+@@ -1378,6 +1592,15 @@
                                      &buffer_to_free);
          }
  
@@ -309,7 +310,7 @@ Index: ffmpeg.c
          // preprocess audio (volume)
          if (ist->st->codec->codec_type == CODEC_TYPE_AUDIO) {
              if (audio_volume != 256) {
-@@ -1399,10 +1621,18 @@
+@@ -1399,10 +1622,18 @@
              if (pts > now)
                  usleep(pts - now);
          }
@@ -329,7 +330,7 @@ Index: ffmpeg.c
              for(i=0;i<nb_ostreams;i++) {
                  int frame_size;
  
-@@ -1419,6 +1649,9 @@
+@@ -1419,6 +1650,9 @@
                              do_audio_out(os, ost, ist, data_buf, data_size);
                              break;
                          case CODEC_TYPE_VIDEO:
@@ -339,7 +340,7 @@ Index: ffmpeg.c
                              do_video_out(os, ost, ist, &picture, &frame_size);
                              if (vstats_filename && frame_size)
                                  do_video_stats(os, ost, frame_size);
-@@ -1484,7 +1717,17 @@
+@@ -1484,7 +1718,17 @@
                          av_free_packet(&opkt);
                      }
                  }
@@ -357,7 +358,7 @@ Index: ffmpeg.c
          av_free(buffer_to_free);
          /* XXX: allocate the subtitles in the codec ? */
          if (subtitle_to_free) {
-@@ -1938,16 +2181,27 @@
+@@ -1938,16 +2182,27 @@
                          av_exit(1);
                      }
  
@@ -385,7 +386,7 @@ Index: ffmpeg.c
                  break;
              case CODEC_TYPE_SUBTITLE:
                  ost->encoding_needed = 1;
-@@ -2334,6 +2588,12 @@
+@@ -2334,6 +2589,12 @@
              avcodec_close(ist->st->codec);
          }
      }
@@ -398,7 +399,7 @@ Index: ffmpeg.c
  
      /* finished ! */
      ret = 0;
-@@ -3897,6 +4157,9 @@
+@@ -3897,6 +4158,9 @@
      { "psnr", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_psnr}, "calculate PSNR of compressed frames" },
      { "vstats", OPT_EXPERT | OPT_VIDEO, {(void*)&opt_vstats}, "dump video coding statistics to file" },
      { "vstats_file", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_vstats_file}, "dump video coding statistics to file", "file" },

Modified: libavfilter/vf_drawbox.c
==============================================================================
--- libavfilter/vf_drawbox.c	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/vf_drawbox.c	Mon Oct 19 01:23:24 2009	(r5416)
@@ -70,13 +70,15 @@ static av_cold int init(AVFilterContext 
 
 static int query_formats(AVFilterContext *ctx)
 {
-    avfilter_set_common_formats(ctx,
-                                avfilter_make_format_list(10,
-                PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
-                PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
-                PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
-                PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P)
-        );
+    enum PixelFormat pix_fmts[] = {
+        PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
+        PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
+        PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
+        PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P,
+        PIX_FMT_NONE
+    };
+
+    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
     return 0;
 }
 

Modified: libavfilter/vf_hflip.c
==============================================================================
--- libavfilter/vf_hflip.c	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/vf_hflip.c	Mon Oct 19 01:23:24 2009	(r5416)
@@ -29,12 +29,15 @@ typedef struct
 
 static int query_formats(AVFilterContext *ctx)
 {
-    avfilter_set_common_formats(ctx,
-        avfilter_make_format_list(10,
-                PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
-                PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
-                PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
-                PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P));
+    enum PixelFormat pix_fmts[] = {
+        PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
+        PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
+        PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
+        PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P,
+        PIX_FMT_NONE
+    };
+
+    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
     return 0;
 }
 

Modified: libavfilter/vf_negate.c
==============================================================================
--- libavfilter/vf_negate.c	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/vf_negate.c	Mon Oct 19 01:23:24 2009	(r5416)
@@ -29,14 +29,16 @@ typedef struct
 
 static int query_formats(AVFilterContext *ctx)
 {
-    avfilter_set_common_formats(ctx,
-        avfilter_make_format_list(12,
-                PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
-                PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
-                PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
-                PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P,
-                PIX_FMT_MONOWHITE, PIX_FMT_MONOBLACK));
+    enum PixelFormat pix_fmts[] = {
+        PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
+        PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
+        PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
+        PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P,
+        PIX_FMT_MONOWHITE, PIX_FMT_MONOBLACK,
+        PIX_FMT_NONE
+    };
 
+    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
     return 0;
 }
 

Modified: libavfilter/vf_rotate.c
==============================================================================
--- libavfilter/vf_rotate.c	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/vf_rotate.c	Mon Oct 19 01:23:24 2009	(r5416)
@@ -56,12 +56,15 @@ static av_cold int init(AVFilterContext 
 
 static int query_formats(AVFilterContext *ctx)
 {
-    avfilter_set_common_formats(ctx,
-        avfilter_make_format_list(10,
-                PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
-                PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
-                PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
-                PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P));
+    enum PixelFormat pix_fmts[] = {
+        PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
+        PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
+        PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
+        PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P,
+        PIX_FMT_NONE
+    };
+
+    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
     return 0;
 }
 

Modified: libavfilter/vf_transpose.c
==============================================================================
--- libavfilter/vf_transpose.c	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/vf_transpose.c	Mon Oct 19 01:23:24 2009	(r5416)
@@ -44,12 +44,15 @@ static int config_props_input(AVFilterLi
 
 static int query_formats(AVFilterContext *ctx)
 {
-    avfilter_set_common_formats(ctx,
-        avfilter_make_format_list(10,
-                PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
-                PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
-                PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
-                PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P));
+    enum PixelFormat pix_fmts[] = {
+        PIX_FMT_YUV444P,  PIX_FMT_YUV422P,  PIX_FMT_YUV420P,
+        PIX_FMT_YUV411P,  PIX_FMT_YUV410P,
+        PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,
+        PIX_FMT_YUV440P,  PIX_FMT_YUVJ440P,
+        PIX_FMT_NONE
+    };
+
+    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
     return 0;
 }
 

Modified: libavfilter/vsrc_buffer.c
==============================================================================
--- libavfilter/vsrc_buffer.c	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/vsrc_buffer.c	Mon Oct 19 01:23:24 2009	(r5416)
@@ -66,8 +66,9 @@ static av_cold int init(AVFilterContext 
 static int query_formats(AVFilterContext *ctx)
 {
     BufferSourceContext *c = ctx->priv;
+    enum PixelFormat pix_fmts[] = { c->pix_fmt, PIX_FMT_NONE };
 
-    avfilter_set_common_formats(ctx, avfilter_make_format_list(1, c->pix_fmt));
+    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
     return 0;
 }
 

Modified: libavfilter/vsrc_movie.c
==============================================================================
--- libavfilter/vsrc_movie.c	Mon Oct 19 01:12:39 2009	(r5415)
+++ libavfilter/vsrc_movie.c	Mon Oct 19 01:23:24 2009	(r5416)
@@ -149,9 +149,9 @@ static av_cold int init(AVFilterContext 
 static int query_formats(AVFilterContext *ctx)
 {
     MovieContext *mv = ctx->priv;
+    enum PixelFormat pix_fmts[] = { mv->codec_ctx->pix_fmt, PIX_FMT_NONE };
 
-    avfilter_set_common_formats(ctx,
-        avfilter_make_format_list(1, mv->codec_ctx->pix_fmt));
+    avfilter_set_common_formats(ctx, avfilter_make_format_list2(pix_fmts));
     return 0;
 }
 


More information about the FFmpeg-soc mailing list