Merge commit '072916d903d3a925bcd0c864f12254157cab63c1'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Aug 2014 17:35:08 +0000 (19:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Aug 2014 17:35:08 +0000 (19:35 +0200)
* commit '072916d903d3a925bcd0c864f12254157cab63c1':
  filtfmts: Replace deprecated uses of AVFilterPad

Conflicts:
libavfilter/filtfmts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavfilter/filtfmts.c

  
  #include <stdio.h>
  
 +#include "libavutil/channel_layout.h"
+ #include "libavutil/mem.h"
  #include "libavutil/pixdesc.h"
 +#include "libavutil/samplefmt.h"
  #include "libavfilter/avfilter.h"
  #include "libavfilter/formats.h"
  
-                        i, filter_ctx->inout##put_pads[i].name,      \
 +static void print_formats(AVFilterContext *filter_ctx)
 +{
 +    int i, j;
 +
 +#define PRINT_FMTS(inout, outin, INOUT)                                 \
 +    for (i = 0; i < filter_ctx->nb_##inout##puts; i++) {                     \
 +        if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) {   \
 +            AVFilterFormats *fmts =                                     \
 +                filter_ctx->inout##puts[i]->outin##_formats;            \
 +            for (j = 0; j < fmts->nb_formats; j++)                    \
 +                if(av_get_pix_fmt_name(fmts->formats[j]))               \
 +                printf(#INOUT "PUT[%d] %s: fmt:%s\n",                   \
-                        i, filter_ctx->inout##put_pads[i].name,      \
++                       i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i),      \
 +                       av_get_pix_fmt_name(fmts->formats[j]));          \
 +        } else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
 +            AVFilterFormats *fmts;                                      \
 +            AVFilterChannelLayouts *layouts;                            \
 +                                                                        \
 +            fmts = filter_ctx->inout##puts[i]->outin##_formats;         \
 +            for (j = 0; j < fmts->nb_formats; j++)                    \
 +                printf(#INOUT "PUT[%d] %s: fmt:%s\n",                   \
-                        i, filter_ctx->inout##put_pads[i].name, buf); \
++                       i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i),      \
 +                       av_get_sample_fmt_name(fmts->formats[j]));       \
 +                                                                        \
 +            layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
 +            for (j = 0; j < layouts->nb_channel_layouts; j++) {                  \
 +                char buf[256];                                          \
 +                av_get_channel_layout_string(buf, sizeof(buf), -1,      \
 +                                             layouts->channel_layouts[j]);         \
 +                printf(#INOUT "PUT[%d] %s: chlayout:%s\n",              \
++                       i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i), buf); \
 +            }                                                           \
 +        }                                                               \
 +    }                                                                   \
 +
 +    PRINT_FMTS(in,  out, IN);
 +    PRINT_FMTS(out, in,  OUT);
 +}
 +
  int main(int argc, char **argv)
  {
      AVFilter *filter;
      /* create a link for each of the input pads */
      for (i = 0; i < filter_ctx->nb_inputs; i++) {
          AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
-         link->type = filter_ctx->input_pads[i].type;
 -        link->type = avfilter_pad_get_type(filter_ctx->filter->inputs, i);
++        link->type = avfilter_pad_get_type(filter_ctx->input_pads, i);
          filter_ctx->inputs[i] = link;
      }
      for (i = 0; i < filter_ctx->nb_outputs; i++) {
          AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
-         link->type = filter_ctx->output_pads[i].type;
 -        link->type = avfilter_pad_get_type(filter_ctx->filter->outputs, i);
++        link->type = avfilter_pad_get_type(filter_ctx->output_pads, i);
          filter_ctx->outputs[i] = link;
      }