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 5302E47F2B for ; Mon, 6 Nov 2023 14:04:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3701068C9C2; Mon, 6 Nov 2023 16:04:15 +0200 (EET) Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8D58168C85E for ; Mon, 6 Nov 2023 16:04:09 +0200 (EET) Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-581e9b8e5fbso2218866eaf.1 for ; Mon, 06 Nov 2023 06:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699279447; x=1699884247; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=QDEbnIc49Tm5HGeJQmNViF07ZUjWQGxMdkkQnQynGfs=; b=SpNsS1s8fr/Uukohd5nRNSwwvov2SedErtUV8hiHytIbnm5vHDz9JjVKQ2rNOkIUHx LNPLekTkpwz/ComDEgICMs/6q6blQ1PTL7bqqzejtdnZGikYUDKplQrYpxiefHlNGjCc YXS153WgIiipkXU1UAuqzaQwFCstc7g4I+ONGUZw/uNgYntiIXc6ZpMjDHIghkz9BfKW BZpQkgf5gsHdZTz093EzrvLpEFl/47c85kBuC1nMuupviTCCsu6KKwKlc2EwBtrM+DZc adLWT9w8R7Re2R1XY8L0YuWnED4UdNDfneMSIrcrZnX0O+OQqMvcqgFRgEYc0jXis17p OOqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699279447; x=1699884247; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QDEbnIc49Tm5HGeJQmNViF07ZUjWQGxMdkkQnQynGfs=; b=vTxGMJ3DFFxoKZF58OGYHXHnuKHUYGIS7vfw4xy4E8O1cL8idt63Q/GW26kevkLjha 2p2eCCpuQu4ipEf8mfyQu21U2ulZgwcyr83LZ/QQoD2nX94rvSUvy02XFSmwFasuVl3I XYDH9nN5pK0sYTqmT5L4FithnJTC3yWFUWFTj1un9wYTNLUBAci0onOv0p6aq+n6e+yG dk69pVADOguoEYWAVtTKMi1SNKRMt9P7H1KOExpA/T3Cx3ABgvizeomxKV9fq2Zv9D6A 60RBY6FRlLBlkh2SrtjbDI+rhZQvuibuoQTzCAJ18zoeWibnEfixqBYxc5ajYN0kpTll eOWQ== X-Gm-Message-State: AOJu0YycVlqTN4/bfMeydVQnCvuJgaZP9E3uCBxAeMG/6g7MCZ6vmsOf bHwmR9mwYyVaevmPyRMPTSrUoc3csJs= X-Google-Smtp-Source: AGHT+IGT8Ie79j+BiIXq5mAcguxWLleagLMioS44DrywOs97u14lNucVdcUMpu+qSaOnHGgyI4ftMw== X-Received: by 2002:a05:6820:355:b0:581:ea79:7052 with SMTP id m21-20020a056820035500b00581ea797052mr5905412ooe.2.1699279446489; Mon, 06 Nov 2023 06:04:06 -0800 (PST) Received: from [192.168.0.14] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id z45-20020a4a9870000000b00587b9063e07sm477740ooi.2.2023.11.06.06.04.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Nov 2023 06:04:05 -0800 (PST) Message-ID: <79f6fd53-2ebb-4f07-8704-23e79a3eae4f@gmail.com> Date: Mon, 6 Nov 2023 11:04:17 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20231030152354.2818-1-jamrial@gmail.com> <169927064380.11195.2245547213925263654@lain.khirnov.net> Content-Language: en-US From: James Almer Autocrypt: addr=jamrial@gmail.com; keydata= xsBNBFjZtqABCADLW+vdEoZaJZDsIO6geYFTOcn1unsEHefj9zn+3oTHlDFFzO47mzHsSfbK 9JE2xpOJEVnC8FAF5Sayi/pVwV+mtQUV3n5dgVeVBYF9GUQwOGFCpK8X54RRqhkgknbunOEE 0CtgAJgmpFmmmHgq02GvEspx1h/rh4apqwQR6QX4Favb+x9+i9ytVpwVcBX94vo2toyP7h/K BWfadQmb8ltgE1kshfg+SQs/H5bTV5Z1DuEASf02ZL/1qYB/sdTgWPLv9XMUHHsRFmMY8TMx wJSkP+Af3AiYQPJYz1B1D4tt98T/NoiVdin10zATakPjV8hXaobuRmxgakkUASXudydDABEB AAHNH0phbWVzIEFsbWVyIDxqYW1yaWFsQGdtYWlsLmNvbT7CwJIEEwEIADwCGwMGCwkIBwMC BhUIAgkKCwQWAgMBAh4BAheAFiEEd1EujP2UoWlX5pp6FGMBrXN2WeAFAmJoLUUCGQEACgkQ FGMBrXN2WeAFVQf9GtGhniRs1PzNUOgJktCnv6j4BbLieaIPYPEFXKDHOgjqQE2zVMYXnoXl Jam928ii902a8OY06r9ywn/R8ApD1/3NY/v64O71CY9scz5XyH2au8wIZ6HwFy3/f7sqjdGD uctY8Qs7rjT7NkoC5lmgMu2v2k03dGtM9AAf5AK5gU+H0EUw7vmKKiXzUqt5kvBuf4CEwXvH AQT1SMJ52rIlDWB7FQFyZeUbOAK2IgY/KNedfK6nsgd/eQVnlofPd2XoddE7kP6iys7jJefw DD3g3rZyDTq7in5dyk5glaNpWZpbHGBs+9SCYLnfQ8XvWqPFOD+gj0plamKANgOvavKTxM7A TQRY2bagAQgA69YtILj8kYxmqPr/M8+MXT7wVoOWVW9lvSmPquCELaDy/NIS7D06VC5EuE/6 JlJXZMTn37NLlyWhzwOgXuXw5w2tyoQQBuvqGiXJijuXwXH7HKdzrc6rpYtAqt5w05hzNrFS KrS0izG64VpWrfproy3BsL+8TBm9brLhhNPynVRqVukbbGzlATTzNQGZ14TTi2/dL6DkMQnM qn4jX9UEe4GdGQBP50bUJSSmeiIkyNLWA+znuN2PZEz930ZwNrF9GtDVw7mzcmpCZ7spldE2 tutbpy9D1bIqxyqBrYDSezyzL2adR1qgHyOTMCHg2AYNkrIQHrSyJxKTpZ1/hqOp8wARAQAB wsBfBBgBAgAJBQJY2bagAhsMAAoJEBRjAa1zdlnghekH/0Yb0iYJ74oID2f/Fj+AJKS2ekQF P2xOr8lpGzgp/+yWUvPtqbX0A33anBJdYwxaAC0NataX3tfZ+oJkzXqfmqhIHMPYHdZesJA2 Bk9hU/33mDl5s5U66/z0uelWzwKVHoQ2O6or4+qF3HJFSJLCe9uvWJ3zXf9F342Ftj73sfx+ 3xkw/IXsN1RqbYqDlzpoEQ99SIEfY/8Jjwnd3sIPfqkuyeaYfe6GJDqKawdCEP1oRRlbXEAp TJgYz8r3nPhGv9cdHNDCk44ISbsqVuxIEnLqi4fTPZaGupiQhT+srl268TTAp2TQW7+6Ce/b NPQorMquzS/LZoyALpmsYi/miMc= In-Reply-To: <169927064380.11195.2245547213925263654@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH v3 1/3] [PoC]avformat: introduce AVStreamGroup 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 11/6/2023 8:37 AM, Anton Khirnov wrote: > Hi, > Quoting James Almer (2023-10-30 16:23:52) >> Signed-off-by: James Almer >> --- >> No changes since last version. I'm resending this for the IAMF demuxer. >> >> I need opinions or reviews for this. We need to get this right from the start >> and i don't want to push something that will afterwards be considered unoptimal > > The API generally looks good to me. > >> diff --git a/libavformat/avformat.h b/libavformat/avformat.h >> index 9e7eca007e..9b2ee7ff14 100644 >> --- a/libavformat/avformat.h >> +++ b/libavformat/avformat.h >> @@ -1018,6 +1018,77 @@ typedef struct AVStream { >> int pts_wrap_bits; >> } AVStream; >> >> +enum AVStreamGroupParamsType { >> + AV_STREAM_GROUP_PARAMS_NONE, >> +}; >> + >> +typedef struct AVStreamGroup { >> + /** >> + * A class for @ref avoptions. Set on group creation. >> + */ >> + const AVClass *av_class; >> + >> + void *priv_data; >> + >> + /** >> + * Group index in AVFormatContext. >> + */ >> + unsigned int index; >> + >> + /** >> + * Group-specific group ID. > > type-specific? > >> + * >> + * decoding: set by libavformat >> + * encoding: set by the user, replaced by libavformat if left unset > > 'may be set' is the terminology we use for optional values > >> + */ >> + int64_t id; >> + >> + /** >> + * Group-specific type > > drop '-specific', I don't see what it adds to the meaning. > >> + * >> + * decoding: set by libavformat on group creation >> + * encoding: set by the user on group creation > > Could just say 'set by avformat_stream_group_create()', the user should > never set it manually. > >> + */ >> + enum AVStreamGroupParamsType type; >> + >> + /** >> + * Group-specific type parameters > > type-specific? > >> + */ >> + union { >> + uintptr_t dummy; // Placeholder >> + } params; >> + >> + /** >> + * Metadata that applies to the whole file. > > s/file/group > >> + * >> + * - demuxing: set by libavformat in avformat_open_input() > > Set on group creation, that does not have to be in > avformat_open_input(). > >> + * - muxing: may be set by the caller before avformat_write_header() >> + * >> + * Freed by libavformat in avformat_free_context(). >> + */ >> + AVDictionary *metadata; >> + >> + /** >> + * Number of elements in AVStreamGroup.streams. >> + * >> + * Set by avformat_stream_group_add_stream() must not be modified by any other code. >> + */ >> + unsigned int nb_streams; >> + >> + /** >> + * A list of streams in the group. New entries are created with >> + * avformat_stream_group_add_stream(). >> + * >> + * - demuxing: entries are created by libavformat in avformat_open_input(). >> + * If AVFMTCTX_NOHEADER is set in ctx_flags, then new entries may also >> + * appear in av_read_frame(). > > We might want to make this type-specific, i.e. some group types are > guaranteed to never change. > >> + * - muxing: entries are created by the user before avformat_write_header(). >> + * >> + * Freed by libavformat in avformat_free_context(). >> + */ >> + const AVStream **streams; > > Is this const useful? I imagine some code might reasonably want to > modify the stream through this pointer. True. Will change. > >> @@ -608,6 +629,18 @@ void ff_free_stream(AVStream **st); >> */ >> void ff_remove_stream(AVFormatContext *s, AVStream *st); >> >> +/** >> + * Frees a stream group without modifying the corresponding AVFormatContext. >> + * Must only be called if the latter doesn't matter or if the stream >> + * is not yet attached to an AVFormatContext. >> + */ >> +void ff_free_stream_group(AVStreamGroup **pstg); > > ff_stream_group_free() > > Also, I'd prefer a dedicated header for this, internal.h is an > abomination. Should i move the AVStream related functions to it too? _______________________________________________ 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".