FFmpeg
Data Structures | Functions | Variables
libtheoraenc.c File Reference

Theora encoder using libtheora. More...

#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/pixdesc.h"
#include "libavutil/log.h"
#include "libavutil/base64.h"
#include "avcodec.h"
#include "encode.h"
#include "internal.h"
#include <theora/theoraenc.h>

Go to the source code of this file.

Data Structures

struct  TheoraContext
 

Functions

static int concatenate_packet (unsigned int *offset, AVCodecContext *avc_context, const ogg_packet *packet)
 Concatenate an ogg_packet into the extradata. More...
 
static int get_stats (AVCodecContext *avctx, int eos)
 
static int submit_stats (AVCodecContext *avctx)
 
static av_cold int encode_init (AVCodecContext *avc_context)
 
static int encode_frame (AVCodecContext *avc_context, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
static av_cold int encode_close (AVCodecContext *avc_context)
 

Variables

const AVCodec ff_libtheora_encoder
 AVCodec struct exposed to libavcodec. More...
 

Detailed Description

Theora encoder using libtheora.

Author
Paul Richards paul..nosp@m.rich.nosp@m.ards@.nosp@m.gmai.nosp@m.l.com

A lot of this is copy / paste from other output codecs in libavcodec or pure guesswork (or both).

I have used t_ prefixes on variables which are libtheora types and o_ prefixes on variables which are libogg types.

Definition in file libtheoraenc.c.

Function Documentation

◆ concatenate_packet()

static int concatenate_packet ( unsigned int offset,
AVCodecContext avc_context,
const ogg_packet packet 
)
static

Concatenate an ogg_packet into the extradata.

Definition at line 57 of file libtheoraenc.c.

Referenced by encode_init().

◆ get_stats()

static int get_stats ( AVCodecContext avctx,
int  eos 
)
static

Definition at line 90 of file libtheoraenc.c.

Referenced by encode_frame(), and encode_init().

◆ submit_stats()

static int submit_stats ( AVCodecContext avctx)
static

Definition at line 128 of file libtheoraenc.c.

Referenced by encode_frame(), and encode_init().

◆ encode_init()

static av_cold int encode_init ( AVCodecContext avc_context)
static

Definition at line 165 of file libtheoraenc.c.

◆ encode_frame()

static int encode_frame ( AVCodecContext avc_context,
AVPacket pkt,
const AVFrame frame,
int got_packet 
)
static

Definition at line 276 of file libtheoraenc.c.

◆ encode_close()

static av_cold int encode_close ( AVCodecContext avc_context)
static

Definition at line 357 of file libtheoraenc.c.

Variable Documentation

◆ ff_libtheora_encoder

const AVCodec ff_libtheora_encoder
Initial value:
= {
.name = "libtheora",
.long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"),
.capabilities = AV_CODEC_CAP_DR1 |
.priv_data_size = sizeof(TheoraContext),
.close = encode_close,
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
},
.wrapper_name = "libtheora",
}

AVCodec struct exposed to libavcodec.

Definition at line 370 of file libtheoraenc.c.

encode_close
static av_cold int encode_close(AVCodecContext *avc_context)
Definition: libtheoraenc.c:357
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
init
static int init
Definition: av_tx.c:47
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:296
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
TheoraContext
Definition: libtheoraenc.c:46
encode_frame
static int encode_frame(AVCodecContext *avc_context, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: libtheoraenc.c:276
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_CODEC_ID_THEORA
@ AV_CODEC_ID_THEORA
Definition: codec_id.h:80
encode_init
static av_cold int encode_init(AVCodecContext *avc_context)
Definition: libtheoraenc.c:165
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:82
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70