On Sat, Mar 19, 2016 at 09:37:47PM -0400, Vittorio Giovara wrote:
> From: Vitaliy E Sugrobov <[email protected]>
>
> This demuxer is capable of extracting multiple frames from gif file.
from a GIF file.
> In conjunction with gif decoder it implements support for reading
with a GIF decoder
> animated gifs.
GIFs
> Changelog | 1 +
> doc/general.texi | 2 +-
> libavformat/Makefile | 1 +
> libavformat/allformats.c | 2 +-
> libavformat/gifdec.c | 322
> +++++++++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 326 insertions(+), 2 deletions(-)
> create mode 100644 libavformat/gifdec.c
version bump
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -135,6 +135,7 @@ OBJS-$(CONFIG_FOURXM_DEMUXER) += 4xm.o
> OBJS-$(CONFIG_FRAMECRC_MUXER) += framecrcenc.o framehash.o
> OBJS-$(CONFIG_FRAMEMD5_MUXER) += md5enc.o framehash.o
> OBJS-$(CONFIG_GIF_MUXER) += gif.o
> +OBJS-$(CONFIG_GIF_DEMUXER) += gifdec.o
Usually the encoder has the "enc" suffix if both are available.
also: order
> --- /dev/null
> +++ b/libavformat/gifdec.c
> @@ -0,0 +1,322 @@
> +
> +/**
> + * @file
> + * GIF demuxer.
> + *
> + * There are two options available to user: default_delay and min_delay.
> + *
> + * These options are for protection from too rapid gif animations.
> + * In practice it is standard approach to slow down rendering of this
> + * kind of gifs. If you try to play gif with delay between frames of one
> + * hundredth of second (100fps) using one of major web browsers, you get
> + * significantly slower playback, around 10 fps. This is because browser
> + * detects that delay value is less than some threshold (usually 2 hundredths
> + * of second) and reset it to default value (usually 10 hundredths of second,
> + * which corresponds to 10fps). Manipulating these options, user can achieve
> + * the same effect during conversion to some video format. Otherwise user
> + * can set them to not protect from rapid animations at all.
> + *
> + * The other case when these options necessary is for gif images encoded
> + * according to gif87a standard since prior to gif89a there was no delay
> + * information included in file.
> + */
/**
* @file
* GIF demuxer
*
* There are two options available to users: default_delay and min_delay.
*
* These options are for protection from too rapid GIF animations. In practice
* the standard approach is to slow down rendering of this kind of GIF. If you
* try to play a GIF with a delay between frames of one hundredth of a second
* (100fps) using one of the major web browsers, you get significantly slower
* playback, around 10 fps. This is because the browser detects that the delay
* value is less than some threshold (usually 2 hundredths of a second) and
* resets it to the default value (usually 10 hundredths of a second, which
* corresponds to 10fps). By manipulating these options, users can achieve
* the same effect during conversion to some video format, or to not protect
* against rapid animations at all.
*
* The other case when these options are necessary is for GIF images encoded
* according to the GIF87a standard since prior to GIF89a there was no delay
* information included in GIF files.
*/
> +static int gif_read_header(AVFormatContext *s)
> +{
> + GIFDemuxContext *gdc = s->priv_data;
> + AVIOContext *pb = s->pb;
> + AVStream *st;
> + int ret;
nit: IMO excessive alignment
> +static int gif_read_packet(AVFormatContext *s, AVPacket *pkt)
> +{
> + while (GIF_TRAILER != (block_label = avio_r8(pb)) && !pb->eof_reached) {
> + switch(block_label) {
switch (
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel