They are no longer avif specific.
Unified · Split
| @@ -325,8 +325,8 @@ typedef struct MOVContext { · 324 unmodified lines | ||
| 325 | 325 | int item_id; |
| 326 | 326 | int extent_length; |
| 327 | 327 | int64_t extent_offset; |
| 328 | − } *avif_info; | |
| 329 | − int avif_info_size; | |
| 328 | + } *heif_info; | |
| 329 | + int heif_info_size; | |
| 330 | 330 | int64_t hvcC_offset; |
| 331 | 331 | int hvcC_size; |
| 332 | 332 | int interleaved_read; |
| @@ -4916,15 +4916,15 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 4915 unmodified lines | ||
| 4916 | 4916 | return ret; |
| 4917 | 4917 | } |
| 4918 | 4918 | |
| 4919 | −static int avif_add_stream(MOVContext *c, int item_id) | |
| 4919 | +static int heif_add_stream(MOVContext *c, int item_id) | |
| 4920 | 4920 | { |
| 4921 | 4921 | MOVStreamContext *sc; |
| 4922 | 4922 | AVStream *st; |
| 4923 | 4923 | int item_index = -1; |
| 4924 | 4924 | if (c->fc->nb_streams) |
| 4925 | 4925 | return AVERROR_INVALIDDATA; |
| 4926 | − for (int i = 0; i < c->avif_info_size; i++) | |
| 4927 | − if (c->avif_info[i].item_id == item_id) { | |
| 4926 | + for (int i = 0; i < c->heif_info_size; i++) | |
| 4927 | + if (c->heif_info[i].item_id == item_id) { | |
| 4928 | 4928 | item_index = i; |
| 4929 | 4929 | break; |
| 4930 | 4930 | } |
| @@ -4987,8 +4987,8 @@ static int avif_add_stream(MOVContext *c, int item_id) · 56 unmodified lines | ||
| 4987 | 4987 | sc->stts_data[0].count = 1; |
| 4988 | 4988 | // Not used for still images. But needed by mov_build_index. |
| 4989 | 4989 | sc->stts_data[0].duration = 0; |
| 4990 | − sc->sample_sizes[0] = c->avif_info[item_index].extent_length; | |
| 4991 | − sc->chunk_offsets[0] = c->avif_info[item_index].extent_offset; | |
| 4990 | + sc->sample_sizes[0] = c->heif_info[item_index].extent_length; | |
| 4991 | + sc->chunk_offsets[0] = c->heif_info[item_index].extent_offset; | |
| 4992 | 4992 | |
| 4993 | 4993 | mov_build_index(c, st); |
| 4994 | 4994 | return 0; |
| @@ -5013,7 +5013,7 @@ static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 18 unmodified lines | ||
| 5013 | 5013 | if (c->is_still_picture_avif) { |
| 5014 | 5014 | int ret; |
| 5015 | 5015 | // Add a stream for the YUV planes (primary item). |
| 5016 | − if ((ret = avif_add_stream(c, c->primary_item_id)) < 0) | |
| 5016 | + if ((ret = heif_add_stream(c, c->primary_item_id)) < 0) | |
| 5017 | 5017 | return ret; |
| 5018 | 5018 | // For still AVIF images, the meta box contains all the |
| 5019 | 5019 | // necessary information that would generally be provided by the |
| @@ -7820,7 +7820,7 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 2800 unmodified lines | ||
| 7820 | 7820 | return 0; |
| 7821 | 7821 | } |
| 7822 | 7822 | |
| 7823 | − if (c->avif_info) { | |
| 7823 | + if (c->heif_info) { | |
| 7824 | 7824 | av_log(c->fc, AV_LOG_INFO, "Duplicate iloc box found\n"); |
| 7825 | 7825 | return 0; |
| 7826 | 7826 | } |
| @@ -7841,16 +7841,16 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 14 unmodified lines | ||
| 7841 | 7841 | } |
| 7842 | 7842 | item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); |
| 7843 | 7843 | |
| 7844 | − c->avif_info = av_malloc_array(item_count, sizeof(*c->avif_info)); | |
| 7845 | − if (!c->avif_info) | |
| 7844 | + c->heif_info = av_malloc_array(item_count, sizeof(*c->heif_info)); | |
| 7845 | + if (!c->heif_info) | |
| 7846 | 7846 | return AVERROR(ENOMEM); |
| 7847 | − c->avif_info_size = item_count; | |
| 7847 | + c->heif_info_size = item_count; | |
| 7848 | 7848 | |
| 7849 | 7849 | for (int i = 0; i < item_count; i++) { |
| 7850 | 7850 | int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); |
| 7851 | 7851 | if (avio_feof(pb)) |
| 7852 | 7852 | return AVERROR_INVALIDDATA; |
| 7853 | − c->avif_info[i].item_id = item_id; | |
| 7853 | + c->heif_info[i].item_id = item_id; | |
| 7854 | 7854 | |
| 7855 | 7855 | if (version > 0) |
| 7856 | 7856 | avio_rb16(pb); // construction_method. |
| @@ -7867,8 +7867,8 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 10 unmodified lines | ||
| 7867 | 7867 | if (rb_size(pb, &extent_offset, offset_size) < 0 || |
| 7868 | 7868 | rb_size(pb, &extent_length, length_size) < 0) |
| 7869 | 7869 | return AVERROR_INVALIDDATA; |
| 7870 | − c->avif_info[i].extent_length = extent_length; | |
| 7871 | − c->avif_info[i].extent_offset = base_offset + extent_offset; | |
| 7870 | + c->heif_info[i].extent_length = extent_length; | |
| 7871 | + c->heif_info[i].extent_offset = base_offset + extent_offset; | |
| 7872 | 7872 | } |
| 7873 | 7873 | } |
| 7874 | 7874 | |
| @@ -8502,7 +8502,7 @@ static int mov_read_close(AVFormatContext *s) · 627 unmodified lines | ||
| 8502 | 8502 | |
| 8503 | 8503 | av_freep(&mov->aes_decrypt); |
| 8504 | 8504 | av_freep(&mov->chapter_tracks); |
| 8505 | − av_freep(&mov->avif_info); | |
| 8505 | + av_freep(&mov->heif_info); | |
| 8506 | 8506 | |
| 8507 | 8507 | return 0; |
| 8508 | 8508 | } |