chromium/third_party/ffmpeg/libavcodec/bytestream.h

/*
 * Bytestream functions
 * copyright (c) 2006 Baptiste Coudurier <[email protected]>
 * Copyright (c) 2012 Aneesh Dogra (lionaneesh) <[email protected]>
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef AVCODEC_BYTESTREAM_H
#define AVCODEC_BYTESTREAM_H

#include <stdint.h>
#include <string.h>

#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"

GetByteContext;

PutByteContext;

#define DEF(type, name, bytes, read, write)

DEF()
DEF()
DEF()
DEF()
DEF()
DEF()
DEF()
DEF()
DEF()

#if AV_HAVE_BIGENDIAN
#define bytestream2_get_ne16
#define bytestream2_get_ne24
#define bytestream2_get_ne32
#define bytestream2_get_ne64
#define bytestream2_get_ne16u
#define bytestream2_get_ne24u
#define bytestream2_get_ne32u
#define bytestream2_get_ne64u
#define bytestream2_put_ne16
#define bytestream2_put_ne24
#define bytestream2_put_ne32
#define bytestream2_put_ne64
#define bytestream2_peek_ne16
#define bytestream2_peek_ne24
#define bytestream2_peek_ne32
#define bytestream2_peek_ne64
#else
#define bytestream2_get_ne16
#define bytestream2_get_ne24
#define bytestream2_get_ne32
#define bytestream2_get_ne64
#define bytestream2_get_ne16u
#define bytestream2_get_ne24u
#define bytestream2_get_ne32u
#define bytestream2_get_ne64u
#define bytestream2_put_ne16
#define bytestream2_put_ne24
#define bytestream2_put_ne32
#define bytestream2_put_ne64
#define bytestream2_peek_ne16
#define bytestream2_peek_ne24
#define bytestream2_peek_ne32
#define bytestream2_peek_ne64
#endif

static av_always_inline void bytestream2_init(GetByteContext *g,
                                              const uint8_t *buf,
                                              int buf_size)
{}

static av_always_inline void bytestream2_init_writer(PutByteContext *p,
                                                     uint8_t *buf,
                                                     int buf_size)
{}

static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
{}

static av_always_inline int bytestream2_get_bytes_left_p(PutByteContext *p)
{}

static av_always_inline void bytestream2_skip(GetByteContext *g,
                                              unsigned int size)
{}

static av_always_inline void bytestream2_skipu(GetByteContext *g,
                                               unsigned int size)
{}

static av_always_inline void bytestream2_skip_p(PutByteContext *p,
                                                unsigned int size)
{}

static av_always_inline int bytestream2_tell(GetByteContext *g)
{}

static av_always_inline int bytestream2_tell_p(PutByteContext *p)
{}

static av_always_inline int bytestream2_size(GetByteContext *g)
{}

static av_always_inline int bytestream2_size_p(PutByteContext *p)
{}

static av_always_inline int bytestream2_seek(GetByteContext *g,
                                             int offset,
                                             int whence)
{}

static av_always_inline int bytestream2_seek_p(PutByteContext *p,
                                               int offset,
                                               int whence)
{}

static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g,
                                                            uint8_t *dst,
                                                            unsigned int size)
{}

static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g,
                                                             uint8_t *dst,
                                                             unsigned int size)
{}

static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p,
                                                            const uint8_t *src,
                                                            unsigned int size)
{}

static av_always_inline unsigned int bytestream2_put_bufferu(PutByteContext *p,
                                                             const uint8_t *src,
                                                             unsigned int size)
{}

static av_always_inline void bytestream2_set_buffer(PutByteContext *p,
                                                    const uint8_t c,
                                                    unsigned int size)
{}

static av_always_inline void bytestream2_set_bufferu(PutByteContext *p,
                                                     const uint8_t c,
                                                     unsigned int size)
{}

static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p)
{}

static av_always_inline unsigned int bytestream2_copy_bufferu(PutByteContext *p,
                                                              GetByteContext *g,
                                                              unsigned int size)
{}

static av_always_inline unsigned int bytestream2_copy_buffer(PutByteContext *p,
                                                             GetByteContext *g,
                                                             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)
{}

#endif /* AVCODEC_BYTESTREAM_H */