[FFmpeg-devel] [PATCH] Introduce avio_wtag.

Baptiste Coudurier baptiste.coudurier
Fri Mar 4 22:12:20 CET 2011

On 3/4/11 3:43 AM, M?ns Rullg?rd wrote:
> "Ronald S. Bultje" <rsbultje at gmail.com> writes:
>> Hi,
>> On Thu, Mar 3, 2011 at 10:28 PM, Baptiste Coudurier
>> <baptiste.coudurier at gmail.com> wrote:
>>> ---
>>>  libavformat/avio.h    |    1 +
>>>  libavformat/aviobuf.c |    9 +++++++--
>>>  2 files changed, 8 insertions(+), 2 deletions(-)
>> <nag> It's unused. </nag>
>> Now on a more serious note, I was OK with removing it because it's
>> slow, unoptimized, duplicates functionality of existing functions in a
>> poorly implemented way and so on.

IMHO it's not poorly implemented, it's simple.
It may be slow, but this function was used for short strings, and it is
was used in muxers, where speed does not matter as much as in encoders,
and where convenience is more importance for developers.

Besides, ffio_wfourcc is is poorly implemented as well, instead of using
av_wl32 it should use avio_write(pb, str, 4), which is faster.

>> For the readability of 99% of the cases, we added ffio_wfourcc(). 

I think put_tag("name") is more readable, now ffio_wtag is fine with me.

>> For the rest, avio_write() is sufficient because the string is always
>> fixed-length. What is the (real, not theoretical) case where
>> avio_wtag() does something that we don't already have in the
>> before-mentioned functions?
> It would be nice to get rid of the "foo", sizeof("foo") pairs, perhaps
> with a macro.

Yes, although some cases cannot use sizeof.

>> Besides, should probably be private, so ffio instead of avio prefix,
>> and I doubt that "wtag" is a good function name, but then again as
>> long as it's private that's not so much of an issue.
> The word tag is used way too much.

I don't think so, but if you have another suggestion, please tell me.
I prefer using tag than fourcc in the muxer context, fourcc has too much
of a "codec identifier" signification.

Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list