[Ffmpeg-devel] [PATCH] Move libavformat Doxygen and other comments to avformat.h

Panagiotis Issaris takis
Sat Mar 3 13:33:35 CET 2007


Hi,

Michael Niedermayer schreef:
> On Thu, Mar 01, 2007 at 05:12:46PM +0100, Panagiotis Issaris wrote:
>   
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi,
>>
>> The attached patch moves the libavformat public API comments to
>> avformat.h. The comments are unmodified.
>>
>>     
> [...]
>   
>> +/**
>> + * Print  nice hexa dump of a buffer
>> + * @param f stream for output
>> + * @param buf buffer
>> + * @param size buffer size
>> + */
>>  void av_hex_dump(FILE *f, uint8_t *buf, int size);
>> +
>> +/**
>> + * Print on 'f' a nice dump of a packet
>> + * @param f stream for output
>> + * @param pkt packet to dump
>> + * @param dump_payload true if the payload must be displayed too
>> + */
>>  void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
>>     
>
> these should be changed to av_logish style, (FILE dependancy sucks ...)
> thats of course seperate and independant of this patch
>   
OK, I'll write a patch for this later today.
> [...]
>   
>> +/**
>> + * Return the next frame of a stream.
>> + *
>> + * The returned packet is valid
>> + * until the next av_read_frame() or until av_close_input_file() and
>> + * must be freed with av_free_packet. For video, the packet contains
>> + * exactly one frame. For audio, it contains an integer number of
>> + * frames if each frame has a known fixed size (e.g. PCM or ADPCM
>> + * data). If the audio frames have a variable size (e.g. MPEG audio),
>> + * then it contains one frame.
>> + *
>> + * pkt->pts, pkt->dts and pkt->duration are always set to correct
>> + * values in AV_TIME_BASE unit (and guessed if the format cannot
>>     
>
> this is wrong, they are in AVStream.timebase units
>   
So a simple change like this would be correct?

+ * pkt->pts, pkt->dts and pkt->duration are always set to correct
+ * values in AVStream.timebase units (and guessed if the format cannot

> [...]
>   
>> +/**
>> + * Converts frame rate from string to a fraction.
>> + *
>> + * First we try to get an exact integer or fractional frame rate.
>> + * If this fails we convert the frame rate to a double and return
>> + * an approximate fraction using the DEFAULT_FRAME_RATE_BASE.
>>     
>
> this is wrong, furthermore i would even say we shouldnt document how its
> done exactly as this can change (it did already since this was written)
>   
Indeed, I fully agree, implementation details should not leak out to the 
API.
> patch looks ok besides these, apply it (and then in a seperate commit
> fix the 2 comments above that keeps svn log easy to review as the move
> can be ignored ...)
>
> [...]
>   
Excellent. Applied the documentation moving patch and a patch correcting 
the
wrong docs is attached.

 avformat.h |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

With friendly regards,
Takis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070303T133043-ffmpeg-avformat_dox_fixes.diff
Type: text/x-patch
Size: 977 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070303/6ebcdd90/attachment.bin>



More information about the ffmpeg-devel mailing list