2 * Apple HTTP Live Streaming segmenter
3 * Copyright (c) 2012, Luca Barbato
4 * Copyright (c) 2017 Akamai Technologies, Inc.
6 * This file is part of FFmpeg.
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef AVFORMAT_HLSPLAYLIST_H
24 #define AVFORMAT_HLSPLAYLIST_H
28 #include "libavutil/common.h"
39 static inline int hls_get_int_from_double(double val)
41 return (int)((val - (int)val) >= 0.001) ? (int)(val + 1) : (int)val;
44 void ff_hls_write_playlist_version(AVIOContext *out, int version);
45 void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
46 int bandwidth, char *filename);
47 void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
48 int target_duration, int64_t sequence,
49 uint32_t playlist_type);
50 void ff_hls_write_init_file(AVIOContext *out, char *filename,
51 int byterange_mode, int64_t size, int64_t pos);
52 int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
54 double duration, int round_duration,
55 int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set
56 char *baseurl, //Ignored if NULL
57 char *filename, double *prog_date_time);
58 void ff_hls_write_end_list (AVIOContext *out);
60 #endif /* AVFORMAT_HLSPLAYLIST_H_ */