FFmpeg
Loading...
Searching...
No Matches
webm_chunk.c File Reference
#include "avformat.h"
#include "avio.h"
#include "avio_internal.h"
#include "internal.h"
#include "mux.h"
#include "libavutil/attributes_internal.h"
#include "libavutil/bprint.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"

Go to the source code of this file.

Data Structures

struct  WebMChunkContext
 

Macros

#define OFFSET(x)
 

Functions

static int webm_chunk_init (AVFormatContext *s)
 
static int get_chunk_filename (AVFormatContext *s, AVBPrint *filename)
 
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)
 

Variables

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

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 276 of file webm_chunk.c.

Function Documentation

◆ webm_chunk_init()

static int webm_chunk_init ( AVFormatContext * s)
static

Definition at line 52 of file webm_chunk.c.

◆ get_chunk_filename()

static int get_chunk_filename ( AVFormatContext * s,
AVBPrint * filename )
static

Definition at line 133 of file webm_chunk.c.

Referenced by chunk_end().

◆ webm_chunk_write_header()

static int webm_chunk_write_header ( AVFormatContext * s)
static

Definition at line 144 of file webm_chunk.c.

◆ chunk_start()

static int chunk_start ( AVFormatContext * s)
static

◆ chunk_end()

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

Definition at line 174 of file webm_chunk.c.

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

◆ webm_chunk_write_packet()

static int webm_chunk_write_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 212 of file webm_chunk.c.

◆ webm_chunk_write_trailer()

static int webm_chunk_write_trailer ( AVFormatContext * s)
static

Definition at line 244 of file webm_chunk.c.

◆ webm_chunk_deinit()

static void webm_chunk_deinit ( AVFormatContext * s)
static

Definition at line 261 of file webm_chunk.c.

Variable Documentation

◆ options

const AVOption options[]
static
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
#define OFFSET(x)
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition opt.h:351
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275

Definition at line 277 of file webm_chunk.c.

◆ webm_chunk_class

const AVClass webm_chunk_class
static
Initial value:
= {
.class_name = "WebM Chunk Muxer",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 285 of file webm_chunk.c.

◆ ff_webm_chunk_muxer

const FFOutputFormat ff_webm_chunk_muxer
Initial value:
= {
.p.name = "webm_chunk",
.p.long_name = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"),
.p.mime_type = "video/webm",
.p.extensions = "chk",
.p.priv_class = &webm_chunk_class,
.priv_data_size = sizeof(WebMChunkContext),
}
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition avformat.h:488
#define AVFMT_TS_NONSTRICT
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition avformat.h:507
#define AVFMT_GLOBALHEADER
Format wants global header.
Definition avformat.h:497
#define AVFMT_NEEDNUMBER
Needs 'd' in filename.
Definition avformat.h:489
static void deinit(AVFormatContext *s)
Definition chromaprint.c:53
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
Definition ffmpeg_mux.c:204
static void write_header(FFV1Context *f)
Definition ffv1enc.c:384
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static int write_trailer(AVFormatContext *s1)
Definition v4l2enc.c:101
static void webm_chunk_deinit(AVFormatContext *s)
Definition webm_chunk.c:261
static int webm_chunk_write_trailer(AVFormatContext *s)
Definition webm_chunk.c:244
static const AVClass webm_chunk_class
Definition webm_chunk.c:285
static int webm_chunk_write_header(AVFormatContext *s)
Definition webm_chunk.c:144
static int webm_chunk_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition webm_chunk.c:212
static int webm_chunk_init(AVFormatContext *s)
Definition webm_chunk.c:52

Definition at line 292 of file webm_chunk.c.