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 1C99F487B9 for ; Wed, 17 Jan 2024 20:42:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 545B268D051; Wed, 17 Jan 2024 22:41:57 +0200 (EET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 598C168D029 for ; Wed, 17 Jan 2024 22:41:51 +0200 (EET) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1d5db9eb0e7so19295395ad.2 for ; Wed, 17 Jan 2024 12:41:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705524109; x=1706128909; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=R1Hx05/L9dGn+BdkUBXxBUdxdWv9LDs5NWWssC60Fd8=; b=Q1ll6DrGFtFPtV0wn+X/0y87WweFtmWYf7slzbORmOrCZeywpKsBk87p0GwxIXqjZL 3tmlXeEF6fc53yMxk3aGY2STE9lN7FAM5dzcD3l8bQ2ZITyLKpC1C69Qonhj70lJucG3 /0J07Fqp7QQG7PF358g0F57kEIlK8MtnSMVQ5iZzA6GHjReLmYtCGFmMrVQOF1hCRURe gY/RhP5glPWPXJwDPK+ajHuMWHEc65Gs0W6Y8iv+OJVP6FQ+mitqGmaK2Y0dR73cz9ik 9siDim8QTAsqX55bm+arnQBD/+qFL2Yk/NfyI1MvJpLrYKJ2t63FJdIYMeKv1OtbcTH7 rUwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705524109; x=1706128909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R1Hx05/L9dGn+BdkUBXxBUdxdWv9LDs5NWWssC60Fd8=; b=sP55T+3xbGrGpkJOHLf3UMJJ7GcVSeXPcpTnGpHgjlN/n/vdz6KJdb/qUJtx10pQC1 SRSJumhzueEn4AsFNlTx3eMg0woiL9kkcCie9inRGSSPRW229SsDsg9FMjZOA7z7u8EC Qx4PwM+MojSWxTK1DZSvWuO+0Wsgf3H1TJQeapBqgChffD2fsLg4Z28nCHt5B3JpMOo5 OU7WY2FvnfR2Wcf+9kYFP9UmLy0U1msyfnaVrsACh+5sPTLJBVEYgBfH6TUW6b3aGC3v 8RzQqfhFt8Fpw452HmNWFLYnUge53GxKpxiDDJ1GDmWg/7OH/ILSR/bSQgxrft9AXqXq 7Ppg== X-Gm-Message-State: AOJu0YzvLOgxk4omyp2OkfuAMlke23zbmmkXF3vzK/WGuOSL82s9scHF GulWzmbcp1CnkqA+hR0apiTa4OkzgGw= X-Google-Smtp-Source: AGHT+IE6sIq/k0eAbgI7S7Lp3koLSMtJ3Wdlk+O8Cl05Aigct0NTgh0YHspYDBcl42Lo3msXXiFDOQ== X-Received: by 2002:a17:902:8345:b0:1d4:4482:83c7 with SMTP id z5-20020a170902834500b001d4448283c7mr4821699pln.117.1705524108798; Wed, 17 Jan 2024 12:41:48 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id o13-20020a170902778d00b001d50ca466e5sm70353pll.133.2024.01.17.12.41.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 12:41:48 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Jan 2024 17:41:33 -0300 Message-ID: <20240117204133.11142-2-jamrial@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117204133.11142-1-jamrial@gmail.com> References: <20240117204133.11142-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avformat: add a Tile Grid stream group type 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 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: This will be used to support tiled image formats like HEIF. Signed-off-by: James Almer --- libavformat/avformat.c | 5 +++++ libavformat/avformat.h | 3 +++ libavformat/dump.c | 36 ++++++++++++++++++++++++++++++++++++ libavformat/options.c | 9 +++++++++ 4 files changed, 53 insertions(+) diff --git a/libavformat/avformat.c b/libavformat/avformat.c index 882927f7b1..a7bd959db5 100644 --- a/libavformat/avformat.c +++ b/libavformat/avformat.c @@ -30,6 +30,7 @@ #include "libavutil/opt.h" #include "libavutil/pixfmt.h" #include "libavutil/samplefmt.h" +#include "libavutil/tile.h" #include "libavcodec/avcodec.h" #include "libavcodec/codec.h" #include "libavcodec/bsf.h" @@ -100,6 +101,10 @@ void ff_free_stream_group(AVStreamGroup **pstg) av_iamf_mix_presentation_free(&stg->params.iamf_mix_presentation); break; } + case AV_STREAM_GROUP_PARAMS_TILE_GRID: { + av_tile_grid_free(&stg->params.tile_grid); + break; + } default: break; } diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 5d0fe82250..f259ad1367 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1022,10 +1022,12 @@ enum AVStreamGroupParamsType { AV_STREAM_GROUP_PARAMS_NONE, AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT, AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION, + AV_STREAM_GROUP_PARAMS_TILE_GRID, }; struct AVIAMFAudioElement; struct AVIAMFMixPresentation; +struct AVTileGrid; typedef struct AVStreamGroup { /** @@ -1062,6 +1064,7 @@ typedef struct AVStreamGroup { union { struct AVIAMFAudioElement *iamf_audio_element; struct AVIAMFMixPresentation *iamf_mix_presentation; + struct AVTileGrid *tile_grid; } params; /** diff --git a/libavformat/dump.c b/libavformat/dump.c index aff51b43f6..84884121a1 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -22,6 +22,7 @@ #include #include +#include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/display.h" #include "libavutil/iamf.h" @@ -35,6 +36,7 @@ #include "libavutil/spherical.h" #include "libavutil/stereo3d.h" #include "libavutil/timecode.h" +#include "libavutil/tile.h" #include "libavcodec/avcodec.h" @@ -720,6 +722,40 @@ static void dump_stream_group(const AVFormatContext *ic, uint8_t *printed, } } break; + case AV_STREAM_GROUP_PARAMS_TILE_GRID: { + const AVTileGrid *tile_grid = stg->params.tile_grid; + AVCodecContext *avctx = avcodec_alloc_context3(NULL); + const char *ptr = NULL; + av_log(NULL, AV_LOG_INFO, " Tile Grid:"); + dump_metadata(NULL, stg->metadata, " ", AV_LOG_INFO); + if (avctx && stg->nb_streams && !avcodec_parameters_to_context(avctx, ic->streams[0]->codecpar)) { + avctx->width = tile_grid->output_width; + avctx->height = tile_grid->output_height; + avctx->coded_width = FFALIGN(tile_grid->output_width, tile_grid->w.tile_width); + avctx->coded_height = FFALIGN(tile_grid->output_height, tile_grid->h.tile_height); + if (ic->dump_separator) + av_opt_set(avctx, "dump_separator", ic->dump_separator, 0); + buf[0] = 0; + avcodec_string(buf, sizeof(buf), avctx, is_output); + ptr = av_stristr(buf, " "); + } + avcodec_free_context(&avctx); + if (ptr) { + ptr++; + av_log(NULL, AV_LOG_INFO, " %s", ptr); + av_log(NULL, AV_LOG_VERBOSE, ","); + } + av_log(NULL, AV_LOG_VERBOSE, " %d rows, %d columns, tile size %dx%d", + tile_grid->tile_rows, tile_grid->tile_cols, + tile_grid->w.tile_width, tile_grid->h.tile_height); + av_log(NULL, AV_LOG_INFO, "\n"); + for (int i = 0; i < stg->nb_streams; i++) { + const AVStream *st = stg->streams[i]; + dump_stream_format(ic, st->index, i, index, is_output, AV_LOG_VERBOSE); + printed[st->index] = 1; + } + break; + } } default: break; diff --git a/libavformat/options.c b/libavformat/options.c index e79ae221d9..dd33ea3470 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -30,6 +30,7 @@ #include "libavutil/internal.h" #include "libavutil/intmath.h" #include "libavutil/opt.h" +#include "libavutil/tile.h" /** * @file @@ -367,6 +368,9 @@ static const AVClass *stream_group_child_iterate(void **opaque) case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION: ret = av_iamf_mix_presentation_get_class(); break; + case AV_STREAM_GROUP_PARAMS_TILE_GRID: + ret = av_tile_grid_get_class(); + break; default: break; } @@ -427,6 +431,11 @@ AVStreamGroup *avformat_stream_group_create(AVFormatContext *s, if (!stg->params.iamf_mix_presentation) goto fail; break; + case AV_STREAM_GROUP_PARAMS_TILE_GRID: + stg->params.tile_grid = av_tile_grid_alloc(); + if (!stg->params.tile_grid) + goto fail; + break; default: goto fail; } -- 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".