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 2ECA347BAF for ; Tue, 3 Oct 2023 15:44:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 26E7668CC2F; Tue, 3 Oct 2023 18:44:00 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C694168CACC for ; Tue, 3 Oct 2023 18:43:53 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 8EC67240490 for ; Tue, 3 Oct 2023 17:43:53 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id a-Rk9D3naNac for ; Tue, 3 Oct 2023 17:43:53 +0200 (CEST) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 228FE240445 for ; Tue, 3 Oct 2023 17:43:53 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 0EDFC1601B9; Tue, 3 Oct 2023 17:43:53 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <40fa74ce-1d31-4f06-9352-436fdd1c2bef@gmail.com> References: <20230906143832.54604-1-jamrial@gmail.com> <169623945333.6638.1744815521200399312@lain.khirnov.net> <40fa74ce-1d31-4f06-9352-436fdd1c2bef@gmail.com> Mail-Followup-To: FFmpeg development discussions and patches Date: Tue, 03 Oct 2023 17:43:53 +0200 Message-ID: <169634783303.6638.10660931052987380956@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] [RFC]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-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: Quoting James Almer (2023-10-02 14:10:11) > > I figured it would be nice to have it for the sake of convenience. For > formats like HEIF, new streams should in theory be created once the > group they will belong to is known. > I have no strong attachment to this function, so it can go if you think > it's superfluous. I expect the use cases for it to be limited and the advantage not that big, so yeah, I'd prefer it dropped. > > > >> + > >> +/** > >> + * Add an already allocated stream to a stream group. > >> + * > >> + * When demuxing, it may be called by the demuxer in read_header(). If the > >> + * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also > >> + * be called in read_packet(). > >> + * > >> + * When muxing, may be called by the user before avformat_write_header() after > >> + * having allocated a new group with avformat_new_stream_group() and stream with > >> + * avformat_new_stream(). > >> + * > >> + * User is required to call avformat_free_context() to clean up the allocation > >> + * by av_stream_group_add_stream(). > >> + * > >> + * @param stg stream group belonging to a media file. > >> + * @param st stream in the media file to add to the group. > >> + * > >> + * @return 0 on success, or a negative AVERROR otherwise. > >> + * @see avformat_new_stream, av_stream_group_new_stream, avformat_new_stream_group. > >> + */ > >> +int av_stream_group_add_stream(AVStreamGroup *stg, const AVStream *st); > > > > It'd be nice to have the streamgroup-related functions consistenly > > namespaced. > > > > E.g. > > * avformat_stream_group_add() > > * avformat_stream_group_add_stream() > > * ff_stream_group_free() > > etc. > > > > alternatively for the first two: > > * avformat_stream_group_create() > > * avformat_stream_group_extend() > > I named avformat_new_stream_group() essentially the same as > avformat_new_stream(), then namespaced the functions that take a > AVStreamGroup as input. > I don't particularly like _extend(), but i guess i could do something like > > AVStreamGroup *avformat_stream_group_create(AVFormatContext *s) > int avformat_stream_group_add_stream(AVStreamGroup *stg, > const AVStream *st); Fine with me. -- Anton Khirnov _______________________________________________ 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".