libgpac
Documentation of the core library of GPAC
out_rtp.c File Reference
#include <gpac/internal/media_dev.h>
#include <gpac/constants.h>
#include <gpac/maths.h>
#include <gpac/filters.h>
#include <gpac/ietf.h>
#include <gpac/config_file.h>
#include <gpac/base_coding.h>
#include <gpac/rtp_streamer.h>
#include "out_rtp.h"
+ Include dependency graph for out_rtp.c:

Data Structures

struct  GF_RTPOutCtx
 

Macros

#define M2TS_MIME_TYPES   "video/mpeg-2|video/mp2t|video/mpeg"
 
#define M2TS_FILE_EXTS   "ts|m2t|mts|dmb|trp"
 
#define OFFS(_n)   #_n, offsetof(GF_RTPOutCtx, _n)
 

Functions

GF_Err rtpout_create_sdp (GF_List *streams, Bool is_rtsp, const char *ip, const char *info, const char *sess_name, const char *url, const char *email, u32 base_pid_id, FILE **sdp_tmp, u64 *session_id)
 
static Bool check_mime_ext (const char *string, const char *pattern)
 
GF_Err rtpout_init_streamer (GF_RTPOutStream *stream, const char *ipdest, Bool inject_xps, Bool use_mpeg4_signaling, Bool use_latm, u32 payt, u32 mtu, u32 ttl, const char *ifce, Bool is_rtsp, u32 *base_pid_id, const char *netcap_id)
 
static GF_Err rtpout_setup_sdp (GF_RTPOutCtx *ctx)
 
static u16 rtpout_check_next_port (GF_RTPOutCtx *ctx, u16 first_port)
 
void rtpout_del_stream (GF_RTPOutStream *st)
 
static GF_Err rtpout_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static GF_Err rtpout_initialize (GF_Filter *filter)
 
static void rtpout_finalize (GF_Filter *filter)
 
static GF_Err rtpout_send_xps (GF_RTPOutStream *stream, GF_List *pslist, Bool *au_start, u32 pck_size, u32 cts, u32 dts, u32 duration)
 
static Bool rtpout_init_clock (GF_RTPOutCtx *ctx)
 
static void rtpout_process_rtcp (void *cbk, u32 ssrc, u32 rtt_ms, u64 jitter_rtp_ts, u32 loss_rate)
 
GF_Err rtpout_process_rtp (GF_List *streams, GF_RTPOutStream **active_stream, Bool loop, s32 delay, u32 *active_stream_idx, u64 sys_clock_at_init, u64 *active_min_ts_microsec, u64 microsec_ts_init, Bool *wait_for_loop, u32 *repost_delay_us, Bool *first_RTCP_sent, u32 base_pid_id)
 
static GF_Err rtpout_process (GF_Filter *filter)
 
static GF_FilterProbeScore rtpout_probe_url (const char *url, const char *mime)
 
const GF_FilterRegister * rtpout_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability RTPOutCaps []
 
static const GF_FilterArgs RTPOutArgs []
 
GF_FilterRegister RTPOutRegister
 

Data Structure Documentation

◆ GF_RTPOutCtx

struct GF_RTPOutCtx
+ Collaboration diagram for GF_RTPOutCtx:
Data Fields
char * ip
char * dst
char * ext
char * mime
u32 port
Bool loop
Bool xps
Bool mpeg4
u32 mtu
u32 ttl
char * ifce
u32 payt
u32 tt
s32 delay
char * info
char * url
char * email
s32 runfor
s32 tso
Bool latm
Double start
Double speed
u64 sys_clock_at_init
GF_List * streams
u32 base_pid_id
Bool first_RTCP_sent
GF_RTPOutStream * active_stream
u32 active_stream_idx
u64 active_min_ts_microsec
GF_FilterPid * opid
Bool wait_for_loop
u64 microsec_ts_init
GF_FilterCapability in_caps[3]
char szExt[10]

Macro Definition Documentation

◆ M2TS_MIME_TYPES

#define M2TS_MIME_TYPES   "video/mpeg-2|video/mp2t|video/mpeg"

◆ M2TS_FILE_EXTS

#define M2TS_FILE_EXTS   "ts|m2t|mts|dmb|trp"

◆ OFFS

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

Function Documentation

◆ rtpout_create_sdp()

GF_Err rtpout_create_sdp ( GF_List *  streams,
Bool  is_rtsp,
const char *  ip,
const char *  info,
const char *  sess_name,
const char *  url,
const char *  email,
u32  base_pid_id,
FILE **  sdp_tmp,
u64 session_id 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_mime_ext()

static Bool check_mime_ext ( const char *  string,
const char *  pattern 
)
static
+ Here is the caller graph for this function:

◆ rtpout_init_streamer()

GF_Err rtpout_init_streamer ( GF_RTPOutStream stream,
const char *  ipdest,
Bool  inject_xps,
Bool  use_mpeg4_signaling,
Bool  use_latm,
u32  payt,
u32  mtu,
u32  ttl,
const char *  ifce,
Bool  is_rtsp,
u32 base_pid_id,
const char *  netcap_id 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_setup_sdp()

static GF_Err rtpout_setup_sdp ( GF_RTPOutCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_check_next_port()

static u16 rtpout_check_next_port ( GF_RTPOutCtx ctx,
u16  first_port 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_del_stream()

void rtpout_del_stream ( GF_RTPOutStream st)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_configure_pid()

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

◆ rtpout_initialize()

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

◆ rtpout_finalize()

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

◆ rtpout_send_xps()

static GF_Err rtpout_send_xps ( GF_RTPOutStream stream,
GF_List *  pslist,
Bool au_start,
u32  pck_size,
u32  cts,
u32  dts,
u32  duration 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_init_clock()

static Bool rtpout_init_clock ( GF_RTPOutCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_process_rtcp()

static void rtpout_process_rtcp ( void *  cbk,
u32  ssrc,
u32  rtt_ms,
u64  jitter_rtp_ts,
u32  loss_rate 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_process_rtp()

GF_Err rtpout_process_rtp ( GF_List *  streams,
GF_RTPOutStream **  active_stream,
Bool  loop,
s32  delay,
u32 active_stream_idx,
u64  sys_clock_at_init,
u64 active_min_ts_microsec,
u64  microsec_ts_init,
Bool wait_for_loop,
u32 repost_delay_us,
Bool first_RTCP_sent,
u32  base_pid_id 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rtpout_process()

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

◆ rtpout_probe_url()

static GF_FilterProbeScore rtpout_probe_url ( const char *  url,
const char *  mime 
)
static

◆ rtpout_register()

const GF_FilterRegister* rtpout_register ( GF_FilterSession *  session)
+ Here is the call graph for this function:

Variable Documentation

◆ RTPOutCaps

const GF_FilterCapability RTPOutCaps[]
static
Initial value:
=
{
{0},
{0},
}
@ 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
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_CAPFLAG_LOADED_FILTER
Definition: filters.h:2210
@ GF_CAPFLAG_PRESENT
Definition: filters.h:2216
@ 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_TIMESCALE
Definition: filters.h:1128
@ GF_PROP_PID_MIME
Definition: filters.h:1189
@ GF_TRUE
Definition: setup.h:474

◆ RTPOutArgs

const GF_FilterArgs RTPOutArgs[]
static
Initial value:
=
{
{ OFFS(ip), "destination IP address (NULL is 127.0.0.1)", GF_PROP_STRING, NULL, NULL, 0},
{ OFFS(port), "port for first stream in session", GF_PROP_UINT, "7000", NULL, 0},
{ OFFS(loop), "loop all streams in session (not always possible depending on source type)", GF_PROP_BOOL, "false", NULL, 0},
{ OFFS(mpeg4), "send all streams using MPEG-4 generic payload format if possible", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_EXPERT},
{ OFFS(mtu), "size of RTP MTU in bytes", GF_PROP_UINT, "1460", NULL, 0},
{ OFFS(ttl), "time-to-live for multicast packets", GF_PROP_UINT, "2", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(ifce), "default network interface to use", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(payt), "payload type to use for dynamic decoder configurations", GF_PROP_UINT, "96", "96-127", GF_FS_ARG_HINT_EXPERT},
{ OFFS(delay), "send delay for packet (negative means send earlier)", GF_PROP_SINT, "0", NULL, 0},
{ OFFS(tt), "time tolerance in microseconds. Whenever schedule time minus realtime is below this value, the packet is sent right away", GF_PROP_UINT, "1000", NULL, GF_FS_ARG_HINT_EXPERT},
{ OFFS(runfor), "run for the given time in ms. Negative value means run for ever (if loop) or source duration, 0 only outputs the sdp", GF_PROP_SINT, "-1", NULL, 0},
{ OFFS(tso), "set timestamp offset in microseconds. Negative value means random initial timestamp", GF_PROP_SINT, "-1", NULL, GF_FS_ARG_HINT_EXPERT},
{ OFFS(xps), "force parameter set injection at each SAP. If not set, only inject if different from SDP ones", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(latm), "use latm for AAC payload format", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_EXPERT},
{ OFFS(dst), "URL for direct RTP mode", GF_PROP_NAME, NULL, NULL, 0},
{ OFFS(ext), "file extension for direct RTP mode", GF_PROP_STRING, NULL, NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(mime), "set mime type for direct RTP mode", GF_PROP_NAME, NULL, NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(speed), "set streaming speed. If negative and start is 0, start is set to -1", GF_PROP_DOUBLE, "1.0", NULL, 0},
{ OFFS(start), "set streaming start offset. A negative value means percent of media duration with -1 equal to duration", GF_PROP_DOUBLE, "0.0", NULL, 0},
{0}
}
static s32 runfor
Definition: gpac.c:70
@ 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_STRING
Definition: filters.h:876
@ GF_PROP_SINT
Definition: filters.h:850
@ GF_PROP_DOUBLE
Definition: filters.h:866
@ GF_PROP_NAME
Definition: filters.h:884
@ GF_PROP_UINT
Definition: filters.h:852
#define OFFS(_n)
Definition: out_rtp.c:1273

◆ RTPOutRegister

GF_FilterRegister RTPOutRegister