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 9F89047475 for ; Thu, 9 Nov 2023 12:01:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B503E68CB6E; Thu, 9 Nov 2023 14:01:01 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA27168C5FF for ; Thu, 9 Nov 2023 14:00:54 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id A9FFA2404B1 for ; Thu, 9 Nov 2023 13:00:54 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Cfa0G34De0tj for ; Thu, 9 Nov 2023 13:00:54 +0100 (CET) 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 0ECD224043D for ; Thu, 9 Nov 2023 13:00:54 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id E12DA1601B9; Thu, 9 Nov 2023 13:00:53 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <5ff31151-4ec7-48ab-9cc8-5cbe81bb4cbd@gmail.com> References: <20231104092125.10213-1-anton@khirnov.net> <20231104092125.10213-15-anton@khirnov.net> <169953006589.11195.2105026997611442764@lain.khirnov.net> <5ff31151-4ec7-48ab-9cc8-5cbe81bb4cbd@gmail.com> Mail-Followup-To: FFmpeg development discussions and patches Date: Thu, 09 Nov 2023 13:00:53 +0100 Message-ID: <169953125389.11195.8813053849129946619@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 14/24] fftools/ffmpeg_mux: move bitstream filtering to the muxer thread 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-11-09 12:47:56) > On 11/9/2023 8:41 AM, Anton Khirnov wrote: > > Quoting James Almer (2023-11-04 14:39:44) > >> On 11/4/2023 4:56 AM, Anton Khirnov wrote: > >>> This will be the appropriate place for it after the rest of transcoding > >>> is switched to a threaded architecture. > >>> --- > >>> fftools/ffmpeg_mux.c | 112 ++++++++++++++++++++++++++----------------- > >>> 1 file changed, 67 insertions(+), 45 deletions(-) > >>> > >>> diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c > >>> index 82352b7981..57fb8a8413 100644 > >>> --- a/fftools/ffmpeg_mux.c > >>> +++ b/fftools/ffmpeg_mux.c > >>> @@ -207,6 +207,67 @@ static int sync_queue_process(Muxer *mux, OutputStream *ost, AVPacket *pkt, int > >>> return 0; > >>> } > >>> > >>> +/* apply the output bitstream filters */ > >>> +static int mux_packet_filter(Muxer *mux, OutputStream *ost, > >>> + AVPacket *pkt, int *stream_eof) > >>> +{ > >>> + MuxStream *ms = ms_from_ost(ost); > >>> + const char *err_msg; > >>> + int ret = 0; > >>> + > >>> + if (ms->bsf_ctx) { > >>> + int bsf_eof = 0; > >>> + > >>> + if (pkt) > >>> + av_packet_rescale_ts(pkt, pkt->time_base, ms->bsf_ctx->time_base_in); > >>> + > >>> + ret = av_bsf_send_packet(ms->bsf_ctx, pkt); > >>> + if (ret < 0) { > >> > >> Unrelated to this patch, but this should probably include a comment > >> about the reason we're not checking for EAGAIN, like we do for > >> avcodec_send_packet(). > > > > Isn't the situation pretty much the same here - seeing EAGAIN would be a > > bug? > > Yes, and a similar comment here is a good idea as people may use > ffmpeg.c as a reference implementation for our APIs. Right, then certainly there should be a comment or maybe even a check like for decoding. -- 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".