libgpac
Documentation of the core library of GPAC
reframer.c File Reference
#include <gpac/avparse.h>
#include <gpac/constants.h>
#include <gpac/filters.h>
+ Include dependency graph for reframer.c:

Data Structures

struct  RTStream
 
struct  GF_ReframerCtx
 

Macros

#define RT_PRECISION_US   2000
 
#define OFFS(_n)   #_n, offsetof(GF_ReframerCtx, _n)
 

Enumerations

enum  { REFRAME_RT_OFF = 0 , REFRAME_RT_ON , REFRAME_RT_SYNC }
 
enum  { REFRAME_ROUND_BEFORE =0 , REFRAME_ROUND_SEEK , REFRAME_ROUND_AFTER , REFRAME_ROUND_CLOSEST }
 
enum  { RANGE_NONE =0 , RANGE_CLOSED , RANGE_OPEN , RANGE_DONE }
 
enum  { UTCREF_LOCAL =0 , UTCREF_ANY , UTCREF_MEDIA }
 
enum  {
  EXTRACT_NONE =0 , EXTRACT_RANGE , EXTRACT_SAP , EXTRACT_SIZE ,
  EXTRACT_DUR
}
 
enum  { RAW_AV =0 , RAW_AUDIO , RAW_VIDEO , RAW_NONE }
 

Functions

static void reframer_reset_stream (GF_ReframerCtx *ctx, RTStream *st, Bool do_free)
 
static void reframer_push_props (GF_ReframerCtx *ctx, RTStream *st)
 
GF_Err reframer_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static Bool reframer_parse_date (char *date, GF_Fraction64 *value, u64 *frame_idx_plus_one, u32 *extract_mode, Bool *is_dur, Bool *is_timecode)
 
static void reframer_load_range (GF_ReframerCtx *ctx)
 
void reframer_drop_packet (GF_ReframerCtx *ctx, RTStream *st, GF_FilterPacket *pck, Bool pck_is_ref)
 
void reframer_copy_raw_audio (RTStream *st, const u8 *src, u32 src_size, u32 offset, u8 *dst, u32 nb_samp)
 
Bool reframer_send_packet (GF_Filter *filter, GF_ReframerCtx *ctx, RTStream *st, GF_FilterPacket *pck, Bool pck_is_ref)
 
static u32 reframer_check_pck_range (GF_Filter *filter, GF_ReframerCtx *ctx, RTStream *st, GF_FilterPacket *pck, u64 ts, u32 dur, u32 frame_idx, u32 *nb_audio_samples_to_keep)
 
void reframer_purge_queues (GF_ReframerCtx *ctx, u64 ts, u32 timescale)
 
static void check_gop_split (GF_ReframerCtx *ctx)
 
GF_Err reframer_process (GF_Filter *filter)
 
static GF_Err reframer_initialize (GF_Filter *filter)
 
static Bool reframer_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static void reframer_finalize (GF_Filter *filter)
 
static GF_Err reframer_update_arg (GF_Filter *filter, const char *arg_name, const GF_PropertyValue *new_val)
 
const GF_FilterRegister * reframer_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability ReframerCaps_RAW_AV []
 
static const GF_FilterCapability ReframerCaps_RAW_A []
 
static const GF_FilterCapability ReframerCaps_RAW_V []
 
static const GF_FilterCapability ReframerCaps []
 
static const GF_FilterArgs ReframerArgs []
 
GF_FilterRegister ReframerRegister
 

Data Structure Documentation

◆ RTStream

struct RTStream
Data Fields
GF_FilterPid * ipid
GF_FilterPid * opid
u32 timescale
u64 cts_us_at_init
u64 sys_clock_at_init
u32 nb_frames
Bool can_split
Bool all_saps
Bool needs_adjust
Bool use_blocking_refs
u64 ts_at_range_start_plus_one
u64 ts_at_range_end
GF_List * pck_queue
u32 range_start_computed
u64 range_end_reached_ts
u64 prev_sap_ts
u32 prev_sap_frame_idx
u32 nb_frames_range
u64 sap_ts_plus_one
Bool first_pck_sent
u64 tk_delay
u32 ts_sub
Bool in_eos
u32 split_start
u32 split_end
GF_FilterPacket * split_pck
GF_FilterPacket * reinsert_single_pck
Bool is_playing
Bool is_raw
u32 codec_id
u32 stream_type
u32 nb_ch
u32 sample_rate
u32 abps
Bool audio_planar
u32 audio_samples_to_keep
u32 nb_frames_until_start
Bool seek_mode
u64 probe_ref_frame_ts
Bool fetch_done
u64 last_utc_ref
u64 last_utc_ref_ts

◆ GF_ReframerCtx

struct GF_ReframerCtx
+ Collaboration diagram for GF_ReframerCtx:
Data Fields
Bool exporter
GF_PropUIntList saps
GF_PropIntList frames
Bool refs
u32 rt
Double speed
u32 raw
GF_PropStringList xs
GF_PropStringList xe
Bool nosap
Bool splitrange
Bool xadjust
Bool tcmdrw
Bool no_audio_seek
Bool probe_ref
Bool xots
Bool xdts
u32 xround
u32 utc_ref
u32 utc_probe
Double seeksafe
GF_PropStringList props
Bool copy
Bool rmseek
u32 cues
u32 sapcue
Bool filter_sap1
Bool filter_sap2
Bool filter_sap3
Bool filter_sap4
Bool filter_sap_none
GF_List * streams
RTStream * clock
Double rt_speed
u64 reschedule_in
u64 clock_val
u32 range_type
u32 cur_range_idx
GF_Fraction64 cur_start
GF_Fraction64 cur_end
Bool cur_start_is_tc
Bool cur_end_is_tc
u64 start_frame_idx_plus_one
u64 end_frame_idx_plus_one
Bool in_range
Bool seekable
GF_Fraction64 extract_dur
u32 extract_mode
Bool is_range_extraction
u32 file_idx
u64 min_ts_computed
u32 min_ts_scale
u64 split_size
u64 est_file_size
u64 prev_min_ts_computed
u32 prev_min_ts_scale
u32 wait_video_range_adjust
Bool has_seen_eos
u32 eos_state
u32 nb_non_saps
u32 nb_video_frames_since_start_at_range_start
u32 nb_video_frames_since_start
Bool flush_samples
u64 cumulated_size
u64 last_ts
u64 flush_max_ts
u32 flush_max_ts_scale
u64 last_utc_time_s
u32 last_clock_probe

Macro Definition Documentation

◆ RT_PRECISION_US

#define RT_PRECISION_US   2000

◆ OFFS

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
REFRAME_RT_OFF 
REFRAME_RT_ON 
REFRAME_RT_SYNC 

◆ anonymous enum

anonymous enum
Enumerator
REFRAME_ROUND_BEFORE 
REFRAME_ROUND_SEEK 
REFRAME_ROUND_AFTER 
REFRAME_ROUND_CLOSEST 

◆ anonymous enum

anonymous enum
Enumerator
RANGE_NONE 
RANGE_CLOSED 
RANGE_OPEN 
RANGE_DONE 

◆ anonymous enum

anonymous enum
Enumerator
UTCREF_LOCAL 
UTCREF_ANY 
UTCREF_MEDIA 

◆ anonymous enum

anonymous enum
Enumerator
EXTRACT_NONE 
EXTRACT_RANGE 
EXTRACT_SAP 
EXTRACT_SIZE 
EXTRACT_DUR 

◆ anonymous enum

anonymous enum
Enumerator
RAW_AV 
RAW_AUDIO 
RAW_VIDEO 
RAW_NONE 

Function Documentation

◆ reframer_reset_stream()

static void reframer_reset_stream ( GF_ReframerCtx ctx,
RTStream st,
Bool  do_free 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_push_props()

static void reframer_push_props ( GF_ReframerCtx ctx,
RTStream st 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_configure_pid()

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

◆ reframer_parse_date()

static Bool reframer_parse_date ( char *  date,
GF_Fraction64 value,
u64 frame_idx_plus_one,
u32 extract_mode,
Bool is_dur,
Bool is_timecode 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_load_range()

static void reframer_load_range ( GF_ReframerCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_drop_packet()

void reframer_drop_packet ( GF_ReframerCtx ctx,
RTStream st,
GF_FilterPacket *  pck,
Bool  pck_is_ref 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_copy_raw_audio()

void reframer_copy_raw_audio ( RTStream st,
const u8 src,
u32  src_size,
u32  offset,
u8 dst,
u32  nb_samp 
)
+ Here is the caller graph for this function:

◆ reframer_send_packet()

Bool reframer_send_packet ( GF_Filter *  filter,
GF_ReframerCtx ctx,
RTStream st,
GF_FilterPacket *  pck,
Bool  pck_is_ref 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_check_pck_range()

static u32 reframer_check_pck_range ( GF_Filter *  filter,
GF_ReframerCtx ctx,
RTStream st,
GF_FilterPacket *  pck,
u64  ts,
u32  dur,
u32  frame_idx,
u32 nb_audio_samples_to_keep 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_purge_queues()

void reframer_purge_queues ( GF_ReframerCtx ctx,
u64  ts,
u32  timescale 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_gop_split()

static void check_gop_split ( GF_ReframerCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reframer_process()

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

◆ reframer_initialize()

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

◆ reframer_process_event()

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

◆ reframer_finalize()

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

◆ reframer_update_arg()

static GF_Err reframer_update_arg ( GF_Filter *  filter,
const char *  arg_name,
const GF_PropertyValue *  new_val 
)
static
+ Here is the call graph for this function:

◆ reframer_register()

const GF_FilterRegister* reframer_register ( GF_FilterSession *  session)

Variable Documentation

◆ ReframerCaps_RAW_AV

const GF_FilterCapability ReframerCaps_RAW_AV[]
static
Initial value:
=
{
{0},
}
@ GF_CODECID_RAW
Definition: constants.h:600
@ GF_STREAM_AUDIO
Definition: constants.h:66
@ GF_STREAM_ENCRYPTED
Definition: constants.h:102
@ GF_STREAM_FILE
Definition: constants.h:104
@ GF_STREAM_VISUAL
Definition: constants.h:64
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define GF_CAPS_INPUT_OUTPUT
Definition: filters.h:2242
#define GF_CAPS_INPUT_EXCLUDED
Definition: filters.h:2228
#define GF_CAPS_OUTPUT_EXCLUDED
Definition: filters.h:2236
#define CAP_BOOL(_f, _a, _b)
Definition: filters.h:2180
#define GF_CAPS_IN_OUT_EXCLUDED
Definition: filters.h:2246
@ 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_TRUE
Definition: setup.h:474

◆ ReframerCaps_RAW_A

◆ ReframerCaps_RAW_V

◆ ReframerCaps

◆ ReframerArgs

const GF_FilterArgs ReframerArgs[]
static

◆ ReframerRegister

GF_FilterRegister ReframerRegister