diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2015-11-03 09:57:17 -0800 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-11-09 08:09:34 +0100 |
commit | 48ff6683ba5d40b629428673b1028e8ec542a9fa (patch) | |
tree | bf3938f99ca50068b45a161ca1f3a0ba8d23578d | |
parent | 79f5347a983342e2711ca8ba19ec3d8d151183f0 (diff) | |
download | ffmpeg-48ff6683ba5d40b629428673b1028e8ec542a9fa.tar.gz |
lavfi: add a frame_rate field to AVFilterLink.
(cherry picked from ffmpeg commit 7b42036b3b23c85f473bf9369e37fa8da22eaf93)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavfilter/avfilter.c | 2 | ||||
-rw-r--r-- | libavfilter/avfilter.h | 12 | ||||
-rw-r--r-- | libavfilter/version.h | 2 |
4 files changed, 18 insertions, 1 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index d301bd5fac..cc48b5109d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -12,6 +12,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2015-11-xx - xxxxxxx - lavfi 6.1.0 - avfilter.h + Add a frame_rate field to AVFilterLink + 2015-xx-xx - xxxxxxx - lavc 57.6.0 - avcodec.h 2015-xx-xx - lavc 57.7.0 - avcodec.h diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 64b26457f5..cd98d16220 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -195,6 +195,8 @@ int avfilter_config_links(AVFilterContext *filter) link->src->inputs[0]->sample_aspect_ratio : (AVRational){1,1}; if (link->src->nb_inputs) { + if (!link->frame_rate.num && !link->frame_rate.den) + link->frame_rate = link->src->inputs[0]->frame_rate; if (!link->w) link->w = link->src->inputs[0]->w; if (!link->h) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 9dbfeea9eb..18908583a2 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -375,6 +375,18 @@ struct AVFilterLink { AVLINK_STARTINIT, ///< started, but incomplete AVLINK_INIT ///< complete } init_state; + + /** + * Frame rate of the stream on the link, or 1/0 if unknown or variable; + * if left to 0/0, will be automatically copied from the first input + * of the source filter if it exists. + * + * Sources should set it to the real constant frame rate. + * If the source frame rate is unknown or variable, set this to 1/0. + * Filters should update it if necessary depending on their function. + * Sinks can use it to set a default output frame rate. + */ + AVRational frame_rate; }; /** diff --git a/libavfilter/version.h b/libavfilter/version.h index 3cbd8f85b4..884cfa0c9c 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFILTER_VERSION_MAJOR 6 -#define LIBAVFILTER_VERSION_MINOR 0 +#define LIBAVFILTER_VERSION_MINOR 1 #define LIBAVFILTER_VERSION_MICRO 0 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |