Data Structures | Macros | Functions | Variables
webm_chunk.c File Reference
#include "avformat.h"
#include "avio.h"
#include "avio_internal.h"
#include "internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"

Go to the source code of this file.

Data Structures

struct  WebMChunkContext


#define MAX_FILENAME_SIZE   1024
#define OFFSET(x)   offsetof(WebMChunkContext, x)


static int webm_chunk_init (AVFormatContext *s)
static int get_chunk_filename (AVFormatContext *s, char filename[MAX_FILENAME_SIZE])
static int webm_chunk_write_header (AVFormatContext *s)
static int chunk_start (AVFormatContext *s)
static int chunk_end (AVFormatContext *s, int flush)
static int webm_chunk_write_packet (AVFormatContext *s, AVPacket *pkt)
static int webm_chunk_write_trailer (AVFormatContext *s)
static void webm_chunk_deinit (AVFormatContext *s)


static const AVOption options []
static const AVClass webm_chunk_class
AVOutputFormat ff_webm_chunk_muxer

Macro Definition Documentation

#define MAX_FILENAME_SIZE   1024

Definition at line 36 of file webm_chunk.c.

Referenced by chunk_end().

#define OFFSET (   x)    offsetof(WebMChunkContext, x)

Definition at line 282 of file webm_chunk.c.

Function Documentation

static int webm_chunk_init ( AVFormatContext s)

Definition at line 50 of file webm_chunk.c.

static int get_chunk_filename ( AVFormatContext s,
char  filename[MAX_FILENAME_SIZE] 

Definition at line 141 of file webm_chunk.c.

Referenced by chunk_end().

static int webm_chunk_write_header ( AVFormatContext s)

Definition at line 155 of file webm_chunk.c.

static int chunk_start ( AVFormatContext s)
static int chunk_end ( AVFormatContext s,
int  flush 

Definition at line 182 of file webm_chunk.c.

Referenced by decode_lsp(), webm_chunk_write_packet(), and webm_chunk_write_trailer().

static int webm_chunk_write_packet ( AVFormatContext s,
AVPacket pkt 

Definition at line 218 of file webm_chunk.c.

static int webm_chunk_write_trailer ( AVFormatContext s)

Definition at line 250 of file webm_chunk.c.

static void webm_chunk_deinit ( AVFormatContext s)

Definition at line 267 of file webm_chunk.c.

Variable Documentation

const AVOption options[]
Initial value:
= {
{ "chunk_start_index", "start index of the chunk", OFFSET(chunk_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "header", "filename of the header where the initialization data will be written", OFFSET(header_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "audio_chunk_duration", "duration of each chunk in milliseconds", OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 5000}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "method", "set the HTTP method", OFFSET(http_method), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
#define NULL
Definition: coverity.c:32
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:278
#define OFFSET(x)
Definition: webm_chunk.c:282

Definition at line 283 of file webm_chunk.c.

Referenced by chunk_end().

const AVClass webm_chunk_class
Initial value:
= {
.class_name = "WebM Chunk Muxer",
.item_name = av_default_item_name,
.option = options,
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
static const AVOption options[]
Definition: webm_chunk.c:283

Definition at line 291 of file webm_chunk.c.

AVOutputFormat ff_webm_chunk_muxer
Initial value:
= {
.name = "webm_chunk",
.long_name = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"),
.mime_type = "video/webm",
.extensions = "chk",
.priv_data_size = sizeof(WebMChunkContext),
.deinit = webm_chunk_deinit,
.priv_class = &webm_chunk_class,
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:726
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition: avformat.h:472
static void webm_chunk_deinit(AVFormatContext *s)
Definition: webm_chunk.c:267
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:115
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:98
Format wants global header.
Definition: avformat.h:461
static int webm_chunk_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: webm_chunk.c:218
static const AVClass webm_chunk_class
Definition: webm_chunk.c:291
static int webm_chunk_write_header(AVFormatContext *s)
Definition: webm_chunk.c:155
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:458
static int webm_chunk_write_trailer(AVFormatContext *s)
Definition: webm_chunk.c:250
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:346
static int webm_chunk_init(AVFormatContext *s)
Definition: webm_chunk.c:50
Needs 'd' in filename.
Definition: avformat.h:459

Definition at line 298 of file webm_chunk.c.