Data Structures | Defines | Functions

libavcodec/bytestream.h File Reference

#include <string.h>
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"

Go to the source code of this file.

Data Structures

struct  GetByteContext

Defines

#define DEF_T(type, name, bytes, read, write)
#define DEF(name, bytes, read, write)   DEF_T(unsigned int, name, bytes, read, write)
#define DEF64(name, bytes, read, write)   DEF_T(uint64_t, name, bytes, read, write)

Functions

static unsigned int bytestream_get_le32 (const uint8_t **b)
static void bytestream_put_le32 (uint8_t **b, const unsigned int value)
static unsigned int bytestream2_get_le32 (GetByteContext *g)
static unsigned int bytestream2_peek_le32 (GetByteContext *g)
static unsigned int bytestream_get_le24 (const uint8_t **b)
static void bytestream_put_le24 (uint8_t **b, const unsigned int value)
static unsigned int bytestream2_get_le24 (GetByteContext *g)
static unsigned int bytestream2_peek_le24 (GetByteContext *g)
static unsigned int bytestream_get_le16 (const uint8_t **b)
static void bytestream_put_le16 (uint8_t **b, const unsigned int value)
static unsigned int bytestream2_get_le16 (GetByteContext *g)
static unsigned int bytestream2_peek_le16 (GetByteContext *g)
 DEF64 (be64, 8, AV_RB64, AV_WB64) static inline unsigned int bytestream_get_be32(const uint8_t **b)
static void bytestream_put_be32 (uint8_t **b, const unsigned int value)
static unsigned int bytestream2_get_be32 (GetByteContext *g)
static unsigned int bytestream2_peek_be32 (GetByteContext *g)
static unsigned int bytestream_get_be24 (const uint8_t **b)
static void bytestream_put_be24 (uint8_t **b, const unsigned int value)
static unsigned int bytestream2_get_be24 (GetByteContext *g)
static unsigned int bytestream2_peek_be24 (GetByteContext *g)
static unsigned int bytestream_get_be16 (const uint8_t **b)
static void bytestream_put_be16 (uint8_t **b, const unsigned int value)
static unsigned int bytestream2_get_be16 (GetByteContext *g)
static unsigned int bytestream2_peek_be16 (GetByteContext *g)
static unsigned int bytestream_get_byte (const uint8_t **b)
static void bytestream_put_byte (uint8_t **b, const unsigned int value)
static unsigned int bytestream2_get_byte (GetByteContext *g)
static unsigned int bytestream2_peek_byte (GetByteContext *g)
static av_always_inline void bytestream2_init (GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline
unsigned int 
bytestream2_get_bytes_left (GetByteContext *g)
static av_always_inline void bytestream2_skip (GetByteContext *g, unsigned int size)
static av_always_inline
unsigned int 
bytestream2_get_buffer (GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline
unsigned int 
bytestream_get_buffer (const uint8_t **b, uint8_t *dst, unsigned int size)
static av_always_inline void bytestream_put_buffer (uint8_t **b, const uint8_t *src, unsigned int size)

Define Documentation

#define DEF (   name,
  bytes,
  read,
  write 
)    DEF_T(unsigned int, name, bytes, read, write)

Definition at line 55 of file bytestream.h.

#define DEF64 (   name,
  bytes,
  read,
  write 
)    DEF_T(uint64_t, name, bytes, read, write)

Definition at line 57 of file bytestream.h.

#define DEF_T (   type,
  name,
  bytes,
  read,
  write 
)
Value:
static av_always_inline type bytestream_get_ ## name(const uint8_t **b){\
    (*b) += bytes;\
    return read(*b - bytes);\
}\
static av_always_inline void bytestream_put_ ##name(uint8_t **b, const type value){\
    write(*b, value);\
    (*b) += bytes;\
}\
static av_always_inline type bytestream2_get_ ## name(GetByteContext *g)\
{\
    if (g->buffer_end - g->buffer < bytes)\
        return 0;\
    return bytestream_get_ ## name(&g->buffer);\
}\
static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g)\
{\
    if (g->buffer_end - g->buffer < bytes)\
        return 0;\
    return read(g->buffer);\
}

Definition at line 33 of file bytestream.h.


Function Documentation

static unsigned int bytestream2_get_be16 ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static unsigned int bytestream2_get_be24 ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static unsigned int bytestream2_get_be32 ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static av_always_inline unsigned int bytestream2_get_buffer ( GetByteContext g,
uint8_t *  dst,
unsigned int  size 
) [static]

Definition at line 84 of file bytestream.h.

static unsigned int bytestream2_get_byte ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static av_always_inline unsigned int bytestream2_get_bytes_left ( GetByteContext g  )  [static]

Definition at line 73 of file bytestream.h.

static unsigned int bytestream2_get_le16 ( GetByteContext g  )  [inline, static]

Definition at line 61 of file bytestream.h.

static unsigned int bytestream2_get_le24 ( GetByteContext g  )  [inline, static]

Definition at line 61 of file bytestream.h.

static unsigned int bytestream2_get_le32 ( GetByteContext g  )  [inline, static]

Definition at line 61 of file bytestream.h.

static av_always_inline void bytestream2_init ( GetByteContext g,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 66 of file bytestream.h.

static unsigned int bytestream2_peek_be16 ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static unsigned int bytestream2_peek_be24 ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static unsigned int bytestream2_peek_be32 ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static unsigned int bytestream2_peek_byte ( GetByteContext g  )  [inline, static]

Definition at line 62 of file bytestream.h.

static unsigned int bytestream2_peek_le16 ( GetByteContext g  )  [inline, static]

Definition at line 61 of file bytestream.h.

static unsigned int bytestream2_peek_le24 ( GetByteContext g  )  [inline, static]

Definition at line 61 of file bytestream.h.

static unsigned int bytestream2_peek_le32 ( GetByteContext g  )  [inline, static]

Definition at line 61 of file bytestream.h.

static av_always_inline void bytestream2_skip ( GetByteContext g,
unsigned int  size 
) [static]

Definition at line 78 of file bytestream.h.

static unsigned int bytestream_get_be16 ( const uint8_t **  b  )  [inline, static]
static unsigned int bytestream_get_be24 ( const uint8_t **  b  )  [inline, static]
static av_always_inline unsigned int bytestream_get_buffer ( const uint8_t **  b,
uint8_t *  dst,
unsigned int  size 
) [static]
static unsigned int bytestream_get_byte ( const uint8_t **  b  )  [inline, static]
static unsigned int bytestream_get_le16 ( const uint8_t **  b  )  [inline, static]
static unsigned int bytestream_get_le24 ( const uint8_t **  b  )  [inline, static]

Definition at line 61 of file bytestream.h.

Referenced by bmp_decode_frame(), and cinvideo_decode_frame().

static unsigned int bytestream_get_le32 ( const uint8_t **  b  )  [inline, static]
static void bytestream_put_be16 ( uint8_t **  b,
const unsigned int  value 
) [inline, static]
static void bytestream_put_be24 ( uint8_t **  b,
const unsigned int  value 
) [inline, static]
static void bytestream_put_be32 ( uint8_t **  b,
const unsigned int  value 
) [inline, static]

Definition at line 62 of file bytestream.h.

Referenced by encode_frame(), mjpega_dump_header(), and png_write_chunk().

static av_always_inline void bytestream_put_buffer ( uint8_t **  b,
const uint8_t *  src,
unsigned int  size 
) [static]
static void bytestream_put_byte ( uint8_t **  b,
const unsigned int  value 
) [inline, static]
static void bytestream_put_le16 ( uint8_t **  b,
const unsigned int  value 
) [inline, static]
static void bytestream_put_le24 ( uint8_t **  b,
const unsigned int  value 
) [inline, static]

Definition at line 61 of file bytestream.h.

Referenced by mxf_get_d10_aes3_packet().

static void bytestream_put_le32 ( uint8_t **  b,
const unsigned int  value 
) [inline, static]
DEF64 ( be64  ,
,
AV_RB64  ,
AV_WB64   
) const

Definition at line 61 of file bytestream.h.