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 BE38646FCA for ; Fri, 25 Aug 2023 09:38:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1D2B468C5A9; Fri, 25 Aug 2023 12:38:40 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1177368C279 for ; Fri, 25 Aug 2023 12:38:32 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 37P9cSJc021157-37P9cSJd021157; Fri, 25 Aug 2023 12:38:28 +0300 Received: from foo.martin.st (host-97-144.parnet.fi [77.234.97.144]) by mail9.parnet.fi (Postfix) with ESMTPS id A1BF3A146A; Fri, 25 Aug 2023 12:38:27 +0300 (EEST) Date: Fri, 25 Aug 2023 12:38:27 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: Message-ID: <49a65bba-634c-1afb-6c52-94565bd7cc9@martin.st> References: <776917a5-a1fc-457b-df47-c3d76ecb112b@passwd.hu> <20230825053027.6610-1-lq@chinaffmpeg.org> <20230825053027.6610-2-lq@chinaffmpeg.org> <60982037-99ea-942-76ad-59f1238c631d@martin.st> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH v2 2/2] avformat/rtmpproto: support enhanced rtmp 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 Cc: Steven Liu 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 Fri, 25 Aug 2023, Steven Liu wrote: >> > + list_len = (fourcc_str_len + 1) / 5; >> > + // write the fourCcList field name >> > + ff_amf_write_field_name(&p, "fourCcList"); >> > + >> > + // write the fourcc array length >> > + ff_amf_write_array_start(&p, list_len); >> > + >> > + while(fourcc_data - rt->enhanced_codecs < fourcc_str_len) { >> > + unsigned char fourcc[5]; >> > + switch (AV_RN32(fourcc_data)) { >> > + case MKTAG('h', 'v', 'c', '1'): >> >> This feels a bit convoluted to use AV_RN32 + MKTAG on data that is already >> just a string - just using strncmp(fourcc_data, "hvc1", 4) would work just > I want use strncmp at first, but i think strncmp will slower than > switch uint32_t value, so i chose use uint32_t. or should i use > strncmp? Yes, strncmp will be slower than switching on an uint32_t - but this isn't really performance sensitive code. We do this once only, on startup, on a handful of fourccs. So I believe code clarity is more important than absolute performance here. // Martin _______________________________________________ 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".