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"
Include dependency graph for hlsenc.c:

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
 

Typedefs

typedef struct ListEntry ListEntry
 
typedef struct HLSContext HLSContext
 

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

Definition at line 319 of file hlsenc.c.

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

Definition at line 318 of file hlsenc.c.

Typedef Documentation

typedef struct HLSContext HLSContext
typedef struct ListEntry ListEntry

Function Documentation

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_mux_init ( AVFormatContext s)
static

Definition at line 60 of file hlsenc.c.

Referenced by hls_write_header().

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_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_write_header ( AVFormatContext s)
static

Definition at line 186 of file hlsenc.c.

static int hls_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 250 of file hlsenc.c.

static int hls_write_trailer ( struct AVFormatContext s)
static

Definition at line 301 of file hlsenc.c.

Variable Documentation

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,
}
static int hls_write_trailer(struct AVFormatContext *s)
Definition: hlsenc.c:301
static int write_packet(AVFormatContext *s, AVPacket *pkt)
#define AVFMT_ALLOW_FLUSH
Format allows flushing.
Definition: avformat.h:361
static int write_trailer(AVFormatContext *s)
static int hls_write_header(AVFormatContext *s)
Definition: hlsenc.c:186
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: hlsenc.c:250
preferred ID for MPEG-1/2 video decoding
struct HLSContext HLSContext
static int flags
Definition: cpu.c:23
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:345
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:470
static const AVClass hls_class
Definition: hlsenc.c:328

Definition at line 336 of file hlsenc.c.

const AVClass hls_class
static
Initial value:
= {
.class_name = "hls muxer",
.item_name = av_default_item_name,
.option = options,
}
av_default_item_name
static const AVOption options[]
Definition: hlsenc.c:320
LIBAVUTIL_VERSION_INT
Definition: eval.c:55

Definition at line 328 of file hlsenc.c.

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 },
}
#define wrap(func)
Definition: w64xmmtest.h:70
#define OFFSET(x)
Definition: hlsenc.c:318
int size
#define E
Definition: hlsenc.c:319
NULL
Definition: eval.c:55

Definition at line 320 of file hlsenc.c.