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

Go to the source code of this file.

Data Structures

struct  HLSSegment
 
struct  HLSContext
 

Macros

#define KEYSIZE   16
 
#define LINE_BUFFER_SIZE   1024
 
#define OFFSET(x)   offsetof(HLSContext, x)
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Enumerations

enum  HLSFlags {
  HLS_SINGLE_FILE = (1 << 0), HLS_DELETE_SEGMENTS = (1 << 1), HLS_ROUND_DURATIONS = (1 << 2), HLS_DISCONT_START = (1 << 3),
  HLS_OMIT_ENDLIST = (1 << 4), HLS_SPLIT_BY_TIME = (1 << 5), HLS_APPEND_LIST = (1 << 6), HLS_PROGRAM_DATE_TIME = (1 << 7)
}
 
enum  PlaylistType {
  PLS_TYPE_UNSPECIFIED, PLS_TYPE_EVENT, PLS_TYPE_VOD, PLAYLIST_TYPE_NONE,
  PLAYLIST_TYPE_EVENT, PLAYLIST_TYPE_VOD, PLAYLIST_TYPE_NB
}
 

Functions

static int mkdir_p (const char *path)
 
static int hls_delete_old_segments (HLSContext *hls)
 
static int hls_encryption_start (AVFormatContext *s)
 
static int read_chomp_line (AVIOContext *s, char *buf, int maxlen)
 
static int hls_mux_init (AVFormatContext *s)
 
static int hls_append_segment (struct AVFormatContext *s, HLSContext *hls, double duration, int64_t pos, int64_t size)
 
static int parse_playlist (AVFormatContext *s, const char *url)
 
static void hls_free_segments (HLSSegment *p)
 
static void set_http_options (AVDictionary **options, HLSContext *c)
 
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 KEYSIZE   16

Definition at line 42 of file hlsenc.c.

Referenced by hls_encryption_start(), and hls_start().

#define LINE_BUFFER_SIZE   1024

Definition at line 43 of file hlsenc.c.

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

Definition at line 1098 of file hlsenc.c.

Definition at line 1099 of file hlsenc.c.

Enumeration Type Documentation

enum HLSFlags
Enumerator
HLS_SINGLE_FILE 
HLS_DELETE_SEGMENTS 
HLS_ROUND_DURATIONS 
HLS_DISCONT_START 
HLS_OMIT_ENDLIST 
HLS_SPLIT_BY_TIME 
HLS_APPEND_LIST 
HLS_PROGRAM_DATE_TIME 

Definition at line 59 of file hlsenc.c.

Enumerator
PLS_TYPE_UNSPECIFIED 
PLS_TYPE_EVENT 
PLS_TYPE_VOD 
PLAYLIST_TYPE_NONE 
PLAYLIST_TYPE_EVENT 
PLAYLIST_TYPE_VOD 
PLAYLIST_TYPE_NB 

Definition at line 71 of file hlsenc.c.

Function Documentation

static int mkdir_p ( const char *  path)
static

Definition at line 138 of file hlsenc.c.

Referenced by hls_start().

static int hls_delete_old_segments ( HLSContext hls)
static

Definition at line 171 of file hlsenc.c.

Referenced by hls_append_segment().

static int hls_encryption_start ( AVFormatContext s)
static

Definition at line 257 of file hlsenc.c.

Referenced by hls_start().

static int read_chomp_line ( AVIOContext s,
char *  buf,
int  maxlen 
)
static

Definition at line 309 of file hlsenc.c.

Referenced by parse_playlist().

static int hls_mux_init ( AVFormatContext s)
static

Definition at line 317 of file hlsenc.c.

Referenced by hls_write_header().

static int hls_append_segment ( struct AVFormatContext s,
HLSContext hls,
double  duration,
int64_t  pos,
int64_t  size 
)
static

Definition at line 366 of file hlsenc.c.

Referenced by hls_write_packet(), hls_write_trailer(), and parse_playlist().

static int parse_playlist ( AVFormatContext s,
const char *  url 
)
static

Definition at line 437 of file hlsenc.c.

Referenced by hls_write_header().

static void hls_free_segments ( HLSSegment p)
static

Definition at line 489 of file hlsenc.c.

Referenced by hls_write_trailer().

static void set_http_options ( AVDictionary **  options,
HLSContext c 
)
static

Definition at line 500 of file hlsenc.c.

Referenced by hls_start(), and hls_window().

static int hls_window ( AVFormatContext s,
int  last 
)
static

Definition at line 506 of file hlsenc.c.

Referenced by hls_write_packet(), and hls_write_trailer().

static int hls_start ( AVFormatContext s)
static

Definition at line 656 of file hlsenc.c.

Referenced by hls_write_header(), and hls_write_packet().

static int hls_write_header ( AVFormatContext s)
static

Definition at line 778 of file hlsenc.c.

static int hls_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 961 of file hlsenc.c.

static int hls_write_trailer ( struct AVFormatContext s)
static

Definition at line 1062 of file hlsenc.c.

Variable Documentation

const AVOption options[]
static

Definition at line 1100 of file hlsenc.c.

Referenced by hls_start(), hls_window(), and hls_write_header().

const AVClass hls_class
static
Initial value:
= {
.class_name = "hls muxer",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: hlsenc.c:1100
av_default_item_name

Definition at line 1133 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_AAC,
.video_codec = AV_CODEC_ID_H264,
.subtitle_codec = AV_CODEC_ID_WEBVTT,
.priv_class = &hls_class,
}
static int hls_write_trailer(struct AVFormatContext *s)
Definition: hlsenc.c:1062
#define AVFMT_ALLOW_FLUSH
Format allows flushing.
Definition: avformat.h:495
static int flags
Definition: log.c:57
static int hls_write_header(AVFormatContext *s)
Definition: hlsenc.c:778
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:94
static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: hlsenc.c:961
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
Definition: ffmpeg.c:650
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:478
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:344
static const AVClass hls_class
Definition: hlsenc.c:1133

Definition at line 1141 of file hlsenc.c.