Revision fafa7290

View differences:

libavformat/avio.h
32 32

  
33 33
#include "libavformat/version.h"
34 34

  
35

  
36
#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
37

  
38
/**
39
 * Bytestream IO Context.
40
 * New fields can be added to the end with minor version bumps.
41
 * Removal, reordering and changes to existing fields require a major
42
 * version bump.
43
 * sizeof(AVIOContext) must not be used outside libav*.
44
 */
45
typedef struct {
46
    unsigned char *buffer;
47
    int buffer_size;
48
    unsigned char *buf_ptr, *buf_end;
49
    void *opaque;
50
    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
51
    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
52
    int64_t (*seek)(void *opaque, int64_t offset, int whence);
53
    int64_t pos; /**< position in the file of the current buffer */
54
    int must_flush; /**< true if the next seek should flush */
55
    int eof_reached; /**< true if eof reached */
56
    int write_flag;  /**< true if open for writing */
57
#if FF_API_OLD_AVIO
58
    attribute_deprecated int is_streamed;
59
#endif
60
    int max_packet_size;
61
    unsigned long checksum;
62
    unsigned char *checksum_ptr;
63
    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
64
    int error;         ///< contains the error code or 0 if no error happened
65
    int (*read_pause)(void *opaque, int pause);
66
    int64_t (*read_seek)(void *opaque, int stream_index,
67
                         int64_t timestamp, int flags);
68
    /**
69
     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
70
     */
71
    int seekable;
72
} AVIOContext;
73

  
35 74
/* unbuffered I/O */
36 75

  
37 76
#if FF_API_OLD_AVIO
......
197 236
attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size);
198 237
#endif
199 238

  
200
#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
201

  
202 239
/**
203 240
 * @}
204 241
 */
205 242

  
206
/**
207
 * Bytestream IO Context.
208
 * New fields can be added to the end with minor version bumps.
209
 * Removal, reordering and changes to existing fields require a major
210
 * version bump.
211
 * sizeof(AVIOContext) must not be used outside libav*.
212
 */
213
typedef struct {
214
    unsigned char *buffer;
215
    int buffer_size;
216
    unsigned char *buf_ptr, *buf_end;
217
    void *opaque;
218
    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
219
    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
220
    int64_t (*seek)(void *opaque, int64_t offset, int whence);
221
    int64_t pos; /**< position in the file of the current buffer */
222
    int must_flush; /**< true if the next seek should flush */
223
    int eof_reached; /**< true if eof reached */
224
    int write_flag;  /**< true if open for writing */
225
#if FF_API_OLD_AVIO
226
    attribute_deprecated int is_streamed;
227
#endif
228
    int max_packet_size;
229
    unsigned long checksum;
230
    unsigned char *checksum_ptr;
231
    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
232
    int error;         ///< contains the error code or 0 if no error happened
233
    int (*read_pause)(void *opaque, int pause);
234
    int64_t (*read_seek)(void *opaque, int stream_index,
235
                         int64_t timestamp, int flags);
236
    /**
237
     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
238
     */
239
    int seekable;
240
} AVIOContext;
241

  
242 243
#if FF_API_OLD_AVIO
243 244
typedef attribute_deprecated AVIOContext ByteIOContext;
244 245

  

Also available in: Unified diff