vlc_input.h File Reference

Include dependency graph for vlc_input.h:

Go to the source code of this file.

Data Structures

struct  info_t
struct  info_category_t
struct  input_item_t
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 ITEM_TYPE_UNKNOWN   0
#define ITEM_TYPE_FILE   1
#define ITEM_TYPE_DIRECTORY   2
#define ITEM_TYPE_DISC   3
#define ITEM_TYPE_CDDA   4
#define ITEM_TYPE_CARD   5
#define ITEM_TYPE_NET   6
#define ITEM_TYPE_PLAYLIST   7
#define ITEM_TYPE_NODE   8
#define ITEM_TYPE_NUMBER   9
#define VLC_INPUT_OPTION_TRUSTED   0x2
#define VLC_INPUT_OPTION_UNIQUE   0x100
#define input_item_SetTitle(item, b)   input_item_SetMeta( item, vlc_meta_Title, b )
#define input_item_SetArtist(item, b)   input_item_SetMeta( item, vlc_meta_Artist, b )
#define input_item_SetGenre(item, b)   input_item_SetMeta( item, vlc_meta_Genre, b )
#define input_item_SetCopyright(item, b)   input_item_SetMeta( item, vlc_meta_Copyright, b )
#define input_item_SetAlbum(item, b)   input_item_SetMeta( item, vlc_meta_Album, b )
#define input_item_SetTrackNum(item, b)   input_item_SetMeta( item, vlc_meta_TrackNumber, b )
#define input_item_SetDescription(item, b)   input_item_SetMeta( item, vlc_meta_Description, b )
#define input_item_SetRating(item, b)   input_item_SetMeta( item, vlc_meta_Rating, b )
#define input_item_SetDate(item, b)   input_item_SetMeta( item, vlc_meta_Date, b )
#define input_item_SetSetting(item, b)   input_item_SetMeta( item, vlc_meta_Setting, b )
#define input_item_SetURL(item, b)   input_item_SetMeta( item, vlc_meta_URL, b )
#define input_item_SetLanguage(item, b)   input_item_SetMeta( item, vlc_meta_Language, b )
#define input_item_SetNowPlaying(item, b)   input_item_SetMeta( item, vlc_meta_NowPlaying, b )
#define input_item_SetPublisher(item, b)   input_item_SetMeta( item, vlc_meta_Publisher, b )
#define input_item_SetEncodedBy(item, b)   input_item_SetMeta( item, vlc_meta_EncodedBy, b )
#define input_item_SetArtURL(item, b)   input_item_SetMeta( item, vlc_meta_ArtworkURL, b )
#define input_item_SetTrackID(item, b)   input_item_SetMeta( item, vlc_meta_TrackID, b )
#define input_item_GetTitle(item)   input_item_GetMeta( item, vlc_meta_Title )
#define input_item_GetArtist(item)   input_item_GetMeta( item, vlc_meta_Artist )
#define input_item_GetGenre(item)   input_item_GetMeta( item, vlc_meta_Genre )
#define input_item_GetCopyright(item)   input_item_GetMeta( item, vlc_meta_Copyright )
#define input_item_GetAlbum(item)   input_item_GetMeta( item, vlc_meta_Album )
#define input_item_GetTrackNum(item)   input_item_GetMeta( item, vlc_meta_TrackNumber )
#define input_item_GetDescription(item)   input_item_GetMeta( item, vlc_meta_Description )
#define input_item_GetRating(item)   input_item_GetMeta( item, vlc_meta_Rating )
#define input_item_GetDate(item)   input_item_GetMeta( item, vlc_meta_Date )
#define input_item_GetGetting(item)   input_item_GetMeta( item, vlc_meta_Getting )
#define input_item_GetURL(item)   input_item_GetMeta( item, vlc_meta_URL )
#define input_item_GetLanguage(item)   input_item_GetMeta( item, vlc_meta_Language )
#define input_item_GetNowPlaying(item)   input_item_GetMeta( item, vlc_meta_NowPlaying )
#define input_item_GetPublisher(item)   input_item_GetMeta( item, vlc_meta_Publisher )
#define input_item_GetEncodedBy(item)   input_item_GetMeta( item, vlc_meta_EncodedBy )
#define input_item_GetArtURL(item)   input_item_GetMeta( item, vlc_meta_ArtworkURL )
#define input_item_GetTrackID(item)   input_item_GetMeta( item, vlc_meta_TrackID )
#define input_item_GetSetting(item)   input_item_GetMeta( item, vlc_meta_Setting )
#define input_ItemNew(a, b, c)   input_ItemNewExt( a, b, c, 0, NULL, -1 )
#define input_ItemNewExt(a, b, c, d, e, f)   __input_ItemNewExt( VLC_OBJECT(a),b,c,d,e,f)
#define input_ItemGetById(a, b)   __input_ItemGetById( VLC_OBJECT(a),b )
#define INPUT_RATE_DEFAULT   1000
#define INPUT_RATE_MIN   125
#define INPUT_RATE_MAX   32000
#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_CONTROL_FIFO_SIZE   100
#define input_CreateThread(a, b)   __input_CreateThread(VLC_OBJECT(a),b)
#define input_Preparse(a, b)   __input_Preparse(VLC_OBJECT(a),b)
#define input_Read(a, b, c)   __input_Read(VLC_OBJECT(a),b, c)

Typedefs

typedef input_thread_private_t input_thread_private_t

Enumerations

enum  input_state_e {
  INIT_S = 0, OPENING_S, BUFFERING_S, PLAYING_S,
  PAUSE_S, STOP_S, FORWARD_S, BACKWARD_S,
  END_S, ERROR_S
}
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_BYTE_POSITION, INPUT_SET_BYTE_SIZE,
  INPUT_GET_VIDEO_FPS, 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
}

Functions

static void input_ItemCopyOptions (input_item_t *p_parent, input_item_t *p_child)
static void input_item_SetName (input_item_t *p_item, const char *psz_name)
static void input_ItemAddSubItem (input_item_t *p_parent, input_item_t *p_child)
int input_ItemAddOpt (input_item_t *, const char *str, unsigned flags)
static int input_ItemAddOption (input_item_t *item, const char *str)
static int input_ItemHasErrorWhenReading (input_item_t *item)
void input_item_SetMeta (input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz_val)
static bool input_item_MetaMatch (input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz)
static char * input_item_GetMeta (input_item_t *p_i, vlc_meta_type_t meta_type)
static char * input_item_GetName (input_item_t *p_i)
static char * input_item_GetURI (input_item_t *p_i)
static void input_item_SetURI (input_item_t *p_i, char *psz_uri)
static mtime_t input_item_GetDuration (input_item_t *p_i)
static void input_item_SetDuration (input_item_t *p_i, mtime_t i_duration)
static bool input_item_IsPreparsed (input_item_t *p_i)
static bool input_item_IsArtFetched (input_item_t *p_i)
static const vlc_meta_tinput_item_GetMetaObject (input_item_t *p_i)
static void input_item_MetaMerge (input_item_t *p_i, const vlc_meta_t *p_new_meta)
char * input_ItemGetInfo (input_item_t *p_i, const char *psz_cat, const char *psz_name)
 Get a info item from a given category in a given input item.
int input_ItemAddInfo (input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format,...)
input_item_t__input_ItemNewExt (vlc_object_t *, const char *, const char *, int, const char *const *, mtime_t i_duration)
input_item_tinput_ItemNewWithType (vlc_object_t *, const char *, const char *e, int, const char *const *, mtime_t i_duration, int)
input_item_t__input_ItemGetById (vlc_object_t *, int)
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_item_tinput_GetItem (input_thread_t *)
 Get the input item for an input thread.
input_thread_t__input_CreateThread (vlc_object_t *, input_item_t *)
 Initialize an input thread and run it.
int __input_Preparse (vlc_object_t *, input_item_t *)
 Initialize an input and initialize it to preparse the item This function is blocking.
int __input_Read (vlc_object_t *, input_item_t *, bool)
 Initialize an input thread and run it.
void input_StopThread (input_thread_t *)
int input_vaControl (input_thread_t *, int i_query, va_list)
int input_Control (input_thread_t *, int i_query,...)
 Control function for inputs.
static input_state_e input_GetState (input_thread_t *p_input)
decoder_tinput_DecoderNew (input_thread_t *, es_format_t *, bool b_force_decoder)
 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 *)
 Put a block_t in the decoder's fifo.
bool input_AddSubtitles (input_thread_t *, char *, bool)
vlc_event_manager_tinput_get_event_manager (input_thread_t *)


Define Documentation

#define INPUT_CONTROL_FIFO_SIZE   100

#define input_CreateThread ( a,
 )     __input_CreateThread(VLC_OBJECT(a),b)

#define input_item_GetAlbum ( item   )     input_item_GetMeta( item, vlc_meta_Album )

#define input_item_GetArtist ( item   )     input_item_GetMeta( item, vlc_meta_Artist )

#define input_item_GetArtURL ( item   )     input_item_GetMeta( item, vlc_meta_ArtworkURL )

#define input_item_GetCopyright ( item   )     input_item_GetMeta( item, vlc_meta_Copyright )

#define input_item_GetDate ( item   )     input_item_GetMeta( item, vlc_meta_Date )

#define input_item_GetDescription ( item   )     input_item_GetMeta( item, vlc_meta_Description )

#define input_item_GetEncodedBy ( item   )     input_item_GetMeta( item, vlc_meta_EncodedBy )

#define input_item_GetGenre ( item   )     input_item_GetMeta( item, vlc_meta_Genre )

#define input_item_GetGetting ( item   )     input_item_GetMeta( item, vlc_meta_Getting )

#define input_item_GetLanguage ( item   )     input_item_GetMeta( item, vlc_meta_Language )

#define input_item_GetNowPlaying ( item   )     input_item_GetMeta( item, vlc_meta_NowPlaying )

#define input_item_GetPublisher ( item   )     input_item_GetMeta( item, vlc_meta_Publisher )

#define input_item_GetRating ( item   )     input_item_GetMeta( item, vlc_meta_Rating )

#define input_item_GetSetting ( item   )     input_item_GetMeta( item, vlc_meta_Setting )

#define input_item_GetTitle ( item   )     input_item_GetMeta( item, vlc_meta_Title )

#define input_item_GetTrackID ( item   )     input_item_GetMeta( item, vlc_meta_TrackID )

#define input_item_GetTrackNum ( item   )     input_item_GetMeta( item, vlc_meta_TrackNumber )

#define input_item_GetURL ( item   )     input_item_GetMeta( item, vlc_meta_URL )

#define input_item_SetAlbum ( item,
 )     input_item_SetMeta( item, vlc_meta_Album, b )

#define input_item_SetArtist ( item,
 )     input_item_SetMeta( item, vlc_meta_Artist, b )

#define input_item_SetArtURL ( item,
 )     input_item_SetMeta( item, vlc_meta_ArtworkURL, b )

#define input_item_SetCopyright ( item,
 )     input_item_SetMeta( item, vlc_meta_Copyright, b )

#define input_item_SetDate ( item,
 )     input_item_SetMeta( item, vlc_meta_Date, b )

#define input_item_SetDescription ( item,
 )     input_item_SetMeta( item, vlc_meta_Description, b )

#define input_item_SetEncodedBy ( item,
 )     input_item_SetMeta( item, vlc_meta_EncodedBy, b )

#define input_item_SetGenre ( item,
 )     input_item_SetMeta( item, vlc_meta_Genre, b )

#define input_item_SetLanguage ( item,
 )     input_item_SetMeta( item, vlc_meta_Language, b )

#define input_item_SetNowPlaying ( item,
 )     input_item_SetMeta( item, vlc_meta_NowPlaying, b )

#define input_item_SetPublisher ( item,
 )     input_item_SetMeta( item, vlc_meta_Publisher, b )

#define input_item_SetRating ( item,
 )     input_item_SetMeta( item, vlc_meta_Rating, b )

#define input_item_SetSetting ( item,
 )     input_item_SetMeta( item, vlc_meta_Setting, b )

#define input_item_SetTitle ( item,
 )     input_item_SetMeta( item, vlc_meta_Title, b )

#define input_item_SetTrackID ( item,
 )     input_item_SetMeta( item, vlc_meta_TrackID, b )

#define input_item_SetTrackNum ( item,
 )     input_item_SetMeta( item, vlc_meta_TrackNumber, b )

#define input_item_SetURL ( item,
 )     input_item_SetMeta( item, vlc_meta_URL, b )

#define input_ItemGetById ( a,
 )     __input_ItemGetById( VLC_OBJECT(a),b )

#define input_ItemNew ( a,
b,
 )     input_ItemNewExt( a, b, c, 0, NULL, -1 )

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

#define input_Preparse ( a,
 )     __input_Preparse(VLC_OBJECT(a),b)

#define INPUT_RATE_DEFAULT   1000

#define INPUT_RATE_MAX   32000

#define INPUT_RATE_MIN   125

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

#define INPUT_UPDATE_META   0x0040

#define INPUT_UPDATE_NONE   0x0000

#define INPUT_UPDATE_SEEKPOINT   0x0020

#define INPUT_UPDATE_SIZE   0x0001

#define INPUT_UPDATE_TITLE   0x0010

#define ITEM_TYPE_CARD   5

#define ITEM_TYPE_CDDA   4

#define ITEM_TYPE_DIRECTORY   2

#define ITEM_TYPE_DISC   3

#define ITEM_TYPE_FILE   1

#define ITEM_TYPE_NET   6

#define ITEM_TYPE_NODE   8

#define ITEM_TYPE_NUMBER   9

#define ITEM_TYPE_PLAYLIST   7

#define ITEM_TYPE_UNKNOWN   0

#define VLC__INPUT_H   1

#define VLC_INPUT_OPTION_TRUSTED   0x2

#define VLC_INPUT_OPTION_UNIQUE   0x100


Typedef Documentation

typedef struct input_thread_private_t input_thread_private_t


Enumeration Type Documentation

enum input_query_e

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_BYTE_POSITION 
INPUT_SET_BYTE_SIZE 
INPUT_GET_VIDEO_FPS 
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 

enum input_state_e

Enumerator:
INIT_S 
OPENING_S 
BUFFERING_S 
PLAYING_S 
PAUSE_S 
STOP_S 
FORWARD_S 
BACKWARD_S 
END_S 
ERROR_S 


Function Documentation

input_thread_t* __input_CreateThread ( vlc_object_t p_parent,
input_item_t p_item 
)

Initialize an input thread and run it.

You will need to monitor the thread to clean up after it is done

Parameters:
p_parent a vlc_object
p_item an input item
Returns:
a pointer to the spawned input thread

input_item_t* __input_ItemGetById ( vlc_object_t ,
int   
)

input_item_t* __input_ItemNewExt ( vlc_object_t ,
const char *  ,
const char *  ,
int  ,
const char *const *  ,
mtime_t  i_duration 
)

int __input_Preparse ( vlc_object_t p_parent,
input_item_t p_item 
)

Initialize an input and initialize it to preparse the item This function is blocking.

It will only accept to parse files

Parameters:
p_parent a vlc_object_t
p_item an input item
Returns:
VLC_SUCCESS or an error

int __input_Read ( vlc_object_t p_parent,
input_item_t p_item,
bool  b_block 
)

Initialize an input thread and run it.

This thread will clean after itself, you can forget about it. It can work either in blocking or non-blocking mode

Parameters:
p_parent a vlc_object
p_item an input item
b_block should we block until read is finished ?
Returns:
the input object id if non blocking, an error code else

bool input_AddSubtitles ( input_thread_t ,
char *  ,
bool   
)

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

Control function for inputs.

Parameters:
p_input input handle
i_query query type
Returns:
VLC_SUCCESS if ok

void input_DecoderDecode ( decoder_t p_dec,
block_t p_block 
)

Put a block_t in the decoder's fifo.

Parameters:
p_dec the decoder object
p_block the data block

void input_DecoderDelete ( decoder_t p_dec  ) 

Kills a decoder thread and waits until it's finished.

Parameters:
p_input the input thread
p_es the es descriptor
Returns:
nothing

decoder_t* input_DecoderNew ( input_thread_t p_input,
es_format_t fmt,
bool  b_force_decoder 
)

Spawns a new decoder thread.

Parameters:
p_input the input thread
p_es the es descriptor
Returns:
the spawned decoder object

vlc_event_manager_t* input_get_event_manager ( input_thread_t  ) 

input_item_t* input_GetItem ( input_thread_t  ) 

Get the input item for an input thread.

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

static mtime_t input_item_GetDuration ( input_item_t p_i  )  [inline, static]

static char* input_item_GetMeta ( input_item_t p_i,
vlc_meta_type_t  meta_type 
) [inline, static]

static const vlc_meta_t* input_item_GetMetaObject ( input_item_t p_i  )  [inline, static]

static char* input_item_GetName ( input_item_t p_i  )  [inline, static]

static char* input_item_GetURI ( input_item_t p_i  )  [inline, static]

static bool input_item_IsArtFetched ( input_item_t p_i  )  [inline, static]

static bool input_item_IsPreparsed ( input_item_t p_i  )  [inline, static]

static bool input_item_MetaMatch ( input_item_t p_i,
vlc_meta_type_t  meta_type,
const char *  psz 
) [inline, static]

static void input_item_MetaMerge ( input_item_t p_i,
const vlc_meta_t p_new_meta 
) [inline, static]

static void input_item_SetDuration ( input_item_t p_i,
mtime_t  i_duration 
) [inline, static]

void input_item_SetMeta ( input_item_t p_i,
vlc_meta_type_t  meta_type,
const char *  psz_val 
)

static void input_item_SetName ( input_item_t p_item,
const char *  psz_name 
) [inline, static]

static void input_item_SetURI ( input_item_t p_i,
char *  psz_uri 
) [inline, static]

int input_ItemAddInfo ( input_item_t p_i,
const char *  psz_cat,
const char *  psz_name,
const char *&nbs