VLC  4.0.0-dev
Data Structures | Macros | Typedefs | Enumerations | Functions
input_internal.h File Reference
Include dependency graph for input_internal.h:

Go to the source code of this file.

Data Structures

struct  input_thread_t
 Main structure representing an input thread. More...
 
struct  vlc_input_event_state
 
struct  vlc_input_event_times
 
struct  vlc_input_event_output_clock
 
struct  vlc_input_event_title
 
struct  vlc_input_event_chapter
 
struct  vlc_input_event_program
 
struct  vlc_input_event_es
 
struct  vlc_input_event_signal
 
struct  vlc_input_event_vout
 
struct  vlc_input_event
 
struct  input_source_t
 
union  input_control_param_t
 
struct  input_control_t
 
struct  input_thread_private_t
 Private input fields. More...
 
struct  input_rate_t
 
struct  input_stats
 

Macros

#define VLC_INPUT_CAPABILITIES_SEEKABLE   (1<<0)
 
#define VLC_INPUT_CAPABILITIES_PAUSEABLE   (1<<1)
 
#define VLC_INPUT_CAPABILITIES_CHANGE_RATE   (1<<2)
 
#define VLC_INPUT_CAPABILITIES_REWINDABLE   (1<<3)
 
#define VLC_INPUT_CAPABILITIES_RECORDABLE   (1<<4)
 
#define input_Create(a, b, c, d, e, f)   input_Create(VLC_OBJECT(a),b,c,d,e,f)
 
#define INPUT_CONTROL_FIFO_SIZE   100
 
#define INPUT_PTS_DELAY_MAX   VLC_TICK_FROM_SEC(60)
 

Typedefs

typedef struct input_thread_t input_thread_t
 Main structure representing an input thread. More...
 
typedef enum input_state_e input_state_e
 Input state. More...
 
typedef enum input_event_type_e input_event_type_e
 Input events. More...
 
typedef void(* input_thread_events_cb) (input_thread_t *input, const struct vlc_input_event *event, void *userdata)
 
typedef struct input_thread_private_t input_thread_private_t
 Private input fields. More...
 
typedef struct input_rate_t input_rate_t
 

Enumerations

enum  input_state_e {
  INIT_S = 0, OPENING_S, PLAYING_S, PAUSE_S,
  END_S, ERROR_S
}
 Input state. More...
 
enum  input_event_type_e {
  INPUT_EVENT_STATE, INPUT_EVENT_DEAD, INPUT_EVENT_RATE, INPUT_EVENT_CAPABILITIES,
  INPUT_EVENT_TIMES, INPUT_EVENT_OUTPUT_CLOCK, INPUT_EVENT_TITLE, INPUT_EVENT_CHAPTER,
  INPUT_EVENT_PROGRAM, INPUT_EVENT_ES, INPUT_EVENT_RECORD, INPUT_EVENT_ITEM_META,
  INPUT_EVENT_ITEM_INFO, INPUT_EVENT_ITEM_EPG, INPUT_EVENT_STATISTICS, INPUT_EVENT_SIGNAL,
  INPUT_EVENT_BOOKMARK, INPUT_EVENT_CACHE, INPUT_EVENT_VOUT, INPUT_EVENT_SUBITEMS,
  INPUT_EVENT_VBI_PAGE, INPUT_EVENT_VBI_TRANSPARENCY, INPUT_EVENT_SUBS_FPS, INPUT_EVENT_THUMBNAIL_READY
}
 Input events. More...
 
enum  input_control_e {
  INPUT_CONTROL_SET_STATE, INPUT_CONTROL_SET_RATE, INPUT_CONTROL_SET_POSITION, INPUT_CONTROL_JUMP_POSITION,
  INPUT_CONTROL_SET_TIME, INPUT_CONTROL_JUMP_TIME, INPUT_CONTROL_SET_PROGRAM, INPUT_CONTROL_SET_TITLE,
  INPUT_CONTROL_SET_TITLE_NEXT, INPUT_CONTROL_SET_TITLE_PREV, INPUT_CONTROL_SET_SEEKPOINT, INPUT_CONTROL_SET_SEEKPOINT_NEXT,
  INPUT_CONTROL_SET_SEEKPOINT_PREV, INPUT_CONTROL_SET_BOOKMARK, INPUT_CONTROL_NAV_ACTIVATE, INPUT_CONTROL_NAV_UP,
  INPUT_CONTROL_NAV_DOWN, INPUT_CONTROL_NAV_LEFT, INPUT_CONTROL_NAV_RIGHT, INPUT_CONTROL_NAV_POPUP,
  INPUT_CONTROL_NAV_MENU, INPUT_CONTROL_SET_ES_BY_ID, INPUT_CONTROL_RESTART_ES_BY_ID, INPUT_CONTROL_SET_ES,
  INPUT_CONTROL_SET_ES_LIST, INPUT_CONTROL_UNSET_ES, INPUT_CONTROL_RESTART_ES, INPUT_CONTROL_SET_VIEWPOINT,
  INPUT_CONTROL_SET_INITIAL_VIEWPOINT, INPUT_CONTROL_UPDATE_VIEWPOINT, INPUT_CONTROL_SET_CATEGORY_DELAY, INPUT_CONTROL_SET_ES_DELAY,
  INPUT_CONTROL_ADD_SLAVE, INPUT_CONTROL_SET_SUBS_FPS, INPUT_CONTROL_SET_RECORD_STATE, INPUT_CONTROL_SET_FRAME_NEXT,
  INPUT_CONTROL_SET_RENDERER, INPUT_CONTROL_SET_VBI_PAGE, INPUT_CONTROL_SET_VBI_TRANSPARENCY, INPUT_CONTROL_SET_ES_AUTOSELECT
}
 

Functions

input_thread_tinput_Create (vlc_object_t *p_parent, input_thread_events_cb event_cb, void *events_data, input_item_t *, input_resource_t *, vlc_renderer_item_t *p_renderer)
 Create a new input_thread_t. More...
 
input_thread_tinput_CreatePreparser (vlc_object_t *obj, input_thread_events_cb events_cb, void *events_data, input_item_t *item)
 Creates an item preparser. More...
 
input_thread_tinput_CreateThumbnailer (vlc_object_t *obj, input_thread_events_cb events_cb, void *events_data, input_item_t *item)
 
int input_Start (input_thread_t *)
 Start a input_thread_t created by input_Create. More...
 
void input_Stop (input_thread_t *)
 Request a running input thread to stop and die. More...
 
void input_Close (input_thread_t *)
 Close an input. More...
 
void input_SetTime (input_thread_t *, vlc_tick_t i_time, bool b_fast)
 
void input_SetPosition (input_thread_t *, float f_position, bool b_fast)
 
void input_SetEsIdDelay (input_thread_t *input, vlc_es_id_t *es_id, vlc_tick_t delay)
 Set the delay of an ES identifier. More...
 
input_item_tinput_GetItem (input_thread_t *)
 Get the input item for an input thread. More...
 
static input_thread_private_tinput_priv (input_thread_t *input)
 
int input_ControlPush (input_thread_t *, int, const input_control_param_t *)
 
static int input_ControlPushHelper (input_thread_t *p_input, int i_type, vlc_value_t *val)
 
static int input_ControlPushEsHelper (input_thread_t *p_input, int i_type, vlc_es_id_t *id)
 
void input_ControlSync (input_thread_t *, int, const input_control_param_t *)
 Synchronously execute a control sequence. More...
 
bool input_Stopped (input_thread_t *)
 
int input_GetAttachments (input_thread_t *input, input_attachment_t ***attachments)
 
input_attachment_tinput_GetAttachment (input_thread_t *input, const char *name)
 
void input_ExtractAttachmentAndCacheArt (input_thread_t *, const char *name)
 
void input_ConfigVarInit (input_thread_t *)
 
int subtitles_Detect (input_thread_t *, char *, const char *, input_item_slave_t ***, int *)
 Detect subtitle files. More...
 
int subtitles_Filter (const char *)
 
void vlc_audio_replay_gain_MergeFromMeta (audio_replay_gain_t *p_dst, const vlc_meta_t *p_meta)
 
struct input_statsinput_stats_Create (void)
 
void input_stats_Destroy (struct input_stats *)
 
void input_rate_Add (input_rate_t *, uintmax_t)
 Update a counter element with new values. More...
 
void input_stats_Compute (struct input_stats *, input_stats_t *)
 

Macro Definition Documentation

◆ INPUT_CONTROL_FIFO_SIZE

#define INPUT_CONTROL_FIFO_SIZE   100

Referenced by input_ControlPush().

◆ input_Create

#define input_Create (   a,
  b,
  c,
  d,
  e,
 
)    input_Create(VLC_OBJECT(a),b,c,d,e,f)

◆ INPUT_PTS_DELAY_MAX

#define INPUT_PTS_DELAY_MAX   VLC_TICK_FROM_SEC(60)

◆ VLC_INPUT_CAPABILITIES_CHANGE_RATE

#define VLC_INPUT_CAPABILITIES_CHANGE_RATE   (1<<2)

Referenced by InputSourceNew().

◆ VLC_INPUT_CAPABILITIES_PAUSEABLE

#define VLC_INPUT_CAPABILITIES_PAUSEABLE   (1<<1)

Referenced by InputSourceNew().

◆ VLC_INPUT_CAPABILITIES_RECORDABLE

#define VLC_INPUT_CAPABILITIES_RECORDABLE   (1<<4)

Referenced by InputSourceNew().

◆ VLC_INPUT_CAPABILITIES_REWINDABLE

#define VLC_INPUT_CAPABILITIES_REWINDABLE   (1<<3)

Referenced by InputSourceNew().

◆ VLC_INPUT_CAPABILITIES_SEEKABLE

#define VLC_INPUT_CAPABILITIES_SEEKABLE   (1<<0)

Referenced by InputSourceNew().

Typedef Documentation

◆ input_event_type_e

Input events.

You can catch input event by adding a callback on the variable "intf-event". This variable is an integer that will hold a input_event_type_e value.

◆ input_rate_t

typedef struct input_rate_t input_rate_t

◆ input_state_e

Input state.

This enum is used by the variable "state"

◆ input_thread_events_cb

typedef void(* input_thread_events_cb) (input_thread_t *input, const struct vlc_input_event *event, void *userdata)

◆ input_thread_private_t

Private input fields.

◆ input_thread_t

Main structure representing an input thread.

This structure is mostly private. The only public fields are read-only and constant.

Enumeration Type Documentation

◆ input_control_e

Enumerator
INPUT_CONTROL_SET_STATE 
INPUT_CONTROL_SET_RATE 
INPUT_CONTROL_SET_POSITION 
INPUT_CONTROL_JUMP_POSITION 
INPUT_CONTROL_SET_TIME 
INPUT_CONTROL_JUMP_TIME 
INPUT_CONTROL_SET_PROGRAM 
INPUT_CONTROL_SET_TITLE 
INPUT_CONTROL_SET_TITLE_NEXT 
INPUT_CONTROL_SET_TITLE_PREV 
INPUT_CONTROL_SET_SEEKPOINT 
INPUT_CONTROL_SET_SEEKPOINT_NEXT 
INPUT_CONTROL_SET_SEEKPOINT_PREV 
INPUT_CONTROL_SET_BOOKMARK 
INPUT_CONTROL_NAV_ACTIVATE 
INPUT_CONTROL_NAV_UP 
INPUT_CONTROL_NAV_DOWN 
INPUT_CONTROL_NAV_LEFT 
INPUT_CONTROL_NAV_RIGHT 
INPUT_CONTROL_NAV_POPUP 
INPUT_CONTROL_NAV_MENU 
INPUT_CONTROL_SET_ES_BY_ID 
INPUT_CONTROL_RESTART_ES_BY_ID 
INPUT_CONTROL_SET_ES 
INPUT_CONTROL_SET_ES_LIST 
INPUT_CONTROL_UNSET_ES 
INPUT_CONTROL_RESTART_ES 
INPUT_CONTROL_SET_VIEWPOINT 
INPUT_CONTROL_SET_INITIAL_VIEWPOINT 
INPUT_CONTROL_UPDATE_VIEWPOINT 
INPUT_CONTROL_SET_CATEGORY_DELAY 
INPUT_CONTROL_SET_ES_DELAY 
INPUT_CONTROL_ADD_SLAVE 
INPUT_CONTROL_SET_SUBS_FPS 
INPUT_CONTROL_SET_RECORD_STATE 
INPUT_CONTROL_SET_FRAME_NEXT 
INPUT_CONTROL_SET_RENDERER 
INPUT_CONTROL_SET_VBI_PAGE 
INPUT_CONTROL_SET_VBI_TRANSPARENCY 
INPUT_CONTROL_SET_ES_AUTOSELECT 

◆ input_event_type_e

Input events.

You can catch input event by adding a callback on the variable "intf-event". This variable is an integer that will hold a input_event_type_e value.

Enumerator
INPUT_EVENT_STATE 
INPUT_EVENT_DEAD 
INPUT_EVENT_RATE 
INPUT_EVENT_CAPABILITIES 
INPUT_EVENT_TIMES 
INPUT_EVENT_OUTPUT_CLOCK 
INPUT_EVENT_TITLE 
INPUT_EVENT_CHAPTER 
INPUT_EVENT_PROGRAM 
INPUT_EVENT_ES 
INPUT_EVENT_RECORD 
INPUT_EVENT_ITEM_META 
INPUT_EVENT_ITEM_INFO 
INPUT_EVENT_ITEM_EPG 
INPUT_EVENT_STATISTICS 
INPUT_EVENT_SIGNAL 
INPUT_EVENT_BOOKMARK 
INPUT_EVENT_CACHE 
INPUT_EVENT_VOUT 
INPUT_EVENT_SUBITEMS 
INPUT_EVENT_VBI_PAGE 
INPUT_EVENT_VBI_TRANSPARENCY 
INPUT_EVENT_SUBS_FPS 
INPUT_EVENT_THUMBNAIL_READY 

◆ input_state_e

Input state.

This enum is used by the variable "state"

Enumerator
INIT_S 
OPENING_S 
PLAYING_S 
PAUSE_S 
END_S 
ERROR_S 

Function Documentation

◆ input_Close()

void input_Close ( input_thread_t p_input)

◆ input_ConfigVarInit()

void input_ConfigVarInit ( input_thread_t )

◆ input_ControlPush()

int input_ControlPush ( input_thread_t ,
int  ,
const input_control_param_t  
)

◆ input_ControlPushEsHelper()

static int input_ControlPushEsHelper ( input_thread_t p_input,
int  i_type,
vlc_es_id_t id 
)
inlinestatic

◆ input_ControlPushHelper()

static int input_ControlPushHelper ( input_thread_t p_input,
int  i_type,
vlc_value_t val 
)
inlinestatic

◆ input_ControlSync()

void input_ControlSync ( input_thread_t ,
int  ,
const input_control_param_t  
)

Synchronously execute a control sequence.

This MUST only be used before the input is started

References Control(), and input_priv().

Referenced by input_ControlPushEsHelper(), and vlc_player_input_RestoreMlStates().

◆ input_Create()

input_thread_t* input_Create ( vlc_object_t p_parent,
input_thread_events_cb  events_cb,
void *  events_data,
input_item_t p_item,
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
p_resourcean optional input ressource
Returns
a pointer to the spawned input thread

References Create(), and INPUT_CREATE_OPTION_NONE.

Referenced by vlc_player_input_New().

◆ input_CreatePreparser()

input_thread_t* input_CreatePreparser ( vlc_object_t obj,
input_thread_events_cb  events_cb,
void *  events_data,
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(), and INPUT_CREATE_OPTION_PREPARSING.

Referenced by input_item_Parse().

◆ input_CreateThumbnailer()

input_thread_t* input_CreateThumbnailer ( vlc_object_t obj,
input_thread_events_cb  events_cb,
void *  events_data,
input_item_t item 
)

◆ input_ExtractAttachmentAndCacheArt()

void input_ExtractAttachmentAndCacheArt ( input_thread_t ,
const char *  name 
)

◆ input_GetAttachment()

input_attachment_t* input_GetAttachment ( input_thread_t input,
const char *  name 
)

◆ input_GetAttachments()

int input_GetAttachments ( input_thread_t input,
input_attachment_t ***  attachments 
)

◆ input_GetItem()

input_item_t* input_GetItem ( input_thread_t p_input)

Get the input item for an input thread.

You have to keep a reference to the input or to the input_item_t until you do not need it anymore.

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.

Referenced by access_New(), demux_NewAdvanced(), DisplayVoutTitle(), EsOutEsUpdateFmt(), EsOutMeta(), EsOutSetRecord(), input_item_parser_InputEvent(), input_thread_Events(), stream_AccessNew(), and vlc_player_UpdateMLStates().

◆ input_priv()

static input_thread_private_t* input_priv ( input_thread_t input)
inlinestatic

References container_of.

Referenced by AStreamReadBlock(), AStreamReadStream(), Control(), ControlGetReducedIndexLocked(), ControlInsertDemuxFilter(), ControlLockedGetWakeup(), ControlLockedSetPauseState(), ControlLockedSetRate(), ControlNav(), ControlPause(), ControlPop(), ControlUnpause(), Create(), decoder_on_new_audio_stats(), decoder_on_new_video_stats(), Destroy(), End(), EsOutCreateDecoder(), EsOutDeleteInfoEs(), EsOutEpgTime(), EsOutFillEsFmt(), EsOutGetWakeup(), EsOutMeta(), EsOutProgramEpg(), EsOutProgramEpgEvent(), EsOutProgramMeta(), EsOutProgramSelect(), EsOutProgramUpdateScrambled(), EsOutPropsInit(), EsOutSelectEs(), EsOutSend(), EsOutSendEsEvent(), EsOutSetRecord(), EsOutStopFreeVout(), EsOutTerminate(), EsOutUpdateInfo(), EsOutVaControlLocked(), Init(), InitPrograms(), InitTitle(), input_ChangeState(), input_Close(), input_ConfigVarInit(), input_ControlPush(), input_ControlSync(), input_ExtractAttachmentAndCacheArt(), input_GetAttachment(), input_GetAttachments(), input_GetItem(), input_SendEvent(), input_SlaveSourceAdd(), input_Start(), input_Stop(), input_Stopped(), InputDemuxNew(), InputSourceMeta(), InputSourceNew(), InputUpdateMeta(), LoadSlaves(), MainLoop(), MainLoopDemux(), MainLoopStatistics(), MainLoopTryRepeat(), RequestSubRate(), SetSubtitlesOptions(), SlaveDemux(), SlaveSeek(), StartTitle(), UpdateGenericFromDemux(), UpdatePtsDelay(), UpdateTitleListfromDemux(), UpdateTitleSeekpoint(), UpdateTitleSeekpointFromDemux(), ViewpointApply(), and vlc_player_input_HandleTitleEvent().

◆ input_rate_Add()

void input_rate_Add ( input_rate_t counter,
uintmax_t  val 
)

Update a counter element with new values.

Parameters
p_counterthe counter to update
valthe vlc_value union containing the new value to aggregate. For more information on how data is aggregated,
See also
stats_Create

References input_rate_t::date, input_rate_t::lock, input_rate_t::samples, input_rate_t::updates, input_rate_t::value, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_TICK_FROM_SEC, VLC_TICK_INVALID, and vlc_tick_now().

Referenced by AStreamReadBlock(), AStreamReadStream(), and EsOutSend().

◆ input_SetEsIdDelay()

void input_SetEsIdDelay ( input_thread_t input,
vlc_es_id_t es_id,
vlc_tick_t  delay 
)

Set the delay of an ES identifier.

◆ input_SetPosition()

void input_SetPosition ( input_thread_t ,
float  f_position,
bool  b_fast 
)

◆ input_SetTime()

void input_SetTime ( input_thread_t ,
vlc_tick_t  i_time,
bool  b_fast 
)

◆ input_Start()

int input_Start ( input_thread_t p_input)

◆ input_stats_Compute()

void input_stats_Compute ( struct input_stats ,
input_stats_t  
)

◆ input_stats_Create()

struct input_stats* input_stats_Create ( void  )

◆ input_stats_Destroy()

void input_stats_Destroy ( struct input_stats )

◆ input_Stop()

void input_Stop ( input_thread_t p_input)

◆ input_Stopped()

bool input_Stopped ( input_thread_t )

◆ subtitles_Detect()

int subtitles_Detect ( input_thread_t p_this,
char *  psz_path,
const char *  psz_name_org,
input_item_slave_t ***  ppp_slaves,
int *  p_slaves 
)

Detect subtitle files.

When called this function will split up the psz_name string into a directory, filename and extension. It then opens the directory in which the file resides and tries to find possible matches of subtitles files.

Parameters
p_thisthe calling input_thread_t
psz_patha list of subdirectories (separated by a ',') to look in.
psz_name_orgthe complete filename to base the search on.
pp_slavesan initialized input item slave list to append detected subtitles to
p_slavespointer to the size of the slave list
Returns
VLC_SUCCESS if ok

References ARRAY_SIZE, asprintf(), input_item_slave::b_forced, DIR_SEP, DIR_SEP_CHAR, input_item_slave::i_priority, input_item_slave_Delete, input_item_slave_New(), msg_Dbg, noslave_exts, paths_to_list(), psz_ext, psz_name, input_item_slave::psz_uri, SLAVE_PRIORITY_MATCH_ALL, SLAVE_PRIORITY_MATCH_LEFT, SLAVE_PRIORITY_MATCH_NONE, SLAVE_PRIORITY_MATCH_RIGHT, slave_strcmp(), SLAVE_TYPE_SPU, strcasecmp(), strcpy_get_ext(), strcpy_strip_ext(), strcpy_trim(), strdup(), subtitles_Filter(), TAB_APPEND, var_GetInteger(), VLC_EGENERIC, VLC_ENOMEM, vlc_opendir(), vlc_path2uri(), vlc_readdir(), vlc_stat(), VLC_SUCCESS, vlc_uri2path(), and whiteonly().

Referenced by LoadSlaves().

◆ subtitles_Filter()

int subtitles_Filter ( const char *  )

◆ vlc_audio_replay_gain_MergeFromMeta()

void vlc_audio_replay_gain_MergeFromMeta ( audio_replay_gain_t p_dst,
const vlc_meta_t p_meta 
)