vlc_input.h File Reference

This file defines functions, structures and enums for input objects in vlc. More...

Include dependency graph for vlc_input.h:

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...

Defines

#define VLC__INPUT_H   1
#define INPUT_UPDATE_NONE   0x0000
#define INPUT_UPDATE_SIZE   0x0001
#define INPUT_UPDATE_TITLE   0x0010
#define INPUT_UPDATE_SEEKPOINT   0x0020
#define INPUT_UPDATE_META   0x0040
#define INPUT_UPDATE_SIGNAL   0x0080
#define INPUT_RECORD_PREFIX   "vlc-record-%Y-%m-%d-%Hh%Mm%Ss-$ N-$ p"
 Record prefix string.
#define INPUT_RATE_DEFAULT   1000
 Input rate.
#define INPUT_RATE_MIN   32
 Minimal rate value.
#define INPUT_RATE_MAX   32000
 Maximal rate value.
#define input_Create(a, b, c, d)   __input_Create(VLC_OBJECT(a),b,c,d)
#define input_CreateAndStart(a, b, c)   __input_CreateAndStart(VLC_OBJECT(a),b,c)
#define input_Read(a, b)   __input_Read(VLC_OBJECT(a),b)

Typedefs

typedef struct
input_thread_private_t 
input_thread_private_t
 This defines private core storage for an input.
typedef struct input_resource_t input_resource_t
 This defines an opaque input resource handler.
typedef struct input_clock_t input_clock_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_ABORT, INPUT_EVENT_RATE,
  INPUT_EVENT_POSITION, INPUT_EVENT_LENGTH, INPUT_EVENT_TITLE, INPUT_EVENT_CHAPTER,
  INPUT_EVENT_PROGRAM, INPUT_EVENT_ES, INPUT_EVENT_TELETEXT, INPUT_EVENT_RECORD,
  INPUT_EVENT_ITEM_META, INPUT_EVENT_ITEM_INFO, INPUT_EVENT_ITEM_NAME, INPUT_EVENT_STATISTICS,
  INPUT_EVENT_SIGNAL, INPUT_EVENT_AUDIO_DELAY, INPUT_EVENT_SUBTITLE_DELAY, INPUT_EVENT_BOOKMARK,
  INPUT_EVENT_CACHE, INPUT_EVENT_AOUT, INPUT_EVENT_VOUT
}
 Input events. More...
enum  input_query_e {
  INPUT_GET_POSITION, INPUT_SET_POSITION, INPUT_GET_LENGTH, INPUT_GET_TIME,
  INPUT_SET_TIME, INPUT_GET_RATE, INPUT_SET_RATE, INPUT_GET_STATE,
  INPUT_SET_STATE, INPUT_GET_AUDIO_DELAY, INPUT_SET_AUDIO_DELAY, INPUT_GET_SPU_DELAY,
  INPUT_SET_SPU_DELAY, INPUT_ADD_INFO, INPUT_GET_INFO, INPUT_DEL_INFO,
  INPUT_SET_NAME, INPUT_ADD_OPTION, INPUT_GET_VIDEO_FPS, INPUT_GET_BOOKMARK,
  INPUT_GET_BOOKMARKS, INPUT_CLEAR_BOOKMARKS, INPUT_ADD_BOOKMARK, INPUT_CHANGE_BOOKMARK,
  INPUT_DEL_BOOKMARK, INPUT_SET_BOOKMARK, INPUT_GET_ATTACHMENTS, INPUT_GET_ATTACHMENT,
  INPUT_ADD_SLAVE, INPUT_ADD_SUBTITLE, INPUT_SET_RECORD_STATE, INPUT_GET_RECORD_STATE,
  INPUT_RESTART_ES, INPUT_GET_AOUT, INPUT_GET_VOUTS
}
 Input queries. More...

Functions

static void vlc_audio_replay_gain_MergeFromMeta (audio_replay_gain_t *p_dst, const vlc_meta_t *p_meta)
static seekpoint_tvlc_seekpoint_New (void)
static void vlc_seekpoint_Delete (seekpoint_t *point)
static seekpoint_tvlc_seekpoint_Duplicate (seekpoint_t *src)
static input_title_tvlc_input_title_New (void)
static void vlc_input_title_Delete (input_title_t *t)
static input_title_tvlc_input_title_Duplicate (input_title_t *t)
static input_attachment_tvlc_input_attachment_New (const char *psz_name, const char *psz_mime, const char *psz_description, const void *p_data, int i_data)
static input_attachment_tvlc_input_attachment_Duplicate (const input_attachment_t *a)
static void vlc_input_attachment_Delete (input_attachment_t *a)
input_thread_t__input_Create (vlc_object_t *p_parent, input_item_t *, const char *psz_log, input_resource_t *)
 Create a new input_thread_t.
input_thread_t__input_CreateAndStart (vlc_object_t *p_parent, input_item_t *, const char *psz_log)
 Create a new input_thread_t and start it.
int input_Start (input_thread_t *)
 Start a input_thread_t created by input_Create.
void input_Stop (input_thread_t *, bool b_abort)
 Request a running input thread to stop and die.
int __input_Read (vlc_object_t *, input_item_t *)
 Initialize an input thread and run it until it stops by itself.
int input_vaControl (input_thread_t *, int i_query, va_list)
int input_Control (input_thread_t *, int i_query,...)
 Control function for inputs.
input_item_tinput_GetItem (input_thread_t *)
 Get the input item for an input thread.
static input_state_e input_GetState (input_thread_t *p_input)
 It will return the current state of the input.
static int input_AddSubtitle (input_thread_t *p_input, const char *psz_url, bool b_check_extension)
 It will add a new subtitle source to the input.
static vout_thread_tinput_GetVout (input_thread_t *p_input)
 Return one of the video output (if any).
static aout_instance_tinput_GetAout (input_thread_t *p_input)
 Return the audio output (if any) associated with an input.
decoder_tinput_DecoderNew (input_thread_t *, es_format_t *, input_clock_t *, sout_instance_t *)
 Spawns a new decoder thread.
void input_DecoderDelete (decoder_t *)
 Kills a decoder thread and waits until it's finished.
void input_DecoderDecode (decoder_t *, block_t *, bool b_do_pace)
 Put a block_t in the decoder's fifo.
void input_SplitMRL (const char **ppsz_access, const char **ppsz_demux, char **ppsz_path, char *psz_dup)
 This function allows to split a MRL into access, demux and path part.
char * input_CreateFilename (vlc_object_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension)
 This function creates a sane filename path.
input_resource_tinput_DetachResource (input_thread_t *)
 This function detaches resources from a dead input.
void input_resource_Delete (input_resource_t *)
 This function releases the input resource.


Detailed Description

This file defines functions, structures and enums for input objects in vlc.


Define Documentation

#define input_Create ( a,
b,
c,
 )     __input_Create(VLC_OBJECT(a),b,c,d)

#define input_CreateAndStart ( a,
b,
 )     __input_CreateAndStart(VLC_OBJECT(a),b,c)

Referenced by ParseUrls().

#define INPUT_RATE_DEFAULT   1000

#define INPUT_RATE_MAX   32000

Maximal rate value.

Referenced by Control(), and PutAction().

#define INPUT_RATE_MIN   32

Minimal rate value.

Referenced by Control(), and PutAction().

#define input_Read ( a,
 )     __input_Read(VLC_OBJECT(a),b)

#define INPUT_RECORD_PREFIX   "vlc-record-%Y-%m-%d-%Hh%Mm%Ss-$ N-$ p"

Record prefix string.

TODO make it configurable.

Referenced by EsOutSetRecord(), and Start().

#define INPUT_UPDATE_META   0x0040

#define INPUT_UPDATE_NONE   0x0000

#define INPUT_UPDATE_SEEKPOINT   0x0020

#define INPUT_UPDATE_SIGNAL   0x0080

Referenced by Block(), and UpdateGenericFromAccess().

#define INPUT_UPDATE_SIZE   0x0001

#define INPUT_UPDATE_TITLE   0x0010

#define VLC__INPUT_H   1


Typedef Documentation

typedef struct input_clock_t input_clock_t

This defines an opaque input resource handler.

This defines private core storage for an input.


Enumeration Type Documentation

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_ABORT 
INPUT_EVENT_RATE 
INPUT_EVENT_POSITION 
INPUT_EVENT_LENGTH 
INPUT_EVENT_TITLE 
INPUT_EVENT_CHAPTER 
INPUT_EVENT_PROGRAM 
INPUT_EVENT_ES 
INPUT_EVENT_TELETEXT 
INPUT_EVENT_RECORD 
INPUT_EVENT_ITEM_META 
INPUT_EVENT_ITEM_INFO 
INPUT_EVENT_ITEM_NAME 
INPUT_EVENT_STATISTICS 
INPUT_EVENT_SIGNAL 
INPUT_EVENT_AUDIO_DELAY 
INPUT_EVENT_SUBTITLE_DELAY 
INPUT_EVENT_BOOKMARK 
INPUT_EVENT_CACHE 
INPUT_EVENT_AOUT 
INPUT_EVENT_VOUT 

Input queries.

Enumerator:
INPUT_GET_POSITION 
INPUT_SET_POSITION 
INPUT_GET_LENGTH 
INPUT_GET_TIME 
INPUT_SET_TIME 
INPUT_GET_RATE 
INPUT_SET_RATE 
INPUT_GET_STATE 
INPUT_SET_STATE 
INPUT_GET_AUDIO_DELAY 
INPUT_SET_AUDIO_DELAY 
INPUT_GET_SPU_DELAY 
INPUT_SET_SPU_DELAY 
INPUT_ADD_INFO 
INPUT_GET_INFO 
INPUT_DEL_INFO 
INPUT_SET_NAME 
INPUT_ADD_OPTION 
INPUT_GET_VIDEO_FPS 
INPUT_GET_BOOKMARK 
INPUT_GET_BOOKMARKS 
INPUT_CLEAR_BOOKMARKS 
INPUT_ADD_BOOKMARK 
INPUT_CHANGE_BOOKMARK 
INPUT_DEL_BOOKMARK 
INPUT_SET_BOOKMARK 
INPUT_GET_ATTACHMENTS 
INPUT_GET_ATTACHMENT 
INPUT_ADD_SLAVE 
INPUT_ADD_SUBTITLE 
INPUT_SET_RECORD_STATE 
INPUT_GET_RECORD_STATE 
INPUT_RESTART_ES 
INPUT_GET_AOUT 
INPUT_GET_VOUTS 

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_thread_t* __input_Create ( vlc_object_t p_parent,
input_item_t p_item,
const char *  psz_log,
input_resource_t p_resource 
)

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_parent a vlc_object
p_item an input item
psz_log an optional prefix for this input logs
p_resource an optional input ressource
Returns:
a pointer to the spawned input thread

References Create().

Referenced by __input_CreateAndStart().

input_thread_t* __input_CreateAndStart ( vlc_object_t p_parent,
input_item_t p_item,
const char *  psz_log 
)

Create a new input_thread_t and start it.

Provided for convenience.

See also:
input_Create

References __input_Create(), input_Start(), and vlc_object_release.

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_parent a vlc_object
p_item an input item
Returns:
an error code, VLC_SUCCESS on success

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

static int input_AddSubtitle ( input_thread_t p_input,
const char *  psz_url,
bool  b_check_extension 
) [inline, static]

It will add a new subtitle source to the input.

Provided for convenience.

Referenced by VLCControls::addSubtitleFile:, MainInterface::dropEventPlay(), libvlc_video_set_subtitle_file(), and DialogsProvider::loadSubtitlesFile().

int input_Control ( input_thread_t p_input,
int  i_query,
  ... 
)

char* input_CreateFilename ( vlc_object_t ,
const char *  psz_path,
const char *  psz_prefix,
const char *  psz_extension 
)

This function creates a sane filename path.

References asprintf(), closedir, DIR_SEP, filename_sanitize(), path_sanitize(), str_format, and utf8_opendir().

Referenced by EsOutSetRecord(), and Start().

void input_DecoderDecode ( decoder_t p_dec,
block_t p_block,
bool  b_do_pace 
)

Put a block_t in the decoder's fifo.

Thread-safe w.r.t. the decoder. May be a cancellation point.

Parameters:
p_dec the decoder object
p_block the data block

References decoder_owner_sys_t::b_buffering, block_FifoEmpty(), block_FifoPace(), block_FifoPut(), block_FifoSize(), msg_Warn, decoder_owner_sys_t::p_fifo, and decoder_t::p_owner.

Referenced by DecoderFlush(), EsOutSend(), and Send().

void input_DecoderDelete ( decoder_t p_dec  ) 

decoder_t* input_DecoderNew ( input_thread_t p_input,
es_format_t fmt,
input_clock_t p_clock,
sout_instance_t p_sout 
)

input_resource_t* input_DetachResource ( input_thread_t  ) 

This function detaches resources from a dead input.

It MUST be called on a dead input (p_input->b_dead true) otherwise it will assert. It does not support concurrent calls.

References input_thread_t::b_dead, input_resource_Detach(), input_resource_SetInput(), input_thread_t::p, input_thread_private_t::p_resource, and input_thread_private_t::p_sout.

Referenced by LoopInput(), release_input_thread(), vlm_ControlMediaInstanceStart(), and vlm_MediaInstanceDelete().

static aout_instance_t* input_GetAout ( input_thread_t p_input  )  [inline, static]

Return the audio output (if any) associated with an input.

Parameters:
p_input an input thread
Returns:
NULL on error, or the audio output (which needs to be released with vlc_object_release()).

Referenced by AudioConfig(), MainInputManager::getAout(), getAout(), GetVLCObject(), VlcProc::on_intf_event_changed(), PutAction(), EqualizerPreamp::set(), and VLCMain::setupMenus.

input_item_t* input_GetItem ( input_thread_t p_input  ) 

static input_state_e input_GetState ( input_thread_t p_input  )  [inline, static]

It will return the current state of the input.

Provided for convenience.

Referenced by VLCMain::manage, and VLCMain::manageIntf:.

static vout_thread_t* input_GetVout ( input_thread_t p_input  )  [inline, static]

Return one of the video output (if any).

If possible, you should use INPUT_GET_VOUTS directly and process _all_ video outputs instead.

Parameters:
p_input an input thread from which to get a video output
Returns:
NULL on error, or a video output thread pointer (which needs to be released with vlc_object_release()).

References i.

Referenced by EvaluateRPN(), EventIntf(), CmdSnapshot::execute(), CmdFullscreen::execute(), GetVLCObject(), GetVout(), MainInputManager::getVout(), getVout(), VLCControls::keyEvent:, libvlc_media_player_has_vout(), MacroDo(), mediacontrol_display_text(), mediacontrol_snapshot(), VlcProc::on_intf_event_changed(), PutAction(), Run(), RunIntf(), VLCMain::setupMenus, VLCControls::showPosition:, VideoConfig(), and VLCControls::windowAction:.

void input_resource_Delete ( input_resource_t  ) 

void input_SplitMRL ( const char **  ppsz_access,
const char **  ppsz_demux,
char **  ppsz_path,
char *  psz_dup 
)

This function allows to split a MRL into access, demux and path part.

You should not write into access and demux string as they may not point into the provided buffer. The buffer provided by psz_dup will be modified.

Referenced by __stream_UrlNew(), and InputSourceInit().

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:
the input thread to start

References ERROR_S, input_ChangeState(), msg_Err, Run(), VLC_EGENERIC, VLC_SUCCESS, vlc_thread_create, and VLC_THREAD_PRIORITY_INPUT.

Referenced by __input_CreateAndStart(), libvlc_media_player_play(), PlayItem(), vlm_ControlMediaInstanceStart(), and vlm_OnMediaUpdate().

void input_Stop ( input_thread_t p_input,
bool  b_abort 
)

Request a running input thread to stop and die.

b_abort must be true when a user stop is requested and not because you have detected an error or an eof. It will be used to properly send the INPUT_EVENT_ABORT event.

Parameters:
p_input the input thread to stop
b_abort true if the input has been aborted by a user request

References input_thread_private_t::b_abort, INPUT_CONTROL_SET_DIE, input_ControlPush(), input_thread_private_t::lock_control, ObjectKillChildrens(), input_thread_t::p, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_OBJECT.

Referenced by GoAndPreparse(), LoopInput(), release_input_thread(), Run(), vlm_ControlMediaInstanceStart(), vlm_MediaInstanceDelete(), and vlm_OnMediaUpdate().

int input_vaControl ( input_thread_t ,
int  i_query,
va_list   
)

References _, asprintf(), input_thread_private_t::attachment, input_thread_t::b_preparsing, input_thread_private_t::bookmark, input_thread_private_t::f_fps, i, input_thread_private_t::i_attachment, input_thread_private_t::i_bookmark, vlc_value_t::i_int, INPUT_ADD_BOOKMARK, INPUT_ADD_INFO, INPUT_ADD_OPTION, INPUT_ADD_SLAVE, INPUT_ADD_SUBTITLE, INPUT_CHANGE_BOOKMARK, INPUT_CLEAR_BOOKMARKS, INPUT_CONTROL_ADD_SLAVE, INPUT_CONTROL_ADD_SUBTITLE, INPUT_CONTROL_RESTART_ES, INPUT_CONTROL_SET_BOOKMARK, 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_INFO, INPUT_GET_LENGTH, INPUT_GET_POSITION, INPUT_GET_RATE, INPUT_GET_RECORD_STATE, INPUT_GET_SPU_DELAY, INPUT_GET_STATE, INPUT_GET_TIME, INPUT_GET_VIDEO_FPS, INPUT_GET_VOUTS, input_item_AddInfo(), input_item_AddOption(), input_item_DelInfo(), input_item_GetInfo(), input_item_SetName(), input_resource_HoldAout(), input_resource_HoldVouts(), INPUT_RESTART_ES, input_SendEventMetaInfo(), input_SendEventMetaName(), INPUT_SET_AUDIO_DELAY, INPUT_SET_BOOKMARK, INPUT_SET_NAME, INPUT_SET_POSITION, INPUT_SET_RATE, INPUT_SET_RECORD_STATE, INPUT_SET_SPU_DELAY, INPUT_SET_STATE, INPUT_SET_TIME, input_item_t::lock, msg_Err, input_thread_t::p, input_thread_private_t::p_item, input_thread_private_t::p_resource, input_thread_private_t::pp_bookmark, input_attachment_t::psz_name, seekpoint_t::psz_name, psz_name, psz_option, vlc_value_t::psz_string, psz_value, gen_builder::str, strdup(), subtitles_Filter(), TAB_APPEND, TAB_REMOVE, UpdateBookmarksOption(), var_GetBool, var_GetFloat, var_GetInteger, var_GetTime, var_SetBool, var_SetFloat, var_SetInteger, var_SetTime, vasprintf(), VLC_EGENERIC, VLC_ENOMEM, vlc_input_attachment_Duplicate(), VLC_INPUT_OPTION_UNIQUE, vlc_mutex_lock(), vlc_mutex_unlock(), vlc_seekpoint_Delete(), vlc_seekpoint_Duplicate(), and VLC_SUCCESS.

Referenced by input_Control().

static void vlc_audio_replay_gain_MergeFromMeta ( audio_replay_gain_t p_dst,
const vlc_meta_t p_meta 
) [inline, static]

static void vlc_input_attachment_Delete ( input_attachment_t a  )  [inline, static]

static input_attachment_t* vlc_input_attachment_Duplicate ( const input_attachment_t a  )  [inline, static]

static input_attachment_t* vlc_input_attachment_New ( const char *  psz_name,
const char *  psz_mime,
const char *  psz_description,
const void *  p_data,
int  i_data 
) [inline, static]

static void vlc_input_title_Delete ( input_title_t t  )  [inline, static]

static input_title_t* vlc_input_title_Duplicate ( input_title_t t  )  [inline, static]

static input_title_t* vlc_input_title_New ( void   )  [inline, static]

static void vlc_seekpoint_Delete ( seekpoint_t point  )  [inline, static]

static seekpoint_t* vlc_seekpoint_Duplicate ( seekpoint_t src  )  [inline, static]

static seekpoint_t* vlc_seekpoint_New ( void   )  [inline, static]


Generated on Sat Nov 21 08:05:26 2009 for VLC by  doxygen 1.5.6