]> git.sesse.net Git - vlc/blobdiff - include/vlc_input.h
Moved stream record to its own module.
[vlc] / include / vlc_input.h
index d336de9d5da1051954fca8af60c66c74b9525cf4..048be2d6af039b04deccdb6c9a1caab0e7e733a8 100644 (file)
@@ -423,6 +423,12 @@ struct input_thread_t
     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 +441,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 +450,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 +461,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 +475,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;
@@ -560,6 +561,12 @@ 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,
+
 } input_event_type_e;
 
 /** @}*/
@@ -617,11 +624,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 +640,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 */
@@ -647,22 +654,38 @@ enum input_query_e
 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 );
+}
+
+/**
+ * It will return the input event manager.
+ *
+ * You are advised to use "intf-event" instead if you want completness.
+ */
+VLC_EXPORT( vlc_event_manager_t *, input_GetEventManager, ( input_thread_t * ) );
 
+/* */
 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 +695,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