]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '6d86cef06ba36c0ed591e14a2382e9630059fc5d'
authorMark Thompson <sw@jkqxz.net>
Mon, 12 Feb 2018 22:28:12 +0000 (22:28 +0000)
committerMark Thompson <sw@jkqxz.net>
Mon, 12 Feb 2018 22:28:12 +0000 (22:28 +0000)
* commit '6d86cef06ba36c0ed591e14a2382e9630059fc5d':
  lavfi: Add support for increasing hardware frame pool sizes

Merged-by: Mark Thompson <sw@jkqxz.net>
1  2 
doc/APIchanges
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/internal.h
libavfilter/version.h

diff --cc doc/APIchanges
index e5c392ead5166f45ac85e4a1ea72b9dfe8e086b1,d385d73b0c12d3dec4ff15b914fad4fd820300f7..8565cbeb094e153785e55dbe45d55599f9548cae
@@@ -15,92 -13,16 +15,95 @@@ libavutil:     2017-10-2
  
  API changes, most recent first:
  
 -2018-02-xx - xxxxxxx - lavfi 7.1.0 - avfilter.h
++2018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h
+   Add AVFilterContext.extra_hw_frames.
 -2018-02-xx - xxxxxxx - lavc 58.9.0 - avcodec.h
 +2018-02-xx - xxxxxxx - lavc 58.11.100 - avcodec.h
    Add AVCodecContext.extra_hw_frames.
  
 -2017-xx-xx - xxxxxxx - lavc 58.8.0 - avcodec.h
 +2018-02-06 - 0fd475704e - lavd 58.1.100 - avdevice.h
 +  Deprecate use of av_input_audio_device_next(), av_input_video_device_next(),
 +  av_output_audio_device_next(), av_output_video_device_next().
 +  Add av_indev_iterate(), and av_outdev_iterate().
 +
 +2018-xx-xx - xxxxxxx - lavf 58.9.100 - avformat.h
 +  Deprecate use of av_register_input_format(), av_register_output_format(),
 +  av_register_all(), av_iformat_next(), av_oformat_next().
 +  Add av_demuxer_iterate(), and av_muxer_iterate().
 +
 +2018-xx-xx - xxxxxxx - lavc 58.10.100 - avcodec.h
 +  Deprecate use of avcodec_register(), avcodec_register_all(),
 +  av_codec_next(), av_register_codec_parser(), and av_parser_next().
 +  Add av_codec_iterate() and av_parser_iterate().
 +
 +2018-02-xx - xxxxxxx - lavf 58.8.100 - avformat.h
 +  Deprecate the current names of the RTSP "timeout", "stimeout", "user-agent"
 +  options. Introduce "listen_timeout" as replacement for the current "timeout"
 +  option, and "user_agent" as replacement for "user-agent". Once the deprecation
 +  is over, the old "timeout" option will be removed, and "stimeout" will be
 +  renamed to "stimeout" (the "timeout" option will essentially change semantics).
 +
 +2018-01-xx - xxxxxxx - lavf 58.7.100 - avformat.h
 +  Deprecate AVFormatContext filename field which had limited length, use the
 +  new dynamically allocated url field instead.
 +
 +2018-01-xx - xxxxxxx - lavf 58.7.100 - avformat.h
 +  Add url field to AVFormatContext and add ff_format_set_url helper function.
 +
 +2018-01-xx - xxxxxxx - lavf 58.6.100 - avformat.h
 +  Add AVFMTCTX_UNSEEKABLE (for HLS demuxer).
 +
 +2018-xx-xx - xxxxxxx - lavu 56.9.100 - aes_ctr.h
 +  Add method to set the 16-byte IV.
 +
 +2018-01-xx - xxxxxxx - lavf 58.5.100 - avformat.h
 +  Explicitly make avformat_network_init() and avformat_network_deinit() optional.
 +  If these are not called, network initialization and deinitialization is
 +  automatic, and unlike in older versions, fully supported, unless libavformat
 +  is linked to ancient GnuTLS and OpenSSL.
 +
 +2018-01-xx - xxxxxxx - lavf 58.4.100 - avformat.h
 +  Deprecate AVStream.recommended_encoder_configuration. It was useful only for
 +  FFserver, which has been removed.
 +
 +2018-01-xx - xxxxxxx - lavfi 7.11.101 - avfilter.h
 +  Deprecate avfilter_link_get_channels(). Use av_buffersink_get_channels().
 +
 +2017-xx-xx - xxxxxxx - lavr 4.0.0 - avresample.h
 +  Deprecate the entire library. Merged years ago to provide compatibility
 +  with Libav, it remained unmaintained by the FFmpeg project and duplicated
 +  functionality provided by libswresample.
 +
 +  In order to improve consistency and reduce attack surface, it has been deprecated.
 +  Users of this library are asked to migrate to libswresample, which, as well as
 +  providing more functionality, is faster and has higher accuracy.
 +
 +2017-xx-xx - xxxxxxx - lavc 58.9.100 - avcodec.h
 +  Deprecate av_lockmgr_register(). You need to build FFmpeg with threading
 +  support enabled to get basic thread-safety (which is the default build
 +  configuration).
 +
 +2017-12-xx - xxxxxxx - lavu 56.7.100 - cpu.h
 +  AVX-512 flags added.
 +
 +2017-xx-xx - xxxxxxx - lavc 58.8.100 - avcodec.h
 +  The MediaCodec decoders now support AVCodecContext.hw_device_ctx.
 +
 +2017-xx-xx - xxxxxxx - lavu 56.6.100 - hwcontext.h hwcontext_mediacodec.h
 +  Add AV_HWDEVICE_TYPE_MEDIACODEC and a new installed header with
 +  MediaCodec-specific hwcontext definitions.
 +
 +2017-xx-xx - xxxxxxc - lavc 58.7.100 - avcodec.h
 +  Add AV_CODEC_CAP_HARDWARE, AV_CODEC_CAP_HYBRID, and AVCodec.wrapper_name,
 +  and mark all AVCodecs accordingly.
 +
 +2017-xx-xx - xxxxxxx - lavu 56.4.100 / 56.7.0 - stereo3d.h
 +  Add view field to AVStereo3D structure and AVStereo3DView enum.
 +
 +2017-xx-xx - xxxxxxx - lavc 58.6.100 - avcodec.h
    Add const to AVCodecContext.hwaccel.
  
 -2017-xx-xx - xxxxxxx - lavc 58.7.0 - avcodec.h
 +2017-11-xx - xxxxxxx - lavc 58.5.100 - avcodec.h
    Deprecate user visibility of the AVHWAccel structure and the functions
    av_register_hwaccel() and av_hwaccel_next().
  
index ea75467a758f3c9209900b39d20da5c442cde0c8,2c4a385ea907f7699c6e18a99a9e1416e520a7c1..7553f7c36a22f9b806c5193e3f3bea6dcefb661a
@@@ -673,9 -368,8 +673,11 @@@ static const AVOption avfilter_options[
      { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS,
          { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, FLAGS, "thread_type" },
          { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .unit = "thread_type" },
 +    { "enable", "set enable expression", OFFSET(enable_str), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
 +    { "threads", "Allowed number of threads", OFFSET(nb_threads), AV_OPT_TYPE_INT,
 +        { .i64 = 0 }, 0, INT_MAX, FLAGS },
+     { "extra_hw_frames", "Number of extra hardware frames to allocate for the user",
+         OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
      { NULL },
  };
  
index 62eed2168f001b7105b216946d3268184a8a1b22,46dbadfcdc20aa731636fa7bd02333dd523dcc63..2d1195eeeb7aa22aafb4755d45a619d52376d7b3
@@@ -393,19 -312,21 +393,35 @@@ struct AVFilterContext 
       */
      AVBufferRef *hw_device_ctx;
  
 +    /**
 +     * Max number of threads allowed in this filter instance.
 +     * If <= 0, its value is ignored.
 +     * Overrides global number of threads set per filter graph.
 +     */
 +    int nb_threads;
 +
 +    /**
 +     * Ready status of the filter.
 +     * A non-0 value means that the filter needs activating;
 +     * a higher value suggests a more urgent activation.
 +     */
 +    unsigned ready;
++
+     /**
+      * Sets the number of extra hardware frames which the filter will
+      * allocate on its output links for use in following filters or by
+      * the caller.
+      *
+      * Some hardware filters require all frames that they will use for
+      * output to be defined in advance before filtering starts.  For such
+      * filters, any hardware frame pools used for output must therefore be
+      * of fixed size.  The extra frames set here are on top of any number
+      * that the filter needs internally in order to operate normally.
+      *
+      * This field must be set before the graph containing this filter is
+      * configured.
+      */
+     int extra_hw_frames;
  };
  
  /**
index f9679ed1d77f9af89eea76b7375e2303f0e1bcc4,dd021e00a124d374631fa54e03d93049e588adb2..498bd3328d0939d692a03b460818c2345202e8b3
@@@ -384,31 -226,21 +384,47 @@@ void ff_filter_graph_remove_filter(AVFi
   */
  #define FF_FILTER_FLAG_HWFRAME_AWARE (1 << 0)
  
 -
 +/**
 + * Run one round of processing on a filter graph.
 + */
 +int ff_filter_graph_run_once(AVFilterGraph *graph);
 +
 +/**
 + * Normalize the qscale factor
 + * FIXME the H264 qscale is a log based scale, mpeg1/2 is not, the code below
 + *       cannot be optimal
 + */
 +static inline int ff_norm_qscale(int qscale, int type)
 +{
 +    switch (type) {
 +    case FF_QSCALE_TYPE_MPEG1: return qscale;
 +    case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
 +    case FF_QSCALE_TYPE_H264:  return qscale >> 2;
 +    case FF_QSCALE_TYPE_VP56:  return (63 - qscale + 2) >> 2;
 +    }
 +    return qscale;
 +}
 +
 +/**
 + * Get number of threads for current filter instance.
 + * This number is always same or less than graph->nb_threads.
 + */
 +int ff_filter_get_nb_threads(AVFilterContext *ctx);
 +
+ /**
+  * Perform any additional setup required for hardware frames.
+  *
+  * link->hw_frames_ctx must be set before calling this function.
+  * Inside link->hw_frames_ctx, the fields format, sw_format, width and
+  * height must be set.  If dynamically allocated pools are not supported,
+  * then initial_pool_size must also be set, to the minimum hardware frame
+  * pool size necessary for the filter to work (taking into account any
+  * frames which need to stored for use in operations as appropriate).  If
+  * default_pool_size is nonzero, then it will be used as the pool size if
+  * no other modification takes place (this can be used to preserve
+  * compatibility).
+  */
+ int ff_filter_init_hw_frames(AVFilterContext *avctx, AVFilterLink *link,
+                              int default_pool_size);
  #endif /* AVFILTER_INTERNAL_H */
index 0f1172182253afbc81a09bebe7aeb16dfc55b62d,00e9bf7a99d5f8bfe9470aa4f86ee4b7f86de860..ca096962bb5d30b470e3f7a8bd68a54387f82387
@@@ -29,9 -29,9 +29,9 @@@
  
  #include "libavutil/version.h"
  
 -#define LIBAVFILTER_VERSION_MAJOR  7
 -#define LIBAVFILTER_VERSION_MINOR  1
 -#define LIBAVFILTER_VERSION_MICRO  0
 +#define LIBAVFILTER_VERSION_MAJOR   7
- #define LIBAVFILTER_VERSION_MINOR  11
- #define LIBAVFILTER_VERSION_MICRO 101
++#define LIBAVFILTER_VERSION_MINOR  12
++#define LIBAVFILTER_VERSION_MICRO 100
  
  #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                 LIBAVFILTER_VERSION_MINOR, \