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
m2ts_mux.c File Reference
#include <gpac/mpegts.h>
#include <gpac/constants.h>
#include <gpac/media_tools.h>
+ Include dependency graph for m2ts_mux.c:

Macros

#define PCR_UPDATE_MS   200
 
#define BITRATE_UPDATE_WINDOW   90000
 
#define ADAPTATION_LENGTH_LENGTH   1
 
#define ADAPTATION_FLAGS_LENGTH   1
 
#define PCR_LENGTH   6
 
#define FORCE_PCR_FIRST   0
 

Functions

static Bool gf_m2ts_time_less (GF_M2TS_Time *a, GF_M2TS_Time *b)
 
static Bool gf_m2ts_time_less_or_equal (GF_M2TS_Time *a, GF_M2TS_Time *b)
 
static void gf_m2ts_time_inc (GF_M2TS_Time *time, u32 delta_inc_num, u32 delta_inc_den)
 
void gf_m2ts_mux_table_update (GF_M2TS_Mux_Stream *stream, u8 table_id, u16 table_id_extension, u8 *table_payload, u32 table_payload_length, Bool use_syntax_indicator, Bool private_indicator, Bool use_checksum)
 
void gf_m2ts_mux_table_update_bitrate (GF_M2TS_Mux *mux, GF_M2TS_Mux_Stream *stream)
 
void gf_m2ts_mux_table_update_mpeg4 (GF_M2TS_Mux_Stream *stream, u8 table_id, u16 table_id_extension, char *table_payload, u32 table_payload_length, Bool use_syntax_indicator, Bool private_indicator, Bool increment_version_number, Bool use_checksum)
 
static u32 gf_m2ts_add_adaptation (GF_M2TS_Mux_Program *prog, GF_BitStream *bs, u16 pid, Bool has_pcr, u64 pcr_time, Bool is_rap, u32 padding_length)
 
void gf_m2ts_mux_table_get_next_packet (GF_M2TS_Mux_Stream *stream, char *packet)
 
u32 gf_m2ts_stream_process_pat (GF_M2TS_Mux *muxer, GF_M2TS_Mux_Stream *stream)
 
u32 gf_m2ts_stream_process_pmt (GF_M2TS_Mux *muxer, GF_M2TS_Mux_Stream *stream)
 
static void gf_m2ts_remap_timestamps_for_pes (GF_M2TS_Mux_Stream *stream, u32 pck_flags, u64 *dts, u64 *cts)
 
u32 gf_m2ts_stream_process_stream (GF_M2TS_Mux *muxer, GF_M2TS_Mux_Stream *stream)
 
static u64 gf_m2ts_get_pcr (GF_M2TS_Mux_Program *program)
 
void gf_m2ts_stream_update_data_following (GF_M2TS_Mux_Stream *stream)
 
Bool gf_m2ts_stream_compute_pes_length (GF_M2TS_Mux_Stream *stream, u32 payload_length)
 
static u32 gf_m2ts_stream_get_pes_header_length (GF_M2TS_Mux_Stream *stream)
 
u32 gf_m2ts_stream_add_pes_header (GF_BitStream *bs, GF_M2TS_Mux_Stream *stream, u32 payload_length)
 
void gf_m2ts_mux_pes_get_next_packet (GF_M2TS_Mux_Stream *stream, char *packet)
 
GF_M2TS_Mux_Streamgf_m2ts_stream_new (u32 pid)
 
GF_Err gf_m2ts_output_ctrl (GF_ESInterface *_self, u32 ctrl_type, void *param)
 
static void gf_m2ts_stream_set_default_slconfig (GF_M2TS_Mux_Stream *stream)
 
static u32 gf_m2ts_stream_get_pid (GF_M2TS_Mux_Program *program, u32 stream_id)
 
static void gf_m2ts_stream_add_hierarchy_descriptor (GF_M2TS_Mux_Stream *stream)
 
GF_M2TS_Mux_Streamgf_m2ts_program_stream_add (GF_M2TS_Mux_Program *program, struct __elementary_stream_ifce *ifce, u32 pid, Bool is_pcr, Bool force_pes)
 
GF_Err gf_m2ts_program_stream_update_ts_scale (GF_ESInterface *_self, u32 time_scale)
 
GF_M2TS_Mux_Program * gf_m2ts_mux_program_add (GF_M2TS_Mux *muxer, u32 program_number, u32 pmt_pid, u32 pmt_refresh_rate, u32 pcr_offset, Bool mpeg4_signaling)
 
GF_M2TS_Mux * gf_m2ts_mux_new (u32 mux_rate, u32 pat_refresh_rate, Bool real_time)
 
void gf_m2ts_mux_stream_del (GF_M2TS_Mux_Stream *st)
 
void gf_m2ts_mux_program_del (GF_M2TS_Mux_Program *prog)
 
void gf_m2ts_mux_del (GF_M2TS_Mux *mux)
 
void gf_m2ts_mux_update_bitrate (GF_M2TS_Mux *mux)
 
void gf_m2ts_mux_update_config (GF_M2TS_Mux *mux, Bool reset_time)
 
u32 gf_m2ts_get_sys_clock (GF_M2TS_Mux *muxer)
 
u32 gf_m2ts_get_ts_clock (GF_M2TS_Mux *muxer)
 
GF_Err gf_m2ts_mux_use_single_au_pes_mode (GF_M2TS_Mux *muxer, Bool strict_au_pes_mode)
 
GF_Err gf_m2ts_mux_set_initial_pcr (GF_M2TS_Mux *muxer, u64 init_pcr_value)
 
const char * gf_m2ts_mux_process (GF_M2TS_Mux *muxer, u32 *status, u32 *usec_till_next)
 

Macro Definition Documentation

#define PCR_UPDATE_MS   200
#define BITRATE_UPDATE_WINDOW   90000
#define ADAPTATION_LENGTH_LENGTH   1
#define ADAPTATION_FLAGS_LENGTH   1
#define PCR_LENGTH   6
#define FORCE_PCR_FIRST   0

Function Documentation

static Bool gf_m2ts_time_less ( GF_M2TS_Time a,
GF_M2TS_Time b 
)
static

+ Here is the caller graph for this function:

static Bool gf_m2ts_time_less_or_equal ( GF_M2TS_Time a,
GF_M2TS_Time b 
)
static

+ Here is the caller graph for this function:

static void gf_m2ts_time_inc ( GF_M2TS_Time time,
u32  delta_inc_num,
u32  delta_inc_den 
)
static

+ Here is the caller graph for this function:

void gf_m2ts_mux_table_update ( GF_M2TS_Mux_Stream stream,
u8  table_id,
u16  table_id_extension,
u8 table_payload,
u32  table_payload_length,
Bool  use_syntax_indicator,
Bool  private_indicator,
Bool  use_checksum 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_m2ts_mux_table_update_bitrate ( GF_M2TS_Mux *  mux,
GF_M2TS_Mux_Stream stream 
)

+ Here is the caller graph for this function:

void gf_m2ts_mux_table_update_mpeg4 ( GF_M2TS_Mux_Stream stream,
u8  table_id,
u16  table_id_extension,
char *  table_payload,
u32  table_payload_length,
Bool  use_syntax_indicator,
Bool  private_indicator,
Bool  increment_version_number,
Bool  use_checksum 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 gf_m2ts_add_adaptation ( GF_M2TS_Mux_Program *  prog,
GF_BitStream *  bs,
u16  pid,
Bool  has_pcr,
u64  pcr_time,
Bool  is_rap,
u32  padding_length 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_m2ts_mux_table_get_next_packet ( GF_M2TS_Mux_Stream stream,
char *  packet 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_m2ts_stream_process_pat ( GF_M2TS_Mux *  muxer,
GF_M2TS_Mux_Stream stream 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_m2ts_stream_process_pmt ( GF_M2TS_Mux *  muxer,
GF_M2TS_Mux_Stream stream 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gf_m2ts_remap_timestamps_for_pes ( GF_M2TS_Mux_Stream stream,
u32  pck_flags,
u64 dts,
u64 cts 
)
static

+ Here is the caller graph for this function:

u32 gf_m2ts_stream_process_stream ( GF_M2TS_Mux *  muxer,
GF_M2TS_Mux_Stream stream 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u64 gf_m2ts_get_pcr ( GF_M2TS_Mux_Program *  program)
static

+ Here is the caller graph for this function:

void gf_m2ts_stream_update_data_following ( GF_M2TS_Mux_Stream stream)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool gf_m2ts_stream_compute_pes_length ( GF_M2TS_Mux_Stream stream,
u32  payload_length 
)

+ Here is the caller graph for this function:

static u32 gf_m2ts_stream_get_pes_header_length ( GF_M2TS_Mux_Stream stream)
static

+ Here is the caller graph for this function:

u32 gf_m2ts_stream_add_pes_header ( GF_BitStream *  bs,
GF_M2TS_Mux_Stream stream,
u32  payload_length 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_m2ts_mux_pes_get_next_packet ( GF_M2TS_Mux_Stream stream,
char *  packet 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_M2TS_Mux_Stream* gf_m2ts_stream_new ( u32  pid)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_m2ts_output_ctrl ( GF_ESInterface _self,
u32  ctrl_type,
void *  param 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gf_m2ts_stream_set_default_slconfig ( GF_M2TS_Mux_Stream stream)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 gf_m2ts_stream_get_pid ( GF_M2TS_Mux_Program *  program,
u32  stream_id 
)
static

+ Here is the caller graph for this function:

static void gf_m2ts_stream_add_hierarchy_descriptor ( GF_M2TS_Mux_Stream stream)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_M2TS_Mux_Stream* gf_m2ts_program_stream_add ( GF_M2TS_Mux_Program *  program,
struct __elementary_stream_ifce *  ifce,
u32  pid,
Bool  is_pcr,
Bool  force_pes 
)

+ Here is the call graph for this function:

GF_Err gf_m2ts_program_stream_update_ts_scale ( GF_ESInterface _self,
u32  time_scale 
)
GF_M2TS_Mux_Program* gf_m2ts_mux_program_add ( GF_M2TS_Mux *  muxer,
u32  program_number,
u32  pmt_pid,
u32  pmt_refresh_rate,
u32  pcr_offset,
Bool  mpeg4_signaling 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_M2TS_Mux* gf_m2ts_mux_new ( u32  mux_rate,
u32  pat_refresh_rate,
Bool  real_time 
)

mux_rate en kbps

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_m2ts_mux_stream_del ( GF_M2TS_Mux_Stream st)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_m2ts_mux_program_del ( GF_M2TS_Mux_Program *  prog)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_m2ts_mux_del ( GF_M2TS_Mux *  mux)

+ Here is the call graph for this function:

void gf_m2ts_mux_update_bitrate ( GF_M2TS_Mux *  mux)

+ Here is the call graph for this function:

void gf_m2ts_mux_update_config ( GF_M2TS_Mux *  mux,
Bool  reset_time 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_m2ts_get_sys_clock ( GF_M2TS_Mux *  muxer)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_m2ts_get_ts_clock ( GF_M2TS_Mux *  muxer)
GF_Err gf_m2ts_mux_use_single_au_pes_mode ( GF_M2TS_Mux *  muxer,
Bool  strict_au_pes_mode 
)
GF_Err gf_m2ts_mux_set_initial_pcr ( GF_M2TS_Mux *  muxer,
u64  init_pcr_value 
)
const char* gf_m2ts_mux_process ( GF_M2TS_Mux *  muxer,
u32 status,
u32 usec_till_next 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: