]> git.sesse.net Git - vlc/blobdiff - include/vlc_input.h
Asynchronous timer API
[vlc] / include / vlc_input.h
index a119c023e8cd680e3fe6f36ac9509a5f2a8feb61..561a75396481dfedb7c86ca6564c6399105c05fb 100644 (file)
@@ -248,14 +248,16 @@ static inline void vlc_input_attachment_Delete( input_attachment_t *a )
 #define INPUT_UPDATE_META       0x0040
 #define INPUT_UPDATE_SIGNAL     0x0080
 
-/** Get the input item for an input thread
- * FIXME see src/input/item.c but is is unsafe unless
- * you hold p_input
+/**
+ * This defines private core storage for an input.
  */
-VLC_EXPORT(input_item_t*, input_GetItem, (input_thread_t*));
-
 typedef struct input_thread_private_t input_thread_private_t;
 
+/**
+ * This defines an opaque input resource handler.
+ */
+typedef struct input_resource_t input_resource_t;
+
 /**
  * Main structure representing an input thread. This structure is mostly
  * private. The only public fields are READ-ONLY. You must use the helpers
@@ -278,7 +280,7 @@ struct input_thread_t
  * Record prefix string.
  * TODO make it configurable.
  */
-#define INPUT_RECORD_PREFIX "vlc-record-%Y-%m-%d-%H:%M:%S-$ N-$ p"
+#define INPUT_RECORD_PREFIX "vlc-record-%Y-%m-%d-%Hh%Mm%Ss-$ N-$ p"
 
 /*****************************************************************************
  * Input events and variables
@@ -375,12 +377,17 @@ typedef enum input_event_type_e
     INPUT_EVENT_STATE,
     /* b_dead is true */
     INPUT_EVENT_DEAD,
+    /* a *user* abort has been requested */
+    INPUT_EVENT_ABORT,
 
     /* "rate" has changed */
     INPUT_EVENT_RATE,
 
-    /* At least one of "position" or "time" or "length" has changed */
-    INPUT_EVENT_TIMES,
+    /* At least one of "position" or "time" */
+    INPUT_EVENT_POSITION,
+
+    /* "length" has changed */
+    INPUT_EVENT_LENGTH,
 
     /* A title has been added or removed or selected.
      * It imply that chapter has changed (not chapter event is sent) */
@@ -429,22 +436,9 @@ typedef enum input_event_type_e
 
 } input_event_type_e;
 
-/** @}*/
-
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
-
-/* input_CreateThread
- * Release the returned input_thread_t using vlc_object_release() */
-#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_Read(a,b,c) __input_Read(VLC_OBJECT(a),b, c)
-VLC_EXPORT( int, __input_Read, ( vlc_object_t *, input_item_t *, bool ) );
-
+/**
+ * Input queries
+ */
 enum input_query_e
 {
     /* input variable "position" */
@@ -514,9 +508,37 @@ enum input_query_e
     INPUT_GET_VOUTS,        /* arg1=vout_thread_t ***, int *        res=can fail */
 };
 
+/** @}*/
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+
+#define input_Create(a,b,c,d) __input_Create(VLC_OBJECT(a),b,c,d)
+VLC_EXPORT( input_thread_t *, __input_Create, ( vlc_object_t *p_parent, input_item_t *, const char *psz_log, input_resource_t * ) );
+
+#define input_CreateAndStart(a,b,c) __input_CreateAndStart(VLC_OBJECT(a),b,c)
+VLC_EXPORT( input_thread_t *, __input_CreateAndStart, ( vlc_object_t *p_parent, input_item_t *, const char *psz_log ) );
+
+VLC_EXPORT( int,  input_Start, ( input_thread_t * ) );
+
+VLC_EXPORT( void, input_Stop, ( input_thread_t *, bool b_abort ) );
+
+#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( int, input_vaControl,( input_thread_t *, int i_query, va_list  ) );
+
 VLC_EXPORT( int, input_Control,  ( input_thread_t *, int i_query, ...  ) );
 
+/**
+ * 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.
+ */
+VLC_EXPORT( input_item_t*, input_GetItem, ( input_thread_t * ) );
+
 /**
  * It will return the current state of the input.
  * Provided for convenience.
@@ -555,7 +577,7 @@ static inline vout_thread_t *input_GetVout( input_thread_t *p_input )
          vlc_object_release( (vlc_object_t *)(pp_vout[i]) );
 
      p_vout = (i_vout >= 1) ? pp_vout[0] : NULL;
-     free (pp_vout);
+     free( pp_vout );
      return p_vout;
 }
 
@@ -575,7 +597,7 @@ static inline aout_instance_t *input_GetAout( input_thread_t *p_input )
 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( void, input_DecoderDecode,( decoder_t *, block_t *, bool b_do_pace ) );
 
 /**
  * This function allows to split a MRL into access, demux and path part.