From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E7A6E4009F for ; Mon, 19 Sep 2022 23:03:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0826B68BA0E; Tue, 20 Sep 2022 02:03:52 +0300 (EEST) Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0173C68B981 for ; Tue, 20 Sep 2022 02:03:45 +0300 (EEST) Received: by mail-yb1-f201.google.com with SMTP id i201-20020a253bd2000000b006b28b887dbaso552294yba.13 for ; Mon, 19 Sep 2022 16:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date; bh=/C3UHBZ0e55vQjeQuYlZkLnOX4im54V5uy8lo/KJTkI=; b=QyawqhX7dOLj5B8JPW0FY99Ci2rfLIZJWDvbgXC8jg6Y9Wf6vTZtx5b/vCE49J8Iiq YPFrzdYlvl5UQmwMkWdqodYO07tTJB+piPyjEoa6BbNWHXLEbnVlCvHwdJM14NUgfmmZ NeFZayFhRjkArMXrl/2lBRcogwjw+YM8HBPbaR3iDkrwXpysA65t5Ky87gQxhxA4TRhb KY4SooEXSvrpFwBpphfqnNUBEjm635u3V+hA0a4Ol9e/1U5r+Uay2YCuD1w4P9DE/mtz mcAJE22uWeod25juhkyiZiOhchQIYpzZABw2pLQw74dPZmfeEFsRTZTBRJxXZZL+fXLP wuow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date; bh=/C3UHBZ0e55vQjeQuYlZkLnOX4im54V5uy8lo/KJTkI=; b=Xv6FdC2Qc4AAuqz5zEvwSLKgGINz5gRWD6kt0p5OiWYvkPajrcxNmQtQAHZgtMH4j8 DzqTp3Jg5VsBYCfEiDdiwkJzET0iqG4oQVfZmwBGyw7WWylDARYHTnbb2Q7orXTKLrMx /TbxKAZOZywqQWcpccpWCoVeVDab5Txa15J2E1VW7ux03WoQlOkfKzLvDYcjJAJEM8sJ I3BmGgTLWK7oh5GovmaJgI3KxneEPQ7dOL3LNjp9NBs/IX5djZI8qES+zl+7ujQXSIJY OkLQpR03upD7JVjcHBE70G1ol+SNqAuvOAqg4xNaQwiMYmdZgjGFaa9Gs0ei8louVqzW 4NIA== X-Gm-Message-State: ACrzQf3QH2ninoNxp/sATfNJvYktdbptrJQyLqzwrivYLihHMA4o6ENE K9VjUebJ0cbRQ20wsWNH85iWTXkGsKPfg1U0nAbmUoN2tegLnrST4tMmLJfSLGjE8Lxe9+R6ZMe e+YvPxz2X1dTtKY01OEGLyNLfja6cGU6YKZFEAuPfjDVL9jt4f1NYUYccoPsWhUzvOpHm X-Google-Smtp-Source: AMsMyM6+TlyPYqRnHE8qAN9RzwMtJYfWAm/M3lvMsBwOciqgIC7HUEQ62xZU5ByIkQ5wPnfmV6WkkJnyZMue1g== X-Received: from vigneshv3.mtv.corp.google.com ([2620:0:1000:2511:daef:a873:fa7b:499]) (user=vigneshv job=sendgmr) by 2002:a81:91c2:0:b0:345:41a:4967 with SMTP id i185-20020a8191c2000000b00345041a4967mr16851068ywg.28.1663628624045; Mon, 19 Sep 2022 16:03:44 -0700 (PDT) Date: Mon, 19 Sep 2022 16:03:36 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog Message-ID: <20220919230336.366882-1-vigneshv@google.com> From: Vignesh Venkatasubramanian To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] avformat/movenc: Write auxi box for animated AVIF with alpha X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Vignesh Venkatasubramanian Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: According to the HEIF specification Section 7.5.3.1, tracks with handler_type 'auxv' must contain a 'auxi' box in its SampleEntry to notify the nature of the auxiliary track to the decoder. The content is the same as the 'auxC' box. So paramterize and re-use the existing function. Signed-off-by: Vignesh Venkatasubramanian --- libavformat/movenc.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index c8b2e141cb..754f95912a 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2179,6 +2179,16 @@ static int mov_write_ccst_tag(AVIOContext *pb) return update_size(pb, pos); } +static int mov_write_aux_tag(AVIOContext *pb, const char *aux_type) +{ + int64_t pos = avio_tell(pb); + avio_wb32(pb, 0); /* size */ + ffio_wfourcc(pb, aux_type); + avio_wb32(pb, 0); /* Version & flags */ + avio_write(pb, "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0", 44); + return update_size(pb, pos); +} + static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int ret = AVERROR_BUG; @@ -2363,8 +2373,11 @@ static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex if (avid) avio_wb32(pb, 0); - if (track->mode == MODE_AVIF) + if (track->mode == MODE_AVIF) { mov_write_ccst_tag(pb); + if (s->nb_streams > 0 && track == &mov->tracks[1]) + mov_write_aux_tag(pb, "auxi"); + } return update_size(pb, pos); } @@ -3044,16 +3057,6 @@ static int mov_write_pixi_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatConte return update_size(pb, pos); } -static int mov_write_auxC_tag(AVIOContext *pb) -{ - int64_t pos = avio_tell(pb); - avio_wb32(pb, 0); /* size */ - ffio_wfourcc(pb, "auxC"); - avio_wb32(pb, 0); /* Version & flags */ - avio_write(pb, "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0", 44); - return update_size(pb, pos); -} - static int mov_write_ipco_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { int64_t pos = avio_tell(pb); @@ -3066,7 +3069,7 @@ static int mov_write_ipco_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatConte if (!i) mov_write_colr_tag(pb, &mov->tracks[0], 0); else - mov_write_auxC_tag(pb); + mov_write_aux_tag(pb, "auxC"); } return update_size(pb, pos); } -- 2.37.3.968.ga6b4b080e4-goog _______________________________________________ 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".