FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
hlsenc.c File Reference
#include <float.h>
#include "libavutil/mathematics.h"
#include "libavutil/parseutils.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/log.h"
#include "avformat.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ListEntry
 
struct  HLSContext
 

Macros

#define OFFSET(x)   offsetof(HLSContext, x)
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int hls_mux_init (AVFormatContext *s)
 
static int append_entry (HLSContext *hls, uint64_t duration)
 
static void free_entries (HLSContext *hls)
 
static int hls_window (AVFormatContext *s, int last)
 
static int hls_start (AVFormatContext *s)
 
static int hls_write_header (AVFormatContext *s)
 
static int hls_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int hls_write_trailer (struct AVFormatContext *s)
 

Variables

static const AVOption options []
 
static const AVClass hls_class
 
AVOutputFormat ff_hls_muxer
 

Macro Definition Documentation

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

Definition at line 319 of file hlsenc.c.

Definition at line 320 of file hlsenc.c.

Function Documentation

static int hls_mux_init ( AVFormatContext s)
static

Definition at line 60 of file hlsenc.c.

Referenced by hls_write_header().

static int append_entry ( HLSContext hls,
uint64_t  duration 
)
static

Definition at line 84 of file hlsenc.c.

Referenced by hls_write_packet(), and hls_write_trailer().

static void free_entries ( HLSContext hls)
static

Definition at line 115 of file hlsenc.c.

Referenced by hls_write_trailer().

static int hls_window ( AVFormatContext s,
int  last 
)
static

Definition at line 126 of file hlsenc.c.

Referenced by hls_write_packet(), and hls_write_trailer().

static int hls_start ( AVFormatContext s)
static

Definition at line 161 of file hlsenc.c.

Referenced by hls_write_header(), and hls_write_packet().

static int hls_write_header ( AVFormatContext s)
static

Definition at line 184 of file hlsenc.c.

static int hls_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 248 of file hlsenc.c.

static int hls_write_trailer ( struct AVFormatContext s)
static

Definition at line 302 of file hlsenc.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{"start_number", "set first number in the sequence", OFFSET(sequence),AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E},
{"hls_time", "set segment length in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E},
{"hls_list_size", "set maximum number of playlist entries", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E},
{"hls_wrap", "set number after which the index wraps", OFFSET(wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E},
{ NULL },
}

Definition at line 321 of file hlsenc.c.

const AVClass hls_class
static
Initial value:
= {
.class_name = "hls muxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 329 of file hlsenc.c.

AVOutputFormat ff_hls_muxer
Initial value:
= {
.name = "hls",
.long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
.extensions = "m3u8",
.priv_data_size = sizeof(HLSContext),
.audio_codec = AV_CODEC_ID_MP2,
.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.priv_class = &hls_class,
}

Definition at line 337 of file hlsenc.c.