libgpac
Documentation of the core library of GPAC
|
MPEG-TS demultiplexer and multiplexer APIs. More...
Modules | |
ES Interface | |
Basic stream interface API used by MPEG-2 TS muxer. | |
Data Structures | |
struct | GF_M2TS_Section |
struct | GF_M2TS_Table |
struct | GF_M2TS_SectionFilter |
struct | GF_M2TS_MetadataPointerDescriptor |
struct | GF_M2TS_TemiLocationDescriptor |
struct | GF_M2TS_TemiTimecodeDescriptor |
struct | GF_M2TS_Program |
struct | GF_M2TS_ES |
struct | GF_M2TS_PESHeader |
struct | GF_M2TS_SECTION_ES |
struct | GF_M2TS_DVB_Subtitling_Descriptor |
struct | GF_M2TS_DVB_Teletext_Descriptor |
struct | GF_M2TS_MetadataDescriptor |
struct | GF_M2TS_Header |
struct | GF_M2TS_AdaptationField |
struct | GF_M2TS_Mux_Section |
struct | GF_M2TS_Mux_Table |
struct | GF_M2TS_Time |
struct | GF_M2TS_Packet |
struct | GF_M2TS_Mux_Stream |
struct | GF_M2TSDescriptor |
struct | GF_M2TS_Mux_Program |
struct | GF_M2TS_Mux |
Macros | |
#define | SECTION_HEADER_LENGTH 3 |
#define | SECTION_ADDITIONAL_HEADER_LENGTH 5 |
#define | CRC_LENGTH 4 |
#define | GF_M2TS_MAX_STREAMS 8192 |
#define | GF_M2TS_MAX_SERVICES 65535 |
#define | GF_M2TS_UDP_BUFFER_SIZE 0x40000 |
#define | GF_M2TS_MAX_PCR 2576980377811ULL |
#define | ABSTRACT_ES |
#define | GF_M2TS_PSI_DEFAULT_REFRESH_RATE 200 |
Typedefs | |
typedef struct tag_m2ts_demux | GF_M2TS_Demuxer |
typedef void(* | gf_m2ts_section_callback) (GF_M2TS_Demuxer *demux, GF_M2TS_SECTION_ES *es, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) |
Enumerations | |
enum | { GF_M2TS_META_ID3 = GF_4CC('I','D','3',' ') , GF_M2TS_META_KLVA = GF_4CC('K','L','V','A') } |
enum | { GF_M2TS_VIDEO_STREAM_DESCRIPTOR = 0x02 , GF_M2TS_AUDIO_STREAM_DESCRIPTOR = 0x03 , GF_M2TS_HIERARCHY_DESCRIPTOR = 0x04 , GF_M2TS_REGISTRATION_DESCRIPTOR = 0x05 , GF_M2TS_DATA_STREAM_ALIGNEMENT_DESCRIPTOR = 0x06 , GF_M2TS_TARGET_BACKGROUND_GRID_DESCRIPTOR = 0x07 , GF_M2TS_VIEW_WINDOW_DESCRIPTOR = 0x08 , GF_M2TS_CA_DESCRIPTOR = 0x09 , GF_M2TS_ISO_639_LANGUAGE_DESCRIPTOR = 0x0A , GF_M2TS_DVB_IP_MAC_PLATFORM_NAME_DESCRIPTOR = 0x0C , GF_M2TS_DVB_IP_MAC_PLATFORM_PROVIDER_NAME_DESCRIPTOR = 0x0D , GF_M2TS_PRIVATE_DATA_INDICATOR_DESCRIPTOR = 0x0F , GF_M2TS_DVB_STREAM_LOCATION_DESCRIPTOR =0x13 , GF_M2TS_STD_DESCRIPTOR = 0x17 , GF_M2TS_MPEG4_VIDEO_DESCRIPTOR = 0x1B , GF_M2TS_MPEG4_AUDIO_DESCRIPTOR = 0x1C , GF_M2TS_MPEG4_IOD_DESCRIPTOR = 0x1D , GF_M2TS_MPEG4_SL_DESCRIPTOR = 0x1E , GF_M2TS_MPEG4_FMC_DESCRIPTOR = 0x1F , GF_M2TS_METADATA_POINTER_DESCRIPTOR = 0x25 , GF_M2TS_METADATA_DESCRIPTOR = 0x26 , GF_M2TS_AVC_VIDEO_DESCRIPTOR = 0x28 , GF_M2TS_AVC_TIMING_HRD_DESCRIPTOR = 0x2A , GF_M2TS_SVC_EXTENSION_DESCRIPTOR = 0x30 , GF_M2TS_MPEG4_ODUPDATE_DESCRIPTOR = 0x35 , GF_M2TS_HEVC_VIDEO_DESCRIPTOR = 0x38 , GF_M2TS_DVB_NETWORK_NAME_DESCRIPTOR = 0x40 , GF_M2TS_DVB_SERVICE_LIST_DESCRIPTOR = 0x41 , GF_M2TS_DVB_STUFFING_DESCRIPTOR = 0x42 , GF_M2TS_DVB_SAT_DELIVERY_SYSTEM_DESCRIPTOR = 0x43 , GF_M2TS_DVB_CABLE_DELIVERY_SYSTEM_DESCRIPTOR = 0x44 , GF_M2TS_DVB_VBI_DATA_DESCRIPTOR = 0x45 , GF_M2TS_DVB_VBI_TELETEXT_DESCRIPTOR = 0x46 , GF_M2TS_DVB_BOUQUET_NAME_DESCRIPTOR = 0x47 , GF_M2TS_DVB_SERVICE_DESCRIPTOR = 0x48 , GF_M2TS_DVB_COUNTRY_AVAILABILITY_DESCRIPTOR = 0x49 , GF_M2TS_DVB_LINKAGE_DESCRIPTOR = 0x4A , GF_M2TS_DVB_NVOD_REFERENCE_DESCRIPTOR = 0x4B , GF_M2TS_DVB_TIME_SHIFTED_SERVICE_DESCRIPTOR = 0x4C , GF_M2TS_DVB_SHORT_EVENT_DESCRIPTOR = 0x4D , GF_M2TS_DVB_EXTENDED_EVENT_DESCRIPTOR = 0x4E , GF_M2TS_DVB_TIME_SHIFTED_EVENT_DESCRIPTOR = 0x4F , GF_M2TS_DVB_COMPONENT_DESCRIPTOR = 0x50 , GF_M2TS_DVB_MOSAIC_DESCRIPTOR = 0x51 , GF_M2TS_DVB_STREAM_IDENTIFIER_DESCRIPTOR = 0x52 , GF_M2TS_DVB_CA_IDENTIFIER_DESCRIPTOR = 0x53 , GF_M2TS_DVB_CONTENT_DESCRIPTOR = 0x54 , GF_M2TS_DVB_PARENTAL_RATING_DESCRIPTOR = 0x55 , GF_M2TS_DVB_TELETEXT_DESCRIPTOR = 0x56 , GF_M2TS_DVB_LOCAL_TIME_OFFSET_DESCRIPTOR = 0x58 , GF_M2TS_DVB_SUBTITLING_DESCRIPTOR = 0x59 , GF_M2TS_DVB_PRIVATE_DATA_SPECIFIER_DESCRIPTOR = 0x5F , GF_M2TS_DVB_DATA_BROADCAST_DESCRIPTOR = 0x64 , GF_M2TS_DVB_DATA_BROADCAST_ID_DESCRIPTOR = 0x66 , GF_M2TS_DVB_AC3_DESCRIPTOR = 0x6A , GF_M2TS_DVB_TIME_SLICE_FEC_DESCRIPTOR = 0x77 , GF_M2TS_DVB_EAC3_DESCRIPTOR = 0x7A , GF_M2TS_DVB_LOGICAL_CHANNEL_DESCRIPTOR = 0x83 , GF_M2TS_DOLBY_VISION_DESCRIPTOR = 0xB0 } |
enum | { GF_M2TS_PID_PAT = 0x0000 , GF_M2TS_PID_CAT = 0x0001 , GF_M2TS_PID_TSDT = 0x0002 , GF_M2TS_PID_NIT_ST = 0x0010 , GF_M2TS_PID_SDT_BAT_ST = 0x0011 , GF_M2TS_PID_EIT_ST_CIT = 0x0012 , GF_M2TS_PID_RST_ST = 0x0013 , GF_M2TS_PID_TDT_TOT_ST = 0x0014 , GF_M2TS_PID_NET_SYNC = 0x0015 , GF_M2TS_PID_RNT = 0x0016 , GF_M2TS_PID_IN_SIG = 0x001C , GF_M2TS_PID_MEAS = 0x001D , GF_M2TS_PID_DIT = 0x001E , GF_M2TS_PID_SIT = 0x001F } |
enum | { GF_M2TS_TABLE_ID_PAT = 0x00 , GF_M2TS_TABLE_ID_CAT = 0x01 , GF_M2TS_TABLE_ID_PMT = 0x02 , GF_M2TS_TABLE_ID_TSDT = 0x03 , GF_M2TS_TABLE_ID_MPEG4_BIFS = 0x04 , GF_M2TS_TABLE_ID_MPEG4_OD = 0x05 , GF_M2TS_TABLE_ID_METADATA = 0x06 , GF_M2TS_TABLE_ID_IPMP_CONTROL = 0x07 , GF_M2TS_TABLE_ID_DSM_CC_ENCAPSULATED_DATA = 0x3A , GF_M2TS_TABLE_ID_DSM_CC_UN_MESSAGE = 0x3B , GF_M2TS_TABLE_ID_DSM_CC_DOWNLOAD_DATA_MESSAGE = 0x3C , GF_M2TS_TABLE_ID_DSM_CC_STREAM_DESCRIPTION = 0x3D , GF_M2TS_TABLE_ID_DSM_CC_PRIVATE = 0x3E , GF_M2TS_TABLE_ID_NIT_ACTUAL = 0x40 , GF_M2TS_TABLE_ID_NIT_OTHER = 0x41 , GF_M2TS_TABLE_ID_SDT_ACTUAL = 0x42 , GF_M2TS_TABLE_ID_SDT_OTHER = 0x46 , GF_M2TS_TABLE_ID_BAT = 0x4a , GF_M2TS_TABLE_ID_INT = 0x4c , GF_M2TS_TABLE_ID_EIT_ACTUAL_PF = 0x4E , GF_M2TS_TABLE_ID_EIT_OTHER_PF = 0x4F , GF_M2TS_TABLE_ID_EIT_SCHEDULE_MIN = 0x50 , GF_M2TS_TABLE_ID_EIT_SCHEDULE_ACTUAL_MAX = 0x5F , GF_M2TS_TABLE_ID_EIT_SCHEDULE_MAX = 0x6F , GF_M2TS_TABLE_ID_TDT = 0x70 , GF_M2TS_TABLE_ID_RST = 0x71 , GF_M2TS_TABLE_ID_ST = 0x72 , GF_M2TS_TABLE_ID_TOT = 0x73 , GF_M2TS_TABLE_ID_AIT = 0x74 , GF_M2TS_TABLE_ID_CONT = 0x75 , GF_M2TS_TABLE_ID_RC = 0x76 , GF_M2TS_TABLE_ID_CID = 0x77 , GF_M2TS_TABLE_ID_MPE_FEC = 0x78 , GF_M2TS_TABLE_ID_RES_NOT = 0x79 , GF_M2TS_TABLE_ID_DIT = 0x7E , GF_M2TS_TABLE_ID_SIT = 0x7F , GF_M2TS_TABLE_ID_SCTE35_SPLICE_INFO = 0xFC } |
enum | GF_M2TSStreamType { GF_M2TS_VIDEO_MPEG1 = 0x01 , GF_M2TS_VIDEO_MPEG2 = 0x02 , GF_M2TS_AUDIO_MPEG1 = 0x03 , GF_M2TS_AUDIO_MPEG2 = 0x04 , GF_M2TS_PRIVATE_SECTION = 0x05 , GF_M2TS_PRIVATE_DATA = 0x06 , GF_M2TS_MHEG = 0x07 , GF_M2TS_13818_1_DSMCC = 0x08 , GF_M2TS_H222_1 = 0x09 , GF_M2TS_13818_6_ANNEX_A = 0x0A , GF_M2TS_13818_6_ANNEX_B = 0x0B , GF_M2TS_13818_6_ANNEX_C = 0x0C , GF_M2TS_13818_6_ANNEX_D = 0x0D , GF_M2TS_13818_1_AUXILIARY = 0x0E , GF_M2TS_AUDIO_AAC = 0x0F , GF_M2TS_VIDEO_MPEG4 = 0x10 , GF_M2TS_AUDIO_LATM_AAC = 0x11 , GF_M2TS_SYSTEMS_MPEG4_PES = 0x12 , GF_M2TS_SYSTEMS_MPEG4_SECTIONS = 0x13 , GF_M2TS_SYNC_DOWNLOAD_PROTOCOL = 0x14 , GF_M2TS_METADATA_PES = 0x15 , GF_M2TS_METADATA_SECTION = 0x16 , GF_M2TS_METADATA_DATA_CAROUSEL = 0x17 , GF_M2TS_METADATA_OBJECT_CAROUSEL = 0x18 , GF_M2TS_METADATA_SYNC_DOWNLOAD_PROTOCOL = 0x19 , GF_M2TS_IPMP = 0x1A , GF_M2TS_VIDEO_H264 = 0x1B , GF_M2TS_MPEG4_AUDIO_NO_SYNTAX = 0x1C , GF_M2TS_MPEG4_TEXT = 0x1D , GF_M2TS_AUX_VIDEO_23002_2 = 0x1E , GF_M2TS_VIDEO_SVC = 0x1F , GF_M2TS_VIDEO_MVC = 0x20 , GF_M2TS_VIDEO_15444_1 = 0x21 , GF_M2TS_VIDEO_MPEG2_ADD_STEREO = 0x22 , GF_M2TS_VIDEO_H264_ADD_STEREO = 0x23 , GF_M2TS_VIDEO_HEVC = 0x24 , GF_M2TS_VIDEO_HEVC_TEMPORAL = 0x25 , GF_M2TS_VIDEO_MVCD = 0x26 , GF_M2TS_TEMI = 0x27 , GF_M2TS_VIDEO_SHVC = 0x28 , GF_M2TS_VIDEO_SHVC_TEMPORAL = 0x29 , GF_M2TS_VIDEO_MHVC = 0x2A , GF_M2TS_VIDEO_MHVC_TEMPORAL = 0x2B , GF_M2TS_GREEN = 0x2C , GF_M2TS_MHAS_MAIN = 0x2D , GF_M2TS_MHAS_AUX = 0x2E , GF_M2TS_QUALITY_SEC = 0x2F , GF_M2TS_MORE_SEC = 0x30 , GF_M2TS_VIDEO_HEVC_MCTS = 0x31 , GF_M2TS_JPEG_XS = 0x32 , GF_M2TS_VIDEO_VVC = 0x33 , GF_M2TS_VIDEO_VVC_TEMPORAL = 0x34 , GF_M2TS_HLS_AC3_CRYPT = 0xc1 , GF_M2TS_HLS_EC3_CRYPT = 0xc2 , GF_M2TS_HLS_AAC_CRYPT = 0xcf , GF_M2TS_HLS_AVC_CRYPT = 0xdb , GF_M2TS_VIDEO_VC1 = 0xEA , GF_M2TS_VIDEO_DCII = 0x80 , GF_M2TS_AUDIO_AC3 = 0x81 , GF_M2TS_AUDIO_DTS = 0x82 , GF_M2TS_AUDIO_TRUEHD = 0x83 , GF_M2TS_AUDIO_EC3 = 0x84 , GF_M2TS_SCTE35_SPLICE_INFO_SECTIONS = 0x86 , GF_M2TS_MPE_SECTIONS = 0x90 , GF_M2TS_SUBTITLE_DVB = 0x100 , GF_M2TS_AUDIO_OPUS = 0x101 , GF_M2TS_VIDEO_AV1 = 0x102 , GF_M2TS_DVB_TELETEXT = 0x152 , GF_M2TS_DVB_VBI = 0x153 , GF_M2TS_DVB_SUBTITLE = 0x154 , GF_M2TS_METADATA_ID3_HLS = 0x155 , GF_M2TS_METADATA_ID3_KLVA = 0x156 } |
enum | { GF_M2TS_RA_STREAM_AC3 = GF_4CC('A','C','-','3') , GF_M2TS_RA_STREAM_EAC3 = GF_4CC('E','A','C','3') , GF_M2TS_RA_STREAM_VC1 = GF_4CC('V','C','-','1') , GF_M2TS_RA_STREAM_HEVC = GF_4CC('H','E','V','C') , GF_M2TS_RA_STREAM_DTS1 = GF_4CC('D','T','S','1') , GF_M2TS_RA_STREAM_DTS2 = GF_4CC('D','T','S','2') , GF_M2TS_RA_STREAM_DTS3 = GF_4CC('D','T','S','3') , GF_M2TS_RA_STREAM_OPUS = GF_4CC('O','p','u','s') , GF_M2TS_RA_STREAM_DOVI = GF_4CC('D','O','V','I') , GF_M2TS_RA_STREAM_AV1 = GF_4CC('A','V','0','1') , GF_M2TS_RA_STREAM_SCTE35 = GF_4CC('C','U','E','I') , GF_M2TS_RA_STREAM_GPAC = GF_4CC('G','P','A','C') } |
enum | { GF_M2TS_AFDESC_TIMELINE_DESCRIPTOR = 0x04 , GF_M2TS_AFDESC_LOCATION_DESCRIPTOR = 0x05 , GF_M2TS_AFDESC_BASEURL_DESCRIPTOR = 0x06 } |
enum | GF_M2TSPesFraming { GF_M2TS_PES_FRAMING_SKIP , GF_M2TS_PES_FRAMING_SKIP_NO_RESET , GF_M2TS_PES_FRAMING_RAW , GF_M2TS_PES_FRAMING_DEFAULT } |
enum | { GF_M2TS_PES_PCK_RAP = 1 , GF_M2TS_PES_PCK_AU_START = 1<<1 , GF_M2TS_PES_PCK_I_FRAME = 1<<2 , GF_M2TS_PES_PCK_P_FRAME = 1<<3 , GF_M2TS_PES_PCK_B_FRAME = 1<<4 , GF_M2TS_PES_PCK_DISCONTINUITY = 1<<5 } |
enum | { GF_M2TS_EVT_PAT_FOUND = 0 , GF_M2TS_EVT_PAT_UPDATE , GF_M2TS_EVT_PAT_REPEAT , GF_M2TS_EVT_PMT_FOUND , GF_M2TS_EVT_PMT_REPEAT , GF_M2TS_EVT_PMT_UPDATE , GF_M2TS_EVT_SDT_FOUND , GF_M2TS_EVT_SDT_REPEAT , GF_M2TS_EVT_SDT_UPDATE , GF_M2TS_EVT_INT_FOUND , GF_M2TS_EVT_INT_REPEAT , GF_M2TS_EVT_INT_UPDATE , GF_M2TS_EVT_PES_PCK , GF_M2TS_EVT_PES_PCR , GF_M2TS_EVT_PES_TIMING , GF_M2TS_EVT_SL_PCK , GF_M2TS_EVT_IP_DATAGRAM , GF_M2TS_EVT_DURATION_ESTIMATED , GF_M2TS_EVT_PCK , GF_M2TS_EVT_AAC_CFG , GF_M2TS_EVT_TDT , GF_M2TS_EVT_TOT , GF_M2TS_EVT_DVB_GENERAL , GF_M2TS_EVT_DVB_MPE , GF_M2TS_EVT_CAT_FOUND , GF_M2TS_EVT_CAT_REPEAT , GF_M2TS_EVT_CAT_UPDATE , GF_M2TS_EVT_AIT_FOUND , GF_M2TS_EVT_DSMCC_FOUND , GF_M2TS_EVT_TEMI_LOCATION , GF_M2TS_EVT_TEMI_TIMECODE , GF_M2TS_EVT_SCTE35_SPLICE_INFO , GF_M2TS_EVT_ID3 , GF_M2TS_EVT_STREAM_REMOVED } |
enum | { GF_M2TS_TABLE_START = 1 , GF_M2TS_TABLE_END = 1<<1 , GF_M2TS_TABLE_FOUND = 1<<2 , GF_M2TS_TABLE_UPDATE = 1<<3 , GF_M2TS_TABLE_REPEAT = 1<<4 } |
enum | metadata_carriage { METADATA_CARRIAGE_SAME_TS = 0 , METADATA_CARRIAGE_DIFFERENT_TS = 1 , METADATA_CARRIAGE_PS = 2 , METADATA_CARRIAGE_OTHER = 3 } |
enum | { GF_M2TS_ES_IS_PES = 1 , GF_M2TS_ES_IS_SECTION = 1<<1 , GF_M2TS_ES_IS_FMC = 1<<2 , GF_M2TS_ES_IS_SL = 1<<3 , GF_M2TS_ES_IS_MPEG4_OD = 1<<4 , GF_M2TS_ES_IS_MPE = 1<<5 , GF_M2TS_INHERIT_PCR = 1<<6 , GF_M2TS_FAKE_PCR = 1<<7 , GF_M2TS_GPAC_CODEC_ID = 1<<8 , GF_M2TS_ES_IS_PMT = 1<<9 , GF_M2TS_ES_IS_PCR_REUSE = 1<<10 , GF_M2TS_ES_STATIC_FLAGS_MASK = 0x0000FFFF , GF_M2TS_ES_SEND_REPEATED_SECTIONS = 1<<16 , GF_M2TS_ES_IGNORE_NEXT_DISCONTINUITY = 1<<17 , GF_M2TS_ES_ALREADY_DECLARED = 1<<18 , GF_M2TS_ES_TEMI_INFO = 1<<19 , GF_M2TS_ES_FULL_AU = 1<<20 , GF_M2TS_CHECK_DISC = 1<<21 , GF_M2TS_CHECK_VC1 = 1<<22 } |
enum | { GF_M2TS_ADAPTATION_RESERVED = 0 , GF_M2TS_ADAPTATION_NONE = 1 , GF_M2TS_ADAPTATION_ONLY = 2 , GF_M2TS_ADAPTATION_AND_PAYLOAD = 3 } |
enum | { GF_M2TS_MPEG4_SIGNALING_NONE = 0 , GF_M2TS_MPEG4_SIGNALING_FULL , GF_M2TS_MPEG4_SIGNALING_SCENE } |
enum | GF_M2TS_PackMode { GF_M2TS_PACK_AUDIO_ONLY =0 , GF_M2TS_PACK_NONE , GF_M2TS_PACK_ALL } |
enum | GF_M2TSMuxState { GF_M2TS_STATE_IDLE , GF_M2TS_STATE_DATA , GF_M2TS_STATE_PADDING , GF_M2TS_STATE_EOS } |
Functions | |
const char * | gf_m2ts_get_stream_name (GF_M2TSStreamType streamType) |
Bool | gf_m2ts_probe_file (const char *fileName) |
Bool | gf_m2ts_probe_data (const u8 *data, u32 size) |
GF_Err | gf_m2ts_restamp (u8 *buffer, u32 size, s64 ts_shift, u8 is_pes[GF_M2TS_MAX_STREAMS]) |
GF_M2TS_Demuxer * | gf_m2ts_demux_new () |
void | gf_m2ts_demux_del (GF_M2TS_Demuxer *demux) |
void | gf_m2ts_reset_parsers (GF_M2TS_Demuxer *demux) |
void | gf_m2ts_mark_seg_start (GF_M2TS_Demuxer *demux) |
void | gf_m2ts_reset_parsers_for_program (GF_M2TS_Demuxer *demux, GF_M2TS_Program *program) |
GF_Err | gf_m2ts_set_pes_framing (GF_M2TS_PES *pes, GF_M2TSPesFraming mode) |
GF_Err | gf_m2ts_process_data (GF_M2TS_Demuxer *demux, u8 *data, u32 data_size) |
void | gf_m2ts_demux_dmscc_init (GF_M2TS_Demuxer *demux) |
GF_M2TS_SDT * | gf_m2ts_get_sdt_info (GF_M2TS_Demuxer *demux, u32 program_id) |
void | gf_m2ts_flush_pes (GF_M2TS_Demuxer *demux, GF_M2TS_PES *pes, u32 force_flush) |
void | gf_m2ts_flush_all (GF_M2TS_Demuxer *demux, Bool no_force_flush) |
GF_M2TS_Mux * | gf_m2ts_mux_new (u32 mux_rate, u32 pat_refresh_rate, Bool real_time) |
void | gf_m2ts_mux_del (GF_M2TS_Mux *muxer) |
void | gf_m2ts_mux_set_pcr_max_interval (GF_M2TS_Mux *muxer, u32 pcr_update_ms) |
GF_M2TS_Mux_Program * | gf_m2ts_mux_program_add (GF_M2TS_Mux *muxer, u32 program_number, u32 pmt_pid, u32 pmt_refresh_rate, u64 pcr_offset, u32 mpeg4_signaling, u32 pmt_version, Bool initial_disc, u64 force_first_pts) |
GF_M2TS_Mux_Stream * | gf_m2ts_program_stream_add (GF_M2TS_Mux_Program *program, GF_ESInterface *ifce, u32 pid, Bool is_pcr, Bool force_pes_mode, Bool needs_mutex) |
void | gf_m2ts_mux_update_config (GF_M2TS_Mux *muxer, Bool reset_time) |
void | gf_m2ts_program_stream_remove (GF_M2TS_Mux_Stream *stream) |
GF_M2TS_Mux_Program * | gf_m2ts_mux_program_find (GF_M2TS_Mux *muxer, u32 program_number) |
u32 | gf_m2ts_mux_program_count (GF_M2TS_Mux *muxer) |
u32 | gf_m2ts_mux_program_get_stream_count (GF_M2TS_Mux_Program *program) |
u32 | gf_m2ts_mux_program_get_pmt_pid (GF_M2TS_Mux_Program *program) |
u32 | gf_m2ts_mux_program_get_pcr_pid (GF_M2TS_Mux_Program *program) |
const u8 * | gf_m2ts_mux_process (GF_M2TS_Mux *muxer, GF_M2TSMuxState *status, u32 *usec_till_next) |
u32 | gf_m2ts_get_sys_clock (GF_M2TS_Mux *muxer) |
u32 | gf_m2ts_get_ts_clock (GF_M2TS_Mux *muxer) |
u64 | gf_m2ts_get_ts_clock_90k (GF_M2TS_Mux *muxer) |
GF_Err | gf_m2ts_mux_use_single_au_pes_mode (GF_M2TS_Mux *muxer, GF_M2TS_PackMode au_pes_mode) |
GF_Err | gf_m2ts_mux_set_initial_pcr (GF_M2TS_Mux *muxer, u64 init_pcr_value) |
GF_Err | gf_m2ts_mux_enable_pcr_only_packets (GF_M2TS_Mux *muxer, Bool enable_forced_pcr) |
void | gf_m2ts_mux_program_set_name (GF_M2TS_Mux_Program *program, const char *program_name, const char *mux_provider_name) |
void | gf_m2ts_mux_program_force_keep_ts (GF_M2TS_Mux_Program *program) |
void | gf_m2ts_mux_enable_sdt (GF_M2TS_Mux *muxer, u32 refresh_rate_ms) |
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) |
This section documents the MPEG-TS demultiplexer and multiplexer APIs.
struct GF_M2TS_Section |
struct GF_M2TS_Table |
MPEG-2 TS demuxer table
Data Fields | ||
---|---|---|
struct __m2ts_demux_table * | next |
pointer to next table/section |
u8 | is_init |
set when first table completely received |
u8 | is_repeat |
set when repeated section |
u8 | table_id |
table id |
u16 | ex_table_id |
extended table id |
u8 | version_number |
current section version number |
u8 | last_version_number |
last received version number |
u8 | current_next_indicator |
current/next indicator (cf MPEG-2 TS spec) |
u8 | section_number |
current section number |
u8 | last_section_number |
last section number to get the complete table |
GF_List * | sections |
list of sections for this table |
u32 | table_size |
total table size |
struct GF_M2TS_SectionFilter |
MPEG-2 TS demuxer section filter
Data Fields | ||
---|---|---|
s16 | cc |
section reassembler |
u8 * | section |
section buffer (max 4096) |
u16 | length |
current section length as indicated in section header |
u16 | received |
number of bytes received from current section |
GF_M2TS_Table * | table |
section->table aggregator |
Bool | process_individual |
indicates that the section and last_section_number do not need to be checked |
Bool | direct_dispatch |
indicates that the section header with table id and extended table id ... is not parsed by the TS demuxer and left for the application |
u32 | service_id |
this field is used for AIT sections, to link the AIT with the program |
gf_m2ts_section_callback | process_section |
section callback |
Bool | demux_restarted |
flag indicatin the demultiplexer has been restarted |
struct GF_M2TS_MetadataPointerDescriptor |
MPEG-2 TS demuxer metadata pointer
Data Fields | ||
---|---|---|
u16 | application_format | |
u32 | application_format_identifier | |
u8 | format | |
u32 | format_identifier | |
u8 | service_id | |
Bool | locator_record_flag | |
u32 | locator_length | |
char * | locator_data | |
enum metadata_carriage | carriage_flag | |
u16 | program_number | |
u16 | ts_location | |
u16 | ts_id | |
u8 * | data | |
u32 | data_size |
struct GF_M2TS_TemiLocationDescriptor |
struct GF_M2TS_TemiTimecodeDescriptor |
struct GF_M2TS_Program |
MPEG-2 TS program object
Data Fields | ||
---|---|---|
GF_M2TS_Demuxer * | ts |
parent demuxer |
GF_List * | streams |
list of streams (PES and sections) |
u32 | pmt_pid |
PID of PMT |
u32 | pcr_pid |
PID of PCR |
u32 | number |
program number |
GF_InitialObjectDescriptor * | pmt_iod |
MPEG-4 IOD if any |
GF_List * | additional_ods |
list of additional ODs found per program this list is only created when MPEG-4 over MPEG-2 is detected the list AND the ODs contained in it are destroyed when destroying the program/demuxer |
u64 | first_dts |
first dts found on this program - this is used by parsers, but not setup by the lib |
u64 | last_pcr_value |
Last PCR value received for this program and associated packet number |
u32 | last_pcr_value_pck_number |
packet number of last PCR value received |
u64 | before_last_pcr_value |
PCR value before the last received one for this program and associated packet number used to compute PCR interpolation value |
u32 | before_last_pcr_value_pck_number |
packet number of before last PCR value received |
Bool | tdt_found |
for hybrid use-cases we need to know if TDT has already been processed |
u32 | pid_playing |
indicates if PID is playing. Used in scalable streams only to toggle quality switch |
Bool | is_scalable | |
GF_M2TS_MetadataPointerDescriptor * | metadata_pointer_descriptor |
metadata descriptor pointer |
s16 | pcr_cc |
continuity counter check for pure PCR PIDs |
void * | user |
struct tag_m2ts_es |
abstract Section/PES stream object
MPEG-2 TS demuxer elementary stream
struct GF_M2TS_PESHeader |
struct tag_m2ts_section_es |
Section elementary stream
MPEG-2 TS demuxer elementary stream section
Data Fields | ||
---|---|---|
ABSTRACT_ES GF_M2TS_SectionFilter * | sec |
derive from base M2TS stream section reassembler |
struct GF_M2TS_DVB_Subtitling_Descriptor |
struct GF_M2TS_DVB_Teletext_Descriptor |
struct GF_M2TS_MetadataDescriptor |
MPEG-2 TS muxer metadata descriptor
Data Fields | ||
---|---|---|
u16 | application_format | |
u32 | application_format_identifier | |
u8 | format | |
u32 | format_identifier | |
u8 | service_id | |
u8 | decoder_config_flags | |
Bool | dsmcc_flag | |
u8 | service_id_record_length | |
char * | service_id_record | |
u8 | decoder_config_length | |
u8 * | decoder_config | |
u8 | decoder_config_id_length | |
u8 * | decoder_config_id | |
u8 | decoder_config_service_id |
struct GF_M2TS_Header |
MPEG-2 TS packet header
Data Fields | ||
---|---|---|
u8 | sync |
sync byte 0x47 |
u8 | error |
error indicator |
u8 | payload_start |
payload start flag (start of PES or section) |
u8 | priority |
priority flag |
u16 | pid |
PID of packet |
u8 | scrambling_ctrl |
scrambling flag ( 0 not scrambled, 1/2 scrambled, 3 reserved) |
u8 | adaptation_field |
adaptation field type |
u8 | continuity_counter |
continuity counter |
struct GF_M2TS_AdaptationField |
MPEG-2 TS packet adaptation field
Data Fields | ||
---|---|---|
u32 | discontinuity_indicator |
discontunity indicator (for timeline splicing) |
u32 | random_access_indicator |
random access indicator |
u32 | priority_indicator |
priority indicator |
u32 | PCR_flag |
PCR present flag |
u64 | PCR_base |
PCR base value |
u64 | PCR_ext |
PCR extended value |
u32 | OPCR_flag |
original PCR flag |
u64 | OPCR_base |
OPCR base value |
u64 | OPCR_ext |
OPCR extended value |
u32 | splicing_point_flag |
splicing point flag |
u32 | transport_private_data_flag |
transport private data flag |
u32 | adaptation_field_extension_flag |
AF extension flag |
struct GF_M2TS_Mux_Section |
struct GF_M2TS_Mux_Table |
struct GF_M2TS_Time |
struct GF_M2TS_Packet |
MPEG-2 TS muxer packet
Data Fields | ||
---|---|---|
struct __m2ts_mux_pck * | next |
pointer to next packet (we queue packets if needed) |
u8 * | data |
payload |
u32 | data_len |
payload size in bytes |
u16 | flags |
flags |
u8 | sap_type |
sap type |
u64 | cts |
CTS in 90 khz |
u64 | dts |
DTS in 90 khz |
u32 | duration |
duration in 90 khz |
u8 * | mpeg2_af_descriptors |
serialized list of adaptation field descriptors if any |
u32 | mpeg2_af_descriptors_size |
size of serialized list of adaptation field descriptors |
struct GF_M2TSDescriptor |
struct __m2ts_mux_program |
MPEG-2 TS muxer program info
MPEG-2 TS muxer program
Data Fields | ||
---|---|---|
struct __m2ts_mux_program * | next |
next program |
struct __m2ts_mux * | mux |
parent muxer |
u16 | number |
program number |
GF_M2TS_Mux_Stream * | streams |
all streams but PMT |
GF_M2TS_Mux_Stream * | pmt |
PMT stream |
GF_M2TS_Mux_Stream * | pcr |
pointer to PCR stream |
GF_M2TS_Time | ts_time_at_pcr_init |
TS time at pcr init |
u64 | pcr_init_time |
pcr init time (rand or fixed by user) |
u64 | num_pck_at_pcr_init |
number of TS packet at PCR init |
u64 | last_pcr |
last PCR value in 27 mhz |
u64 | last_dts |
last DTS value in 90 khz |
u64 | sys_clock_at_last_pcr |
system clock in microseconds at last PCR |
u64 | nb_pck_last_pcr |
number of packets at last PCR |
u64 | initial_ts |
min initial DTS of all streams |
u32 | initial_ts_set |
indicates that min initial DTS of all streams is set |
Bool | pcr_init_time_set |
if set, injects a PCR offset |
u64 | pcr_offset |
PCR offset to inject |
u64 | force_first_pts |
Forced value of first packet CTS |
Bool | initial_disc_set |
indicates the initial discontinuity flag should be set on first packet of all streams |
GF_Descriptor * | iod |
MPEG-4 IOD for 4on2 |
GF_List * | loop_descriptors |
list of GF_M2TSDescriptor to add to the program descriptor loop. By default set to NULL, if non null will be reset and destroyed upon cleanup |
u32 | mpeg4_signaling |
MPEG-4 signaling type |
Bool | mpeg4_signaling_for_scene_only |
if set, use MPEG-4 signaling only for BIFS and OD streams |
char * | name |
program name (for SDT) |
char * | provider |
program provider (for SDT) |
u32 | cts_offset |
CTS offset in 90khz |
struct __m2ts_mux |
MPEG-2 TS muxer
Data Fields | ||
---|---|---|
GF_M2TS_Mux_Program * | programs |
list of programs |
GF_M2TS_Mux_Stream * | pat |
PAT stream |
GF_M2TS_Mux_Stream * | sdt |
SDT stream |
u16 | ts_id |
TS ID |
Bool | needs_reconfig |
signals reconfigure is needed (PAT) |
Bool | real_time |
used to indicate that the input data is pushed to the muxer (i.e. not read from a file) or that the output data is sent on sockets (not written to a file) |
Bool | fixed_rate |
indicates if the multiplexer shall target a fix bit rate (monitoring timing and produce padding packets) or if the output stream will contain only input data |
u32 | bit_rate |
output bit-rate in bit/sec |
u64 | init_pcr_value |
init value for PCRs on all streams if 0, random value is used |
u32 | pcr_update_ms |
PCR update rate in milliseconds |
char | dst_pck[188] |
destination TS packet |
char | null_pck[188] |
destination NULL TS packet |
GF_M2TS_Time | time |
multiplexer time, incremented each time a packet is sent used to monitor the sending of muxer related data (PAT, ...) |
GF_M2TS_Time | init_ts_time |
Time of the muxer when the first call to process is made (first packet sent?) |
u64 | init_sys_time |
System time in microsenconds when the muxer is started |
Bool | force_pat |
forces PAT injection at next packet |
GF_M2TS_PackMode | au_pes_mode |
AU per PES packing mode |
Bool | enable_forced_pcr |
enable forced PCR (PCR only packets) |
u64 | last_br_time_us |
last rate estimation time in microseconds |
u32 | pck_sent_over_br_window |
number of TS packets over the bitrate estimation period |
u64 | tot_pck_sent |
number of TS packets sent |
u64 | tot_pad_sent |
number of TS NULL packets sent |
u64 | tot_pes_pad_bytes |
number of PES bytes sent |
u32 | average_birate_kbps |
average rate in kbps |
Bool | flush_pes_at_rap |
if set, flushes all streams in a program when a PES RAP is found (eg sent remaining audios and co) |
u32 | force_pat_pmt_state |
state for forced injection of PAT/PMT/PCR |
GF_BitStream * | pck_bs |
static write bitstream object for formatting packets |
u32 | ref_pid |
PID to watch for SAP insertions |
Bool | sap_inserted | |
u64 | sap_time |
SAP time (used when dashing) |
u32 | sap_type |
SAP type (used when dashing) |
u64 | last_pts |
last PTS in 90khz (used when dashing to build sidx) |
u32 | last_pid |
last PID (used when dashing to build sidx) |
#define SECTION_HEADER_LENGTH 3 |
header till the last bit of the section_length field
#define SECTION_ADDITIONAL_HEADER_LENGTH 5 |
header from the last bit of the section_length field to the payload
#define CRC_LENGTH 4 |
CRC32 length
#define GF_M2TS_MAX_STREAMS 8192 |
Maximum number of streams in a TS
#define GF_M2TS_MAX_SERVICES 65535 |
Maximum number of service in a TS
#define GF_M2TS_UDP_BUFFER_SIZE 0x40000 |
Maximum size of the buffer in UDP
#define GF_M2TS_MAX_PCR 2576980377811ULL |
Maximum PCR value
#define ABSTRACT_ES |
macro for abstract Section/PES stream object, only used for type casting
#define GF_M2TS_PSI_DEFAULT_REFRESH_RATE 200 |
default refresh rate for PSI data
typedef struct tag_m2ts_demux GF_M2TS_Demuxer |
MPEG-2 TS demuxer
typedef void(* gf_m2ts_section_callback) (GF_M2TS_Demuxer *demux, GF_M2TS_SECTION_ES *es, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) |
section callback function
demux | the target MPEG-2 TS demultiplexer |
es | the target section stream |
sections | the list of gathered sections |
table_id | the ID of the table |
ex_table_id | the extended ID of the table |
version_number | the version number of the table |
last_section_number | the last section number of the table for fragmented cases |
status | the parsing status flags |
anonymous enum |
metadata types for GF_M2TS_METADATA_POINTER_DESCRIPTOR
anonymous enum |
MPEG-2 Descriptor tags
anonymous enum |
Reserved PID values
anonymous enum |
max size includes first header, second header, payload and CRC
enum GF_M2TSStreamType |
MPEG-2 TS Media types
anonymous enum |
MPEG-2 TS Registration codes types
anonymous enum |
MPEG-2 Descriptor tags
enum GF_M2TSPesFraming |
PES data framing modes
anonymous enum |
PES packet flags
anonymous enum |
Events used by the MPEGTS demuxer
anonymous enum |
table parsing state
enum metadata_carriage |
metadata carriage types
anonymous enum |
ES flags
anonymous enum |
anonymous enum |
enum GF_M2TS_PackMode |
enum GF_M2TSMuxState |
const char* gf_m2ts_get_stream_name | ( | GF_M2TSStreamType | streamType | ) |
gets the stream name for an MPEG-2 stream type
streamType | the target stream type |
Bool gf_m2ts_probe_file | ( | const char * | fileName | ) |
probes a file for MPEG-2 TS format
fileName | name / path of the file to brobe |
probes a buffer for MPEG-2 TS format
data | data buffer to probe |
size | size of buffer to probe |
restamps a set of TS packets by shifting all timing by the given value
buffer | data buffer to restamp |
size | size of buffer |
ts_shift | clock shift in 90 kHz |
is_pes | array of GF_M2TS_MAX_STREAMS u8 set to 1 for PES PIDs to be restamped, 0 to stream to left untouched |
GF_M2TS_Demuxer* gf_m2ts_demux_new | ( | ) |
creates a new MPEG-2 TS demultiplexer
void gf_m2ts_demux_del | ( | GF_M2TS_Demuxer * | demux | ) |
destroys a new MPEG-2 TS demultiplexer
demux | the target MPEG-2 TS demultiplexer |
void gf_m2ts_reset_parsers | ( | GF_M2TS_Demuxer * | demux | ) |
resets all parsers (PES, sections) of the demultiplexer and trash any pending data in the demux input
demux | the target MPEG-2 TS demultiplexer |
void gf_m2ts_mark_seg_start | ( | GF_M2TS_Demuxer * | demux | ) |
set all streams is_seg_start variable to GF_TRUE
demux | the target MPEG-2 TS demultiplexer |
void gf_m2ts_reset_parsers_for_program | ( | GF_M2TS_Demuxer * | demux, |
GF_M2TS_Program * | program | ||
) |
resets all parsers (PES, sections) of a given program
demux | the target MPEG-2 TS demultiplexer |
program | the target MPEG-2 TS program |
GF_Err gf_m2ts_set_pes_framing | ( | GF_M2TS_PES * | pes, |
GF_M2TSPesFraming | mode | ||
) |
sets PES framing mode of a stream
pes | the target MPEG-2 TS stream |
mode | the desired PES framing mode |
GF_Err gf_m2ts_process_data | ( | GF_M2TS_Demuxer * | demux, |
u8 * | data, | ||
u32 | data_size | ||
) |
processes input buffer. This will resync the input data to a TS packet start if needed
demux | the target MPEG-2 TS demultiplexer |
data | the data to process |
data_size | size of the date to process |
void gf_m2ts_demux_dmscc_init | ( | GF_M2TS_Demuxer * | demux | ) |
initializes DSM-CC object carousel reception
demux | the target MPEG-2 TS demultiplexer |
GF_M2TS_SDT* gf_m2ts_get_sdt_info | ( | GF_M2TS_Demuxer * | demux, |
u32 | program_id | ||
) |
gets SDT info for a given program
demux | the target MPEG-2 TS demultiplexer |
program_id | ID of the target MPEG-2 TS program |
void gf_m2ts_flush_pes | ( | GF_M2TS_Demuxer * | demux, |
GF_M2TS_PES * | pes, | ||
u32 | force_flush | ||
) |
flushes a given stream. This is used to flush internal demultiplexer buffers on end of stream
demux | the target MPEG-2 demultiplexer |
pes | the target stream to flush |
force_flush | if >0, flushes all streams, otherwise do not flush stream with known PES length and not yet completed (for HLS) |
void gf_m2ts_flush_all | ( | GF_M2TS_Demuxer * | demux, |
Bool | no_force_flush | ||
) |
flushes all streams in the mux. This is used to flush internal demultiplexer buffers on end of stream
demux | the target MPEG-2 demultiplexer |
no_force_flush | do not force a flush of incomplete PES (used for HLS) |
creates a new MPEG-2 TS multiplexer
mux_rate | target mux rate in kbps, can be 0 for VBR |
pat_refresh_rate | PAT refresh rate in ms |
real_time | indicates if real-time production should be used |
void gf_m2ts_mux_del | ( | GF_M2TS_Mux * | muxer | ) |
destroys a TS muxer
muxer | the target MPEG-2 TS multiplexer |
void gf_m2ts_mux_set_pcr_max_interval | ( | GF_M2TS_Mux * | muxer, |
u32 | pcr_update_ms | ||
) |
sets max interval between two PCR. Default/max interval is 100 milliseconds
muxer | the target MPEG-2 TS multiplexer |
pcr_update_ms | PCR interval in milliseconds |
GF_M2TS_Mux_Program* gf_m2ts_mux_program_add | ( | GF_M2TS_Mux * | muxer, |
u32 | program_number, | ||
u32 | pmt_pid, | ||
u32 | pmt_refresh_rate, | ||
u64 | pcr_offset, | ||
u32 | mpeg4_signaling, | ||
u32 | pmt_version, | ||
Bool | initial_disc, | ||
u64 | force_first_pts | ||
) |
adds a new program to the muxer
muxer | the target MPEG-2 TS multiplexer |
program_number | number of program to add |
pmt_pid | value of program PMT packet identifier |
pmt_refresh_rate | refresh rate in milliseconds of PMT. 0 only sends PMT once |
pcr_offset | initial offset in 90 kHz to add to PCR values (usually to compensate for large frame sending times) |
mpeg4_signaling | type of MPEG-4 signaling used |
pmt_version | initial version of the PMT |
initial_disc | if GF_TRUE, signals packet discontinuity on the first packet of eact stream in the program |
force_first_pts | if not 0, the first PTS written in the program will have the indicated value (in 90khz) |
GF_M2TS_Mux_Stream* gf_m2ts_program_stream_add | ( | GF_M2TS_Mux_Program * | program, |
GF_ESInterface * | ifce, | ||
u32 | pid, | ||
Bool | is_pcr, | ||
Bool | force_pes_mode, | ||
Bool | needs_mutex | ||
) |
adds a stream to a program
program | the target program |
ifce | the stream interface object for packet and properties query |
pid | the packet identifier for the stream |
is_pcr | if GF_TRUE, this stream is the clock reference of the program |
force_pes_mode | if GF_TRUE, forces PES packetization (used for streams carried over PES or sections, such as metadata and MPEG-4) |
needs_mutex | indicates a mutex is required before calling the stream interface object |
void gf_m2ts_mux_update_config | ( | GF_M2TS_Mux * | muxer, |
Bool | reset_time | ||
) |
updates muxer configuration
muxer | the target MPEG-2 TS multiplexer |
reset_time | if GF_TRUE, resets multiplexer time to 0 |
void gf_m2ts_program_stream_remove | ( | GF_M2TS_Mux_Stream * | stream | ) |
removes stream from program, triggering PMT update as well
stream | the target stream to remove |
GF_M2TS_Mux_Program* gf_m2ts_mux_program_find | ( | GF_M2TS_Mux * | muxer, |
u32 | program_number | ||
) |
finds a program by its number
muxer | the target MPEG-2 TS multiplexer |
program_number | number of program to retrieve |
u32 gf_m2ts_mux_program_count | ( | GF_M2TS_Mux * | muxer | ) |
gets number of program in a multiplex
muxer | the target MPEG-2 TS multiplexer |
u32 gf_m2ts_mux_program_get_stream_count | ( | GF_M2TS_Mux_Program * | program | ) |
gets number of stream in a program
program | the target program |
u32 gf_m2ts_mux_program_get_pmt_pid | ( | GF_M2TS_Mux_Program * | program | ) |
gets the packet identifier of the PMT of a program
program | the target program |
u32 gf_m2ts_mux_program_get_pcr_pid | ( | GF_M2TS_Mux_Program * | program | ) |
gets the packet identifier of the PCR stream of a program
program | the target program |
const u8* gf_m2ts_mux_process | ( | GF_M2TS_Mux * | muxer, |
GF_M2TSMuxState * | status, | ||
u32 * | usec_till_next | ||
) |
produces one packet of the multiplex
muxer | the target MPEG-2 TS multiplexer |
status | set to the current state of the multiplexer |
usec_till_next | the target MPEG-2 TS multiplexer |
u32 gf_m2ts_get_sys_clock | ( | GF_M2TS_Mux * | muxer | ) |
gets the system clock of the multiplexer (time elapsed since start)
muxer | the target MPEG-2 TS multiplexer |
u32 gf_m2ts_get_ts_clock | ( | GF_M2TS_Mux * | muxer | ) |
gets the multiplexer clock (computed from mux rate and packet sent)
muxer | the target MPEG-2 TS multiplexer |
u64 gf_m2ts_get_ts_clock_90k | ( | GF_M2TS_Mux * | muxer | ) |
gets the multiplexer clock (computed from mux rate and packet sent)
muxer | the target MPEG-2 TS multiplexer |
GF_Err gf_m2ts_mux_use_single_au_pes_mode | ( | GF_M2TS_Mux * | muxer, |
GF_M2TS_PackMode | au_pes_mode | ||
) |
set AU per PES packetization mode
muxer | the target MPEG-2 TS multiplexer |
au_pes_mode | AU packetization mode to use |
sets initial PCR value for all programs in multiplex. If this is not called, each program will use a random initial PCR
muxer | the target MPEG-2 TS multiplexer |
init_pcr_value | initial PCR value in 90kHz |
enables pure PCR packets (no payload). This can be needed for some DVB constraints on PCR refresh rate (less than one frame duration) when next video frame is not yet ready to be muxed.
muxer | the target MPEG-2 TS multiplexer |
enable_forced_pcr | if GF_TRUE, the multiplexer may use PCR-only packets; otherwise, it will wait for a frame to be ready on the PCR stream before sending a PCR |
void gf_m2ts_mux_program_set_name | ( | GF_M2TS_Mux_Program * | program, |
const char * | program_name, | ||
const char * | mux_provider_name | ||
) |
sets program name and provider
program | the target program |
program_name | the program name (UTF-8) |
mux_provider_name | the provider name (UTF-8) |
void gf_m2ts_mux_program_force_keep_ts | ( | GF_M2TS_Mux_Program * | program | ) |
forces keeping DTS CTS untouched (no remap of first packet to 0) - needed when doing stateless dashing
program | the target program |
void gf_m2ts_mux_enable_sdt | ( | GF_M2TS_Mux * | muxer, |
u32 | refresh_rate_ms | ||
) |
enables sending DVB SDT
muxer | the target program |
refresh_rate_ms | the refresh rate for the SDT. A value of 0 only sends the SDT once |
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 | ||
) |
update a given table
stream | target stream carrying the section |
table_id | ID of the table |
table_id_extension | extended ID of the table |
table_payload | payload to send |
table_payload_length | payload length to send |
use_syntax_indicator | inject section syntax extension (extended ID and fragmentation info of the table) |
private_indicator | private indicator flag of section header |