]> git.sesse.net Git - vlc/blobdiff - include/vlc_stream.h
Create a modules-like directory for libraries
[vlc] / include / vlc_stream.h
index c6b85ff525d8ceb2b1d75705eae7ef2d99f8255a..6f02e8b5cbb436620f9be7120519029b3b4f8a6b 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * vlc_stream.h
+ * vlc_stream.h: Stream (between access and demux) descriptor and methods
  *****************************************************************************
  * Copyright (C) 1999-2004 the VideoLAN team
  * $Id$
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#if !defined( __LIBVLC__ )
+  #error You are not libvlc or one of its plugins. You cannot include this file
+#endif
+
 #ifndef _VLC_STREAM_H
 #define _VLC_STREAM_H 1
 
+#include <vlc_block.h>
+
 # ifdef __cplusplus
 extern "C" {
 # endif
@@ -54,8 +60,8 @@ enum stream_query_e
 
     /* Special for direct access control from demuxer.
      * XXX: avoid using it by all means */
-    STREAM_CONTROL_ACCESS,      /* arg1= int i_access_query, args   res: can fail
-                                   if access unreachable or access control answer */
+    STREAM_CONTROL_ACCESS   /* arg1= int i_access_query, args   res: can fail
+                             if access unreachable or access control answer */
 };
 
 /**
@@ -72,6 +78,11 @@ struct stream_t
     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;
+    vlc_bool_t      b_little_endian;
 };
 
 /**
@@ -123,6 +134,9 @@ static inline int stream_Control( stream_t *s, int i_query, ... )
     va_list args;
     int     i_result;
 
+    if ( s == NULL )
+        return VLC_EGENERIC;
+
     va_start( args, i_query );
     i_result = s->pf_control( s, i_query, args );
     va_end( args );
@@ -195,7 +209,7 @@ VLC_EXPORT( char *, stream_ReadLine, ( stream_t * ) );
  * Create a special stream and a demuxer, this allows chaining demuxers
  */
 #define stream_DemuxNew( a, b, c ) __stream_DemuxNew( VLC_OBJECT(a), b, c)
-VLC_EXPORT( stream_t *,__stream_DemuxNew, ( vlc_object_t *p_obj, char *psz_demux, es_out_t *out ) );
+VLC_EXPORT( stream_t *,__stream_DemuxNew, ( vlc_object_t *p_obj, const char *psz_demux, es_out_t *out ) );
 VLC_EXPORT( void,      stream_DemuxSend,  ( stream_t *s, block_t *p_block ) );
 VLC_EXPORT( void,      stream_DemuxDelete,( stream_t *s ) );