libgpac
Documentation of the core library of GPAC
m3u8.h File Reference
#include <gpac/tools.h>
#include <gpac/list.h>
+ Include dependency graph for m3u8.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  Media
 
struct  Playlist
 
struct  PlaylistElement
 
struct  Stream
 
struct  MasterPlaylist
 
union  s_playlistElement.element
 

Macros

#define M3U8_UNKNOWN_MIME_TYPE   "unknown"
 

Enumerations

enum  PlaylistElementType { TYPE_PLAYLIST , TYPE_MEDIA , TYPE_UNKNOWN }
 
enum  PlaylistElementDRMMethod { DRM_NONE , DRM_AES_128 , DRM_CENC }
 
enum  MediaType {
  MEDIA_TYPE_UNKNOWN = 0 , MEDIA_TYPE_AUDIO = 0x100000 , MEDIA_TYPE_VIDEO = 0x200000 , MEDIA_TYPE_SUBTITLES = 0x300000 ,
  MEDIA_TYPE_CLOSED_CAPTIONS = 0x400000
}
 

Functions

GF_Err gf_m3u8_parse_master_playlist (const char *file, MasterPlaylist **playlist, const char *baseURL)
 
GF_Err gf_m3u8_parse_sub_playlist (const char *file, MasterPlaylist **playlist, const char *baseURL, Stream *in_program, PlaylistElement *sub_playlist, Bool is_master)
 
GF_Err gf_m3u8_master_playlist_del (MasterPlaylist **playlist)
 

Data Structure Documentation

◆ Media

struct Media

Basic Media structure

Data Fields
int i

◆ s_playList

struct s_playList

The playlist contains a list of elements to play

Data Fields
int current_media_seq
int media_seq_min
int media_seq_max
int discontinuity
double target_duration
double computed_duration
Bool is_ended
GF_List * elements

◆ s_playlistElement

struct s_playlistElement

The Structure containing the playlist element

Data Fields
MediaType media_type
double duration_info
u64 byte_range_start
u64 byte_range_end
int bandwidth
int width
int height
int low_lat_chunk
int independent_chunk
char * title
char * codecs
char * language
char * name
char * audio_group
char * video_group
char * url
char * init_segment_url
char * main_codecs
u64 init_byte_range_start
u64 init_byte_range_end
u64 utc_start_time
u32 discontinuity
u32 channels
u32 * alt_bandwidths
u32 nb_alt_bandwidths
PlaylistElementDRMMethod drm_method
char * key_uri
bin128 key_iv
GF_Err load_error
PlaylistElementType element_type
union s_playlistElement element

◆ s_stream

struct s_stream
Data Fields
int stream_id
GF_List * variants
double computed_duration

◆ s_masterPlaylist

struct s_masterPlaylist

The root playlist, can contains several PlaylistElements structures

Data Fields
GF_List * streams
u32 version
int current_stream
Bool playlist_needs_refresh
Bool independent_segments
Bool low_latency

◆ s_playlistElement.element

union s_playlistElement.element
Data Fields
Playlist playlist
Media media

Macro Definition Documentation

◆ M3U8_UNKNOWN_MIME_TYPE

#define M3U8_UNKNOWN_MIME_TYPE   "unknown"
            GPAC - Multimedia Framework C SDK

                            Authors: Pierre Souchay - Jean Le Feuvre - Romain Bouqueau
            Copyright (c) Telecom ParisTech 2010-2021
                            All rights reserved

This file is part of GPAC

GPAC is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

GPAC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

Enumeration Type Documentation

◆ PlaylistElementType

Enumerator
TYPE_PLAYLIST 
TYPE_MEDIA 
TYPE_UNKNOWN 

◆ PlaylistElementDRMMethod

Enumerator
DRM_NONE 
DRM_AES_128 
DRM_CENC 

◆ MediaType

enum MediaType
Enumerator
MEDIA_TYPE_UNKNOWN 
MEDIA_TYPE_AUDIO 
MEDIA_TYPE_VIDEO 
MEDIA_TYPE_SUBTITLES 
MEDIA_TYPE_CLOSED_CAPTIONS 

Function Documentation

◆ gf_m3u8_parse_master_playlist()

GF_Err gf_m3u8_parse_master_playlist ( const char *  file,
MasterPlaylist **  playlist,
const char *  baseURL 
)

Parse the given m3u8 playlist file

Parameters
fileThe file from cache to parse
playlistThe playlist to fill. If argument is null, and file is valid, playlist will be allocated
baseURLThe base URL of the playlist
Returns
GF_OK if playlist valid
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_m3u8_parse_sub_playlist()

GF_Err gf_m3u8_parse_sub_playlist ( const char *  file,
MasterPlaylist **  playlist,
const char *  baseURL,
Stream *  in_program,
PlaylistElement *  sub_playlist,
Bool  is_master 
)

Parse the given playlist file as a subplaylist of an existing playlist

Parameters
fileThe file from cache to parse
playlistThe playlist to fill.
baseURLbase URL of the playlist
in_programin which the playlist is parsed
sub_playlistexisting subplaylist element in the playlist in which the playlist is parsed
is_masterset to true to indicate if this is the root playlist
Returns
GF_OK if playlist valid
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_m3u8_master_playlist_del()

GF_Err gf_m3u8_master_playlist_del ( MasterPlaylist **  playlist)

Deletes the given MasterPlaylist and all of its sub elements

+ Here is the call graph for this function:
+ Here is the caller graph for this function: