From: "Martin Storsjö" <martin@martin.st>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Steven Liu <lq@chinaffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 2/2] avformat/rtmpproto: support enhanced rtmp
Date: Fri, 25 Aug 2023 12:38:27 +0300 (EEST)
Message-ID: <49a65bba-634c-1afb-6c52-94565bd7cc9@martin.st> (raw)
In-Reply-To: <CADxeRwmzCS-pZ8CoWZDLD0t9VQEY1fBv4ejUbtxqKOphbUw==Q@mail.gmail.com>
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".
next prev parent reply other threads:[~2023-08-25 9:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 5:32 [FFmpeg-devel] [PATCH v1 1/2] avformat/rtmppkt: add ff_amf_write_array for write array strings Steven Liu
2023-08-24 5:32 ` [FFmpeg-devel] [PATCH v1 2/2] avformat/rtmpproto: support enhanced rtmp Steven Liu
2023-08-24 20:10 ` Tristan Matthews
2023-08-24 21:45 ` Marton Balint
2023-08-25 5:30 ` [FFmpeg-devel] [PATCH v2 1/2] avformat/rtmppkt: add ff_amf_write_array for write array strings Steven Liu
2023-08-25 5:30 ` [FFmpeg-devel] [PATCH v2 2/2] avformat/rtmpproto: support enhanced rtmp Steven Liu
2023-08-25 9:04 ` Martin Storsjö
2023-08-25 9:11 ` Steven Liu
2023-08-25 9:38 ` Martin Storsjö [this message]
2023-08-25 10:00 ` Steven Liu
2023-08-25 10:06 ` Martin Storsjö
2023-08-25 10:05 ` [FFmpeg-devel] [PATCH v3 1/2] avformat/rtmppkt: add ff_amf_write_array for write Steven Liu
2023-08-25 10:05 ` [FFmpeg-devel] [PATCH v3 2/2] avformat/rtmpproto: support enhanced rtmp Steven Liu
2023-08-25 10:09 ` Steven Liu
2023-08-26 7:49 ` Marton Balint
2023-08-26 8:28 ` Steven Liu
2023-08-26 9:25 ` Marton Balint
2023-08-28 2:00 ` [FFmpeg-devel] [PATCH v4 1/2] avformat/rtmppkt: add ff_amf_write_array for write Steven Liu
2023-08-28 2:00 ` [FFmpeg-devel] [PATCH v4 2/2] avformat/rtmpproto: support enhanced rtmp Steven Liu
2023-08-28 19:33 ` Marton Balint
2023-08-29 1:06 ` Steven Liu
2023-08-25 5:33 ` [FFmpeg-devel] [PATCH v1 " Steven Liu
2023-08-25 5:32 ` Steven Liu
2023-08-24 20:47 ` [FFmpeg-devel] [PATCH v1 1/2] avformat/rtmppkt: add ff_amf_write_array for write array strings Marton Balint
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49a65bba-634c-1afb-6c52-94565bd7cc9@martin.st \
--to=martin@martin.st \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=lq@chinaffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git