libgpac
Documentation of the core library of GPAC
dmx_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 dmx_gsf.c:

Data Structures

struct  GSF_PacketFragment
 
struct  GSF_Packet
 
struct  GSF_Stream
 
struct  GSF_DemuxCtx
 

Macros

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

Enumerations

enum  GSF_PacketType {
  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 void gsfdmx_stream_del (GSF_DemuxCtx *ctx, GSF_Stream *gst, Bool is_flush)
 
GF_Err gsfdmx_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static Bool gsfdmx_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static void gsfdmx_decrypt (GSF_DemuxCtx *ctx, char *data, u32 size)
 
static GFINLINE u32 gsfdmx_read_vlen (GF_BitStream *bs)
 
static GF_Err gsfdmx_read_prop (GF_BitStream *bs, GF_PropertyValue *p)
 
static GSF_Streamgsfdmx_get_stream (GF_Filter *filter, GSF_DemuxCtx *ctx, u32 idx, u32 pkt_type)
 
static GF_Err gsfdmx_parse_pid_info (GF_Filter *filter, GSF_DemuxCtx *ctx, GSF_Stream *gst, GSF_Packet *pck, Bool is_info_update)
 
static GF_Err gsfdmx_tune (GF_Filter *filter, GSF_DemuxCtx *ctx, char *pck_data, u32 pck_size, Bool is_crypted)
 
static GFINLINE void gsfdmx_pck_reset (GSF_Packet *pck)
 
static GFINLINE GSF_Packetgsfdmx_get_packet (GSF_DemuxCtx *ctx, GSF_Stream *gst, Bool pck_frag, s32 frame_sn, u8 pkt_type, u32 frame_size)
 
static void gsfdmx_packet_append_frag (GSF_Packet *pck, u32 size, u32 offset)
 
GF_Err gsfdmx_read_data_pck (GSF_DemuxCtx *ctx, GSF_Stream *gst, GSF_Packet *gpck, u32 pck_len, Bool full_pck, GF_BitStream *bs)
 
static const char * gsfdmx_pck_name (u32 pck_type)
 
static GF_Err gsfdmx_process_packets (GF_Filter *filter, GSF_DemuxCtx *ctx, GSF_Stream *gst)
 
static GF_Err gsfdmx_demux (GF_Filter *filter, GSF_DemuxCtx *ctx, char *data, u32 data_size)
 
GF_Err gsfdmx_process (GF_Filter *filter)
 
static const char * gsfdmx_probe_data (const u8 *data, u32 data_size, GF_FilterProbeScore *score)
 
static void gsfdmx_not_enough_bytes (void *par)
 
static GF_Err gsfdmx_initialize (GF_Filter *filter)
 
static void gsfdmx_finalize (GF_Filter *filter)
 
const GF_FilterRegister * gsfdmx_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability GSFDemuxCaps []
 
static const GF_FilterArgs GSFDemuxArgs []
 
GF_FilterRegister GSFDemuxRegister
 

Data Structure Documentation

◆ GSF_PacketFragment

struct GSF_PacketFragment
Data Fields
u32 offset
u32 size

◆ GSF_Packet

struct GSF_Packet
+ Collaboration diagram for GSF_Packet:
Data Fields
GF_FilterPacket * pck
u8 * output
u32 full_block_size
u32 nb_bytes
u32 recv_bytes
Bool corrupted
u16 frame_sn
u8 pck_type
u8 crypted
u32 nb_frags
u32 nb_alloc_frags
u32 nb_recv_frags
Bool complete
GSF_PacketFragment * frags

◆ GSF_Stream

struct GSF_Stream
Data Fields
GF_FilterPid * opid
GF_List * packets
u32 idx
u16 nb_pck
u8 config_version
u16 last_frame_sn

◆ GSF_DemuxCtx

struct GSF_DemuxCtx
+ Collaboration diagram for GSF_DemuxCtx:
Data Fields
const char * magic
GF_PropData key
u32 pad
u32 mq
GF_FilterPid * ipid
GF_List * streams
bin128 crypt_IV
GF_Crypt * crypt
u16 crypt_blocks
u16 skip_blocks
u32 nb_playing
Double start_range
Bool is_file
u64 file_pos
u64 file_size
GF_Fraction64 duration
Bool initial_play_done
GF_BitStream * bs_r
GF_BitStream * bs_pck
GSF_Stream * signal_st
char * buffer
u32 alloc_size
u32 buf_size
u32 missing_bytes
Bool tuned
Bool tune_error
Bool use_seq_num
Bool wait_for_play
GF_List * pck_res
Bool buffer_too_small
Bool corrupted
Bool file_pids
Bool stop_pending
Bool pid_pending

Macro Definition Documentation

◆ OFFS

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

Enumeration Type Documentation

◆ GSF_PacketType

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

◆ gsfdmx_stream_del()

static void gsfdmx_stream_del ( GSF_DemuxCtx ctx,
GSF_Stream gst,
Bool  is_flush 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_configure_pid()

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

◆ gsfdmx_process_event()

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

◆ gsfdmx_decrypt()

static void gsfdmx_decrypt ( GSF_DemuxCtx ctx,
char *  data,
u32  size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_read_vlen()

static GFINLINE u32 gsfdmx_read_vlen ( GF_BitStream *  bs)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_read_prop()

static GF_Err gsfdmx_read_prop ( GF_BitStream *  bs,
GF_PropertyValue *  p 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_get_stream()

static GSF_Stream* gsfdmx_get_stream ( GF_Filter *  filter,
GSF_DemuxCtx ctx,
u32  idx,
u32  pkt_type 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_parse_pid_info()

static GF_Err gsfdmx_parse_pid_info ( GF_Filter *  filter,
GSF_DemuxCtx ctx,
GSF_Stream gst,
GSF_Packet pck,
Bool  is_info_update 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_tune()

static GF_Err gsfdmx_tune ( GF_Filter *  filter,
GSF_DemuxCtx ctx,
char *  pck_data,
u32  pck_size,
Bool  is_crypted 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_pck_reset()

static GFINLINE void gsfdmx_pck_reset ( GSF_Packet pck)
static
+ Here is the caller graph for this function:

◆ gsfdmx_get_packet()

static GFINLINE GSF_Packet* gsfdmx_get_packet ( GSF_DemuxCtx ctx,
GSF_Stream gst,
Bool  pck_frag,
s32  frame_sn,
u8  pkt_type,
u32  frame_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_packet_append_frag()

static void gsfdmx_packet_append_frag ( GSF_Packet pck,
u32  size,
u32  offset 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_read_data_pck()

GF_Err gsfdmx_read_data_pck ( GSF_DemuxCtx ctx,
GSF_Stream gst,
GSF_Packet gpck,
u32  pck_len,
Bool  full_pck,
GF_BitStream *  bs 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_pck_name()

static const char* gsfdmx_pck_name ( u32  pck_type)
static
+ Here is the caller graph for this function:

◆ gsfdmx_process_packets()

static GF_Err gsfdmx_process_packets ( GF_Filter *  filter,
GSF_DemuxCtx ctx,
GSF_Stream gst 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_demux()

static GF_Err gsfdmx_demux ( GF_Filter *  filter,
GSF_DemuxCtx ctx,
char *  data,
u32  data_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsfdmx_process()

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

◆ gsfdmx_probe_data()

static const char* gsfdmx_probe_data ( const u8 data,
u32  data_size,
GF_FilterProbeScore score 
)
static

◆ gsfdmx_not_enough_bytes()

static void gsfdmx_not_enough_bytes ( void *  par)
static
+ Here is the caller graph for this function:

◆ gsfdmx_initialize()

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

◆ gsfdmx_finalize()

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

◆ gsfdmx_register()

const GF_FilterRegister* gsfdmx_register ( GF_FilterSession *  session)

Variable Documentation

◆ GSFDemuxCaps

const GF_FilterCapability GSFDemuxCaps[]
static
Initial value:
=
{
CAP_STRING(GF_CAPS_INPUT, GF_PROP_PID_MIME, "application/x-gpac-sf"),
}
@ GF_CODECID_NONE
Definition: constants.h:383
@ GF_STREAM_TEXT
Definition: constants.h:82
@ GF_STREAM_AUDIO
Definition: constants.h:66
@ GF_STREAM_FILE
Definition: constants.h:104
@ GF_STREAM_VISUAL
Definition: constants.h:64
#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_OUTPUT_EXCLUDED
Definition: filters.h:2236
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ 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

◆ GSFDemuxArgs

const GF_FilterArgs GSFDemuxArgs[]
static
Initial value:
=
{
{ OFFS(key), "key for decrypting packets", GF_PROP_DATA, NULL, NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(magic), "magic string to check in setup packet", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(mq), "set max packet queue length for loss detection. 0 will flush incomplete packet when a new one starts", GF_PROP_UINT, "4", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(pad), "byte value used to pad lost packets", GF_PROP_UINT, "0", "0-255", GF_FS_ARG_HINT_ADVANCED},
{0}
}
#define OFFS(_n)
Definition: dmx_gsf.c:1453
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_STRING
Definition: filters.h:876
@ GF_PROP_DATA
Definition: filters.h:882
@ GF_PROP_UINT
Definition: filters.h:852

◆ GSFDemuxRegister

GF_FilterRegister GSFDemuxRegister
Initial value:
= {
.name = "gsfdmx",
.help = "This filter provides GSF (__GPAC Serialized Format__) demultiplexing.\n"
"It de-serializes the stream states (config/reconfig/info update/remove/eos) and packets in the GSF bytestream.\n"
"This allows either reading a session saved to file, or receiving the state/data of streams from another instance of GPAC using either pipes or sockets\n"
"\n"
"The stream format can be encrypted in AES 128 CBC mode, in which case the demultiplexing filter must be given a 128 bit key."
,
.private_size = sizeof(GSF_DemuxCtx),
.initialize = gsfdmx_initialize,
.finalize = gsfdmx_finalize,
.configure_pid = gsfdmx_configure_pid,
.process = gsfdmx_process,
.process_event = gsfdmx_process_event,
.probe_data = gsfdmx_probe_data,
.hint_class_type = GF_FS_CLASS_DEMULTIPLEXER
}
static const GF_FilterCapability GSFDemuxCaps[]
Definition: dmx_gsf.c:1438
GF_Err gsfdmx_process(GF_Filter *filter)
Definition: dmx_gsf.c:1306
static Bool gsfdmx_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: dmx_gsf.c:168
GF_Err gsfdmx_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: dmx_gsf.c:146
static const char * gsfdmx_probe_data(const u8 *data, u32 data_size, GF_FilterProbeScore *score)
Definition: dmx_gsf.c:1366
static GF_Err gsfdmx_initialize(GF_Filter *filter)
Definition: dmx_gsf.c:1395
static void gsfdmx_finalize(GF_Filter *filter)
Definition: dmx_gsf.c:1413
static const GF_FilterArgs GSFDemuxArgs[]
Definition: dmx_gsf.c:1454
Definition: dmx_gsf.c:71
#define SETCAPS(__struct)
Definition: filters.h:2364
@ GF_FS_REG_DYNAMIC_PIDS
Definition: filters.h:2403
@ GF_FS_CLASS_DEMULTIPLEXER
Definition: filters.h:2461
attribute Array args
Definition: jsf.idl:24