From patchwork Mon Mar 8 15:29:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26272 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 961E844AF6D for ; Mon, 8 Mar 2021 17:30:46 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7CB9768A853; Mon, 8 Mar 2021 17:30:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A999B68A8F0 for ; Mon, 8 Mar 2021 17:30:38 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id hs11so21196418ejc.1 for ; Mon, 08 Mar 2021 07:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=yZvK/gFl9/bBfJVIkU0z8rdOLU1woiXu3eyZIlnJQLI=; b=C+AnIAzgouH5vChOo4Z2oFCTIVUjYi+xkhwEjPcmswqF63Jq0ZnPGbjngdasj9lB+D fOHfXzVsRkXbrH8CmdgKdYN3Sm2qrJ3mtBTH/LKHHjDjoVcr7HanTl/ADbHMyPvvsMQ5 E5SKQYX7xWT42mgmKi7NlCV/KZ8yfxtexkUhu2PnyVRG9OmLIPJNTMUwaerLizH5N5VM B2aowpsVRKYu4LoCO0xEf6QgX3GBUpic4W2/T8NKXgPLUKl4rDhqZvyaCHEbydY0K3E3 Z0hRN/EMg3mhcXCkiPFB/5Ar00CZO2FOv4yFNImDlM/1h8teK53h2u/lrj+yH25fD3/z 96jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=yZvK/gFl9/bBfJVIkU0z8rdOLU1woiXu3eyZIlnJQLI=; b=gYAJSV6B2bk8YOZmhHCXRsqjnn/bJaveVJFNF1jm7BWDP3LQw1jeDNr8XZ/fxPTwxH yF6F+HFeMpkaD8msSdYflVNieXgDtSovSKXbCyNe8YGslYpcHT3wkZrX2I/tOdcnHXhn gK51vVMpPCFmI3Jvc/a/L3IPK9pLDz0eZ/OxHzjGh0MmkOyCLgsgYMwiHK87gxvXN/ka cTEAlDYcWGKvfxcZ9Yev0wkIISaMpwPGYeF654aq0k7Kka4+vHr4fxrrlVWEDw78YnmQ XvimMsI64pp8HjcWyLNBkyYhEYdUR2ylFP/LEpUMUc07zJWQjQq4h7aRLPwxgVk+j7Zs lkyA== X-Gm-Message-State: AOAM532HXCXl193JaXlPsHf93fp6SaEtJKSZMkBglhJCS4vLdOQ+4KRP EqxbpH7/Eo2+pG0dCuHBoMc3y7q5gpE= X-Google-Smtp-Source: ABdhPJz526RK3d22n9VmgfaxdYmTZLPENvbm8q56L3NmErKkNRHlq11pxKqTmHBGbqcPrbbMD3pVUw== X-Received: by 2002:a17:906:dbd0:: with SMTP id yc16mr15557383ejb.71.1615217437873; Mon, 08 Mar 2021 07:30:37 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id lk12sm6665296ejb.14.2021.03.08.07.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:30:37 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 8 Mar 2021 16:29:57 +0100 Message-Id: <20210308152957.601419-5-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210308152957.601419-1-andreas.rheinhardt@gmail.com> References: <20210308152957.601419-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avformat/rawenc: Use init instead of write_header function X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" force_one_stream() does not write anything. Signed-off-by: Andreas Rheinhardt --- Is it it actually intended that the mp2 muxer does not use force_one_stream at all? And is it intended that force_one_stream does only check codec_type and not the actual codec? And wouldn't it be better to inform the caller about the fact that the format supports only one stream by adding a new AVOutputFormat.flags? libavformat/rawenc.c | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 32704f9bfd..caec297f4a 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -64,7 +64,7 @@ AVOutputFormat ff_ac3_muxer = { .extensions = "ac3", .audio_codec = AV_CODEC_ID_AC3, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -96,7 +96,7 @@ AVOutputFormat ff_adx_muxer = { .extensions = "adx", .audio_codec = AV_CODEC_ID_ADPCM_ADX, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .write_trailer = adx_write_trailer, .flags = AVFMT_NOTIMESTAMPS, @@ -110,7 +110,7 @@ AVOutputFormat ff_aptx_muxer = { .extensions = "aptx", .audio_codec = AV_CODEC_ID_APTX, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -123,7 +123,7 @@ AVOutputFormat ff_aptx_hd_muxer = { .extensions = "aptxhd", .audio_codec = AV_CODEC_ID_APTX_HD, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -136,7 +136,7 @@ AVOutputFormat ff_avs2_muxer = { .extensions = "avs,avs2", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_AVS2, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -149,7 +149,7 @@ AVOutputFormat ff_cavsvideo_muxer = { .extensions = "cavs", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_CAVS, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -161,7 +161,7 @@ AVOutputFormat ff_codec2raw_muxer = { .long_name = NULL_IF_CONFIG_SMALL("raw codec2 muxer"), .audio_codec = AV_CODEC_ID_CODEC2, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -172,7 +172,7 @@ AVOutputFormat ff_codec2raw_muxer = { AVOutputFormat ff_data_muxer = { .name = "data", .long_name = NULL_IF_CONFIG_SMALL("raw data"), - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -185,7 +185,7 @@ AVOutputFormat ff_dirac_muxer = { .extensions = "drc,vc2", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_DIRAC, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -198,7 +198,7 @@ AVOutputFormat ff_dnxhd_muxer = { .extensions = "dnxhd,dnxhr", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_DNXHD, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -212,7 +212,7 @@ AVOutputFormat ff_dts_muxer = { .extensions = "dts", .audio_codec = AV_CODEC_ID_DTS, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -226,7 +226,7 @@ AVOutputFormat ff_eac3_muxer = { .extensions = "eac3", .audio_codec = AV_CODEC_ID_EAC3, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -240,7 +240,7 @@ AVOutputFormat ff_g722_muxer = { .extensions = "g722", .audio_codec = AV_CODEC_ID_ADPCM_G722, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -254,7 +254,7 @@ AVOutputFormat ff_g723_1_muxer = { .extensions = "tco,rco", .audio_codec = AV_CODEC_ID_G723_1, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -266,7 +266,7 @@ AVOutputFormat ff_g726_muxer = { .long_name = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"), .audio_codec = AV_CODEC_ID_ADPCM_G726, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -278,7 +278,7 @@ AVOutputFormat ff_g726le_muxer = { .long_name = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"), .audio_codec = AV_CODEC_ID_ADPCM_G726LE, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -292,7 +292,7 @@ AVOutputFormat ff_gsm_muxer = { .extensions = "gsm", .audio_codec = AV_CODEC_ID_GSM, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -306,7 +306,7 @@ AVOutputFormat ff_h261_muxer = { .extensions = "h261", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_H261, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -320,7 +320,7 @@ AVOutputFormat ff_h263_muxer = { .extensions = "h263", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_H263, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -342,7 +342,7 @@ AVOutputFormat ff_h264_muxer = { .extensions = "h264,264", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_H264, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .check_bitstream = h264_check_bitstream, .flags = AVFMT_NOTIMESTAMPS, @@ -365,7 +365,7 @@ AVOutputFormat ff_hevc_muxer = { .extensions = "hevc,h265,265", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_HEVC, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .check_bitstream = hevc_check_bitstream, .flags = AVFMT_NOTIMESTAMPS, @@ -379,7 +379,7 @@ AVOutputFormat ff_m4v_muxer = { .extensions = "m4v", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_MPEG4, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -393,7 +393,7 @@ AVOutputFormat ff_mjpeg_muxer = { .extensions = "mjpg,mjpeg", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_MJPEG, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -406,9 +406,9 @@ AVOutputFormat ff_singlejpeg_muxer = { .mime_type = "image/jpeg", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_MJPEG, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, - .write_header = force_one_stream, }; #endif @@ -419,7 +419,7 @@ AVOutputFormat ff_mlp_muxer = { .extensions = "mlp", .audio_codec = AV_CODEC_ID_MLP, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -446,7 +446,7 @@ AVOutputFormat ff_mpeg1video_muxer = { .extensions = "mpg,mpeg,m1v", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_MPEG1VIDEO, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -459,7 +459,7 @@ AVOutputFormat ff_mpeg2video_muxer = { .extensions = "m2v", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_MPEG2VIDEO, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -484,7 +484,7 @@ AVOutputFormat ff_sbc_muxer = { .mime_type = "audio/x-sbc", .extensions = "sbc,msbc", .audio_codec = AV_CODEC_ID_SBC, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -497,7 +497,7 @@ AVOutputFormat ff_truehd_muxer = { .extensions = "thd", .audio_codec = AV_CODEC_ID_TRUEHD, .video_codec = AV_CODEC_ID_NONE, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; @@ -510,7 +510,7 @@ AVOutputFormat ff_vc1_muxer = { .extensions = "vc1", .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_VC1, - .write_header = force_one_stream, + .init = force_one_stream, .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, };