|
FFmpeg
|
Apple HTTP Live Streaming demuxer https://www.rfc-editor.org/rfc/rfc8216.txt. More...
#include "config_components.h"#include "libavformat/http.h"#include "libavutil/aes.h"#include "libavutil/avstring.h"#include "libavutil/avassert.h"#include "libavutil/intreadwrite.h"#include "libavutil/mathematics.h"#include "libavutil/mem.h"#include "libavutil/opt.h"#include "libavutil/dict.h"#include "libavutil/time.h"#include "avformat.h"#include "demux.h"#include "internal.h"#include "avio_internal.h"#include "id3v2.h"#include "url.h"#include "hls_sample_encryption.h"Go to the source code of this file.
Data Structures | |
| struct | segment |
| struct | playlist |
| struct | rendition |
| struct | variant |
| struct | HLSContext |
| struct | variant_info |
| struct | key_info |
| struct | init_section_info |
| struct | rendition_info |
Macros | |
| #define | INITIAL_BUFFER_SIZE 32768 |
| #define | MAX_FIELD_LEN 64 |
| #define | MAX_CHARACTERISTICS_LEN 512 |
| #define | MPEG_TIME_BASE 90000 |
| #define | MPEG_TIME_BASE_Q (AVRational){1, MPEG_TIME_BASE} |
| #define | PACKED_AUDIO_FORMATS "aac,ac3,eac3,mp3" |
| #define | OFFSET(x) |
| #define | FLAGS AV_OPT_FLAG_DECODING_PARAM |
Enumerations | |
| enum | KeyType { KEY_NONE , KEY_AES_128 , KEY_SAMPLE_AES } |
| enum | PlaylistType { PLS_TYPE_UNSPECIFIED , PLS_TYPE_EVENT , PLS_TYPE_VOD } |
Functions | |
| static void | free_segment_dynarray (struct segment **segments, int n_segments) |
| static void | free_segment_list (struct playlist *pls) |
| static void | free_init_section_list (struct playlist *pls) |
| static void | free_playlist_list (HLSContext *c) |
| static void | free_variant_list (HLSContext *c) |
| static void | free_rendition_list (HLSContext *c) |
| static struct playlist * | new_playlist (HLSContext *c, const char *url, const char *base) |
| static struct variant * | new_variant (HLSContext *c, struct variant_info *info, const char *url, const char *base) |
| static void | handle_variant_args (void *context, const char *key, int key_len, char **dest, int *dest_len) |
| static void | handle_key_args (void *context, const char *key, int key_len, char **dest, int *dest_len) |
| static struct segment * | new_init_section (struct playlist *pls, struct init_section_info *info, const char *url_base) |
| static void | handle_init_section_args (void *context, const char *key, int key_len, char **dest, int *dest_len) |
| static struct rendition * | new_rendition (HLSContext *c, struct rendition_info *info, const char *url_base) |
| static void | handle_rendition_args (void *vinfo, const char *key, int key_len, char **dest, int *dest_len) |
| static int | ensure_playlist (HLSContext *c, struct playlist **pls, const char *url) |
| static int | is_native_http (AVIOContext *pb) |
| static int | open_url_keepalive (AVFormatContext *s, AVIOContext **pb, const char *url, AVDictionary **options) |
| static int | open_url (AVFormatContext *s, AVIOContext **pb, const char *url, AVDictionary **opts, AVDictionary *opts2, int *is_http_out) |
| static int | test_segment (AVFormatContext *s, const AVInputFormat *in_fmt, struct playlist *pls, struct segment *seg) |
| static int | parse_playlist (HLSContext *c, const char *url, struct playlist *pls, AVIOContext *in) |
| static struct segment * | current_segment (struct playlist *pls) |
| static struct segment * | next_segment (struct playlist *pls) |
| static int | segment_reusable (AVIOContext *in, const struct segment *cur, const struct segment *next) |
| static int | read_from_url (struct playlist *pls, struct segment *seg, uint8_t *buf, int buf_size) |
| static void | parse_id3 (AVFormatContext *s, AVIOContext *pb, AVDictionary **metadata, int64_t *dts, HLSAudioSetupInfo *audio_setup_info, ID3v2ExtraMetaAPIC **apic, ID3v2ExtraMeta **extra_meta) |
| static int | id3_has_changed_values (struct playlist *pls, AVDictionary *metadata, ID3v2ExtraMetaAPIC *apic) |
| static void | handle_id3 (AVIOContext *pb, struct playlist *pls) |
| static void | intercept_id3 (struct playlist *pls, uint8_t *buf, int buf_size, int *len) |
| static int | read_key (HLSContext *c, struct playlist *pls, struct segment *seg) |
| static int | open_input (HLSContext *c, struct playlist *pls, struct segment *seg, AVIOContext **in) |
| static int | update_init_section (struct playlist *pls, struct segment *seg) |
| static int64_t | default_reload_interval (struct playlist *pls) |
| static int | playlist_needed (struct playlist *pls) |
| static int | reload_playlist (struct playlist *v, HLSContext *c) |
| static int | read_data_continuous (void *opaque, uint8_t *buf, int buf_size) |
| static int | read_data_subtitle_segment (void *opaque, uint8_t *buf, int buf_size) |
| static int | nested_io_open (AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **opts) |
| static int | init_subtitle_context (struct playlist *pls) |
| static int | read_subtitle_packet (struct playlist *v, AVPacket *pkt) |
| static void | add_renditions_to_variant (HLSContext *c, struct variant *var, enum AVMediaType type, const char *group_id) |
| static void | add_metadata_from_renditions (AVFormatContext *s, struct playlist *pls, enum AVMediaType type) |
| static int | find_timestamp_in_playlist (HLSContext *c, struct playlist *pls, int64_t timestamp, int64_t *seq_no, int64_t *seg_start_ts) |
| static int64_t | select_cur_seq_no (HLSContext *c, struct playlist *pls) |
| static void | add_stream_to_programs (AVFormatContext *s, struct playlist *pls, AVStream *stream) |
| static int | set_stream_info_from_input_stream (AVStream *st, struct playlist *pls, AVStream *ist) |
| static int | update_streams_from_subdemuxer (AVFormatContext *s, struct playlist *pls) |
| static void | update_noheader_flag (AVFormatContext *s) |
| static int | hls_close (AVFormatContext *s) |
| static int | hls_read_header (AVFormatContext *s) |
| static int | recheck_discard_flags (AVFormatContext *s, int first) |
| static void | fill_timing_for_id3_timestamped_stream (struct playlist *pls) |
| static AVRational | get_timebase (struct playlist *pls) |
| static int | compare_ts_with_wrapdetect (int64_t ts_a, struct playlist *pls_a, int64_t ts_b, struct playlist *pls_b) |
| static int | metadata_has_changed (const AVDictionary *current, const AVDictionary *update) |
Check whether any entry in update differs from the corresponding entry in current. | |
| static int | hls_read_packet (AVFormatContext *s, AVPacket *pkt) |
| static int | hls_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags) |
| static int | hls_probe (const AVProbeData *p) |
Variables | |
| static const AVOption | hls_options [] |
| static const AVClass | hls_class |
| const FFInputFormat | ff_hls_demuxer |
Apple HTTP Live Streaming demuxer https://www.rfc-editor.org/rfc/rfc8216.txt.
Definition in file hls.c.
| #define MPEG_TIME_BASE 90000 |
Definition at line 56 of file hls.c.
Referenced by set_stream_info_from_input_stream().
| #define MPEG_TIME_BASE_Q (AVRational){1, MPEG_TIME_BASE} |
Definition at line 57 of file hls.c.
Referenced by compare_ts_with_wrapdetect(), fill_timing_for_id3_timestamped_stream(), and get_timebase().
| #define PACKED_AUDIO_FORMATS "aac,ac3,eac3,mp3" |
Definition at line 59 of file hls.c.
Referenced by handle_id3(), and hls_read_header().
| #define OFFSET | ( | x | ) |
| #define FLAGS AV_OPT_FLAG_DECODING_PARAM |
| enum PlaylistType |
|
static |
Definition at line 254 of file hls.c.
Referenced by free_segment_list(), and parse_playlist().
|
static |
Definition at line 264 of file hls.c.
Referenced by free_playlist_list().
|
static |
Definition at line 271 of file hls.c.
Referenced by free_playlist_list().
|
static |
Definition at line 283 of file hls.c.
Referenced by hls_close().
|
static |
Definition at line 314 of file hls.c.
Referenced by hls_close().
|
static |
Definition at line 326 of file hls.c.
Referenced by hls_close().
|
static |
Definition at line 335 of file hls.c.
Referenced by new_rendition(), and new_variant().
|
static |
Definition at line 379 of file hls.c.
Referenced by ensure_playlist(), and parse_playlist().
|
static |
Definition at line 405 of file hls.c.
Referenced by parse_playlist().
|
static |
Definition at line 430 of file hls.c.
Referenced by parse_playlist().
|
static |
Definition at line 451 of file hls.c.
Referenced by parse_playlist().
|
static |
Definition at line 500 of file hls.c.
Referenced by parse_playlist().
|
static |
Definition at line 525 of file hls.c.
Referenced by parse_playlist().
|
static |
Definition at line 612 of file hls.c.
Referenced by parse_playlist().
|
static |
Definition at line 658 of file hls.c.
Referenced by parse_playlist().
|
static |
Definition at line 669 of file hls.c.
Referenced by open_url(), parse_playlist(), and read_data_continuous().
|
static |
Definition at line 679 of file hls.c.
Referenced by open_url(), and parse_playlist().
|
static |
Definition at line 697 of file hls.c.
Referenced by open_input(), parse_playlist(), and read_key().
|
static |
Definition at line 785 of file hls.c.
Referenced by hls_read_header(), and parse_playlist().
|
static |
Definition at line 832 of file hls.c.
Referenced by hls_read_header(), hls_read_seek(), reload_playlist(), and select_cur_seq_no().
Definition at line 1190 of file hls.c.
Referenced by hls_read_header(), hls_read_packet(), init_subtitle_context(), intercept_id3(), open_input(), read_data_continuous(), and read_data_subtitle_segment().
Definition at line 1198 of file hls.c.
Referenced by read_data_continuous().
|
static |
Definition at line 1209 of file hls.c.
Referenced by read_data_continuous().
|
static |
Definition at line 1221 of file hls.c.
Referenced by intercept_id3(), read_data_continuous(), read_data_subtitle_segment(), and update_init_section().
|
static |
Definition at line 1238 of file hls.c.
Referenced by handle_id3().
|
static |
Definition at line 1267 of file hls.c.
Referenced by handle_id3().
|
static |
Definition at line 1296 of file hls.c.
Referenced by intercept_id3().
|
static |
Definition at line 1339 of file hls.c.
Referenced by read_data_continuous().
|
static |
|
static |
Definition at line 1470 of file hls.c.
Referenced by read_data_continuous(), read_data_subtitle_segment(), and update_init_section().
Definition at line 1577 of file hls.c.
Referenced by read_data_continuous().
Definition at line 1634 of file hls.c.
Referenced by hls_read_seek(), reload_playlist(), and select_cur_seq_no().
|
static |
Definition at line 1641 of file hls.c.
Referenced by recheck_discard_flags(), and reload_playlist().
|
static |
Definition at line 1687 of file hls.c.
Referenced by read_data_continuous(), and read_subtitle_packet().
|
static |
Definition at line 1764 of file hls.c.
Referenced by hls_read_header().
|
static |
Definition at line 1891 of file hls.c.
Referenced by init_subtitle_context().
|
static |
|
static |
Definition at line 1930 of file hls.c.
Referenced by read_subtitle_packet().
Definition at line 1970 of file hls.c.
Referenced by hls_read_packet().
|
static |
Definition at line 2002 of file hls.c.
Referenced by hls_read_header().
|
static |
Definition at line 2026 of file hls.c.
Referenced by hls_read_header().
|
static |
Definition at line 2058 of file hls.c.
Referenced by hls_read_seek(), and select_cur_seq_no().
|
static |
Definition at line 2097 of file hls.c.
Referenced by hls_read_header(), and recheck_discard_flags().
|
static |
Definition at line 2172 of file hls.c.
Referenced by update_streams_from_subdemuxer().
|
static |
Definition at line 2198 of file hls.c.
Referenced by hls_read_packet(), and update_streams_from_subdemuxer().
|
static |
Definition at line 2222 of file hls.c.
Referenced by hls_read_header(), and hls_read_packet().
|
static |
Definition at line 2263 of file hls.c.
Referenced by hls_read_header(), and hls_read_packet().
|
static |
|
static |
|
static |
Definition at line 2627 of file hls.c.
Referenced by hls_read_packet().
|
static |
Definition at line 2672 of file hls.c.
Referenced by hls_read_packet().
|
static |
Definition at line 2697 of file hls.c.
Referenced by compare_ts_with_wrapdetect(), and hls_read_packet().
|
static |
Definition at line 2705 of file hls.c.
Referenced by hls_read_packet().
|
static |
Check whether any entry in update differs from the corresponding entry in current.
HLS segments can repeat timed ID3 metadata in every segment so that listeners joining mid-stream immediately receive the current track information. Only signal a metadata change when values actually differ to avoid spurious updates on every segment boundary.
Definition at line 2723 of file hls.c.
Referenced by hls_read_packet().
|
static |
|
static |
|
static |
|
static |
| const FFInputFormat ff_hls_demuxer |