VLC  3.0.15
Macros | Functions
input.c File Reference
Include dependency graph for input.c:

Macros

#define SLAVE_ADD_NOFLAG   0
 
#define SLAVE_ADD_FORCED   (1<<0)
 
#define SLAVE_ADD_CANFAIL   (1<<1)
 
#define SLAVE_ADD_SET_TIME   (1<<2)
 
#define INIT_COUNTER(c, compute)
 
#define EXIT_COUNTER(c)
 
#define CL_CO(c)
 
#define I(c)   stats_Update( input_priv(p_input)->counters.c, i_delta, NULL )
 

Functions

static void * Run (void *)
 
static void * Preparse (void *)
 
static input_thread_tCreate (vlc_object_t *, input_item_t *, const char *, bool, input_resource_t *, vlc_renderer_item_t *)
 
static int Init (input_thread_t *p_input)
 
static void End (input_thread_t *p_input)
 
static void MainLoop (input_thread_t *p_input, bool b_interactive)
 MainLoop The main input loop. More...
 
static int ControlPop (input_thread_t *, int *, vlc_value_t *, mtime_t i_deadline, bool b_postpone_seek)
 
static void ControlRelease (int i_type, vlc_value_t val)
 
static bool ControlIsSeekRequest (int i_type)
 
static bool Control (input_thread_t *, int, vlc_value_t)
 
static void ControlPause (input_thread_t *, mtime_t)
 
static int UpdateTitleSeekpointFromDemux (input_thread_t *)
 
static void UpdateGenericFromDemux (input_thread_t *)
 
static void UpdateTitleListfromDemux (input_thread_t *)
 
static void MRLSections (const char *, int *, int *, int *, int *)
 
static input_source_tInputSourceNew (input_thread_t *, const char *, const char *psz_forced_demux, bool b_in_can_fail)
 
static void InputSourceDestroy (input_source_t *)
 
static void InputSourceMeta (input_thread_t *, input_source_t *, vlc_meta_t *)
 
static void SlaveDemux (input_thread_t *p_input)
 
static void SlaveSeek (input_thread_t *p_input)
 
static void InputMetaUser (input_thread_t *p_input, vlc_meta_t *p_meta)
 
static void InputUpdateMeta (input_thread_t *p_input, demux_t *p_demux)
 
static void InputGetExtraFiles (input_thread_t *p_input, int *pi_list, char ***pppsz_list, const char **psz_access, const char *psz_path)
 
static void AppendAttachment (int *pi_attachment, input_attachment_t ***ppp_attachment, const demux_t ***ppp_attachment_demux, int i_new, input_attachment_t **pp_new, const demux_t *p_demux)
 
static int input_SlaveSourceAdd (input_thread_t *, enum slave_type, const char *, unsigned)
 
static char * input_SubtitleFile2Uri (input_thread_t *, const char *)
 
static void input_ChangeState (input_thread_t *p_input, int i_state)
 
input_thread_tinput_Create (vlc_object_t *p_parent, input_item_t *p_item, const char *psz_log, input_resource_t *p_resource, vlc_renderer_item_t *p_renderer)
 Create a new input_thread_t. More...
 
int input_Read (vlc_object_t *p_parent, input_item_t *p_item)
 Initialize an input thread and run it until it stops by itself. More...
 
input_thread_tinput_CreatePreparser (vlc_object_t *parent, input_item_t *item)
 Creates an item preparser. More...
 
int input_Start (input_thread_t *p_input)
 Start a input_thread_t created by input_Create. More...
 
void input_Stop (input_thread_t *p_input)
 Request a running input thread to stop and die. More...
 
void input_Close (input_thread_t *p_input)
 Close an input. More...
 
static void input_Destructor (vlc_object_t *obj)
 Input destructor (called when the object's refcount reaches 0). More...
 
input_item_tinput_GetItem (input_thread_t *p_input)
 Get the item from an input thread FIXME it does not increase ref count of the item. More...
 
bool input_Stopped (input_thread_t *input)
 
static void MainLoopDemux (input_thread_t *p_input, bool *pb_changed)
 MainLoopDemux It asks the demuxer to demux some data. More...
 
static int MainLoopTryRepeat (input_thread_t *p_input)
 
static void MainLoopStatistics (input_thread_t *p_input)
 Update timing infos and statistics. More...
 
static void InitStatistics (input_thread_t *p_input)
 
static void InitTitle (input_thread_t *p_input)
 
static void StartTitle (input_thread_t *p_input)
 
static int SlaveCompare (const void *a, const void *b)
 
static bool SlaveExists (input_item_slave_t **pp_slaves, int i_slaves, const char *psz_uri)
 
static void SetSubtitlesOptions (input_thread_t *p_input)
 
static void GetVarSlaves (input_thread_t *p_input, input_item_slave_t ***ppp_slaves, int *p_slaves)
 
static void LoadSlaves (input_thread_t *p_input)
 
static void UpdatePtsDelay (input_thread_t *p_input)
 
static void InitPrograms (input_thread_t *p_input)
 
void input_ControlPush (input_thread_t *p_input, int i_type, vlc_value_t *p_val)
 
static int ControlGetReducedIndexLocked (input_thread_t *p_input)
 
static void ControlUnpause (input_thread_t *p_input, mtime_t i_control_date)
 
static void ViewpointApply (input_thread_t *p_input)
 
static void ControlNavDisplayVolume (vout_thread_t *p_vout, float vol)
 
static void ControlNavDisplayPosition (vout_thread_t *p_vout, input_thread_t *p_input)
 
static void ControlNav (input_thread_t *p_input, int i_type)
 
static void ControlInsertDemuxFilter (input_thread_t *p_input, const char *psz_demux_chain)
 
static int UpdateTitleSeekpoint (input_thread_t *p_input, int i_title, int i_seekpoint)
 
static int InputStreamHandleAnchor (input_source_t *source, stream_t **stream, char const *anchor)
 
static demux_tInputDemuxNew (input_thread_t *p_input, input_source_t *p_source, const char *psz_access, const char *psz_demux, const char *psz_path, const char *psz_anchor)
 
static void InputGetExtraFilesPattern (input_thread_t *p_input, int *pi_list, char ***pppsz_list, const char *psz_path, const char *psz_match, const char *psz_format, int i_start, int i_stop)
 
void input_SplitMRL (const char **access, const char **demux, const char **path, const char **anchor, char *buf)
 
static const char * MRLSeekPoint (const char *str, int *title, int *chapter)
 
void input_UpdateStatistic (input_thread_t *p_input, input_statistic_t i_type, int i_delta)
 It will update internal input statistics from external sources. More...
 
char * input_CreateFilename (input_thread_t *input, const char *dir, const char *filenamefmt, const char *ext)
 This function creates a sane filename path. More...
 

Macro Definition Documentation

◆ CL_CO

#define CL_CO (   c)
Value:
do { \
stats_CounterClean( priv->counters.p_##c ); \
priv->counters.p_##c = NULL; \
} while (0)

◆ EXIT_COUNTER

#define EXIT_COUNTER (   c)
Value:
do { if( input_priv(p_input)->counters.p_##c ) \
stats_CounterClean( input_priv(p_input)->counters.p_##c );\
input_priv(p_input)->counters.p_##c = NULL; } while(0)

◆ I

#define I (   c)    stats_Update( input_priv(p_input)->counters.c, i_delta, NULL )

◆ INIT_COUNTER

#define INIT_COUNTER (   c,
  compute 
)
Value:
free( priv->counters.p_##c ); \
priv->counters.p_##c = \
stats_CounterCreate( STATS_##compute);

◆ SLAVE_ADD_CANFAIL

#define SLAVE_ADD_CANFAIL   (1<<1)

◆ SLAVE_ADD_FORCED

#define SLAVE_ADD_FORCED   (1<<0)

◆ SLAVE_ADD_NOFLAG

#define SLAVE_ADD_NOFLAG   0

◆ SLAVE_ADD_SET_TIME

#define SLAVE_ADD_SET_TIME   (1<<2)

Function Documentation

◆ AppendAttachment()

static void AppendAttachment ( int *  pi_attachment,
input_attachment_t ***  ppp_attachment,
const demux_t ***  ppp_attachment_demux,
int  i_new,
input_attachment_t **  pp_new,
const demux_t p_demux 
)
static

◆ Control()

static bool Control ( input_thread_t p_input,
int  i_type,
vlc_value_t  val 
)
static

< No error

Referenced by MainLoop().

◆ ControlGetReducedIndexLocked()

static int ControlGetReducedIndexLocked ( input_thread_t p_input)
static

◆ ControlInsertDemuxFilter()

static void ControlInsertDemuxFilter ( input_thread_t p_input,
const char *  psz_demux_chain 
)
static

◆ ControlIsSeekRequest()

static bool ControlIsSeekRequest ( int  i_type)
static

Referenced by MainLoop().

◆ ControlNav()

static void ControlNav ( input_thread_t p_input,
int  i_type 
)
static

◆ ControlNavDisplayPosition()

static void ControlNavDisplayPosition ( vout_thread_t p_vout,
input_thread_t p_input 
)
static

◆ ControlNavDisplayVolume()

static void ControlNavDisplayVolume ( vout_thread_t p_vout,
float  vol 
)
static

◆ ControlPause()

static void ControlPause ( input_thread_t p_input,
mtime_t  i_control_date 
)
static

Referenced by MainLoop().

◆ ControlPop()

static int ControlPop ( input_thread_t p_input,
int *  pi_type,
vlc_value_t p_val,
mtime_t  i_deadline,
bool  b_postpone_seek 
)
inlinestatic

< Unspecified error

< Unspecified error

< No error

Referenced by MainLoop().

◆ ControlRelease()

static void ControlRelease ( int  i_type,
vlc_value_t  val 
)
static

Referenced by input_Destructor(), and input_Stop().

◆ ControlUnpause()

static void ControlUnpause ( input_thread_t p_input,
mtime_t  i_control_date 
)
static

◆ Create()

static input_thread_t * Create ( vlc_object_t p_parent,
input_item_t p_item,
const char *  psz_header,
bool  b_preparsing,
input_resource_t p_resource,
vlc_renderer_item_t p_renderer 
)
static

References atof(), input_thread_private_t::attachment, input_thread_private_t::attachment_demux, input_thread_private_t::b_can_pace_control, input_thread_private_t::b_out_pace_control, input_item_t::b_preparse_interact, input_thread_private_t::b_preparsing, input_thread_private_t::b_recording, input_thread_private_t::bookmark, CLOCK_FREQ, input_thread_private_t::counters, input_thread_private_t::counters_lock, vlc_common_members::flags, vlc_common_members::header, input_thread_private_t::i_attachment, input_thread_private_t::i_bookmark, input_thread_private_t::i_control, input_item_t::i_preparse_depth, input_thread_private_t::i_rate, input_thread_private_t::i_seekpoint_offset, input_thread_private_t::i_slave, input_thread_private_t::i_start, input_thread_private_t::i_state, input_thread_private_t::i_stop, input_thread_private_t::i_time, seekpoint_t::i_time_offset, input_thread_private_t::i_title, input_thread_private_t::i_title_offset, INIT_S, input_thread_private_t::input, INPUT_ADD_BOOKMARK, input_ConfigVarInit(), input_Control(), input_ControlVarInit(), input_Destructor(), input_EsOutNew(), input_item_ApplyOptions(), input_item_GetName(), input_item_Hold(), input_item_SetESNowPlaying(), input_item_SetNowPlaying(), input_priv(), INPUT_RATE_DEFAULT, input_resource_Hold(), input_resource_New(), input_resource_SetInput(), input_SendEventMeta(), input_thread_private_t::interrupt, input_thread_private_t::is_running, input_thread_private_t::is_stopped, input_item_t::lock, input_thread_private_t::lock_control, input_thread_private_t::master, msg_Dbg, input_thread_t::obj, OBJECT_FLAGS_NOINTERACT, OBJECT_FLAGS_QUIET, input_thread_private_t::p_es_out, input_thread_private_t::p_es_out_display, input_thread_private_t::p_item, input_thread_private_t::p_renderer, input_thread_private_t::p_resource, input_thread_private_t::p_resource_private, input_thread_private_t::p_sout, input_item_t::p_stats, input_thread_private_t::pp_bookmark, seekpoint_t::psz_name, psz_name, input_thread_private_t::slave, stats_NewInputStats(), strcasecmp(), strdup(), TAB_INIT, input_thread_private_t::title, unlikely, var_GetNonEmptyString, var_InheritAddress, var_InheritBool, var_InheritString, input_thread_private_t::viewpoint, input_thread_private_t::viewpoint_changed, vlc_cond_init(), vlc_custom_create, vlc_interrupt_init(), vlc_mutex_init(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_OBJECT, vlc_object_set_destructor, vlc_renderer_item_hold(), vlc_seekpoint_Delete(), vlc_seekpoint_New(), vlc_viewpoint_init(), and input_thread_private_t::wait_control.

Referenced by input_Create(), input_CreatePreparser(), and input_Read().

◆ End()

static void End ( input_thread_t p_input)
static

Referenced by input_Read(), and Run().

◆ GetVarSlaves()

static void GetVarSlaves ( input_thread_t p_input,
input_item_slave_t ***  ppp_slaves,
int *  p_slaves 
)
static

< No error

◆ Init()

static int Init ( input_thread_t p_input)
static

< No error

< Unspecified error

Referenced by input_Read(), and Run().

◆ InitPrograms()

static void InitPrograms ( input_thread_t p_input)
static

◆ InitStatistics()

static void InitStatistics ( input_thread_t p_input)
static

◆ InitTitle()

static void InitTitle ( input_thread_t p_input)
static

◆ input_ChangeState()

static void input_ChangeState ( input_thread_t p_input,
int  i_state 
)
static

◆ input_Close()

void input_Close ( input_thread_t p_input)

Close an input.

It does not call input_Stop itself.

References input_priv(), thread, vlc_interrupt_deinit(), vlc_join(), and vlc_object_release.

Referenced by PreparserCloseInput().

◆ input_ControlPush()

void input_ControlPush ( input_thread_t p_input,
int  i_type,
vlc_value_t p_val 
)

◆ input_Create()

input_thread_t* input_Create ( vlc_object_t p_parent,
input_item_t p_item,
const char *  psz_log,
input_resource_t p_resource,
vlc_renderer_item_t p_renderer 
)

Create a new input_thread_t.

You need to call input_Start on it when you are done adding callback on the variables/events you want to monitor.

Parameters
p_parenta vlc_object
p_iteman input item
psz_logan optional prefix for this input logs
p_resourcean optional input ressource
Returns
a pointer to the spawned input thread

References Create().

◆ input_CreateFilename()

char* input_CreateFilename ( input_thread_t input,
const char *  dir,
const char *  filenamefmt,
const char *  ext 
)

◆ input_CreatePreparser()

input_thread_t* input_CreatePreparser ( vlc_object_t obj,
input_item_t item 
)

Creates an item preparser.

Creates an input thread to preparse an item. The input needs to be started with input_Start() afterwards.

Parameters
objparent object
iteminput item to preparse
Returns
an input thread or NULL on error

References Create().

◆ input_Destructor()

static void input_Destructor ( vlc_object_t obj)
static

◆ input_GetItem()

input_item_t* input_GetItem ( input_thread_t p_input)

Get the item from an input thread FIXME it does not increase ref count of the item.

Get the input item for an input thread.

if it is used after p_input is destroyed nothing prevent it from being freed.

References input_priv(), and input_thread_private_t::p_item.

◆ input_Read()

int input_Read ( vlc_object_t p_parent,
input_item_t p_item 
)

Initialize an input thread and run it until it stops by itself.

Parameters
p_parenta vlc_object
p_iteman input item
Returns
an error code, VLC_SUCCESS on success

< Unspecified error

< No error

References Create(), End(), Init(), MainLoop(), VLC_EGENERIC, vlc_object_release, and VLC_SUCCESS.

◆ input_SlaveSourceAdd()

static int input_SlaveSourceAdd ( input_thread_t p_input,
enum slave_type  i_type,
const char *  psz_uri,
unsigned  i_flags 
)
static

< Unspecified error

< Unspecified error

< Unspecified error

< No error

< No error

< No error

◆ input_SplitMRL()

void input_SplitMRL ( const char **  access,
const char **  demux,
const char **  path,
const char **  anchor,
char *  buf 
)

◆ input_Start()

int input_Start ( input_thread_t p_input)

Start a input_thread_t created by input_Create.

You must not start an already running input_thread_t.

Parameters
theinput thread to start

< Unspecified error

< No error

References input_thread_private_t::b_preparsing, ERROR_S, input_ChangeState(), input_priv(), input_thread_private_t::is_running, msg_Err, Preparse(), Run(), input_thread_private_t::thread, vlc_clone(), VLC_EGENERIC, VLC_SUCCESS, and VLC_THREAD_PRIORITY_INPUT.

Referenced by PlayItem().

◆ input_Stop()

void input_Stop ( input_thread_t p_input)

◆ input_Stopped()

bool input_Stopped ( input_thread_t input)

Referenced by MainLoop().

◆ input_SubtitleFile2Uri()

static char * input_SubtitleFile2Uri ( input_thread_t p_input,
const char *  psz_subtitle 
)
static

◆ input_UpdateStatistic()

void input_UpdateStatistic ( input_thread_t ,
input_statistic_t  ,
int  i_delta 
)

It will update internal input statistics from external sources.

XXX For now, the only one allowed to do it is stream_out and input core.

References msg_Dbg.

◆ InputDemuxNew()

static demux_t* InputDemuxNew ( input_thread_t p_input,
input_source_t p_source,
const char *  psz_access,
const char *  psz_demux,
const char *  psz_path,
const char *  psz_anchor 
)
static

◆ InputGetExtraFiles()

static void InputGetExtraFiles ( input_thread_t p_input,
int *  pi_list,
char ***  pppsz_list,
const char **  psz_access,
const char *  psz_path 
)
static

◆ InputGetExtraFilesPattern()

static void InputGetExtraFilesPattern ( input_thread_t p_input,
int *  pi_list,
char ***  pppsz_list,
const char *  psz_path,
const char *  psz_match,
const char *  psz_format,
int  i_start,
int  i_stop 
)
static

Referenced by input_ChangeState().

◆ InputMetaUser()

static void InputMetaUser ( input_thread_t p_input,
vlc_meta_t p_meta 
)
static

◆ InputSourceDestroy()

static void InputSourceDestroy ( input_source_t in)
static

◆ InputSourceMeta()

static void InputSourceMeta ( input_thread_t p_input,
input_source_t p_source,
vlc_meta_t p_meta 
)
static

◆ InputSourceNew()

static input_source_t * InputSourceNew ( input_thread_t p_input,
const char *  psz_mrl,
const char *  psz_forced_demux,
bool  b_in_can_fail 
)
static

◆ InputStreamHandleAnchor()

static int InputStreamHandleAnchor ( input_source_t source,
stream_t **  stream,
char const *  anchor 
)
static

< Unspecified error

< No error

◆ InputUpdateMeta()

static void InputUpdateMeta ( input_thread_t p_input,
demux_t p_demux 
)
static

◆ LoadSlaves()

static void LoadSlaves ( input_thread_t p_input)
static

< No error

< No error

< No error

◆ MainLoop()

static void MainLoop ( input_thread_t p_input,
bool  b_interactive 
)
static

◆ MainLoopDemux()

static void MainLoopDemux ( input_thread_t p_input,
bool *  pb_changed 
)
static

◆ MainLoopStatistics()

static void MainLoopStatistics ( input_thread_t p_input)
static

◆ MainLoopTryRepeat()

static int MainLoopTryRepeat ( input_thread_t p_input)
static

< Unspecified error

< No error

Referenced by MainLoop().

◆ MRLSections()

static void MRLSections ( const char *  p,
int *  pi_title_start,
int *  pi_title_end,
int *  pi_chapter_start,
int *  pi_chapter_end 
)
static

◆ MRLSeekPoint()

static const char* MRLSeekPoint ( const char *  str,
int *  title,
int *  chapter 
)
static

◆ Preparse()

static void * Preparse ( void *  data)
static

Referenced by input_Start().

◆ Run()

static void * Run ( void *  data)
static

◆ SetSubtitlesOptions()

static void SetSubtitlesOptions ( input_thread_t p_input)
static

◆ SlaveCompare()

static int SlaveCompare ( const void *  a,
const void *  b 
)
static

◆ SlaveDemux()

static void SlaveDemux ( input_thread_t p_input)
static

◆ SlaveExists()

static bool SlaveExists ( input_item_slave_t **  pp_slaves,
int  i_slaves,
const char *  psz_uri 
)
static

◆ SlaveSeek()

static void SlaveSeek ( input_thread_t p_input)
static

◆ StartTitle()

static void StartTitle ( input_thread_t p_input)
static

◆ UpdateGenericFromDemux()

static void UpdateGenericFromDemux ( input_thread_t p_input)
static

Referenced by MainLoopDemux().

◆ UpdatePtsDelay()

static void UpdatePtsDelay ( input_thread_t p_input)
static

◆ UpdateTitleListfromDemux()

static void UpdateTitleListfromDemux ( input_thread_t p_input)
static

Referenced by MainLoopDemux().

◆ UpdateTitleSeekpoint()

static int UpdateTitleSeekpoint ( input_thread_t p_input,
int  i_title,
int  i_seekpoint 
)
static

◆ UpdateTitleSeekpointFromDemux()

static int UpdateTitleSeekpointFromDemux ( input_thread_t p_input)
static

Referenced by MainLoopDemux().

◆ ViewpointApply()

static void ViewpointApply ( input_thread_t p_input)
static
input_priv
static input_thread_private_t * input_priv(input_thread_t *input)
Definition: input_internal.h:179