libavformat/oggenc.c File Reference

#include "libavutil/crc.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
#include "libavutil/random_seed.h"
#include "libavcodec/xiph.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/flac.h"
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "vorbiscomment.h"

Go to the source code of this file.

Data Structures

struct  OGGPage
struct  OGGStreamContext
struct  OGGPageList
struct  OGGContext

Defines

#define MAX_PAGE_SIZE   65025
#define SPEEX_HEADER_SIZE   80

Functions

static void ogg_update_checksum (AVFormatContext *s, AVIOContext *pb, int64_t crc_offset)
static int ogg_write_page (AVFormatContext *s, OGGPage *page, int extra_flags)
static int64_t ogg_granule_to_timestamp (OGGStreamContext *oggstream, int64_t granule)
static int ogg_compare_granule (AVFormatContext *s, OGGPage *next, OGGPage *page)
static int ogg_reset_cur_page (OGGStreamContext *oggstream)
static int ogg_buffer_page (AVFormatContext *s, OGGStreamContext *oggstream)
static int ogg_buffer_data (AVFormatContext *s, AVStream *st, uint8_t *data, unsigned size, int64_t granule)
static uint8_t * ogg_write_vorbiscomment (int offset, int bitexact, int *header_len, AVDictionary **m, int framing_bit)
static int ogg_build_flac_headers (AVCodecContext *avctx, OGGStreamContext *oggstream, int bitexact, AVDictionary **m)
static int ogg_build_speex_headers (AVCodecContext *avctx, OGGStreamContext *oggstream, int bitexact, AVDictionary **m)
static int ogg_write_header (AVFormatContext *s)
static void ogg_write_pages (AVFormatContext *s, int flush)
static int ogg_write_packet (AVFormatContext *s, AVPacket *pkt)
static int ogg_write_trailer (AVFormatContext *s)

Variables

static const AVOption options []
static const AVClass ogg_muxer_class
AVOutputFormat ff_ogg_muxer


Define Documentation

#define MAX_PAGE_SIZE   65025

Definition at line 34 of file oggenc.c.

#define SPEEX_HEADER_SIZE   80

Definition at line 307 of file oggenc.c.

Referenced by ogg_build_speex_headers().


Function Documentation

static int ogg_buffer_data ( AVFormatContext s,
AVStream st,
uint8_t *  data,
unsigned  size,
int64_t  granule 
) [static]

Definition at line 192 of file oggenc.c.

Referenced by ogg_write_header(), and ogg_write_packet().

static int ogg_buffer_page ( AVFormatContext s,
OGGStreamContext oggstream 
) [static]

Definition at line 168 of file oggenc.c.

Referenced by ogg_buffer_data(), ogg_write_header(), and ogg_write_trailer().

static int ogg_build_flac_headers ( AVCodecContext avctx,
OGGStreamContext oggstream,
int  bitexact,
AVDictionary **  m 
) [static]

Definition at line 269 of file oggenc.c.

Referenced by ogg_write_header().

static int ogg_build_speex_headers ( AVCodecContext avctx,
OGGStreamContext oggstream,
int  bitexact,
AVDictionary **  m 
) [static]

Definition at line 309 of file oggenc.c.

Referenced by ogg_write_header().

static int ogg_compare_granule ( AVFormatContext s,
OGGPage next,
OGGPage page 
) [static]

Definition at line 143 of file oggenc.c.

Referenced by ogg_buffer_page().

static int64_t ogg_granule_to_timestamp ( OGGStreamContext oggstream,
int64_t  granule 
) [static]

Definition at line 134 of file oggenc.c.

Referenced by ogg_buffer_data(), and ogg_compare_granule().

static int ogg_reset_cur_page ( OGGStreamContext oggstream  )  [static]

Definition at line 159 of file oggenc.c.

Referenced by ogg_buffer_page().

static void ogg_update_checksum ( AVFormatContext s,
AVIOContext pb,
int64_t  crc_offset 
) [static]

Definition at line 87 of file oggenc.c.

Referenced by ogg_write_page().

static int ogg_write_header ( AVFormatContext s  )  [static]

KFGSHIFT is the width of the less significant section of the granule position The less significant section is the frame count since the last keyframe

Definition at line 336 of file oggenc.c.

static int ogg_write_packet ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 471 of file oggenc.c.

static int ogg_write_page ( AVFormatContext s,
OGGPage page,
int  extra_flags 
) [static]

Definition at line 96 of file oggenc.c.

Referenced by ogg_write_pages().

static void ogg_write_pages ( AVFormatContext s,
int  flush 
) [static]

Definition at line 449 of file oggenc.c.

Referenced by ogg_write_packet(), and ogg_write_trailer().

static int ogg_write_trailer ( AVFormatContext s  )  [static]

Definition at line 504 of file oggenc.c.

static uint8_t* ogg_write_vorbiscomment ( int  offset,
int  bitexact,
int *  header_len,
AVDictionary **  m,
int  framing_bit 
) [static]

Definition at line 244 of file oggenc.c.

Referenced by ogg_build_flac_headers(), ogg_build_speex_headers(), and ogg_write_header().


Variable Documentation

Initial value:

 {
    .name              = "ogg",
    .long_name         = NULL_IF_CONFIG_SMALL("Ogg"),
    .mime_type         = "application/ogg",
    .extensions        = "ogg,ogv,spx",
    .priv_data_size    = sizeof(OGGContext),
    .audio_codec       = CODEC_ID_FLAC,
    .video_codec       = CODEC_ID_THEORA,
    .write_header      = ogg_write_header,
    .write_packet      = ogg_write_packet,
    .write_trailer     = ogg_write_trailer,
    .priv_class = &ogg_muxer_class,
}

Definition at line 529 of file oggenc.c.

const AVClass ogg_muxer_class [static]

Initial value:

Definition at line 79 of file oggenc.c.

const AVOption options[] [static]

Initial value:

 {
    { "oggpagesize", "Set preferred Ogg page size.",
      0x42, AV_OPT_TYPE_INT, {.dbl = 0}, 0, MAX_PAGE_SIZE, AV_OPT_FLAG_ENCODING_PARAM},
    { NULL },
}

Definition at line 73 of file oggenc.c.


Generated on Fri Oct 26 02:43:52 2012 for FFmpeg by  doxygen 1.5.8