FFmpeg
Data Structures | Macros | Functions | Variables
webmdashenc.c File Reference
#include <float.h>
#include <stdint.h>
#include <string.h>
#include <time.h>
#include "avformat.h"
#include "matroska.h"
#include "mux.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "libavutil/time_internal.h"
#include "libavcodec/codec_desc.h"

Go to the source code of this file.

Data Structures

struct  AdaptationSet
 
struct  WebMDashMuxContext
 

Macros

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

Functions

static const char * get_codec_name (int codec_id)
 
static double get_duration (AVFormatContext *s)
 
static int write_header (AVFormatContext *s)
 
static void write_footer (AVFormatContext *s)
 
static int subsegment_alignment (AVFormatContext *s, const AdaptationSet *as)
 
static int bitstream_switching (AVFormatContext *s, const AdaptationSet *as)
 
static int write_representation (AVFormatContext *s, AVStream *st, char *id, int output_width, int output_height, int output_sample_rate)
 
static int check_matching_width (AVFormatContext *s, const AdaptationSet *as)
 
static int check_matching_height (AVFormatContext *s, const AdaptationSet *as)
 
static int check_matching_sample_rate (AVFormatContext *s, const AdaptationSet *as)
 
static void free_adaptation_sets (AVFormatContext *s)
 
static int split_filename (char *filename, char **underscore_pos, char **period_pos)
 
static int write_adaptation_set (AVFormatContext *s, int as_index)
 
static int parse_adaptation_sets (AVFormatContext *s)
 
static int webm_dash_manifest_write_header (AVFormatContext *s)
 
static int webm_dash_manifest_write_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVOption options []
 
static const AVClass webm_dash_class
 
const FFOutputFormat ff_webm_dash_manifest_muxer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 526 of file webmdashenc.c.

Function Documentation

◆ get_codec_name()

static const char* get_codec_name ( int  codec_id)
static

Definition at line 65 of file webmdashenc.c.

Referenced by write_adaptation_set(), and write_representation().

◆ get_duration()

static double get_duration ( AVFormatContext s)
static

Definition at line 70 of file webmdashenc.c.

Referenced by webm_dash_manifest_write_header(), and write_header().

◆ write_header()

static int write_header ( AVFormatContext s)
static

Definition at line 83 of file webmdashenc.c.

Referenced by webm_dash_manifest_write_header().

◆ write_footer()

static void write_footer ( AVFormatContext s)
static

Definition at line 126 of file webmdashenc.c.

Referenced by webm_dash_manifest_write_header().

◆ subsegment_alignment()

static int subsegment_alignment ( AVFormatContext s,
const AdaptationSet as 
)
static

Definition at line 131 of file webmdashenc.c.

Referenced by write_adaptation_set().

◆ bitstream_switching()

static int bitstream_switching ( AVFormatContext s,
const AdaptationSet as 
)
static

Definition at line 145 of file webmdashenc.c.

Referenced by write_adaptation_set().

◆ write_representation()

static int write_representation ( AVFormatContext s,
AVStream st,
char *  id,
int  output_width,
int  output_height,
int  output_sample_rate 
)
static

Definition at line 174 of file webmdashenc.c.

Referenced by write_adaptation_set().

◆ check_matching_width()

static int check_matching_width ( AVFormatContext s,
const AdaptationSet as 
)
static

Definition at line 231 of file webmdashenc.c.

Referenced by write_adaptation_set().

◆ check_matching_height()

static int check_matching_height ( AVFormatContext s,
const AdaptationSet as 
)
static

Definition at line 245 of file webmdashenc.c.

Referenced by write_adaptation_set().

◆ check_matching_sample_rate()

static int check_matching_sample_rate ( AVFormatContext s,
const AdaptationSet as 
)
static

Definition at line 259 of file webmdashenc.c.

Referenced by write_adaptation_set().

◆ free_adaptation_sets()

static void free_adaptation_sets ( AVFormatContext s)
static

Definition at line 270 of file webmdashenc.c.

Referenced by webm_dash_manifest_write_header().

◆ split_filename()

static int split_filename ( char *  filename,
char **  underscore_pos,
char **  period_pos 
)
static

Definition at line 290 of file webmdashenc.c.

Referenced by write_adaptation_set().

◆ write_adaptation_set()

static int write_adaptation_set ( AVFormatContext s,
int  as_index 
)
static

Definition at line 305 of file webmdashenc.c.

Referenced by webm_dash_manifest_write_header().

◆ parse_adaptation_sets()

static int parse_adaptation_sets ( AVFormatContext s)
static

Definition at line 409 of file webmdashenc.c.

Referenced by webm_dash_manifest_write_header().

◆ webm_dash_manifest_write_header()

static int webm_dash_manifest_write_header ( AVFormatContext s)
static

Definition at line 477 of file webmdashenc.c.

◆ webm_dash_manifest_write_packet()

static int webm_dash_manifest_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 521 of file webmdashenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "adaptation_sets", "Adaptation sets. Syntax: id=0,streams=0,1,2 id=1,streams=3,4 and so on", OFFSET(adaptation_sets), AV_OPT_TYPE_STRING, { 0 }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "live", "create a live stream manifest", OFFSET(is_live), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
{ "chunk_start_index", "start index of the chunk", OFFSET(chunk_start_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "chunk_duration_ms", "duration of each chunk (in milliseconds)", OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "utc_timing_url", "URL of the page that will return the UTC timestamp in ISO format", OFFSET(utc_timing_url), AV_OPT_TYPE_STRING, { 0 }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "time_shift_buffer_depth", "Smallest time (in seconds) shifting buffer for which any Representation is guaranteed to be available.", OFFSET(time_shift_buffer_depth), AV_OPT_TYPE_DOUBLE, { .dbl = 60.0 }, 1.0, DBL_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "minimum_update_period", "Minimum Update Period (in seconds) of the manifest.", OFFSET(minimum_update_period), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
}

Definition at line 527 of file webmdashenc.c.

◆ webm_dash_class

const AVClass webm_dash_class
static
Initial value:
= {
.class_name = "WebM DASH Manifest muxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 538 of file webmdashenc.c.

◆ ff_webm_dash_manifest_muxer

const FFOutputFormat ff_webm_dash_manifest_muxer
Initial value:
= {
.p.name = "webm_dash_manifest",
.p.long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
.p.mime_type = "application/xml",
.p.extensions = "xml",
.priv_data_size = sizeof(WebMDashMuxContext),
.p.priv_class = &webm_dash_class,
}

Definition at line 545 of file webmdashenc.c.

webm_dash_manifest_write_packet
static int webm_dash_manifest_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: webmdashenc.c:521
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:237
write_header
static int write_header(AVFormatContext *s)
Definition: webmdashenc.c:83
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
WebMDashMuxContext
Definition: webmdashenc.c:51
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition: opt.h:269
webm_dash_manifest_write_header
static int webm_dash_manifest_write_header(AVFormatContext *s)
Definition: webmdashenc.c:477
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:106
OFFSET
#define OFFSET(x)
Definition: webmdashenc.c:526
write_packet
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
Definition: ffmpeg_mux.c:209
options
static const AVOption options[]
Definition: webmdashenc.c:527
webm_dash_class
static const AVClass webm_dash_class
Definition: webmdashenc.c:538
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:251
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239