Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Vignesh Venkat via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Vignesh Venkat <vigneshv@google.com>
Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: rename avif fields to heif
Date: Wed, 10 Jan 2024 13:06:50 -0800
Message-ID: <CAOJaEP+t71aWjbkng7MstcrZ6Dzgd=WavPXCu8pOh7i=d5ONpg@mail.gmail.com> (raw)
In-Reply-To: <20240109195545.59231-1-jamrial@gmail.com>

On Tue, Jan 9, 2024 at 11:56 AM James Almer <jamrial@gmail.com> wrote:
>
> They are no longer avif specific.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/isom.h |  4 ++--
>  libavformat/mov.c  | 28 ++++++++++++++--------------
>  2 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/libavformat/isom.h b/libavformat/isom.h
> index b30b9da65e..90c4fb5530 100644
> --- a/libavformat/isom.h
> +++ b/libavformat/isom.h
> @@ -325,8 +325,8 @@ typedef struct MOVContext {
>          int item_id;
>          int extent_length;
>          int64_t extent_offset;
> -    } *avif_info;
> -    int avif_info_size;
> +    } *heif_info;
> +    int heif_info_size;
>      int64_t hvcC_offset;
>      int hvcC_size;
>      int interleaved_read;
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index c6398d6d81..12e82c66a9 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4916,15 +4916,15 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>      return ret;
>  }
>
> -static int avif_add_stream(MOVContext *c, int item_id)
> +static int heif_add_stream(MOVContext *c, int item_id)
>  {
>      MOVStreamContext *sc;
>      AVStream *st;
>      int item_index = -1;
>      if (c->fc->nb_streams)
>          return AVERROR_INVALIDDATA;
> -    for (int i = 0; i < c->avif_info_size; i++)
> -        if (c->avif_info[i].item_id == item_id) {
> +    for (int i = 0; i < c->heif_info_size; i++)
> +        if (c->heif_info[i].item_id == item_id) {
>              item_index = i;
>              break;
>          }
> @@ -4987,8 +4987,8 @@ static int avif_add_stream(MOVContext *c, int item_id)
>      sc->stts_data[0].count = 1;
>      // Not used for still images. But needed by mov_build_index.
>      sc->stts_data[0].duration = 0;
> -    sc->sample_sizes[0] = c->avif_info[item_index].extent_length;
> -    sc->chunk_offsets[0] = c->avif_info[item_index].extent_offset;
> +    sc->sample_sizes[0] = c->heif_info[item_index].extent_length;
> +    sc->chunk_offsets[0] = c->heif_info[item_index].extent_offset;
>
>      mov_build_index(c, st);
>      return 0;
> @@ -5013,7 +5013,7 @@ static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>              if (c->is_still_picture_avif) {
>                  int ret;
>                  // Add a stream for the YUV planes (primary item).
> -                if ((ret = avif_add_stream(c, c->primary_item_id)) < 0)
> +                if ((ret = heif_add_stream(c, c->primary_item_id)) < 0)
>                      return ret;
>                  // For still AVIF images, the meta box contains all the
>                  // necessary information that would generally be provided by the
> @@ -7820,7 +7820,7 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>          return 0;
>      }
>
> -    if (c->avif_info) {
> +    if (c->heif_info) {
>          av_log(c->fc, AV_LOG_INFO, "Duplicate iloc box found\n");
>          return 0;
>      }
> @@ -7841,16 +7841,16 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>      }
>      item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb);
>
> -    c->avif_info = av_malloc_array(item_count, sizeof(*c->avif_info));
> -    if (!c->avif_info)
> +    c->heif_info = av_malloc_array(item_count, sizeof(*c->heif_info));
> +    if (!c->heif_info)
>          return AVERROR(ENOMEM);
> -    c->avif_info_size = item_count;
> +    c->heif_info_size = item_count;
>
>      for (int i = 0; i < item_count; i++) {
>          int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb);
>          if (avio_feof(pb))
>              return AVERROR_INVALIDDATA;
> -        c->avif_info[i].item_id = item_id;
> +        c->heif_info[i].item_id = item_id;
>
>          if (version > 0)
>              avio_rb16(pb);  // construction_method.
> @@ -7867,8 +7867,8 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>              if (rb_size(pb, &extent_offset, offset_size) < 0 ||
>                  rb_size(pb, &extent_length, length_size) < 0)
>                  return AVERROR_INVALIDDATA;
> -            c->avif_info[i].extent_length = extent_length;
> -            c->avif_info[i].extent_offset = base_offset + extent_offset;
> +            c->heif_info[i].extent_length = extent_length;
> +            c->heif_info[i].extent_offset = base_offset + extent_offset;
>          }
>      }
>
> @@ -8502,7 +8502,7 @@ static int mov_read_close(AVFormatContext *s)
>
>      av_freep(&mov->aes_decrypt);
>      av_freep(&mov->chapter_tracks);
> -    av_freep(&mov->avif_info);
> +    av_freep(&mov->heif_info);
>
>      return 0;
>  }
> --
> 2.43.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

lgtm

-- 
Vignesh
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      parent reply	other threads:[~2024-01-10 21:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 19:55 James Almer
2024-01-09 19:55 ` [FFmpeg-devel] [PATCH 2/2] avformat/mov: improve HEIF parsing James Almer
2024-01-10  1:27   ` [FFmpeg-devel] [PATCH 2/2 v2] " James Almer
2024-01-15 16:50     ` James Almer
2024-04-13 11:04   ` [FFmpeg-devel] 回复: [PATCH 2/2] " Wu Jianhua
2024-04-13 13:12     ` James Almer
2024-04-13 14:20       ` [FFmpeg-devel] 回复: " Wu Jianhua
2024-01-10 21:06 ` Vignesh Venkat via ffmpeg-devel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOJaEP+t71aWjbkng7MstcrZ6Dzgd=WavPXCu8pOh7i=d5ONpg@mail.gmail.com' \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=vigneshv@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git