]> git.sesse.net Git - vlc/blobdiff - include/vlc_input.h
Privatized p_input->i_time.
[vlc] / include / vlc_input.h
index d336de9d5da1051954fca8af60c66c74b9525cf4..8cc5da2b547be15b013fcf8abb1dd0d85c67122d 100644 (file)
@@ -128,7 +128,7 @@ VLC_EXPORT( bool, input_item_MetaMatch, ( input_item_t *p_i, vlc_meta_type_t met
 VLC_EXPORT( char *, input_item_GetMeta, ( input_item_t *p_i, vlc_meta_type_t meta_type ) );
 VLC_EXPORT( char *, input_item_GetName, ( input_item_t * p_i ) );
 VLC_EXPORT( char *, input_item_GetURI, ( input_item_t * p_i ) );
-VLC_EXPORT( void,   input_item_SetURI, ( input_item_t * p_i, char * psz_uri ));
+VLC_EXPORT( void,   input_item_SetURI, ( input_item_t * p_i, const char *psz_uri ));
 VLC_EXPORT(mtime_t, input_item_GetDuration, ( input_item_t * p_i ) );
 VLC_EXPORT( void,   input_item_SetDuration, ( input_item_t * p_i, mtime_t i_duration ));
 VLC_EXPORT( bool,   input_item_IsPreparsed, ( input_item_t *p_i ));
@@ -413,16 +413,18 @@ struct input_thread_t
 
     int i_state;
     bool b_can_pace_control;
-    int64_t     i_time;     /* Current time */
-
-    /* Internal caching common to all inputs */
-    mtime_t i_pts_delay;
 
     /* All other data is input_thread is PRIVATE. You can't access it
      * outside of src/input */
     input_thread_private_t *p;
 };
 
+/**
+ * Record prefix string.
+ * TODO make it configurable.
+ */
+#define INPUT_RECORD_PREFIX "vlc-record-%Y-%m-%d-%H:%M:%S-$ N-$ p"
+
 /*****************************************************************************
  * Input events and variables
  *****************************************************************************/
@@ -435,8 +437,7 @@ struct input_thread_t
  * TODO complete the documentation.
  * The read only variables are:
  *  - "length"
- *  - "bookmarks"
- *  - "seekable (if you can seek, it doesn't say if 'bar display' has be shown FIXME rename can-seek
+ *  - "can-seek" (if you can seek, it doesn't say if 'bar display' has be shown
  *    or not, for that check position != 0.0)
  *  - "can-pause"
  *  - "can-rate"
@@ -445,6 +446,7 @@ struct input_thread_t
  *  - "teletext-es" to get the index of spu track that is teletext -1 if no teletext)
  *  - "signal-quality"
  *  - "signal-strength"
+ *  - "cache" (level of data cached [0 .. 1])
  *
  * The read-write variables are:
  *  - state (\see input_state_e)
@@ -455,7 +457,7 @@ struct input_thread_t
  *  - chapter, next-chapter, next-chapter-prev
  *  - program, audio-es, video-es, spu-es
  *  - audio-delay, spu-delay
- *  - bookmark
+ *  - bookmark (bookmark list)
  *  - record
  *  - frame-next
  *  - navigation (list of "title %2i")
@@ -469,18 +471,13 @@ struct input_thread_t
  * Input state
  *
  * This enum is used by the variable "state"
- *
- * NOTE: you need to update ppsz_input_state in the RC interface
- * if you modify this list.
  */
 typedef enum input_state_e
 {
     INIT_S = 0,
     OPENING_S,
-    BUFFERING_S,
     PLAYING_S,
     PAUSE_S,
-    STOP_S,
     END_S,
     ERROR_S,
 } input_state_e;
@@ -519,8 +516,12 @@ typedef enum input_event_type_e
 {
     /* "state" has changed */
     INPUT_EVENT_STATE,
+    /* b_dead is true */
+    INPUT_EVENT_DEAD,
+
     /* "rate" has changed */
     INPUT_EVENT_RATE,
+
     /* At least one of "position" or "time" or "length" has changed */
     INPUT_EVENT_TIMES,
 
@@ -540,9 +541,6 @@ typedef enum input_event_type_e
     /* "record" has changed */
     INPUT_EVENT_RECORD,
 
-    /* A vout has been created/deleted by *the input* */
-    INPUT_EVENT_VOUT,
-
     /* input_item_t media has changed */
     INPUT_EVENT_ITEM_META,
     /* input_item_t info has changed */
@@ -560,6 +558,17 @@ typedef enum input_event_type_e
     /* "spu-delay" has changed */
     INPUT_EVENT_SUBTITLE_DELAY,
 
+    /* "bookmark" has changed */
+    INPUT_EVENT_BOOKMARK,
+
+    /* cache" has changed */
+    INPUT_EVENT_CACHE,
+
+    /* A aout_instance_t object has been created/deleted by *the input* */
+    INPUT_EVENT_AOUT,
+    /* A vout_thread_t object has been created/deleted by *the input* */
+    INPUT_EVENT_VOUT,
+
 } input_event_type_e;
 
 /** @}*/
@@ -573,12 +582,13 @@ typedef enum input_event_type_e
 #define input_CreateThread(a,b) __input_CreateThread(VLC_OBJECT(a),b)
 VLC_EXPORT( input_thread_t *, __input_CreateThread, ( vlc_object_t *, input_item_t * ) );
 
+VLC_EXPORT( void,             input_StopThread,     ( input_thread_t * ) );
+
 #define input_Preparse(a,b) __input_Preparse(VLC_OBJECT(a),b)
 VLC_EXPORT( int, __input_Preparse, ( vlc_object_t *, input_item_t * ) );
 
 #define input_Read(a,b,c) __input_Read(VLC_OBJECT(a),b, c)
 VLC_EXPORT( int, __input_Read, ( vlc_object_t *, input_item_t *, bool ) );
-VLC_EXPORT( void,             input_StopThread,     ( input_thread_t * ) );
 
 enum input_query_e
 {
@@ -617,11 +627,10 @@ enum input_query_e
     INPUT_ADD_OPTION,      /* arg1= char * arg2= char *  res=can fail*/
 
     /* Input properties */
-    INPUT_GET_BYTE_POSITION,     /* arg1= int64_t *       res=    */
-    INPUT_SET_BYTE_SIZE,         /* arg1= int64_t *       res=    */
     INPUT_GET_VIDEO_FPS,         /* arg1= double *        res=can fail */
 
     /* bookmarks */
+    INPUT_GET_BOOKMARK,    /* arg1= seekpoint_t *               res=can fail */
     INPUT_GET_BOOKMARKS,   /* arg1= seekpoint_t *** arg2= int * res=can fail */
     INPUT_CLEAR_BOOKMARKS, /* res=can fail */
     INPUT_ADD_BOOKMARK,    /* arg1= seekpoint_t *  res=can fail   */
@@ -634,7 +643,8 @@ enum input_query_e
     INPUT_GET_ATTACHMENT,  /* arg1=input_attachment_t**, arg2=char*  res=can fail */
 
     /* On the fly input slave */
-    INPUT_ADD_SLAVE,       /* arg1= char * */
+    INPUT_ADD_SLAVE,       /* arg1= const char * */
+    INPUT_ADD_SUBTITLE,    /* arg1= const char *, arg2=bool b_check_extension */
 
     /* On the fly record while playing */
     INPUT_SET_RECORD_STATE, /* arg1=bool    res=can fail */
@@ -642,27 +652,41 @@ enum input_query_e
 
     /* ES */
     INPUT_RESTART_ES,       /* arg1=int (-AUDIO/VIDEO/SPU_ES for the whole category) */
+
+    /* Input ressources
+     * XXX You must call vlc_object_release as soon as possible */
+    INPUT_GET_AOUT,         /* arg1=aout_instance_t **              res=can fail */
+    INPUT_GET_VOUTS,        /* arg1=vout_thread_t ***, int *        res=can fail */
 };
 
 VLC_EXPORT( int, input_vaControl,( input_thread_t *, int i_query, va_list  ) );
 VLC_EXPORT( int, input_Control,  ( input_thread_t *, int i_query, ...  ) );
 
+/**
+ * It will return the current state of the input.
+ * Provided for convenience.
+ */
 static inline input_state_e input_GetState( input_thread_t * p_input )
 {
     input_state_e state = INIT_S;
     input_Control( p_input, INPUT_GET_STATE, &state );
     return state;
 }
+/**
+ * It will add a new subtitle source to the input.
+ * Provided for convenience.
+ */
+static inline int input_AddSubtitle( input_thread_t *p_input, const char *psz_url, bool b_check_extension )
+{
+    return input_Control( p_input, INPUT_ADD_SUBTITLE, psz_url, b_check_extension );
+}
 
+/* */
 typedef struct input_clock_t input_clock_t;
 VLC_EXPORT( decoder_t *, input_DecoderNew, ( input_thread_t *, es_format_t *, input_clock_t *, sout_instance_t * ) );
 VLC_EXPORT( void, input_DecoderDelete, ( decoder_t * ) );
 VLC_EXPORT( void, input_DecoderDecode,( decoder_t *, block_t * ) );
 
-VLC_EXPORT( bool, input_AddSubtitles, ( input_thread_t *, char *, bool ) );
-
-VLC_EXPORT( vlc_event_manager_t *, input_get_event_manager, ( input_thread_t * ) );
-
 /**
  * This function allows to split a MRL into access, demux and path part.
  *
@@ -672,4 +696,9 @@ VLC_EXPORT( vlc_event_manager_t *, input_get_event_manager, ( input_thread_t * )
  */
 VLC_EXPORT( void, input_SplitMRL, ( const char **ppsz_access, const char **ppsz_demux, char **ppsz_path, char *psz_dup ) );
 
+/**
+ * This function creates a sane filename path.
+ */
+VLC_EXPORT( char *, input_CreateFilename, ( vlc_object_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) );
+
 #endif