[FFmpeg-devel] [PATCH] avcodec_copy_context()

Benoit Fouet benoit.fouet
Tue Mar 30 17:43:28 CEST 2010


On Tue, 30 Mar 2010 16:35:17 +0100 M?ns Rullg?rd wrote:
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> 
> > On date Tuesday 2010-03-30 10:22:26 -0400, Ronald S. Bultje encoded:
> >> Hi,
> >> 
> >> as per $subj. Subsequent patches will use this function.
> >> 
> >> Ronald
> >
> >> Index: ffmpeg-svn/libavcodec/avcodec.h
> >> ===================================================================
> >> --- ffmpeg-svn.orig/libavcodec/avcodec.h	2010-03-29 13:37:31.000000000 -0400
> >> +++ ffmpeg-svn/libavcodec/avcodec.h	2010-03-29 13:37:49.000000000 -0400
> >> @@ -3256,6 +3256,19 @@
> >>  AVCodecContext *avcodec_alloc_context2(enum CodecType);
> >>  /**
> >> + * Copy the settings of the source AVCodecContext into the destination
> >
> > Nit: "Copies" (but I won't fight the Third Person Holy War so do as
> > you prefer).
> >
> >> + * AVCodecContext. The resulting destination codec context will be
> >> + * unopened, i.e. you are required to call avcodec_open() before you
> >> + * can use this AVCodecContext to decode/encode video/audio data.
> >> + *
> >> + * @param dest target codec context, should be initialized with
> >> + *             #avcodec_alloc_context(), but otherwise uninitialized
> >> + * @param src source codec context
> >> + * @returns AVERROR() on error (e.g. memory allocation error), 0 on success.
> 
> @return
> 
> The war rages on, but this particular battle you cannot win.
> 

I was about to do the same remark, but did a grep before:

./libavutil/mathematics.h:90: * @returns -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
./libavformat/avio.h:379: * @returns number of bytes read or AVERROR
./libavformat/avio.h:387: * @returns number of bytes read or AVERROR
./libavformat/nutdec.c:139: * @returns the position of the startcode or -1 if not found
./libavformat/rtsp.c:1083: * @returns 0 on success, <0 on error, 1 if protocol is unavailable.
./libavformat/avformat.h:1006: * @returns >=0 on success, error code otherwise
./libavformat/asfdec.c:641: * @returns 0 on success, <0 on error
./libavformat/asfdec.c:804: * @returns 0 if data was stored in pkt, <0 on error or 1 if more ASF
./libavformat/rm.h:88: * @returns the number of samples left for subsequent calls to this same
./libavformat/rtsp.h:407: * @returns 1 if a data packets is ready to be received, -1 on error,
./libavformat/rtsp.h:425: * @returns 0 on success, < 0 on error. Cleans up all allocations done
./libavcodec/h264enc.c:34: * @returns pointer to current position in the output buffer or NULL if an error occurred
./libavcodec/h264_cabac.c:1184: * @returns 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
./libavcodec/h264.h:626: * @returns decoded bytes, might be src+1 if no escapes
./libavcodec/h264.h:688: * @returns 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
./libavcodec/h264.h:694: * @returns 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
./libavcodec/h264.h:1168: * @returns non zero if the loop filter can be skiped
./libavcodec/parser.c:247: * @returns -1 if no complete frame could be created, AVERROR(ENOMEM) if there was a memory allocation error
./libavcodec/mpeg4videodec.c:438: * @returns the average MV for a GMC MB
./libavcodec/cavs.c:575: * @returns 0 if end of frame is reached, 1 otherwise
./libavcodec/wmavoice.c:757: * @returns a (non-)random number in the [0, 1000 - block_size] range.
./libavcodec/wmavoice.c:1190: * @returns -1 if unsupported, 1 on not enough bits or 0 if OK.
./libavcodec/wmavoice.c:1394: * @returns 1 if not enough bits were available, or 0 on success.

now, we're just a sed away from removing them; shall I ?

-- 
Ben



More information about the ffmpeg-devel mailing list