]> git.sesse.net Git - vlc/blobdiff - include/vlc_input.h
decoder: add input_DecoderFlush()
[vlc] / include / vlc_input.h
index 491c329b020e67c34aa6aa24db23c5f132c80e87..a6ea43296f7a6ab4f1e410063e6477f2ac1ee3f9 100644 (file)
@@ -36,6 +36,7 @@
 #include <vlc_epg.h>
 #include <vlc_events.h>
 #include <vlc_input_item.h>
+#include <vlc_vout_osd.h>
 
 #include <string.h>
 
@@ -77,7 +78,7 @@ static inline seekpoint_t *vlc_seekpoint_Duplicate( const seekpoint_t *src )
 /*****************************************************************************
  * Title:
  *****************************************************************************/
-typedef struct
+typedef struct input_title_t
 {
     char        *psz_name;
 
@@ -202,12 +203,6 @@ static inline void vlc_input_attachment_Delete( input_attachment_t *a )
  * input defines/constants.
  *****************************************************************************/
 
-/* i_update field of access_t/demux_t */
-#define INPUT_UPDATE_TITLE      0x0010
-#define INPUT_UPDATE_SEEKPOINT  0x0020
-#define INPUT_UPDATE_META       0x0040
-#define INPUT_UPDATE_TITLE_LIST 0x0100
-
 /**
  * This defines private core storage for an input.
  */
@@ -340,8 +335,6 @@ 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,
@@ -501,7 +494,7 @@ VLC_API input_thread_t * input_CreateAndStart( vlc_object_t *p_parent, input_ite
 
 VLC_API int input_Start( input_thread_t * );
 
-VLC_API void input_Stop( input_thread_t *, bool b_abort );
+VLC_API void input_Stop( input_thread_t * );
 
 VLC_API int input_Read( vlc_object_t *, input_item_t * );
 #define input_Read(a,b) input_Read(VLC_OBJECT(a),b)
@@ -532,14 +525,6 @@ static inline input_state_e input_GetState( input_thread_t * p_input )
     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 );
-}
 
 /**
  * Return one of the video output (if any). If possible, you should use
@@ -564,6 +549,29 @@ static inline vout_thread_t *input_GetVout( input_thread_t *p_input )
      return p_vout;
 }
 
+/**
+ * It will add a new subtitle source to the input.
+ * Provided for convenience.
+ */
+static inline int input_AddSubtitleOSD( input_thread_t *p_input, const char *psz_url,
+        bool b_check_extension, bool b_osd )
+{
+    int i_result = input_Control( p_input, INPUT_ADD_SUBTITLE, psz_url, b_check_extension );
+    if( i_result != VLC_SUCCESS || !b_osd )
+        return i_result;
+
+    vout_thread_t *p_vout = input_GetVout( p_input );
+    if( p_vout )
+    {
+        vout_OSDMessage(p_vout, SPU_DEFAULT_CHANNEL, "%s",
+                        vlc_gettext("Subtitle track added") );
+        vlc_object_release( (vlc_object_t *)p_vout );
+    }
+    return i_result;
+}
+#define input_AddSubtitle(a, b, c) input_AddSubtitleOSD(a, b, c, false)
+
+
 /**
  * Return the audio output (if any) associated with an input.
  * @param p_input an input thread
@@ -606,14 +614,15 @@ static inline int input_ModifyPcrSystem( input_thread_t *p_input, bool b_absolut
 }
 
 /* */
-VLC_API decoder_t * input_DecoderCreate( vlc_object_t *, es_format_t *, input_resource_t * ) VLC_USED;
+VLC_API decoder_t * input_DecoderCreate( vlc_object_t *, const es_format_t *, input_resource_t * ) VLC_USED;
 VLC_API void input_DecoderDelete( decoder_t * );
 VLC_API void input_DecoderDecode( decoder_t *, block_t *, bool b_do_pace );
+VLC_API void input_DecoderFlush( decoder_t * );
 
 /**
  * This function creates a sane filename path.
  */
-VLC_API char * input_CreateFilename( vlc_object_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) VLC_USED;
+VLC_API char * input_CreateFilename( input_thread_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) VLC_USED;
 
 /**
  * It creates an empty input resource handler.
@@ -644,4 +653,19 @@ VLC_API void input_resource_Terminate( input_resource_t * );
  */
 VLC_API audio_output_t *input_resource_HoldAout( input_resource_t * );
 
+/**
+ * This function creates or recycles an audio output.
+ */
+VLC_API audio_output_t *input_resource_GetAout( input_resource_t * );
+
+/**
+ * This function retains or destroys an audio output.
+ */
+VLC_API void input_resource_PutAout( input_resource_t *, audio_output_t * );
+
+/**
+ * Prevents the existing audio output (if any) from being recycled.
+ */
+VLC_API void input_resource_ResetAout( input_resource_t * );
+
 #endif