GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
media_tools.h File Reference
#include <gpac/isomedia.h>
#include <gpac/avparse.h>
#include <gpac/config_file.h>
+ Include dependency graph for media_tools.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  __track_video_info
 
struct  __track_audio_info
 
struct  __track_import_info
 
struct  __program_import_info
 
struct  GF_MediaImporter
 
struct  GF_DashSegmenterInput
 
struct  GF_MediaExporter
 

Macros

#define GF_IMPORT_DEFAULT_FPS   25.0
 
#define GF_IMPORT_AUTO_FPS   10000.0
 
#define GF_IMPORT_MAX_TRACKS   100
 

Enumerations

enum  {
  GF_IMPORT_USE_DATAREF = 1, GF_IMPORT_NO_FRAME_DROP = 1<<1, GF_IMPORT_FORCE_PACKED = 1<<2, GF_IMPORT_SBR_IMPLICIT = 1<<3,
  GF_IMPORT_SBR_EXPLICIT = 1<<4, GF_IMPORT_FORCE_MPEG4 = 1<<5, GF_IMPORT_SKIP_TXT_BOX = 1<<6, GF_IMPORT_KEEP_ALL_TRACKS = 1<<7,
  GF_IMPORT_USE_COMPACT_SIZE = 1<<8, GF_IMPORT_NO_TEXT_FLUSH = 1<<9, GF_IMPORT_SVC_EXPLICIT = 1<<10, GF_IMPORT_SVC_NONE = 1<<11,
  GF_IMPORT_PS_IMPLICIT = 1<<12, GF_IMPORT_PS_EXPLICIT = 1<<13, GF_IMPORT_OVSBR = 1<<14, GF_IMPORT_SET_SUBSAMPLES = 1<<15,
  GF_IMPORT_FORCE_SYNC = 1<<16, GF_IMPORT_PROBE_ONLY = 1<<20, GF_IMPORT_3GPP_AGGREGATION = 1<<21, GF_IMPORT_OVERRIDE_FPS = 1<<22,
  GF_IMPORT_NO_DURATION = 1<<23, GF_IMPORT_MPE_DEMUX = 1<<24, GF_IMPORT_DO_ABORT = 1<<31
}
 
enum  GF_DashProfile {
  GF_DASH_PROFILE_FULL = 0, GF_DASH_PROFILE_LIVE, GF_DASH_PROFILE_ONDEMAND, GF_DASH_PROFILE_MAIN,
  GF_DASH_PROFILE_AVC264_LIVE, GF_DASH_PROFILE_AVC264_ONDEMAND, GF_DASH_PROFILE_UNKNOWN
}
 
enum  GF_DashSwitchingMode { GF_DASH_BSMODE_NONE = 0, GF_DASH_BSMODE_INBAND, GF_DASH_BSMODE_MERGED, GF_DASH_BSMODE_SINGLE }
 
enum  {
  GF_EXPORT_NATIVE = GF_TRUE, GF_EXPORT_RAW_SAMPLES = (1<<1), GF_EXPORT_NHNT = (1<<2), GF_EXPORT_AVI = (1<<3),
  GF_EXPORT_MP4 = (1<<4), GF_EXPORT_AVI_NATIVE = (1<<5), GF_EXPORT_NHML = (1<<6), GF_EXPORT_SAF = (1<<7),
  GF_EXPORT_WEBVTT_META = (1<<8), GF_EXPORT_WEBVTT_META_EMBEDDED = (1<<9), GF_EXPORT_SIX = (1<<14), GF_EXPORT_MERGE = (1<<10),
  GF_EXPORT_USE_QCP = (1<<11), GF_EXPORT_NHML_FULL = (1<<11), GF_EXPORT_SVC_LAYER = (1<<12), GF_EXPORT_WEBVTT_NOMERGE = (1<<13),
  GF_EXPORT_PROBE_ONLY = (1<<30), GF_EXPORT_DO_ABORT = (1<<31)
}
 
enum  { GF_SDP_IOD_NONE = 0, GF_SDP_IOD_REGULAR, GF_SDP_IOD_ISMA, GF_SDP_IOD_ISMA_STRICT }
 

Functions

GF_Err gf_media_get_file_hash (const char *file, u8 hash[20])
 
GF_ESDgf_media_map_esd (GF_ISOFile *mp4, u32 track)
 
GF_Err gf_media_change_par (GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den)
 
GF_Err gf_media_import (GF_MediaImporter *importer)
 
GF_Err gf_media_import_chapters (GF_ISOFile *file, char *chap_file, Double import_fps)
 
GF_Err gf_media_make_isma (GF_ISOFile *mp4file, Bool keepESIDs, Bool keepImage, Bool no_ocr)
 
GF_Err gf_media_make_3gpp (GF_ISOFile *mp4file)
 
GF_Err gf_media_make_psp (GF_ISOFile *mp4file)
 
GF_Err gf_media_change_pl (GF_ISOFile *file, u32 track, u32 profile, u32 level)
 
GF_Err gf_media_avc_rewrite_samples (GF_ISOFile *file, u32 track, u32 prev_size_in_bits, u32 new_size_in_bits)
 
GF_Err gf_media_split_svc (GF_ISOFile *file, u32 track, Bool splitAll)
 
GF_Err gf_media_merge_svc (GF_ISOFile *file, u32 track, Bool mergeAll)
 
GF_Err gf_media_split_shvc (GF_ISOFile *file, u32 track, Bool splitAll, Bool use_extractors)
 
GF_Err gf_media_split_hevc_tiles (GF_ISOFile *file)
 
GF_Err gf_dasher_segment_files (const char *mpd_name, GF_DashSegmenterInput *inputs, u32 nb_inputs, GF_DashProfile profile, const char *mpd_title, const char *mpd_source, const char *mpd_copyright, const char *mpd_moreInfoURL, const char **mpd_base_urls, u32 nb_mpd_base_urls, u32 use_url_template, Bool use_segment_timeline, Bool single_segment, Bool single_file, GF_DashSwitchingMode bitstream_switching_mode, Bool segments_start_with_rap, Double dash_duration_sec, char *seg_rad_name, char *seg_ext, u32 segment_marker_4cc, Double frag_duration_sec, s32 subsegs_per_sidx, Bool daisy_chain_sidx, Bool fragments_start_with_rap, const char *tmp_dir, GF_Config *dash_ctx, u32 dash_dynamic, u32 mpd_update_time, u32 time_shift_depth, Double subduration, Double min_buffer, u32 ast_shift_sec, u32 dash_scale, Bool fragments_in_memory, u32 initial_moof_sn, u64 initial_tfdt, Bool no_fragments_defaults, Bool pssh_moof)
 
u32 gf_dasher_next_update_time (GF_Config *dash_ctx, u32 mpd_update_time)
 
GF_Err gf_media_fragment_file (GF_ISOFile *input, const char *output_file, Double max_duration_sec)
 
GF_Err gf_media_export (GF_MediaExporter *dump)
 
GF_RTPHinter * gf_hinter_track_new (GF_ISOFile *file, u32 TrackNum, u32 Path_MTU, u32 max_ptime, u32 default_rtp_rate, u32 hint_flags, u8 PayloadID, Bool copy_media, u32 InterleaveGroupID, u8 InterleaveGroupPriority, GF_Err *e)
 
void gf_hinter_track_del (GF_RTPHinter *tkHinter)
 
GF_Err gf_hinter_track_process (GF_RTPHinter *tkHint)
 
u32 gf_hinter_track_get_bandwidth (GF_RTPHinter *tkHinter)
 
u32 gf_hinter_track_get_flags (GF_RTPHinter *tkHinter)
 
void gf_hinter_track_get_payload_name (GF_RTPHinter *tkHint, char *payloadName)
 
GF_Err gf_hinter_track_finalize (GF_RTPHinter *tkHint, Bool AddSystemInfo)
 
GF_Err gf_hinter_finalize (GF_ISOFile *file, u32 IOD_Profile, u32 bandwidth)
 
Bool gf_hinter_can_embbed_data (char *data, u32 data_size, u32 streamType)
 
GF_SAFMuxer * gf_saf_mux_new ()
 
void gf_saf_mux_del (GF_SAFMuxer *mux)
 
GF_Err gf_saf_mux_stream_add (GF_SAFMuxer *mux, u32 stream_id, u32 ts_res, u32 buffersize_db, u8 stream_type, u8 object_type, char *mime_type, char *dsi, u32 dsi_len, char *remote_url)
 
GF_Err gf_saf_mux_stream_rem (GF_SAFMuxer *mux, u32 stream_id)
 
GF_Err gf_saf_mux_add_au (GF_SAFMuxer *mux, u32 stream_id, u32 CTS, char *data, u32 data_len, Bool is_rap)
 
GF_Err gf_saf_mux_for_time (GF_SAFMuxer *mux, u32 time_ms, Bool force_end_of_session, char **out_data, u32 *out_size)
 
void gf_media_reduce_aspect_ratio (u32 *width, u32 *height)
 
void gf_media_get_reduced_frame_rate (u32 *timescale, u32 *sample_dur)
 

Data Structure Documentation

struct __track_video_info
+ Collaboration diagram for __track_video_info:
Data Fields
u32 width
u32 height
u32 par
Double FPS
struct __track_audio_info
+ Collaboration diagram for __track_audio_info:
Data Fields
u32 sample_rate
u32 nb_channels
struct __track_import_info
+ Collaboration diagram for __track_import_info:
Data Fields
u32 track_num
u32 type
u32 media_type
u32 flags
struct __track_video_info video_info
struct __track_audio_info audio_info
char szCodecProfile[20]
u32 lang
u32 mpeg4_es_id
u16 prog_num
struct __program_import_info
+ Collaboration diagram for __program_import_info:
Data Fields
u32 number
char name[40]
struct GF_MediaImporter
+ Collaboration diagram for GF_MediaImporter:
Data Fields
GF_ISOFile * dest
u32 trackID
char * in_name
u32 duration
u32 flags
u32 swf_flags
Float swf_flatten_angle
Double video_fps
GF_ESD * esd
char * streamFormat
u32 frames_per_sample
u32 final_trackID
char * force_ext
GF_ISOFile * orig
u32 fontSize
char * fontName
u32 text_track_width
u32 text_track_height
u32 text_width
u32 text_height
s32 text_x
s32 text_y
Double initial_time_offset
u32 nb_tracks
struct __track_import_info tk_info[100]
u32 nb_progs
struct __program_import_info pg_info[100]
GF_Err last_error
struct GF_DashSegmenterInput
+ Collaboration diagram for GF_DashSegmenterInput:
Data Fields
char * file_name
char representationID[100]
char periodID[100]
char role[100]
u32 bandwidth
struct GF_MediaExporter
+ Collaboration diagram for GF_MediaExporter:
Data Fields
GF_ISOFile * file
u32 trackID
u32 sample_num
char * out_name
u32 flags
char * in_name

Macro Definition Documentation

#define GF_IMPORT_DEFAULT_FPS   25.0
#define GF_IMPORT_AUTO_FPS   10000.0
#define GF_IMPORT_MAX_TRACKS   100

Enumeration Type Documentation

anonymous enum
Enumerator
GF_IMPORT_USE_DATAREF 
GF_IMPORT_NO_FRAME_DROP 
GF_IMPORT_FORCE_PACKED 
GF_IMPORT_SBR_IMPLICIT 
GF_IMPORT_SBR_EXPLICIT 
GF_IMPORT_FORCE_MPEG4 
GF_IMPORT_SKIP_TXT_BOX 
GF_IMPORT_KEEP_ALL_TRACKS 
GF_IMPORT_USE_COMPACT_SIZE 
GF_IMPORT_NO_TEXT_FLUSH 
GF_IMPORT_SVC_EXPLICIT 
GF_IMPORT_SVC_NONE 
GF_IMPORT_PS_IMPLICIT 
GF_IMPORT_PS_EXPLICIT 
GF_IMPORT_OVSBR 
GF_IMPORT_SET_SUBSAMPLES 
GF_IMPORT_FORCE_SYNC 
GF_IMPORT_PROBE_ONLY 
GF_IMPORT_3GPP_AGGREGATION 
GF_IMPORT_OVERRIDE_FPS 
GF_IMPORT_NO_DURATION 
GF_IMPORT_MPE_DEMUX 
GF_IMPORT_DO_ABORT 
Enumerator
GF_DASH_PROFILE_FULL 
GF_DASH_PROFILE_LIVE 
GF_DASH_PROFILE_ONDEMAND 
GF_DASH_PROFILE_MAIN 
GF_DASH_PROFILE_AVC264_LIVE 
GF_DASH_PROFILE_AVC264_ONDEMAND 
GF_DASH_PROFILE_UNKNOWN 
Enumerator
GF_DASH_BSMODE_NONE 
GF_DASH_BSMODE_INBAND 
GF_DASH_BSMODE_MERGED 
GF_DASH_BSMODE_SINGLE 
anonymous enum
Enumerator
GF_EXPORT_NATIVE 
GF_EXPORT_RAW_SAMPLES 
GF_EXPORT_NHNT 
GF_EXPORT_AVI 
GF_EXPORT_MP4 
GF_EXPORT_AVI_NATIVE 
GF_EXPORT_NHML 
GF_EXPORT_SAF 
GF_EXPORT_WEBVTT_META 
GF_EXPORT_WEBVTT_META_EMBEDDED 
GF_EXPORT_SIX 
GF_EXPORT_MERGE 
GF_EXPORT_USE_QCP 
GF_EXPORT_NHML_FULL 
GF_EXPORT_SVC_LAYER 
GF_EXPORT_WEBVTT_NOMERGE 
GF_EXPORT_PROBE_ONLY 
GF_EXPORT_DO_ABORT 
anonymous enum
Enumerator
GF_SDP_IOD_NONE 
GF_SDP_IOD_REGULAR 
GF_SDP_IOD_ISMA 
GF_SDP_IOD_ISMA_STRICT 

Function Documentation

GF_Err gf_media_get_file_hash ( const char *  file,
u8  hash[20] 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_ESD* gf_media_map_esd ( GF_ISOFile *  mp4,
u32  track 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_change_par ( GF_ISOFile *  file,
u32  track,
s32  ar_num,
s32  ar_den 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_import ( GF_MediaImporter importer)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_import_chapters ( GF_ISOFile *  file,
char *  chap_file,
Double  import_fps 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_make_isma ( GF_ISOFile *  mp4file,
Bool  keepESIDs,
Bool  keepImage,
Bool  no_ocr 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_make_3gpp ( GF_ISOFile *  mp4file)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_make_psp ( GF_ISOFile *  mp4file)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_change_pl ( GF_ISOFile *  file,
u32  track,
u32  profile,
u32  level 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_avc_rewrite_samples ( GF_ISOFile *  file,
u32  track,
u32  prev_size_in_bits,
u32  new_size_in_bits 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_split_svc ( GF_ISOFile *  file,
u32  track,
Bool  splitAll 
)

+ Here is the caller graph for this function:

GF_Err gf_media_merge_svc ( GF_ISOFile *  file,
u32  track,
Bool  mergeAll 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_split_shvc ( GF_ISOFile *  file,
u32  track,
Bool  splitAll,
Bool  use_extractors 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_split_hevc_tiles ( GF_ISOFile *  file)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_dasher_segment_files ( const char *  mpd_name,
GF_DashSegmenterInput inputs,
u32  nb_inputs,
GF_DashProfile  profile,
const char *  mpd_title,
const char *  mpd_source,
const char *  mpd_copyright,
const char *  mpd_moreInfoURL,
const char **  mpd_base_urls,
u32  nb_mpd_base_urls,
u32  use_url_template,
Bool  use_segment_timeline,
Bool  single_segment,
Bool  single_file,
GF_DashSwitchingMode  bitstream_switching_mode,
Bool  segments_start_with_rap,
Double  dash_duration_sec,
char *  seg_rad_name,
char *  seg_ext,
u32  segment_marker_4cc,
Double  frag_duration_sec,
s32  subsegs_per_sidx,
Bool  daisy_chain_sidx,
Bool  fragments_start_with_rap,
const char *  tmp_dir,
GF_Config *  dash_ctx,
u32  dash_dynamic,
u32  mpd_update_time,
u32  time_shift_depth,
Double  subduration,
Double  min_buffer,
u32  ast_shift_sec,
u32  dash_scale,
Bool  fragments_in_memory,
u32  initial_moof_sn,
u64  initial_tfdt,
Bool  no_fragments_defaults,
Bool  pssh_moof 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_dasher_next_update_time ( GF_Config *  dash_ctx,
u32  mpd_update_time 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_fragment_file ( GF_ISOFile *  input,
const char *  output_file,
Double  max_duration_sec 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_media_export ( GF_MediaExporter dump)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_RTPHinter* gf_hinter_track_new ( GF_ISOFile *  file,
u32  TrackNum,
u32  Path_MTU,
u32  max_ptime,
u32  default_rtp_rate,
u32  hint_flags,
u8  PayloadID,
Bool  copy_media,
u32  InterleaveGroupID,
u8  InterleaveGroupPriority,
GF_Err e 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_hinter_track_del ( GF_RTPHinter *  tkHinter)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_hinter_track_process ( GF_RTPHinter *  tkHint)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_hinter_track_get_bandwidth ( GF_RTPHinter *  tkHinter)

+ Here is the caller graph for this function:

u32 gf_hinter_track_get_flags ( GF_RTPHinter *  tkHinter)

+ Here is the caller graph for this function:

void gf_hinter_track_get_payload_name ( GF_RTPHinter *  tkHint,
char *  payloadName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_hinter_track_finalize ( GF_RTPHinter *  tkHint,
Bool  AddSystemInfo 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_hinter_finalize ( GF_ISOFile *  file,
u32  IOD_Profile,
u32  bandwidth 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool gf_hinter_can_embbed_data ( char *  data,
u32  data_size,
u32  streamType 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_SAFMuxer* gf_saf_mux_new ( )

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_saf_mux_del ( GF_SAFMuxer *  mux)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_saf_mux_stream_add ( GF_SAFMuxer *  mux,
u32  stream_id,
u32  ts_res,
u32  buffersize_db,
u8  stream_type,
u8  object_type,
char *  mime_type,
char *  dsi,
u32  dsi_len,
char *  remote_url 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_saf_mux_stream_rem ( GF_SAFMuxer *  mux,
u32  stream_id 
)

+ Here is the call graph for this function:

GF_Err gf_saf_mux_add_au ( GF_SAFMuxer *  mux,
u32  stream_id,
u32  CTS,
char *  data,
u32  data_len,
Bool  is_rap 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_saf_mux_for_time ( GF_SAFMuxer *  mux,
u32  time_ms,
Bool  force_end_of_session,
char **  out_data,
u32 out_size 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_media_reduce_aspect_ratio ( u32 width,
u32 height 
)

+ Here is the caller graph for this function:

void gf_media_get_reduced_frame_rate ( u32 timescale,
u32 sample_dur 
)

+ Here is the caller graph for this function: