libgpac
Documentation of the core library of GPAC
tssplit.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/thread.h>
#include <gpac/list.h>
#include <gpac/bitstream.h>
#include <gpac/mpegts.h>
+ Include dependency graph for tssplit.c:

Data Structures

struct  GF_M2TSSplit_SPTS
 
struct  GF_M2TSSplitCtx
 
struct  M2TSDurProber
 

Macros

#define OFFS(_n)   #_n, offsetof(GF_M2TSSplitCtx, _n)
 
#define OFFS(_n)   #_n, offsetof(GF_M2TSSplitCtx, _n)
 

Functions

static void m2tssplit_on_event (struct tag_m2ts_demux *ts, u32 evt_type, void *par)
 
void m2tssplit_send_packet (GF_M2TSSplitCtx *ctx, GF_M2TSSplit_SPTS *stream, u8 *data, u32 size, u64 pcr_plus_one)
 
void m2tssplit_flush (GF_M2TSSplitCtx *ctx)
 
static void m2tssplit_on_event_duration_probe (GF_M2TS_Demuxer *ts, u32 evt_type, void *param)
 
void m2ts_split_estimate_duration (GF_M2TSSplitCtx *ctx, GF_FilterPid *pid)
 
GF_Err m2tssplit_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static Bool m2tssplit_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
GF_Err m2tssplit_process (GF_Filter *filter)
 
GF_Err m2tssplit_initialize (GF_Filter *filter)
 
void m2tssplit_finalize (GF_Filter *filter)
 
const GF_FilterRegister * tssplit_register (GF_FilterSession *session)
 
GF_Err m2ts_gendts_initialize (GF_Filter *filter)
 
const GF_FilterRegister * tsgendts_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability M2TSSplitCaps []
 
static const GF_FilterArgs M2TSSplitArgs []
 
GF_FilterRegister M2TSSplitRegister
 
static const GF_FilterCapability M2TSGenDTSCaps []
 
static const GF_FilterArgs M2TSGenDTSArgs []
 
GF_FilterRegister M2TSRestampRegister
 

Data Structure Documentation

◆ GF_M2TSSplit_SPTS

struct GF_M2TSSplit_SPTS
Data Fields
GF_FilterPid * opid
u32 pmt_pid
u8 pat_pck[192]
u32 pat_pck_size
u64 last_pcr_plus_one
u32 pcr_id
Bool start_sent
GF_FilterPacket * init_pck
u8 * pck_buffer
u32 nb_pck

◆ GF_M2TSSplitCtx

struct GF_M2TSSplitCtx
+ Collaboration diagram for GF_M2TSSplitCtx:
Data Fields
Bool dvb
s32 mux_id
Bool avonly
u32 nb_pack
Bool gendts
Bool kpad
GF_Filter * filter
GF_FilterPid * ipid
GF_List * streams
GF_M2TS_Demuxer * dmx
u8 tsbuf[192]
GF_BitStream * bsw
GF_M2TSSplit_SPTS * out
u64 filesize
GF_Fraction64 duration
Bool initial_play_done

◆ M2TSDurProber

struct M2TSDurProber
+ Collaboration diagram for M2TSDurProber:
Data Fields
GF_M2TSSplitCtx * ctx
u64 first_pcr
u32 first_pcr_pid
u64 last_pcr
u32 pck_num
Bool abort

Macro Definition Documentation

◆ OFFS [1/2]

#define OFFS (   _n)    #_n, offsetof(GF_M2TSSplitCtx, _n)

◆ OFFS [2/2]

#define OFFS (   _n)    #_n, offsetof(GF_M2TSSplitCtx, _n)

Function Documentation

◆ m2tssplit_on_event()

static void m2tssplit_on_event ( struct tag_m2ts_demux *  ts,
u32  evt_type,
void *  par 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ m2tssplit_send_packet()

void m2tssplit_send_packet ( GF_M2TSSplitCtx ctx,
GF_M2TSSplit_SPTS stream,
u8 data,
u32  size,
u64  pcr_plus_one 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ m2tssplit_flush()

void m2tssplit_flush ( GF_M2TSSplitCtx ctx)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ m2tssplit_on_event_duration_probe()

static void m2tssplit_on_event_duration_probe ( GF_M2TS_Demuxer ts,
u32  evt_type,
void *  param 
)
static
+ Here is the caller graph for this function:

◆ m2ts_split_estimate_duration()

void m2ts_split_estimate_duration ( GF_M2TSSplitCtx ctx,
GF_FilterPid *  pid 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ m2tssplit_configure_pid()

GF_Err m2tssplit_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
+ Here is the call graph for this function:

◆ m2tssplit_process_event()

static Bool m2tssplit_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  evt 
)
static
+ Here is the call graph for this function:

◆ m2tssplit_process()

GF_Err m2tssplit_process ( GF_Filter *  filter)
+ Here is the call graph for this function:

◆ m2tssplit_initialize()

GF_Err m2tssplit_initialize ( GF_Filter *  filter)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ m2tssplit_finalize()

void m2tssplit_finalize ( GF_Filter *  filter)
+ Here is the call graph for this function:

◆ tssplit_register()

const GF_FilterRegister* tssplit_register ( GF_FilterSession *  session)

◆ m2ts_gendts_initialize()

GF_Err m2ts_gendts_initialize ( GF_Filter *  filter)
+ Here is the call graph for this function:

◆ tsgendts_register()

const GF_FilterRegister* tsgendts_register ( GF_FilterSession *  session)

Variable Documentation

◆ M2TSSplitCaps

const GF_FilterCapability M2TSSplitCaps[]
static
Initial value:
=
{
CAP_STRING(GF_CAPS_INPUT_OUTPUT, GF_PROP_PID_MIME, "video/mpeg-2|video/mp2t|video/mpeg"),
}
@ GF_STREAM_FILE
Definition: constants.h:104
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define CAP_STRING(_f, _a, _b)
Definition: filters.h:2194
#define GF_CAPS_INPUT_OUTPUT
Definition: filters.h:2242
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112
@ GF_PROP_PID_FILE_EXT
Definition: filters.h:1190
@ GF_PROP_PID_MIME
Definition: filters.h:1189

◆ M2TSSplitArgs

const GF_FilterArgs M2TSSplitArgs[]
static
Initial value:
=
{
{ OFFS(dvb), "forward all packets from global DVB PIDs", GF_PROP_BOOL, "true", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(mux_id), "set initial ID of output mux; the first program will use mux_id, the second mux_id+1, etc. If not set, this value will be set to sourceMuxId*255", GF_PROP_SINT, "-1", NULL, GF_FS_ARG_HINT_EXPERT},
{ OFFS(avonly), "do not forward programs with no AV component", GF_PROP_BOOL, "true", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(nb_pack), "pack N packets before sending", GF_PROP_UINT, "10", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(gendts), "generate timestamps on output packets based on PCR", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(kpad), "keep padding (null) TS packets", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{0}
}
@ GF_FS_ARG_HINT_EXPERT
Definition: filters.h:2104
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_BOOL
Definition: filters.h:858
@ GF_PROP_SINT
Definition: filters.h:850
@ GF_PROP_UINT
Definition: filters.h:852
#define OFFS(_n)
Definition: tssplit.c:725

◆ M2TSSplitRegister

GF_FilterRegister M2TSSplitRegister
Initial value:
= {
.name = "tssplit",
GF_FS_SET_HELP("This filter splits an MPEG-2 transport stream into several single program transport streams.\n"
"Only the PAT table is rewritten, other tables (PAT, PMT) and streams (PES) are forwarded as is.\n"
"If [-dvb]() is set, global DVB tables of the input multiplex are forwarded to each output mux; otherwise these tables are discarded.")
.private_size = sizeof(GF_M2TSSplitCtx),
.initialize = m2tssplit_initialize,
.finalize = m2tssplit_finalize,
.configure_pid = m2tssplit_configure_pid,
.process = m2tssplit_process,
.process_event = m2tssplit_process_event,
.hint_class_type = GF_FS_CLASS_STREAM
}
#define GF_FS_SET_HELP(_help)
Definition: filters.h:2372
#define SETCAPS(__struct)
Definition: filters.h:2364
@ GF_FS_REG_EXPLICIT_ONLY
Definition: filters.h:2393
@ GF_FS_CLASS_STREAM
Definition: filters.h:2445
attribute Array args
Definition: jsf.idl:24
void m2tssplit_finalize(GF_Filter *filter)
Definition: tssplit.c:658
static Bool m2tssplit_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: tssplit.c:281
static const GF_FilterArgs M2TSSplitArgs[]
Definition: tssplit.c:680
static const GF_FilterCapability M2TSSplitCaps[]
Definition: tssplit.c:672
GF_Err m2tssplit_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: tssplit.c:238
GF_Err m2tssplit_process(GF_Filter *filter)
Definition: tssplit.c:360
GF_Err m2tssplit_initialize(GF_Filter *filter)
Definition: tssplit.c:643
Definition: tssplit.c:55

◆ M2TSGenDTSCaps

const GF_FilterCapability M2TSGenDTSCaps[]
static

◆ M2TSGenDTSArgs

const GF_FilterArgs M2TSGenDTSArgs[]
static
Initial value:
=
{
{ OFFS(nb_pack), "pack N packets before sending", GF_PROP_UINT, "10", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(kpad), "keep padding (null) TS packets", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{0}
}

◆ M2TSRestampRegister

GF_FilterRegister M2TSRestampRegister
Initial value:
= {
.name = "tsgendts",
.private_size = sizeof(GF_M2TSSplitCtx),
.initialize = m2ts_gendts_initialize,
.finalize = m2tssplit_finalize,
.configure_pid = m2tssplit_configure_pid,
.process = m2tssplit_process,
.process_event = m2tssplit_process_event,
.hint_class_type = GF_FS_CLASS_STREAM
}
@ GF_FS_REG_HIDE_WEIGHT
Definition: filters.h:2395
static const GF_FilterArgs M2TSGenDTSArgs[]
Definition: tssplit.c:726
static const GF_FilterCapability M2TSGenDTSCaps[]
Definition: tssplit.c:716
GF_Err m2ts_gendts_initialize(GF_Filter *filter)
Definition: tssplit.c:733