Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 4/5] avformat/mov: Add support for exporting Video Extension Usage info
Date: Mon, 10 Jun 2024 16:38:43 -0300
Message-ID: <15365cbb-22fe-4bde-ae2b-13bf2e8b0411@gmail.com> (raw)
In-Reply-To: <20240610184408.68171-5-derek.buitenhuis@gmail.com>

On 6/10/2024 3:44 PM, Derek Buitenhuis wrote:
> +static int mov_read_vexu(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> +{
> +    int size;
> +    int64_t remaining;
> +    uint32_t tag;
> +
> +    if (c->fc->nb_streams < 1)
> +        return 0;
> +
> +    if (atom.size < 8) {
> +        av_log(c->fc, AV_LOG_ERROR, "Empty video extension usage box\n");
> +        return AVERROR_INVALIDDATA;
> +    }
> +
> +    remaining = atom.size;
> +    while (remaining > 0) {

Maybe this loop should call mov_read_default, with proj and eyes added 
to mov_default_parse_table[]. Although i don't know if eyes may show up 
as child for other parent boxes or not.
At least with proj, i see it can be a child for sv3d, where only prhd is 
expected as a child box in turn. But it shouldn't a problem to add a 
mov_read_proj that handles both prhd and prji for this purpose.

> +        size = avio_rb32(pb);
> +        if (size < 8 || size > remaining ) {
> +            av_log(c->fc, AV_LOG_ERROR, "Invalid child size in vexu box\n");
> +            return AVERROR_INVALIDDATA;
> +        }
> +
> +        tag = avio_rl32(pb);
> +        switch (tag) {
> +        case MKTAG('p','r','o','j'): {
> +            MOVAtom proj = { tag, size - 8 };
> +            int ret = mov_read_vexu_proj(c, pb, proj);
> +            if (ret < 0)
> +                return ret;
> +            break;
> +        }
> +        case MKTAG('e','y','e','s'): {
> +            MOVAtom eyes = { tag, size - 8 };
> +            int ret = mov_read_eyes(c, pb, eyes);
> +            if (ret < 0)
> +                return ret;
> +            break;
> +        }
> +        default:
> +            av_log(c->fc, AV_LOG_WARNING, "Unknown tag in vexu: 0x%08X\n", tag);
> +            avio_skip(pb, size - 8);
> +            break;
> +        }
> +        remaining -= size;
> +    }
> +
> +    if (remaining != 0) {
> +        av_log(c->fc, AV_LOG_ERROR, "Broken vexu box\n");
> +        return AVERROR_INVALIDDATA;
> +    }
> +
> +    return 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".

  reply	other threads:[~2024-06-10 19:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 18:44 [FFmpeg-devel] [PATCH 0/5] Apple Spatial Metadata Derek Buitenhuis
2024-06-10 18:44 ` [FFmpeg-devel] [PATCH 1/5] avutil/spherical: Add more spherical types Derek Buitenhuis
2024-06-11 18:44   ` James Almer
2024-06-14 13:03     ` Derek Buitenhuis
2024-06-17 13:11       ` Derek Buitenhuis
2024-06-10 18:44 ` [FFmpeg-devel] [PATCH 2/5] avutil/stereo3d: Fill out stereo info provided by Vision Pro files Derek Buitenhuis
2024-06-10 18:44 ` [FFmpeg-devel] [PATCH 3/5] fftools/ffprobe: Print more Stereo 3D info from side data Derek Buitenhuis
2024-06-11 18:09   ` Michael Niedermayer
2024-06-11 18:43     ` Derek Buitenhuis
2024-06-14 13:04       ` Derek Buitenhuis
2024-06-10 18:44 ` [FFmpeg-devel] [PATCH 4/5] avformat/mov: Add support for exporting Video Extension Usage info Derek Buitenhuis
2024-06-10 19:38   ` James Almer [this message]
2024-06-10 19:45     ` Derek Buitenhuis
2024-06-10 18:44 ` [FFmpeg-devel] [PATCH 5/5] avformat/mov: Add support for reading and exporting horizontal field of view Derek Buitenhuis

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=15365cbb-22fe-4bde-ae2b-13bf2e8b0411@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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