Libav
Data Structures | Macros | Enumerations | Functions | Variables
hls.c File Reference

Apple HTTP Live Streaming demuxer http://tools.ietf.org/html/draft-pantos-http-live-streaming. More...

#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
#include "libavutil/time.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"

Go to the source code of this file.

Data Structures

struct  segment
 
struct  variant
 
struct  HLSContext
 
struct  variant_info
 
struct  key_info
 

Macros

#define INITIAL_BUFFER_SIZE   32768
 

Enumerations

enum  KeyType { KEY_NONE, KEY_AES_128 }
 

Functions

static int read_chomp_line (AVIOContext *s, char *buf, int maxlen)
 
static void free_segment_list (struct variant *var)
 
static void free_variant_list (HLSContext *c)
 
static void reset_packet (AVPacket *pkt)
 
static struct variantnew_variant (HLSContext *c, int bandwidth, const char *url, const char *base)
 
static void handle_variant_args (struct variant_info *info, const char *key, int key_len, char **dest, int *dest_len)
 
static void handle_key_args (struct key_info *info, const char *key, int key_len, char **dest, int *dest_len)
 
static int open_in (HLSContext *c, AVIOContext **in, const char *url)
 
static int open_url (AVFormatContext *s, AVIOContext **pb, const char *url, const AVDictionary *opts)
 
static int parse_playlist (HLSContext *c, const char *url, struct variant *var, AVIOContext *in)
 
static int open_input (struct variant *var)
 
static int read_data (void *opaque, uint8_t *buf, int buf_size)
 
static int save_avio_options (AVFormatContext *s)
 
static int nested_io_open (AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **opts)
 
static int hls_read_header (AVFormatContext *s)
 
static int recheck_discard_flags (AVFormatContext *s, int first)
 
static int hls_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int hls_close (AVFormatContext *s)
 
static int hls_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 
static int hls_probe (AVProbeData *p)
 

Variables

AVInputFormat ff_hls_demuxer
 

Detailed Description

Apple HTTP Live Streaming demuxer http://tools.ietf.org/html/draft-pantos-http-live-streaming.

Definition in file hls.c.

Macro Definition Documentation

◆ INITIAL_BUFFER_SIZE

#define INITIAL_BUFFER_SIZE   32768

Definition at line 38 of file hls.c.

Referenced by hls_read_header().

Enumeration Type Documentation

◆ KeyType

enum KeyType
Enumerator
KEY_NONE 
KEY_AES_128 

Definition at line 52 of file hls.c.

Function Documentation

◆ read_chomp_line()

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

Definition at line 109 of file hls.c.

Referenced by parse_playlist().

◆ free_segment_list()

static void free_segment_list ( struct variant var)
static

Definition at line 117 of file hls.c.

Referenced by free_variant_list(), and parse_playlist().

◆ free_variant_list()

static void free_variant_list ( HLSContext c)
static

Definition at line 126 of file hls.c.

Referenced by hls_close(), and hls_read_header().

◆ reset_packet()

static void reset_packet ( AVPacket pkt)
static

Definition at line 150 of file hls.c.

Referenced by hls_read_packet(), hls_read_seek(), and new_variant().

◆ new_variant()

static struct variant* new_variant ( HLSContext c,
int  bandwidth,
const char *  url,
const char *  base 
)
static

Definition at line 156 of file hls.c.

Referenced by parse_playlist().

◆ handle_variant_args()

static void handle_variant_args ( struct variant_info info,
const char *  key,
int  key_len,
char **  dest,
int *  dest_len 
)
static

Definition at line 173 of file hls.c.

Referenced by parse_playlist().

◆ handle_key_args()

static void handle_key_args ( struct key_info info,
const char *  key,
int  key_len,
char **  dest,
int *  dest_len 
)
static

Definition at line 188 of file hls.c.

Referenced by parse_playlist().

◆ open_in()

static int open_in ( HLSContext c,
AVIOContext **  in,
const char *  url 
)
static

Definition at line 203 of file hls.c.

Referenced by parse_playlist().

◆ open_url()

static int open_url ( AVFormatContext s,
AVIOContext **  pb,
const char *  url,
const AVDictionary opts 
)
static

Definition at line 216 of file hls.c.

Referenced by open_input().

◆ parse_playlist()

static int parse_playlist ( HLSContext c,
const char *  url,
struct variant var,
AVIOContext in 
)
static

Definition at line 231 of file hls.c.

Referenced by hls_read_header(), and read_data().

◆ open_input()

static int open_input ( struct variant var)
static

Definition at line 361 of file hls.c.

Referenced by read_data().

◆ read_data()

static int read_data ( void opaque,
uint8_t buf,
int  buf_size 
)
static

Definition at line 405 of file hls.c.

Referenced by hls_read_header().

◆ save_avio_options()

static int save_avio_options ( AVFormatContext s)
static

Definition at line 477 of file hls.c.

Referenced by hls_read_header().

◆ nested_io_open()

static int nested_io_open ( AVFormatContext s,
AVIOContext **  pb,
const char *  url,
int  flags,
AVDictionary **  opts 
)
static

Definition at line 498 of file hls.c.

Referenced by hls_read_header().

◆ hls_read_header()

static int hls_read_header ( AVFormatContext s)
static

Definition at line 508 of file hls.c.

◆ recheck_discard_flags()

static int recheck_discard_flags ( AVFormatContext s,
int  first 
)
static

Definition at line 639 of file hls.c.

Referenced by hls_read_packet().

◆ hls_read_packet()

static int hls_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 673 of file hls.c.

◆ hls_close()

static int hls_close ( AVFormatContext s)
static

Definition at line 770 of file hls.c.

◆ hls_read_seek()

static int hls_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
)
static

Definition at line 781 of file hls.c.

◆ hls_probe()

static int hls_probe ( AVProbeData p)
static

Definition at line 837 of file hls.c.

Variable Documentation

◆ ff_hls_demuxer

AVInputFormat ff_hls_demuxer
Initial value:
= {
.name = "hls,applehttp",
.long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
.priv_data_size = sizeof(HLSContext),
}
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:148
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
Definition: hls.c:95
static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: hls.c:673
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:546
static int hls_read_header(AVFormatContext *s)
Definition: hls.c:508
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
static int hls_probe(AVProbeData *p)
Definition: hls.c:837
static int hls_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: hls.c:781
static int hls_close(AVFormatContext *s)
Definition: hls.c:770

Definition at line 850 of file hls.c.