+char **subtitles_Detect( input_thread_t *, char* path, const char *fname );
+int subtitles_Filter( const char *);
+
+void MRLSplit( char *, const char **, const char **, char ** );
+
+static inline void input_ChangeStateWithVarCallback( input_thread_t *p_input, int state, bool callback )
+{
+ const bool changed = p_input->i_state != state;
+
+ p_input->i_state = state;
+
+ input_item_SetHasErrorWhenReading( p_input->p->input.p_item, (state == ERROR_S) );
+
+ if( callback )
+ {
+ var_SetInteger( p_input, "state", state );
+ }
+ else
+ {
+ vlc_value_t val;
+ val.i_int = state;
+ var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
+ }
+ if( changed )
+ {
+ vlc_event_t event;
+ event.type = vlc_InputStateChanged;
+ event.u.input_state_changed.new_state = state;
+ vlc_event_send( &p_input->p->event_manager, &event );
+ }
+}
+
+static inline void input_ChangeState( input_thread_t *p_input, int state )
+{
+ input_ChangeStateWithVarCallback( p_input, state, true );
+}
+
+
+/* Access */
+
+#define access_New( a, b, c, d ) __access_New(VLC_OBJECT(a), b, c, d )
+access_t * __access_New( vlc_object_t *p_obj, const char *psz_access,
+ const char *psz_demux, const char *psz_path );
+access_t * access_FilterNew( access_t *p_source,
+ const char *psz_access_filter );
+void access_Delete( access_t * );
+
+/* Demuxer */
+#include <vlc_demux.h>
+
+/* stream_t *s could be null and then it mean a access+demux in one */
+#define demux_New( a, b, c, d, e, f,g ) __demux_New(VLC_OBJECT(a),b,c,d,e,f,g)
+demux_t *__demux_New(vlc_object_t *p_obj, const char *psz_access, const char *psz_demux, const char *psz_path, stream_t *s, es_out_t *out, bool );
+
+void demux_Delete(demux_t *);
+
+static inline int demux_Demux( demux_t *p_demux )
+{
+ return p_demux->pf_demux( p_demux );
+}
+static inline int demux_vaControl( demux_t *p_demux, int i_query, va_list args )
+{
+ return p_demux->pf_control( p_demux, i_query, args );
+}
+static inline int demux_Control( demux_t *p_demux, int i_query, ... )
+{
+ va_list args;
+ int i_result;
+
+ va_start( args, i_query );
+ i_result = demux_vaControl( p_demux, i_query, args );
+ va_end( args );
+ return i_result;
+}
+
+/* Stream */
+/**
+ * stream_t definition
+ */
+struct stream_t
+{
+ VLC_COMMON_MEMBERS
+
+ /*block_t *(*pf_block) ( stream_t *, int i_size );*/
+ int (*pf_read) ( stream_t *, void *p_read, int i_read );
+ int (*pf_peek) ( stream_t *, const uint8_t **pp_peek, int i_peek );
+ int (*pf_control)( stream_t *, int i_query, va_list );
+ void (*pf_destroy)( stream_t *);
+
+ stream_sys_t *p_sys;
+
+ /* UTF-16 and UTF-32 file reading */
+ vlc_iconv_t conv;
+ int i_char_width;
+ bool b_little_endian;
+};
+
+#include <libvlc.h>
+
+static inline stream_t *vlc_stream_create( vlc_object_t *obj )
+{
+ return (stream_t *)vlc_custom_create( obj, sizeof(stream_t),
+ VLC_OBJECT_GENERIC, "stream" );
+}