On Sat, Apr 09, 2011 at 05:03:34PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Sat, Apr 9, 2011 at 8:57 AM, Anton Khirnov <[email protected]> wrote:
> > ---
> >  libavformat/avio.h |   10 +++++-----
> >  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> This mostly looks OK.
> 
> If you (optionally) want to document more:
> 
> >     unsigned long checksum;
> >     unsigned char *checksum_ptr;
> >     unsigned long (*update_checksum)(unsigned long checksum, const uint8_t 
> > *buf, unsigned int size);
> 
> This allows generating or validating a CRC-or-similar-style checksum
> over input / output data. Callers should normally not need to touch
> the function pointer directly, but would rather just use the utility
> functions provided.
> 
> >     int (*read_pause)(void *opaque, int pause);
> >     int64_t (*read_seek)(void *opaque, int stream_index,
> >                          int64_t timestamp, int flags);
> 
> And for these, normally applications would have no business touching
> them directly. If they do, it's likely a bug.
> 

People implementing custom I/O might want to set them. Patch for that
attached.

-- 
Anton Khirnov
From 9d952073909779705ac8736f3abf70ac9d413a69 Mon Sep 17 00:00:00 2001
From: Anton Khirnov <[email protected]>
Date: Sun, 10 Apr 2011 08:14:26 +0200
Subject: [PATCH] avio: add more documentation for AVIOContext.

---
 libavformat/avio.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index 95cad17..0663afe 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -41,6 +41,10 @@
  * Removal, reordering and changes to existing fields require a major
  * version bump.
  * sizeof(AVIOContext) must not be used outside libav*.
+ *
+ * @note None of the function pointers in AVIOContext should be called
+ *       directly, they should only be set by the client application
+ *       when implementing custom I/O.
  */
 typedef struct {
     unsigned char *buffer;  /**< Start of the buffer. */
@@ -67,7 +71,15 @@ typedef struct {
     unsigned char *checksum_ptr;
     unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
     int error;              /**< contains the error code or 0 if no error happened */
+    /**
+     * Pause or resume playback for network streaming protocols - e.g. MMS.
+     */
     int (*read_pause)(void *opaque, int pause);
+    /**
+     * Seek to a given timestamp in stream with the specified stream_index.
+     * Needed for some network streaming protocols which don't support seeking
+     * to byte position.
+     */
     int64_t (*read_seek)(void *opaque, int stream_index,
                          int64_t timestamp, int flags);
     /**
-- 
1.7.4.1

Attachment: signature.asc
Description: Digital signature

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to