libgpac
Documentation of the core library of GPAC
mux_gsf.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/bitstream.h>
#include <gpac/network.h>
#include <gpac/internal/media_dev.h>
#include <gpac/crypt.h>
+ Include dependency graph for mux_gsf.c:

Data Structures

struct  GSFStream
 
struct  GSFMxCtx
 

Macros

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

Enumerations

enum  GF_GSFPacketType {
  GFS_PCKTYPE_HDR =0 , GFS_PCKTYPE_PID_CONFIG , GFS_PCKTYPE_PID_INFO_UPDATE , GFS_PCKTYPE_PID_REMOVE ,
  GFS_PCKTYPE_PID_EOS , GFS_PCKTYPE_PCK , GFS_PCKTYPE_UNDEF1 , GFS_PCKTYPE_UNDEF2 ,
  GFS_PCKTYPE_UNDEF3 , GFS_PCKTYPE_UNDEF4 , GFS_PCKTYPE_UNDEF5 , GFS_PCKTYPE_UNDEF6 ,
  GFS_PCKTYPE_UNDEF7 , GFS_PCKTYPE_UNDEF8 , GFS_PCKTYPE_UNDEF9 , GFS_PCKTYPE_UNDEF10
}
 

Functions

static GFINLINE u32 get_vlen_size (u32 len)
 
static GFINLINE void gsfmx_write_vlen (GSFMxCtx *ctx, u32 len)
 
static GFINLINE u32 gsfmx_get_header_size (GSFMxCtx *ctx, GSFStream *gst, Bool use_seq_num, Bool first_frag, Bool no_frag, u32 pck_size, u32 block_size, u32 block_offset)
 
static void gsfmx_encrypt (GSFMxCtx *ctx, char *data, u32 nb_crypt_bytes)
 
static void gsfmx_send_packets (GSFMxCtx *ctx, GSFStream *gst, GF_GSFPacketType pck_type, Bool is_end, Bool is_redundant, u32 frame_size, u32 frame_hdr_size)
 
static void gsfmx_send_pid_rem (GSFMxCtx *ctx, GSFStream *gst)
 
static void gsfmx_send_pid_eos (GSFMxCtx *ctx, GSFStream *gst, Bool is_eos)
 
static Bool gsfmx_can_serialize_prop (const GF_PropertyValue *p, u32 prop_4cc)
 
static void gsfmx_write_prop (GSFMxCtx *ctx, const GF_PropertyValue *p)
 
static GFINLINE Bool gsfmx_is_prop_skip (GSFMxCtx *ctx, u32 prop_4cc, const char *prop_name, u8 sep_l)
 
static void gsfmx_write_pid_config (GF_Filter *filter, GSFMxCtx *ctx, GSFStream *gst)
 
static void gsfmx_send_header (GF_Filter *filter, GSFMxCtx *ctx, Bool is_carousel_update)
 
static void gsfmx_send_pid_config (GF_Filter *filter, GSFMxCtx *ctx, GSFStream *gst, Bool is_info, Bool is_carousel_update)
 
static void gsfmx_write_data_packet (GSFMxCtx *ctx, GSFStream *gst, GF_FilterPacket *pck)
 
GF_Err gsfmx_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
GF_Err gsfmx_process (GF_Filter *filter)
 
static Bool gsfmx_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static GF_Err gsfmx_initialize (GF_Filter *filter)
 
static void gsfmx_finalize (GF_Filter *filter)
 
static Bool gsfmx_use_alias (GF_Filter *filter, const char *url, const char *mime)
 
const GF_FilterRegister * gsfmx_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability GSFMxCaps []
 
static const GF_FilterArgs GSFMxArgs []
 
GF_FilterRegister GSFMxRegister
 

Data Structure Documentation

◆ GSFStream

struct GSFStream
Data Fields
GF_FilterPid * pid
u32 idx
u16 nb_frames
Bool eos
u8 config_version
u64 last_cts_config
u32 timescale
u32 is_file

◆ GSFMxCtx

struct GSFMxCtx
+ Collaboration diagram for GSFMxCtx:
Data Fields
Bool sigsn
Bool sigdur
Bool sigbo
Bool sigdts
Bool minp
Bool mixed
u32 dbg
const char * magic
const char * skp
const char * ext
const char * mime
const char * dst
GF_PropData key
GF_PropData IV
GF_Fraction pattern
u32 mpck
Double crate
GF_FilterPid * opid
GF_List * streams
u8 * buffer
u32 alloc_size
GF_BitStream * bs_w
Bool is_start
u32 max_pid_idx
bin128 crypt_IV
GF_Crypt * crypt
Bool regenerate_tunein_info
u32 nb_frames
u32 nb_pck
GF_FilterCapability caps[4]
Bool filemode

Macro Definition Documentation

◆ OFFS

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

Enumeration Type Documentation

◆ GF_GSFPacketType

Enumerator
GFS_PCKTYPE_HDR 
GFS_PCKTYPE_PID_CONFIG 
GFS_PCKTYPE_PID_INFO_UPDATE 
GFS_PCKTYPE_PID_REMOVE 
GFS_PCKTYPE_PID_EOS 
GFS_PCKTYPE_PCK 
GFS_PCKTYPE_UNDEF1 
GFS_PCKTYPE_UNDEF2 
GFS_PCKTYPE_UNDEF3 
GFS_PCKTYPE_UNDEF4 
GFS_PCKTYPE_UNDEF5 
GFS_PCKTYPE_UNDEF6 
GFS_PCKTYPE_UNDEF7 
GFS_PCKTYPE_UNDEF8 
GFS_PCKTYPE_UNDEF9 
GFS_PCKTYPE_UNDEF10 

Function Documentation

◆ get_vlen_size()

static GFINLINE u32 get_vlen_size ( u32  len)
static
+ Here is the caller graph for this function:

◆ gsfmx_write_vlen()

static GFINLINE void gsfmx_write_vlen ( GSFMxCtx ctx,
u32  len 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_get_header_size()

static GFINLINE u32 gsfmx_get_header_size ( GSFMxCtx ctx,
GSFStream gst,
Bool  use_seq_num,
Bool  first_frag,
Bool  no_frag,
u32  pck_size,
u32  block_size,
u32  block_offset 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_encrypt()

static void gsfmx_encrypt ( GSFMxCtx ctx,
char *  data,
u32  nb_crypt_bytes 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_send_packets()

static void gsfmx_send_packets ( GSFMxCtx ctx,
GSFStream gst,
GF_GSFPacketType  pck_type,
Bool  is_end,
Bool  is_redundant,
u32  frame_size,
u32  frame_hdr_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_send_pid_rem()

static void gsfmx_send_pid_rem ( GSFMxCtx ctx,
GSFStream gst 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_send_pid_eos()

static void gsfmx_send_pid_eos ( GSFMxCtx ctx,
GSFStream gst,
Bool  is_eos 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_can_serialize_prop()

static Bool gsfmx_can_serialize_prop ( const GF_PropertyValue *  p,
u32  prop_4cc 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_write_prop()

static void gsfmx_write_prop ( GSFMxCtx ctx,
const GF_PropertyValue *  p 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_is_prop_skip()

static GFINLINE Bool gsfmx_is_prop_skip ( GSFMxCtx ctx,
u32  prop_4cc,
const char *  prop_name,
u8  sep_l 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_write_pid_config()

static void gsfmx_write_pid_config ( GF_Filter *  filter,
GSFMxCtx ctx,
GSFStream gst 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_send_header()

static void gsfmx_send_header ( GF_Filter *  filter,
GSFMxCtx ctx,
Bool  is_carousel_update 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_send_pid_config()

static void gsfmx_send_pid_config ( GF_Filter *  filter,
GSFMxCtx ctx,
GSFStream gst,
Bool  is_info,
Bool  is_carousel_update 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_write_data_packet()

static void gsfmx_write_data_packet ( GSFMxCtx ctx,
GSFStream gst,
GF_FilterPacket *  pck 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfmx_configure_pid()

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

◆ gsfmx_process()

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

◆ gsfmx_process_event()

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

◆ gsfmx_initialize()

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

◆ gsfmx_finalize()

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

◆ gsfmx_use_alias()

static Bool gsfmx_use_alias ( GF_Filter *  filter,
const char *  url,
const char *  mime 
)
static
+ Here is the call graph for this function:

◆ gsfmx_register()

const GF_FilterRegister* gsfmx_register ( GF_FilterSession *  session)

Variable Documentation

◆ GSFMxCaps

const GF_FilterCapability GSFMxCaps[]
static
Initial value:
=
{
CAP_STRING(GF_CAPS_OUTPUT, GF_PROP_PID_MIME, "application/x-gpac-sf"),
}
@ GF_CODECID_NONE
Definition: constants.h:383
@ GF_STREAM_FILE
Definition: constants.h:104
#define GF_CAPS_OUTPUT
Definition: filters.h:2232
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define CAP_STRING(_f, _a, _b)
Definition: filters.h:2194
#define GF_CAPS_INPUT_EXCLUDED
Definition: filters.h:2228
#define CAP_BOOL(_f, _a, _b)
Definition: filters.h:2180
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112
@ GF_PROP_PID_UNFRAMED
Definition: filters.h:1118
@ GF_PROP_PID_FILE_EXT
Definition: filters.h:1190
@ GF_PROP_PID_MIME
Definition: filters.h:1189
@ GF_TRUE
Definition: setup.h:474

◆ GSFMxArgs

const GF_FilterArgs GSFMxArgs[]
static
Initial value:
=
{
{ OFFS(sigsn), "signal packet sequence number after header field and before size field. Sequence number is per PID, encoded on 16 bits. Header packet does not have a SN", GF_PROP_BOOL, "false", NULL, 0},
{ OFFS(sigdur), "signal duration", GF_PROP_BOOL, "true", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(sigbo), "signal byte offset", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(sigdts), "signal decoding timestamp", GF_PROP_BOOL, "true", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(dbg), "set debug mode\n"
"- no: disable debug\n"
"- nodata: force packet size to 0\n"
"- nopck: skip packet", GF_PROP_UINT, "no", "no|nodata|nopck", GF_FS_ARG_HINT_EXPERT},
{ OFFS(key), "encrypt packets using given key", GF_PROP_DATA, NULL, NULL, 0},
{ OFFS(IV), "set IV for encryption - a constant IV is used to keep packet overhead small (cbcs-like)", GF_PROP_DATA, NULL, NULL, 0},
{ OFFS(pattern), "set nb_crypt / nb_skip block pattern. default is all encrypted", GF_PROP_FRACTION, "1/0", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(mpck), "set max packet size. 0 means no fragmentation (each AU is sent in one packet)", GF_PROP_UINT, "0", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(magic), "magic string to append in setup packet", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(skp), "comma separated list of PID property names to skip", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(minp), "include only the minimum set of properties required for stream processing", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(crate), "carousel period for tune-in info in seconds", GF_PROP_DOUBLE, "0", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(ext), "file extension for file mode", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_EXPERT},
{ OFFS(dst), "target URL in file mode", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_EXPERT|GF_FS_ARG_SINK_ALIAS},
{ OFFS(mime), "file mime for file mode", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_HIDE},
{ OFFS(mixed), "allow GSF to contain both files and media streams", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_EXPERT|GF_FS_ARG_SINK_ALIAS},
{0}
}
@ GF_FS_ARG_SINK_ALIAS
Definition: filters.h:2114
@ GF_FS_ARG_HINT_EXPERT
Definition: filters.h:2104
@ GF_FS_ARG_HINT_HIDE
Definition: filters.h:2106
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_BOOL
Definition: filters.h:858
@ GF_PROP_STRING
Definition: filters.h:876
@ GF_PROP_DATA
Definition: filters.h:882
@ GF_PROP_DOUBLE
Definition: filters.h:866
@ GF_PROP_UINT
Definition: filters.h:852
@ GF_PROP_FRACTION
Definition: filters.h:860
#define OFFS(_n)
Definition: mux_gsf.c:1260

◆ GSFMxRegister

GF_FilterRegister GSFMxRegister