VLC
3.0.15
|
Go to the source code of this file.
Data Structures | |
struct | seekpoint_t |
struct | input_title_t |
struct | input_attachment_t |
struct | input_thread_t |
Main structure representing an input thread. More... | |
Macros | |
#define | INPUT_TITLE_MENU 0x01 /* Menu title */ |
#define | INPUT_TITLE_INTERACTIVE 0x02 /* Interactive title. Playback position has no meaning. */ |
#define | INPUT_RECORD_PREFIX "vlc-record-%Y-%m-%d-%Hh%Mm%Ss-$ N-$ p" |
Record prefix string. More... | |
#define | INPUT_RATE_DEFAULT 1000 |
Input rate. More... | |
#define | INPUT_RATE_MIN 32 /* Up to 32/1 */ |
Minimal rate value. More... | |
#define | INPUT_RATE_MAX 32000 /* Up to 1/32 */ |
Maximal rate value. More... | |
#define | input_Create(a, b, c, d, e) input_Create(VLC_OBJECT(a),b,c,d,e) |
#define | input_Read(a, b) input_Read(VLC_OBJECT(a),b) |
#define | input_CreateAndStart(a, b, c) input_CreateAndStart(VLC_OBJECT(a),b,c) |
Typedefs | |
typedef struct input_title_t | input_title_t |
typedef struct input_resource_t | input_resource_t |
This defines an opaque input resource handler. 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... | |
Functions | |
static seekpoint_t * | vlc_seekpoint_New (void) |
static void | vlc_seekpoint_Delete (seekpoint_t *point) |
static seekpoint_t * | vlc_seekpoint_Duplicate (const seekpoint_t *src) |
static input_title_t * | vlc_input_title_New (void) |
static void | vlc_input_title_Delete (input_title_t *t) |
static input_title_t * | vlc_input_title_Duplicate (const input_title_t *t) |
static void | vlc_input_attachment_Delete (input_attachment_t *a) |
static input_attachment_t * | vlc_input_attachment_New (const char *psz_name, const char *psz_mime, const char *psz_description, const void *p_data, size_t i_data) |
static input_attachment_t * | vlc_input_attachment_Duplicate (const input_attachment_t *a) |
input_thread_t * | input_Create (vlc_object_t *p_parent, input_item_t *, const char *psz_log, input_resource_t *, vlc_renderer_item_t *p_renderer) |
Create a new input_thread_t. More... | |
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... | |
int | input_Read (vlc_object_t *, input_item_t *) |
Initialize an input thread and run it until it stops by itself. More... | |
int | input_vaControl (input_thread_t *, int i_query, va_list) |
int | input_Control (input_thread_t *, int i_query,...) |
Control function for inputs. More... | |
void | input_Close (input_thread_t *) |
Close an input. More... | |
static input_thread_t * | input_CreateAndStart (vlc_object_t *parent, input_item_t *item, const char *log) |
Create a new input_thread_t and start it. More... | |
input_item_t * | input_GetItem (input_thread_t *) |
Get the input item for an input thread. More... | |
static input_state_e | input_GetState (input_thread_t *p_input) |
It will return the current state of the input. More... | |
static vout_thread_t * | input_GetVout (input_thread_t *p_input) |
Return one of the video output (if any). More... | |
static int | input_AddSlave (input_thread_t *p_input, enum slave_type type, const char *psz_uri, bool b_forced, bool b_notify, bool b_check_ext) |
static int | input_UpdateViewpoint (input_thread_t *p_input, const vlc_viewpoint_t *p_viewpoint, bool b_absolute) |
Update the viewpoint of the input thread. More... | |
static audio_output_t * | input_GetAout (input_thread_t *p_input) |
Return the audio output (if any) associated with an input. More... | |
static int | input_GetEsObjects (input_thread_t *p_input, int i_id, vlc_object_t **pp_decoder, vout_thread_t **pp_vout, audio_output_t **pp_aout) |
Returns the objects associated to an ES. More... | |
static int | input_GetPcrSystem (input_thread_t *p_input, mtime_t *pi_system, mtime_t *pi_delay) |
static int | input_ModifyPcrSystem (input_thread_t *p_input, bool b_absolute, mtime_t i_system) |
decoder_t * | input_DecoderCreate (vlc_object_t *, const es_format_t *, input_resource_t *) |
Spawn a decoder thread outside of the input thread. More... | |
void | input_DecoderDelete (decoder_t *) |
Kills a decoder thread and waits until it's finished. More... | |
void | input_DecoderDecode (decoder_t *, block_t *, bool b_do_pace) |
Put a block_t in the decoder's fifo. More... | |
void | input_DecoderDrain (decoder_t *) |
Signals that there are no further blocks to decode, and requests that the decoder drain all pending buffers. More... | |
void | input_DecoderFlush (decoder_t *) |
Requests that the decoder immediately discard all pending buffers. More... | |
char * | input_CreateFilename (input_thread_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension) |
This function creates a sane filename path. More... | |
input_resource_t * | input_resource_New (vlc_object_t *) |
It creates an empty input resource handler. More... | |
void | input_resource_Release (input_resource_t *) |
It releases an input resource. More... | |
void | input_resource_TerminateVout (input_resource_t *) |
Forcefully destroys the video output (e.g. More... | |
void | input_resource_Terminate (input_resource_t *) |
This function releases all resources (object). More... | |
audio_output_t * | input_resource_HoldAout (input_resource_t *) |
audio_output_t * | input_resource_GetAout (input_resource_t *) |
This function creates or recycles an audio output. More... | |
void | input_resource_PutAout (input_resource_t *, audio_output_t *) |
This function retains or destroys an audio output. More... | |
void | input_resource_ResetAout (input_resource_t *) |
Prevents the existing audio output (if any) from being recycled. More... | |
Input thread interface
#define input_Create | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) | input_Create(VLC_OBJECT(a),b,c,d,e) |
#define input_CreateAndStart | ( | a, | |
b, | |||
c | |||
) | input_CreateAndStart(VLC_OBJECT(a),b,c) |
#define input_Read | ( | a, | |
b | |||
) | input_Read(VLC_OBJECT(a),b) |
|
inlinestatic |
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().
int input_Control | ( | input_thread_t * | p_input, |
int | i_query, | ||
... | |||
) |
Control function for inputs.
p_input | input handle |
i_query | query type |
References input_vaControl().
Referenced by Create(), DecoderGetInputAttachments(), input_GetAout(), input_GetState(), input_GetVout(), input_ModifyPcrSystem(), input_UpdateViewpoint(), and playlist_SetRenderer().
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.
p_parent | a vlc_object |
p_item | an input item |
psz_log | an optional prefix for this input logs |
p_resource | an optional input ressource |
References Create().
|
inlinestatic |
Create a new input_thread_t and start it.
Provided for convenience.
References input_Create.
char* input_CreateFilename | ( | input_thread_t * | , |
const char * | psz_path, | ||
const char * | psz_prefix, | ||
const char * | psz_extension | ||
) |
This function creates a sane filename path.
References input_priv(), input_thread_private_t::p_sout_send_bitrate, input_thread_private_t::p_sout_sent_bytes, and stats_Update().
decoder_t* input_DecoderCreate | ( | vlc_object_t * | , |
const es_format_t * | , | ||
input_resource_t * | |||
) |
Spawn a decoder thread outside of the input thread.
References decoder_New().
Put a block_t in the decoder's fifo.
Thread-safe w.r.t. the decoder. May be a cancellation point.
p_dec | the decoder object |
p_block | the data block |
References decoder_owner_sys_t::b_waiting, block_ChainRelease(), BLOCK_FLAG_DISCONTINUITY, block_t::i_flags, msg_Warn, decoder_owner_sys_t::p_fifo, decoder_t::p_owner, vlc_fifo_DequeueAllUnlocked(), vlc_fifo_GetBytes(), vlc_fifo_GetCount(), vlc_fifo_Lock(), vlc_fifo_QueueUnlocked(), vlc_fifo_Unlock(), vlc_fifo_WaitCond(), and decoder_owner_sys_t::wait_fifo.
Referenced by EsOutSend().
void input_DecoderDelete | ( | decoder_t * | p_dec | ) |
Kills a decoder thread and waits until it's finished.
p_input | the input thread |
p_es | the es descriptor |
References decoder_owner_sys_t::b_supported, decoder_owner_sys_t::b_waiting, decoder_owner_sys_t::cc, DeleteDecoder(), decoder_owner_sys_t::flushing, input_DecoderSetCcState(), decoder_owner_sys_t::lock, MAX_CC_DECODERS, decoder_owner_sys_t::p_fifo, decoder_t::p_owner, decoder_owner_sys_t::p_vout, decoder_owner_sys_t::thread, vlc_cancel(), VLC_CODEC_CEA608, vlc_cond_signal(), vlc_fifo_Lock(), vlc_fifo_Unlock(), vlc_join(), vlc_mutex_lock(), vlc_mutex_unlock(), vout_Cancel(), decoder_owner_sys_t::wait_request, and decoder_owner_sys_t::wait_timed.
void input_DecoderDrain | ( | decoder_t * | p_dec | ) |
Signals that there are no further blocks to decode, and requests that the decoder drain all pending buffers.
This is used to ensure that all intermediate buffers empty and no samples get lost at the end of the stream.
References decoder_owner_sys_t::b_draining, decoder_owner_sys_t::p_fifo, decoder_t::p_owner, vlc_fifo_Lock(), vlc_fifo_Signal(), and vlc_fifo_Unlock().
Referenced by EsOutControlLocked().
void input_DecoderFlush | ( | decoder_t * | p_dec | ) |
Requests that the decoder immediately discard all pending buffers.
This is useful when seeking or when deselecting a stream.
References block_ChainRelease(), decoder_owner_sys_t::flushing, decoder_owner_sys_t::fmt, decoder_owner_sys_t::frames_countdown, es_format_t::i_cat, decoder_owner_sys_t::p_fifo, decoder_t::p_owner, decoder_owner_sys_t::paused, SPU_ES, VIDEO_ES, vlc_cond_signal(), vlc_fifo_DequeueAllUnlocked(), vlc_fifo_Lock(), vlc_fifo_Signal(), vlc_fifo_Unlock(), and decoder_owner_sys_t::wait_timed.
|
inlinestatic |
Return the audio output (if any) associated with an input.
p_input | an input thread |
References input_Control(), and INPUT_GET_AOUT.
|
inlinestatic |
Returns the objects associated to an ES.
You must release all non NULL object using vlc_object_release. You may set pointer of pointer to NULL to avoid retreiving it.
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.
|
inlinestatic |
|
inlinestatic |
It will return the current state of the input.
Provided for convenience.
References INIT_S, input_Control(), and INPUT_GET_STATE.
Referenced by PreparserCloseInput(), and PreparserProbeInput().
|
inlinestatic |
Return one of the video output (if any).
If possible, you should use INPUT_GET_VOUTS directly and process all video outputs instead.
p_input | an input thread from which to get a video output |
References input_Control(), and INPUT_GET_VOUTS.
Referenced by input_vaControl().
|
inlinestatic |
References input_Control(), and INPUT_GET_PCR_SYSTEM.
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.
p_parent | a vlc_object |
p_item | an input item |
< Unspecified error
< No error
References Create(), End(), Init(), MainLoop(), VLC_EGENERIC, vlc_object_release, and VLC_SUCCESS.
audio_output_t* input_resource_GetAout | ( | input_resource_t * | ) |
This function creates or recycles an audio output.
References aout_New, input_resource_t::b_aout_busy, input_resource_t::lock_hold, msg_Dbg, input_resource_t::p_aout, input_resource_t::p_parent, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by aout_update_format(), and playlist_Create().
audio_output_t* input_resource_HoldAout | ( | input_resource_t * | ) |
Referenced by input_vaControl(), and playlist_GetAout().
input_resource_t* input_resource_New | ( | vlc_object_t * | ) |
It creates an empty input resource handler.
The given object MUST stay alive as long as the input_resource_t is not deleted.
References input_resource_t::lock, input_resource_t::lock_hold, input_resource_t::p_parent, input_resource_t::refs, and vlc_mutex_init().
Referenced by Create(), and playlist_Create().
void input_resource_PutAout | ( | input_resource_t * | , |
audio_output_t * | |||
) |
This function retains or destroys an audio output.
Referenced by aout_update_format(), DeleteDecoder(), playlist_Create(), and ReloadDecoder().
void input_resource_Release | ( | input_resource_t * | ) |
It releases an input resource.
Referenced by input_Destructor(), and playlist_Destroy().
void input_resource_ResetAout | ( | input_resource_t * | ) |
Prevents the existing audio output (if any) from being recycled.
void input_resource_Terminate | ( | input_resource_t * | ) |
This function releases all resources (object).
Referenced by Thread().
void input_resource_TerminateVout | ( | input_resource_t * | ) |
Forcefully destroys the video output (e.g.
when the playlist is stopped).
Referenced by EsOutControlLocked(), and Thread().
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.
the | input 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().
void input_Stop | ( | input_thread_t * | p_input | ) |
Request a running input thread to stop and die.
p_input | the input thread to stop |
References input_thread_private_t::control, ControlRelease(), input_thread_private_t::i_control, input_control_t::i_type, input_priv(), input_thread_private_t::interrupt, input_thread_private_t::is_stopped, input_thread_private_t::lock_control, input_control_t::val, vlc_cond_signal(), vlc_interrupt_kill(), vlc_mutex_lock(), vlc_mutex_unlock(), and input_thread_private_t::wait_control.
Referenced by PreparserCloseInput().
|
inlinestatic |
Update the viewpoint of the input thread.
The viewpoint will be applied to all vouts and aouts.
p_input | an input thread |
p_viewpoint | the viewpoint value |
b_absolute | if true replace the old viewpoint with the new one. If false, increase/decrease it. |
References input_Control(), and INPUT_UPDATE_VIEWPOINT.
int input_vaControl | ( | input_thread_t * | , |
int | i_query, | ||
va_list | |||
) |
< No error
< No error
< No error
< No error
< No error
< No error
< No error
< No error
< Unspecified error
< No error
< No error
< Unspecified error
< No error
< Unspecified error
< No error
< Unspecified error
< No error
< Unspecified error
< No error
< No error
< No error
< No error
< Unspecified error
< Not enough memory
< No error
< Unspecified error
< No error
< Not enough memory
< No error
< Unspecified error
< Unspecified error
< Not enough memory
< No error
< Unspecified error
< No error
< No error
< Unspecified error
< No error
< No error
< No error
< Not enough memory
< No error
< Unspecified error
< No error
< Unspecified error
< No error
< No error
< Unspecified error
References _, asprintf(), input_thread_private_t::attachment, input_item_slave::b_forced, input_thread_private_t::b_preparsing, input_thread_private_t::bookmark, count, es_out_Control(), es_out_ControlGetPcrSystem(), es_out_ControlModifyPcrSystem(), ES_OUT_GET_ES_OBJECTS_BY_ID, input_thread_private_t::i_attachment, input_thread_private_t::i_bookmark, vlc_value_t::i_int, input_title_t::i_seekpoint, input_thread_private_t::i_title, INPUT_ADD_BOOKMARK, INPUT_ADD_INFO, INPUT_ADD_SLAVE, INPUT_CHANGE_BOOKMARK, INPUT_CLEAR_BOOKMARKS, INPUT_CONTROL_ADD_SLAVE, INPUT_CONTROL_NAV_ACTIVATE, INPUT_CONTROL_RESTART_ES, INPUT_CONTROL_SET_BOOKMARK, INPUT_CONTROL_SET_INITIAL_VIEWPOINT, INPUT_CONTROL_SET_RENDERER, INPUT_CONTROL_SET_VIEWPOINT, INPUT_CONTROL_UPDATE_VIEWPOINT, input_ControlPush(), INPUT_DEL_BOOKMARK, INPUT_DEL_INFO, INPUT_GET_AOUT, INPUT_GET_ATTACHMENT, INPUT_GET_ATTACHMENTS, INPUT_GET_AUDIO_DELAY, INPUT_GET_BOOKMARK, INPUT_GET_BOOKMARKS, INPUT_GET_ES_OBJECTS, INPUT_GET_FULL_TITLE_INFO, INPUT_GET_LENGTH, INPUT_GET_PCR_SYSTEM, INPUT_GET_POSITION, INPUT_GET_RATE, INPUT_GET_RECORD_STATE, INPUT_GET_SEEKPOINTS, INPUT_GET_SPU_DELAY, INPUT_GET_STATE, INPUT_GET_TIME, INPUT_GET_TITLE_INFO, INPUT_GET_VOUTS, input_GetVout(), input_item_AddInfo(), input_item_DelInfo(), input_item_MergeInfos(), input_item_ReplaceInfos(), input_item_slave_New(), INPUT_MERGE_INFOS, INPUT_MODIFY_PCR_SYSTEM, INPUT_NAV_ACTIVATE, INPUT_NAV_DOWN, INPUT_NAV_LEFT, INPUT_NAV_MENU, INPUT_NAV_POPUP, INPUT_NAV_RIGHT, INPUT_NAV_UP, input_priv(), INPUT_RATE_DEFAULT, INPUT_REPLACE_INFOS, input_resource_HoldAout(), input_resource_HoldVouts(), INPUT_RESTART_ES, input_SendEventMetaInfo(), INPUT_SET_AUDIO_DELAY, INPUT_SET_BOOKMARK, INPUT_SET_INITIAL_VIEWPOINT, INPUT_SET_POSITION, INPUT_SET_RATE, INPUT_SET_RECORD_STATE, INPUT_SET_RENDERER, INPUT_SET_SPU_DELAY, INPUT_SET_STATE, INPUT_SET_TIME, INPUT_UPDATE_VIEWPOINT, input_item_t::lock, msg_Err, vlc_value_t::p_address, input_thread_private_t::p_es_out_display, input_thread_private_t::p_item, input_thread_private_t::p_resource, input_thread_private_t::pp_bookmark, seekpoint_t::psz_name, input_attachment_t::psz_name, psz_name, psz_value, input_title_t::seekpoint, SLAVE_PRIORITY_USER, SLAVE_TYPE_AUDIO, SLAVE_TYPE_SPU, subtitles_Filter(), TAB_APPEND, TAB_CLEAN, TAB_REMOVE, input_thread_private_t::title, unlikely, UpdateBookmarksOption(), var_GetBool, var_GetFloat, var_GetInteger, var_SetBool, var_SetFloat, var_SetInteger, vasprintf(), vlc_alloc(), VLC_EGENERIC, VLC_ENOMEM, vlc_gettext(), vlc_input_attachment_Duplicate(), vlc_input_title_Duplicate(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_object_release, vlc_renderer_item_hold(), vlc_seekpoint_Delete(), vlc_seekpoint_Duplicate(), VLC_SUCCESS, vout_OSDMessage(), and VOUT_SPU_CHANNEL_OSD.
Referenced by input_Control().