Browse Source

Merge commit '1961e46c15c23a041f8d8614a25388a3ee9eff63'

* commit '1961e46c15c23a041f8d8614a25388a3ee9eff63':
  lavfi: remove disabled FF_API_FILTERS_PUBLIC cruft
  lavfi: remove disabled FF_API_DEFAULT_CONFIG_OUTPUT_LINK cruft
  lavfi: use proper FF_API guards for different deprecated functions
  lavfi: remove disabled FF_API_VSRC_BUFFER_ADD_FRAME cruft
  lavfi: remove disabled FF_API_SAMPLERATE64 cruft
  lavfi: remove disabled FF_API_GRAPH_AVCLASS cruft

Conflicts:
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/formats.c
	libavfilter/graphparser.c
	libavfilter/version.h
	libavfilter/video.c
	libavfilter/vsrc_buffer.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 12 years ago
parent
commit
5916bc4658

+ 0 - 1
libavfilter/Makefile

@@ -22,7 +22,6 @@ HEADERS = asrc_abuffer.h                                                \
           buffersink.h                                                  \
           buffersrc.h                                                   \
           version.h                                                     \
-          vsrc_buffer.h                                                 \
 
 OBJS = allfilters.o                                                     \
        audio.o                                                          \

+ 0 - 4
libavfilter/af_resample.c

@@ -119,11 +119,7 @@ static int config_output(AVFilterLink *outlink)
     av_get_channel_layout_string(buf2, sizeof(buf2),
                                  -1, outlink->channel_layout);
     av_log(ctx, AV_LOG_VERBOSE,
-#if FF_API_SAMPLERATE64
-           "fmt:%s srate:%"PRId64" cl:%s -> fmt:%s srate:%"PRId64" cl:%s\n",
-#else
            "fmt:%s srate:%d cl:%s -> fmt:%s srate:%d cl:%s\n",
-#endif /* FF_API_SAMPLERATE64 */
            av_get_sample_fmt_name(inlink ->format), inlink ->sample_rate, buf1,
            av_get_sample_fmt_name(outlink->format), outlink->sample_rate, buf2);
 

+ 0 - 35
libavfilter/avfilter.c

@@ -560,38 +560,3 @@ enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx)
 {
     return pads[pad_idx].type;
 }
-
-#if FF_API_DEFAULT_CONFIG_OUTPUT_LINK
-void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
-                         AVFilterPad **pads, AVFilterLink ***links,
-                         AVFilterPad *newpad)
-{
-    ff_insert_pad(idx, count, padidx_off, pads, links, newpad);
-}
-void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
-                           AVFilterPad *p)
-{
-    ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
-                  &f->input_pads, &f->inputs, p);
-#if FF_API_FOO_COUNT
-    f->input_count = f->nb_inputs;
-#endif
-}
-void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
-                            AVFilterPad *p)
-{
-    ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
-                  &f->output_pads, &f->outputs, p);
-#if FF_API_FOO_COUNT
-    f->output_count = f->nb_outputs;
-#endif
-}
-int avfilter_poll_frame(AVFilterLink *link)
-{
-    return ff_poll_frame(link);
-}
-int avfilter_request_frame(AVFilterLink *link)
-{
-    return ff_request_frame(link);
-}
-#endif

+ 1 - 227
libavfilter/avfilter.h

@@ -208,143 +208,6 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref);
  */
 void avfilter_unref_bufferp(AVFilterBufferRef **ref);
 
-#if FF_API_FILTERS_PUBLIC
-/**
- * A list of supported formats for one end of a filter link. This is used
- * during the format negotiation process to try to pick the best format to
- * use to minimize the number of necessary conversions. Each filter gives a
- * list of the formats supported by each input and output pad. The list
- * given for each pad need not be distinct - they may be references to the
- * same list of formats, as is often the case when a filter supports multiple
- * formats, but will always output the same format as it is given in input.
- *
- * In this way, a list of possible input formats and a list of possible
- * output formats are associated with each link. When a set of formats is
- * negotiated over a link, the input and output lists are merged to form a
- * new list containing only the common elements of each list. In the case
- * that there were no common elements, a format conversion is necessary.
- * Otherwise, the lists are merged, and all other links which reference
- * either of the format lists involved in the merge are also affected.
- *
- * For example, consider the filter chain:
- * filter (a) --> (b) filter (b) --> (c) filter
- *
- * where the letters in parenthesis indicate a list of formats supported on
- * the input or output of the link. Suppose the lists are as follows:
- * (a) = {A, B}
- * (b) = {A, B, C}
- * (c) = {B, C}
- *
- * First, the first link's lists are merged, yielding:
- * filter (a) --> (a) filter (a) --> (c) filter
- *
- * Notice that format list (b) now refers to the same list as filter list (a).
- * Next, the lists for the second link are merged, yielding:
- * filter (a) --> (a) filter (a) --> (a) filter
- *
- * where (a) = {B}.
- *
- * Unfortunately, when the format lists at the two ends of a link are merged,
- * we must ensure that all links which reference either pre-merge format list
- * get updated as well. Therefore, we have the format list structure store a
- * pointer to each of the pointers to itself.
- * @addtogroup lavfi_deprecated
- * @deprecated Those functions are only useful inside filters and
- * user filters are not supported at this point.
- * @{
- */
-struct AVFilterFormats {
-    unsigned format_count;      ///< number of formats
-    int *formats;               ///< list of media formats
-
-    unsigned refcount;          ///< number of references to this list
-    struct AVFilterFormats ***refs; ///< references to this list
-};
-
-/**
- * Create a list of supported formats. This is intended for use in
- * AVFilter->query_formats().
- *
- * @param fmts list of media formats, terminated by -1. If NULL an
- *        empty list is created.
- * @return the format list, with no existing references
- */
-attribute_deprecated
-AVFilterFormats *avfilter_make_format_list(const int *fmts);
-
-/**
- * Add fmt to the list of media formats contained in *avff.
- * If *avff is NULL the function allocates the filter formats struct
- * and puts its pointer in *avff.
- *
- * @return a non negative value in case of success, or a negative
- * value corresponding to an AVERROR code in case of error
- * @deprecated Use ff_all_formats() instead.
- */
-attribute_deprecated
-int avfilter_add_format(AVFilterFormats **avff, int64_t fmt);
-attribute_deprecated
-AVFilterFormats *avfilter_all_formats(enum AVMediaType type);
-
-/**
- * Return a list of all formats supported by FFmpeg for the given media type.
- */
-AVFilterFormats *avfilter_make_all_formats(enum AVMediaType type);
-
-/**
- * A list of all channel layouts supported by libavfilter.
- */
-extern const int64_t avfilter_all_channel_layouts[];
-
-/**
- * Return a format list which contains the intersection of the formats of
- * a and b. Also, all the references of a, all the references of b, and
- * a and b themselves will be deallocated.
- *
- * If a and b do not share any common formats, neither is modified, and NULL
- * is returned.
- */
-attribute_deprecated
-AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b);
-
-/**
- * Add *ref as a new reference to formats.
- * That is the pointers will point like in the ASCII art below:
- *   ________
- *  |formats |<--------.
- *  |  ____  |     ____|___________________
- *  | |refs| |    |  __|_
- *  | |* * | |    | |  | |  AVFilterLink
- *  | |* *--------->|*ref|
- *  | |____| |    | |____|
- *  |________|    |________________________
- */
-attribute_deprecated
-void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
-attribute_deprecated
-void avfilter_formats_unref(AVFilterFormats **ref);
-attribute_deprecated
-void avfilter_formats_changeref(AVFilterFormats **oldref,
-                                AVFilterFormats **newref);
-/**
- * Helpers for query_formats() which set all links to the same list of
- * formats/layouts. If there are no links hooked to this filter, the list
- * of formats is freed.
- */
-attribute_deprecated
-void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
-
-attribute_deprecated
-void avfilter_set_common_pixel_formats(AVFilterContext *ctx, AVFilterFormats *formats);
-attribute_deprecated
-void avfilter_set_common_sample_formats(AVFilterContext *ctx, AVFilterFormats *formats);
-attribute_deprecated
-void avfilter_set_common_channel_layouts(AVFilterContext *ctx, AVFilterFormats *formats);
-
-/**
- * @}
- */
-#endif
 
 #if FF_API_AVFILTERPAD_PUBLIC
 /**
@@ -518,44 +381,6 @@ enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx);
 attribute_deprecated
 void avfilter_default_end_frame(AVFilterLink *link);
 
-#if FF_API_FILTERS_PUBLIC
-/** default handler for start_frame() for video inputs */
-attribute_deprecated
-void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
-
-/** default handler for draw_slice() for video inputs */
-attribute_deprecated
-void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
-
-/** default handler for get_video_buffer() for video inputs */
-attribute_deprecated
-AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link,
-                                                     int perms, int w, int h);
-
-/** Default handler for query_formats() */
-attribute_deprecated
-int avfilter_default_query_formats(AVFilterContext *ctx);
-#endif
-
-#if FF_API_FILTERS_PUBLIC
-/** start_frame() handler for filters which simply pass video along */
-attribute_deprecated
-void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
-
-/** draw_slice() handler for filters which simply pass video along */
-attribute_deprecated
-void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
-
-/** end_frame() handler for filters which simply pass video along */
-attribute_deprecated
-void avfilter_null_end_frame(AVFilterLink *link);
-
-/** get_video_buffer() handler for filters which simply pass video along */
-attribute_deprecated
-AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link,
-                                                  int perms, int w, int h);
-#endif
-
 /**
  * Filter definition. This defines the pads a filter contains, and all the
  * callback functions used to interact with the filter.
@@ -669,11 +494,8 @@ struct AVFilterLink {
     AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio
     /* These parameters apply only to audio */
     uint64_t channel_layout;    ///< channel layout of current buffer (see libavutil/audioconvert.h)
-#if FF_API_SAMPLERATE64
-    int64_t sample_rate;        ///< samples per second
-#else
     int sample_rate;            ///< samples per second
-#endif
+
     int format;                 ///< agreed upon media format
 
     /**
@@ -788,12 +610,6 @@ void avfilter_link_free(AVFilterLink **link);
  */
 int avfilter_config_links(AVFilterContext *filter);
 
-#if FF_API_FILTERS_PUBLIC
-attribute_deprecated
-AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
-                                          int w, int h);
-#endif
-
 /**
  * Create a buffer reference wrapped around an already allocated image
  * buffer.
@@ -827,34 +643,6 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
                                                              enum AVSampleFormat sample_fmt,
                                                              uint64_t channel_layout);
 
-#if FF_API_FILTERS_PUBLIC
-/**
- * Request an input frame from the filter at the other end of the link.
- *
- * @param link the input link
- * @return     zero on success or a negative error code; in particular:
- *             AVERROR_EOF means that the end of frames have been reached;
- *             AVERROR(EAGAIN) means that no frame could be immediately
- *             produced.
- */
-int avfilter_request_frame(AVFilterLink *link);
-
-attribute_deprecated
-int avfilter_poll_frame(AVFilterLink *link);
-
-attribute_deprecated
-void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
-
-/**
- * Notify the next filter that the current frame has finished.
- *
- * @param link the output link the frame was sent over
- */
-attribute_deprecated
-void avfilter_end_frame(AVFilterLink *link);
-attribute_deprecated
-void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
-#endif
 
 #define AVFILTER_CMD_FLAG_ONE   1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically
 #define AVFILTER_CMD_FLAG_FAST  2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw)
@@ -942,18 +730,4 @@ void avfilter_free(AVFilterContext *filter);
 int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
                            unsigned filt_srcpad_idx, unsigned filt_dstpad_idx);
 
-#if FF_API_FILTERS_PUBLIC
-attribute_deprecated
-void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
-                         AVFilterPad **pads, AVFilterLink ***links,
-                         AVFilterPad *newpad);
-
-attribute_deprecated
-void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
-                           AVFilterPad *p);
-attribute_deprecated
-void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
-                            AVFilterPad *p);
-#endif
-
 #endif /* AVFILTER_AVFILTER_H */

+ 0 - 2
libavfilter/avfiltergraph.c

@@ -47,9 +47,7 @@ AVFilterGraph *avfilter_graph_alloc(void)
     AVFilterGraph *ret = av_mallocz(sizeof(AVFilterGraph));
     if (!ret)
         return NULL;
-#if FF_API_GRAPH_AVCLASS
     ret->av_class = &filtergraph_class;
-#endif
     return ret;
 }
 

+ 0 - 2
libavfilter/avfiltergraph.h

@@ -26,9 +26,7 @@
 #include "libavutil/log.h"
 
 typedef struct AVFilterGraph {
-#if FF_API_GRAPH_AVCLASS
     const AVClass *av_class;
-#endif
     unsigned filter_count;
     AVFilterContext **filters;
 

+ 0 - 1
libavfilter/buffersrc.c

@@ -29,7 +29,6 @@
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
-#include "vsrc_buffer.h"
 #include "avcodec.h"
 
 #include "libavutil/audioconvert.h"

+ 1 - 39
libavfilter/formats.c

@@ -525,45 +525,6 @@ int ff_parse_channel_layout(int64_t *ret, const char *arg, void *log_ctx)
     return 0;
 }
 
-#if FF_API_FILTERS_PUBLIC
-int avfilter_default_query_formats(AVFilterContext *ctx)
-{
-    return ff_default_query_formats(ctx);
-}
-void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
-{
-    ff_set_common_formats(ctx, formats);
-}
-AVFilterFormats *avfilter_make_format_list(const int *fmts)
-{
-    return ff_make_format_list(fmts);
-}
-int avfilter_add_format(AVFilterFormats **avff, int64_t fmt)
-{
-    return ff_add_format(avff, fmt);
-}
-AVFilterFormats *avfilter_all_formats(enum AVMediaType type)
-{
-    return ff_all_formats(type);
-}
-AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
-{
-    return ff_merge_formats(a, b);
-}
-void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
-{
-    ff_formats_ref(f, ref);
-}
-void avfilter_formats_unref(AVFilterFormats **ref)
-{
-    ff_formats_unref(ref);
-}
-void avfilter_formats_changeref(AVFilterFormats **oldref,
-                                AVFilterFormats **newref)
-{
-    ff_formats_changeref(oldref, newref);
-}
-#endif
 #ifdef TEST
 
 #undef printf
@@ -582,3 +543,4 @@ int main(void)
 }
 
 #endif
+

+ 0 - 2
libavfilter/formats.h

@@ -61,7 +61,6 @@
  * get updated as well. Therefore, we have the format list structure store a
  * pointer to each of the pointers to itself.
  */
-#if !FF_API_FILTERS_PUBLIC
 struct AVFilterFormats {
     unsigned format_count;      ///< number of formats
     int *formats;               ///< list of media formats
@@ -69,7 +68,6 @@ struct AVFilterFormats {
     unsigned refcount;          ///< number of references to this list
     struct AVFilterFormats ***refs; ///< references to this list
 };
-#endif
 
 typedef struct AVFilterChannelLayouts {
     uint64_t *channel_layouts;  ///< list of channel layouts

+ 7 - 14
libavfilter/graphparser.c

@@ -350,12 +350,6 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
     return pad;
 }
 
-#if FF_API_GRAPH_AVCLASS
-#define log_ctx graph
-#else
-#define log_ctx NULL
-#endif
-
 static int parse_sws_flags(const char **buf, AVFilterGraph *graph)
 {
     char *p = strchr(*buf, ';');
@@ -364,7 +358,7 @@ static int parse_sws_flags(const char **buf, AVFilterGraph *graph)
         return 0;
 
     if (!p) {
-        av_log(log_ctx, AV_LOG_ERROR, "sws_flags not terminated with ';'.\n");
+        av_log(graph, AV_LOG_ERROR, "sws_flags not terminated with ';'.\n");
         return AVERROR(EINVAL);
     }
 
@@ -397,17 +391,17 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
         AVFilterContext *filter;
         filters += strspn(filters, WHITESPACES);
 
-        if ((ret = parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx)) < 0)
+        if ((ret = parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
             goto end;
-
-        if ((ret = parse_filter(&filter, &filters, graph, index, log_ctx)) < 0)
+        if ((ret = parse_filter(&filter, &filters, graph, index, graph)) < 0)
             goto end;
 
-        if ((ret = link_filter_inouts(filter, &curr_inputs, &open_inputs, log_ctx)) < 0)
+
+        if ((ret = link_filter_inouts(filter, &curr_inputs, &open_inputs, graph)) < 0)
             goto end;
 
         if ((ret = parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
-                                 log_ctx)) < 0)
+                                 graph)) < 0)
             goto end;
 
         filters += strspn(filters, WHITESPACES);
@@ -419,7 +413,7 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
     } while (chr == ',' || chr == ';');
 
     if (chr) {
-        av_log(log_ctx, AV_LOG_ERROR,
+        av_log(graph, AV_LOG_ERROR,
                "Unable to parse graph description substring: \"%s\"\n",
                filters - 1);
         ret = AVERROR(EINVAL);
@@ -446,7 +440,6 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
 
     return ret;
 }
-#undef log_ctx
 
 int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
                          AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr,

Some files were not shown because too many files changed in this diff