[PATCH] Document url_fdopen()
As in subject. -- FFmpeg = Fast and Fundamentalist Minimalistic Philosophical Elastic Ghost
On date Sunday 2009-05-24 18:09:17 +0200, Stefano Sabatini encoded:
As in subject.
Updated. -- FFmpeg = Foolish and Faithless Mastodontic Philosofic Evangelical Gospel
On date Saturday 2010-01-23 18:35:55 +0100, Stefano Sabatini encoded:
On date Sunday 2009-05-24 18:09:17 +0200, Stefano Sabatini encoded:
As in subject.
Updated. -- FFmpeg = Foolish and Faithless Mastodontic Philosofic Evangelical Gospel
Index: ffmpeg/libavformat/avio.h =================================================================== --- ffmpeg.orig/libavformat/avio.h 2010-01-23 18:32:51.000000000 +0100 +++ ffmpeg/libavformat/avio.h 2010-01-23 18:35:03.000000000 +0100 @@ -358,8 +358,17 @@ return s->is_streamed; }
-/** @note when opened as read/write, the buffers are only used for - writing */ +/** + * Creates and initializes a ByteIOContext for accessing to the + * resource accessed by the url context h. + * @note When opened as read/write, the buffers are only used for + * writing. + * + * @param s pointer to the location where, in case of success, the + * function puts the pointer to the created ByteIOContext + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ int url_fdopen(ByteIOContext **s, URLContext *h);
/** @warning must be called before any I/O */
Ping. -- FFmpeg = Free and Fascinating Multimedia Programmable Evangelical Game
On Sat, Jan 30, 2010 at 01:24:17PM +0100, Stefano Sabatini wrote:
On date Saturday 2010-01-23 18:35:55 +0100, Stefano Sabatini encoded:
On date Sunday 2009-05-24 18:09:17 +0200, Stefano Sabatini encoded:
As in subject.
Updated. -- FFmpeg = Foolish and Faithless Mastodontic Philosofic Evangelical Gospel
Index: ffmpeg/libavformat/avio.h =================================================================== --- ffmpeg.orig/libavformat/avio.h 2010-01-23 18:32:51.000000000 +0100 +++ ffmpeg/libavformat/avio.h 2010-01-23 18:35:03.000000000 +0100 @@ -358,8 +358,17 @@ return s->is_streamed; }
-/** @note when opened as read/write, the buffers are only used for - writing */ +/** + * Creates and initializes a ByteIOContext for accessing to the + * resource accessed by the url context h. + * @note When opened as read/write, the buffers are only used for + * writing. + * + * @param s pointer to the location where, in case of success, the + * function puts the pointer to the created ByteIOContext + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ int url_fdopen(ByteIOContext **s, URLContext *h);
/** @warning must be called before any I/O */
Ping.
If someone else wants to review / crosscheck these against the code / make sure that it docs intended api and not implemetation details thats welcome [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus
On Sat, Jan 30, 2010 at 01:24:17PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing to the + * resource accessed by the url context h.
"accessing to" is not proper grammar. The second "accessed" IMO is confusing. Maybe "referenced"? Or maybe "Creates a ByteIOContext wrapping the URLContext h"?
+ * @note When opened as read/write, the buffers are only used for + * writing.
Which buffers? In how for is that relevant to someone using that function, what difference does it make?
+ * @param s pointer to the location where, in case of success, the + * function puts the pointer to the created ByteIOContext
Either explain what happens in case of non-success or just don't mention it. Really the only interesting things for a user are a) do you have to free that thing when the call fails? b) do I have to check the return value or is checking this for != NULL enough?
On date Saturday 2010-01-30 15:50:35 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 01:24:17PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing to the + * resource accessed by the url context h.
"accessing to" is not proper grammar.
Fixed.
The second "accessed" IMO is confusing. Maybe "referenced"? Or maybe "Creates a ByteIOContext wrapping the URLContext h"?
Yes I used "referenced", as I believe the expression "wrapping the URLContext h" is too vague.
+ * @note When opened as read/write, the buffers are only used for + * writing.
Which buffers? In how for is that relevant to someone using that function, what difference does it make?
+ * @param s pointer to the location where, in case of success, the + * function puts the pointer to the created ByteIOContext
Either explain what happens in case of non-success or just don't mention it. Really the only interesting things for a user are a) do you have to free that thing when the call fails? b) do I have to check the return value or is checking this for != NULL enough?
Please check again. Thanks for the review, regards. -- FFmpeg = Fundamentalist and Fundamentalist Multimedia Ponderous Excellent Gospel
On Sat, Jan 30, 2010 at 09:08:55PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing the + * resource referenced by the URLContext h. + * In case of success puts the pointer to the created ByteIOContext in + * *s, otherwise sets *s to NULL.
Maybe make that paragraph into an @param s
+ * @note When the URLContext h has been opened in read+write mode, the + * ByteIOContext can be used only for writing.
Ah, now it makes sense :-)
+ * @return 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure
Seems a bit verbose, but I have no really good suggestion. Looks ok to me otherwise.
On date Saturday 2010-01-30 21:28:53 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 09:08:55PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing the + * resource referenced by the URLContext h. + * In case of success puts the pointer to the created ByteIOContext in + * *s, otherwise sets *s to NULL.
Maybe make that paragraph into an @param s
Turning this into a description it would be: @param s pointer to the location where, in case of success, the function puts the pointer to the created ByteIOContext; in case of failure *s is set to NULL. Maybe you can reword that and make it more clear, but this is a case where it looks more direct and clear just to say what the function *does* with it, rather than saying *what* it is.
+ * @note When the URLContext h has been opened in read+write mode, the + * ByteIOContext can be used only for writing.
Ah, now it makes sense :-)
+ * @return 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure
Seems a bit verbose, but I have no really good suggestion. Looks ok to me otherwise.
Regards. -- FFmpeg = Friendly & Fantastic Mastodontic Patchable Ephemeral Guru
On Sat, Jan 30, 2010 at 10:32:50PM +0100, Stefano Sabatini wrote:
On date Saturday 2010-01-30 21:28:53 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 09:08:55PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing the + * resource referenced by the URLContext h. + * In case of success puts the pointer to the created ByteIOContext in + * *s, otherwise sets *s to NULL.
Maybe make that paragraph into an @param s
Turning this into a description it would be:
@param s pointer to the location where, in case of success, the function puts the pointer to the created ByteIOContext; in case of failure *s is set to NULL.
@param s used to return the pointer to the created ByteIOContext; set to NULL in case of an error (return value < 0).
On date Saturday 2010-01-30 22:43:46 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 10:32:50PM +0100, Stefano Sabatini wrote:
On date Saturday 2010-01-30 21:28:53 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 09:08:55PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing the + * resource referenced by the URLContext h. + * In case of success puts the pointer to the created ByteIOContext in + * *s, otherwise sets *s to NULL.
Maybe make that paragraph into an @param s
Turning this into a description it would be:
@param s pointer to the location where, in case of success, the function puts the pointer to the created ByteIOContext; in case of failure *s is set to NULL.
@param s used to return the pointer to the created ByteIOContext; set to NULL in case of an error (return value < 0).
I don't like the second part, "set to NULL" may be confusing, it is *s which is set to NULL), so that should be: @param s used to return the pointer to the created ByteIOContext; the pointed to value is set to NULL in case of an error which is slightly more verbose and which I found slightly less clear. Attaching another variant, I have a slight preference for the previous one though. Regards. -- FFmpeg = Frenzy and Furious Mythic Power Exploitable Guru
On date Saturday 2010-01-30 23:17:10 +0100, Stefano Sabatini encoded:
On date Saturday 2010-01-30 22:43:46 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 10:32:50PM +0100, Stefano Sabatini wrote:
On date Saturday 2010-01-30 21:28:53 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 09:08:55PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing the + * resource referenced by the URLContext h. + * In case of success puts the pointer to the created ByteIOContext in + * *s, otherwise sets *s to NULL.
Maybe make that paragraph into an @param s
Turning this into a description it would be:
@param s pointer to the location where, in case of success, the function puts the pointer to the created ByteIOContext; in case of failure *s is set to NULL.
@param s used to return the pointer to the created ByteIOContext; set to NULL in case of an error (return value < 0).
I don't like the second part, "set to NULL" may be confusing, it is *s which is set to NULL), so that should be:
@param s used to return the pointer to the created ByteIOContext; the pointed to value is set to NULL in case of an error
which is slightly more verbose and which I found slightly less clear.
Attaching another variant, I have a slight preference for the previous one though.
Ping, this or the previous variant is OK for me. Regards. -- FFmpeg = Fucking & Freak Merciful Pitiless Encoding/decoding God
On date Monday 2010-02-01 19:49:04 +0100, Stefano Sabatini encoded:
On date Saturday 2010-01-30 23:17:10 +0100, Stefano Sabatini encoded:
On date Saturday 2010-01-30 22:43:46 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 10:32:50PM +0100, Stefano Sabatini wrote:
On date Saturday 2010-01-30 21:28:53 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 09:08:55PM +0100, Stefano Sabatini wrote:
+/** + * Creates and initializes a ByteIOContext for accessing the + * resource referenced by the URLContext h. + * In case of success puts the pointer to the created ByteIOContext in + * *s, otherwise sets *s to NULL.
Maybe make that paragraph into an @param s
Turning this into a description it would be:
@param s pointer to the location where, in case of success, the function puts the pointer to the created ByteIOContext; in case of failure *s is set to NULL.
@param s used to return the pointer to the created ByteIOContext; set to NULL in case of an error (return value < 0).
I don't like the second part, "set to NULL" may be confusing, it is *s which is set to NULL), so that should be:
@param s used to return the pointer to the created ByteIOContext; the pointed to value is set to NULL in case of an error
which is slightly more verbose and which I found slightly less clear.
Attaching another variant, I have a slight preference for the previous one though.
Ping, this or the previous variant is OK for me.
If no one will step against I'll commit one of the variant in three days. Regards. -- FFmpeg = Friendly and Fascinating Magical Plastic Eretic Guru
On date Wednesday 2010-02-03 00:34:16 +0100, Stefano Sabatini encoded:
On date Monday 2010-02-01 19:49:04 +0100, Stefano Sabatini encoded:
On date Saturday 2010-01-30 23:17:10 +0100, Stefano Sabatini encoded:
On date Saturday 2010-01-30 22:43:46 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 10:32:50PM +0100, Stefano Sabatini wrote:
On date Saturday 2010-01-30 21:28:53 +0100, Reimar D?ffinger encoded:
On Sat, Jan 30, 2010 at 09:08:55PM +0100, Stefano Sabatini wrote: > +/** > + * Creates and initializes a ByteIOContext for accessing the > + * resource referenced by the URLContext h. > + * In case of success puts the pointer to the created ByteIOContext in > + * *s, otherwise sets *s to NULL.
Maybe make that paragraph into an @param s
Turning this into a description it would be:
@param s pointer to the location where, in case of success, the function puts the pointer to the created ByteIOContext; in case of failure *s is set to NULL.
@param s used to return the pointer to the created ByteIOContext; set to NULL in case of an error (return value < 0).
I don't like the second part, "set to NULL" may be confusing, it is *s which is set to NULL), so that should be:
@param s used to return the pointer to the created ByteIOContext; the pointed to value is set to NULL in case of an error
which is slightly more verbose and which I found slightly less clear.
Attaching another variant, I have a slight preference for the previous one though.
Ping, this or the previous variant is OK for me.
If no one will step against I'll commit one of the variant in three days.
Applied. -- FFmpeg = Funny and Faithless Martial Practical Encoding/decoding Guru
participants (3)
-
michaelni@gmx.at -
Reimar.Doeffinger@gmx.de -
stefano.sabatini-lala@poste.it