]> git.sesse.net Git - vlc/blobdiff - include/stream_output.h
* modules/packetizer/mpegvideo.c: Correctly flag the picture types in
[vlc] / include / stream_output.h
index f3857070dd36b88ee11f1a45773f4a5e141b047f..dc0c894884316bca3469677d14dcadaa6d5eb42c 100644 (file)
@@ -2,7 +2,7 @@
  * stream_output.h : stream output module
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: stream_output.h,v 1.11 2003/07/31 19:14:59 fenrir Exp $
+ * $Id: stream_output.h,v 1.21 2004/02/22 16:08:47 fenrir Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -27,6 +27,8 @@
  * sout_instance_t: stream output thread descriptor
  *****************************************************************************/
 
+#include "vlc_es.h"
+
 /*
  * i_allocated_size: size of allocated buffer
  * p_allocated_buffer: where data has been allocated
@@ -64,26 +66,6 @@ struct sout_buffer_t
     struct sout_buffer_t    *p_next;
 };
 
-struct sout_format_t
-{
-    int             i_cat;
-    vlc_fourcc_t    i_fourcc;
-
-    /* audio */
-    int             i_sample_rate;
-    int             i_channels;
-    int             i_block_align;
-
-    /* video */
-    int             i_width;
-    int             i_height;
-
-    int             i_bitrate;
-    int             i_extra_data;
-    uint8_t         *p_extra_data;
-
-};
-
 struct sout_fifo_t
 {
     vlc_mutex_t         lock;                         /* fifo data lock */
@@ -101,7 +83,7 @@ struct sout_input_t
 {
     sout_instance_t *p_sout;
 
-    sout_format_t   *p_fmt;
+    es_format_t     *p_fmt;
     sout_fifo_t     *p_fifo;
 
     void            *p_sys;
@@ -113,7 +95,7 @@ struct sout_packetizer_input_t
 
     sout_instance_t     *p_sout;
 
-    sout_format_t       *p_fmt;
+    es_format_t         *p_fmt;
 
     sout_stream_id_t    *id;
 };
@@ -139,9 +121,12 @@ struct sout_access_out_t
     sout_access_out_sys_t   *p_sys;
     int                     (* pf_seek  )( sout_access_out_t *,
                                            off_t );
+    int                     (* pf_read  )( sout_access_out_t *,
+                                           sout_buffer_t * );
     int                     (* pf_write )( sout_access_out_t *,
                                            sout_buffer_t * );
 };
+
 /*
  * i_query parameter of pf_mux_capacity
  */
@@ -149,6 +134,9 @@ struct sout_access_out_t
 #define SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME    0x01
 /* SOUT_MUX_CAP_GET_STREAMABLE:             p_args=NULL, p_answer=&boolean */
 #define SOUT_MUX_CAP_GET_STREAMABLE             0x02
+/* SOUT_MUX_CAP_GET_ADD_STREAM_WAIT:        p_args=NULL, p_answer=&boolean */
+#define SOUT_MUX_CAP_GET_ADD_STREAM_WAIT        0x03
+
 /*
  * return error code
  */
@@ -187,8 +175,10 @@ struct  sout_mux_t
     /* mux private */
     sout_mux_sys_t          *p_sys;
 
-//    /* creater private */
-//    void                    *p_sys_owner;
+#if 0
+    /* creater private */
+    void                    *p_sys_owner;
+#endif
 
     /* XXX private to stream_output.c */
     /* if muxer doesn't support adding stream at any time then we first wait
@@ -222,7 +212,7 @@ struct sout_stream_t
     char                    *psz_next;
 
     /* add, remove a stream */
-    sout_stream_id_t *      (*pf_add) ( sout_stream_t *, sout_format_t * );
+    sout_stream_id_t *      (*pf_add) ( sout_stream_t *, es_format_t * );
     int                     (*pf_del) ( sout_stream_t *, sout_stream_id_t * );
 
     /* manage a packet */
@@ -243,6 +233,8 @@ struct sout_instance_t
     /* muxer data */
     int                     i_preheader;    /* max over all muxer */
 
+    int                     i_padding;      /* needed by some decoders */
+
     vlc_mutex_t             lock;
     sout_stream_t           *p_stream;
 
@@ -250,54 +242,6 @@ struct sout_instance_t
     sout_instance_sys_t     *p_sys;
 };
 
-/* some macro */
-#define TAB_APPEND( count, tab, p )             \
-    if( (count) > 0 )                           \
-    {                                           \
-        (tab) = realloc( (tab), sizeof( void ** ) * ( (count) + 1 ) ); \
-    }                                           \
-    else                                        \
-    {                                           \
-        (tab) = malloc( sizeof( void ** ) );    \
-    }                                           \
-    (void**)(tab)[(count)] = (void*)(p);        \
-    (count)++
-
-#define TAB_FIND( count, tab, p, index )        \
-    {                                           \
-        int _i_;                                \
-        (index) = -1;                           \
-        for( _i_ = 0; _i_ < (count); _i_++ )    \
-        {                                       \
-            if((void**)(tab)[_i_]==(void*)(p))  \
-            {                                   \
-                (index) = _i_;                  \
-                break;                          \
-            }                                   \
-        }                                       \
-    }
-
-#define TAB_REMOVE( count, tab, p )             \
-    {                                           \
-        int i_index;                            \
-        TAB_FIND( count, tab, p, i_index );     \
-        if( i_index >= 0 )                      \
-        {                                       \
-            if( count > 1 )                     \
-            {                                   \
-                memmove( ((void**)tab + i_index),    \
-                         ((void**)tab + i_index+1),  \
-                         ( (count) - i_index - 1 ) * sizeof( void* ) );\
-            }                                   \
-            else                                \
-            {                                   \
-                free( tab );                    \
-                (tab) = NULL;                   \
-            }                                   \
-            (count)--;                          \
-        }                                       \
-    }
-
 static inline sout_cfg_t *sout_cfg_find( sout_cfg_t *p_cfg, char *psz_name )
 {
     while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) )
@@ -338,8 +282,7 @@ VLC_EXPORT( sout_buffer_t *, sout_FifoGet,        ( sout_fifo_t * ) );
 VLC_EXPORT( sout_buffer_t *, sout_FifoShow,       ( sout_fifo_t * ) );
 
 
-#define sout_InputNew( a, b ) __sout_InputNew( VLC_OBJECT(a), b )
-VLC_EXPORT( sout_packetizer_input_t *, __sout_InputNew,       ( vlc_object_t *, sout_format_t * ) );
+VLC_EXPORT( sout_packetizer_input_t *, sout_InputNew,( sout_instance_t *, es_format_t * ) );
 VLC_EXPORT( int,            sout_InputDelete,      ( sout_packetizer_input_t * ) );
 VLC_EXPORT( int,            sout_InputSendBuffer,  ( sout_packetizer_input_t *, sout_buffer_t* ) );
 
@@ -353,10 +296,11 @@ VLC_EXPORT( void,           sout_BufferChain,  ( sout_buffer_t **, sout_buffer_t
 VLC_EXPORT( sout_access_out_t *, sout_AccessOutNew, ( sout_instance_t *, char *psz_access, char *psz_name ) );
 VLC_EXPORT( void,                sout_AccessOutDelete, ( sout_access_out_t * ) );
 VLC_EXPORT( int,                 sout_AccessOutSeek,   ( sout_access_out_t *, off_t ) );
+VLC_EXPORT( int,                 sout_AccessOutRead,   ( sout_access_out_t *, sout_buffer_t * ) );
 VLC_EXPORT( int,                 sout_AccessOutWrite,  ( sout_access_out_t *, sout_buffer_t * ) );
 
 VLC_EXPORT( sout_mux_t *,       sout_MuxNew,          ( sout_instance_t*, char *, sout_access_out_t * ) );
-VLC_EXPORT( sout_input_t *,     sout_MuxAddStream,    ( sout_mux_t *, sout_format_t * ) );
+VLC_EXPORT( sout_input_t *,     sout_MuxAddStream,    ( sout_mux_t *, es_format_t * ) );
 VLC_EXPORT( void,               sout_MuxDeleteStream, ( sout_mux_t *, sout_input_t * ) );
 VLC_EXPORT( void,               sout_MuxDelete,       ( sout_mux_t * ) );
 VLC_EXPORT( void,               sout_MuxSendBuffer, ( sout_mux_t *, sout_input_t  *, sout_buffer_t * ) );