[FFmpeg-devel] [PATCH 01/10] lavu: add av_fourcc_make_string() and av_4cc2str()

Clément Bœsch u at pkh.me
Wed Mar 29 10:56:14 EEST 2017


On Wed, Mar 29, 2017 at 09:52:51AM +0200, Carl Eugen Hoyos wrote:
> 2017-03-29 9:43 GMT+02:00 Clément Bœsch <u at pkh.me>:
> > On Wed, Mar 29, 2017 at 09:31:57AM +0200, Carl Eugen Hoyos wrote:
> >> 2017-03-28 17:31 GMT+02:00 Clément Bœsch <u at pkh.me>:
> >> > On Mon, Mar 27, 2017 at 09:51:54AM +0200, Clément Bœsch wrote:
> >> >> ---
> >> >>  doc/APIchanges      |  4 ++++
> >> >>  libavutil/avutil.h  | 14 ++++++++++++++
> >> >>  libavutil/utils.c   | 21 +++++++++++++++++++++
> >> >>  libavutil/version.h |  2 +-
> >> >>  4 files changed, 40 insertions(+), 1 deletion(-)
> >> >>
> >> >
> >> > I'll start pushing that patchset tomorrow if I see no objection.
> >>
> >> > +#define av_4cc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
> >>
> >> Sorry, I really don't understand:
> >> If the preferred name for this function is "av_4cc2str", why not name
> >> it av_4cc2str()?
> >>
> >
> > I don't understand your question: are you asking why there is a macro
> > and a function with different names?
> 
> Yes, why is a function with the preferred name not sufficient?
> 

Because we save the user the need to create a buffer thanks the compound
literal in the macro which can only exist in a macro. It's exactly like
av_ts2str().

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170329/65e31632/attachment.sig>


More information about the ffmpeg-devel mailing list