]> git.sesse.net Git - vlc/blobdiff - include/stream_output.h
Cleanup
[vlc] / include / stream_output.h
index 5be60619d1e7d476fa4a348a41c71b45dd02b441..1d378e891a9296e91bedc127cf6d0b573a818e55 100644 (file)
@@ -1,12 +1,13 @@
 /*****************************************************************************
  * stream_output.h : stream output module
  *****************************************************************************
- * Copyright (C) 2002 VideoLAN
+ * Copyright (C) 2002-2005 the VideoLAN team
  * $Id$
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
+ *          Jean-Paul Saman <jpsaman #_at_# m2x.nl>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,7 +21,7 @@
  *
  * 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.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -51,21 +52,6 @@ struct sout_instance_t
     sout_instance_sys_t *p_sys;
 };
 
-/****************************************************************************
- * sout_cfg_t:
- ****************************************************************************/
-struct sout_cfg_t
-{
-    sout_cfg_t  *p_next;
-
-    char        *psz_name;
-    char        *psz_value;
-};
-
-#define sout_CfgParse( a, b, c, d ) __sout_CfgParse( VLC_OBJECT(a), b, c, d )
-VLC_EXPORT( void,   __sout_CfgParse, ( vlc_object_t *, char *psz_prefix, const char **ppsz_options, sout_cfg_t * ) );
-VLC_EXPORT( char *, sout_CfgCreate, ( char **, sout_cfg_t **, char * ) );
-
 /****************************************************************************
  * sout_stream_id_t: opaque (private for all sout_stream_t)
  ****************************************************************************/
@@ -103,7 +89,11 @@ struct sout_access_out_t
     sout_instance_t         *p_sout;
 
     char                    *psz_access;
-    sout_cfg_t              *p_cfg;
+    config_chain_t              *p_cfg;
+
+    int                      i_writes;
+    int64_t                  i_sent_bytes;      ///< This is a "local" counter that is reset each
+                                                // time it is transferred to stats
 
     char                    *psz_name;
     sout_access_out_sys_t   *p_sys;
@@ -129,7 +119,7 @@ struct  sout_mux_t
     sout_instance_t     *p_sout;
 
     char                *psz_mux;
-    sout_cfg_t          *p_cfg;
+    config_chain_t          *p_cfg;
 
     sout_access_out_t   *p_access;
 
@@ -203,9 +193,12 @@ struct sout_stream_t
     sout_instance_t   *p_sout;
 
     char              *psz_name;
-    sout_cfg_t        *p_cfg;
+    config_chain_t        *p_cfg;
     char              *psz_next;
 
+    /* Subpicture unit */
+    spu_t             *p_spu;
+
     /* add, remove a stream */
     sout_stream_id_t *(*pf_add)( sout_stream_t *, es_format_t * );
     int               (*pf_del)( sout_stream_t *, sout_stream_id_t * );
@@ -245,56 +238,27 @@ struct session_descriptor_t
     int i_ttl;
     int i_payload;   /* SAP Payload type */
 
+    char *psz_group;
+
     sap_session_t *p_sap; /* If we have a sap session, remember it */
     char *psz_sdp;
+    vlc_bool_t b_rtp;
 };
 
 #define METHOD_TYPE_SAP 1
-#define METHOD_TYPE_SLP 2
 
 struct announce_method_t
 {
     int i_type;
-
-    /* For SAP */
-    int i_ip_version;
-    char *psz_ipv6_scope;
-    char *psz_address; /* If we use a custom address */
 };
 
 
-/* SAP Specific structures */
-
-/* 100ms */
-#define SAP_IDLE ((mtime_t)(0.100*CLOCK_FREQ))
-#define SAP_MAX_BUFFER 65534
-#define MIN_INTERVAL 2
-#define MAX_INTERVAL 300
-
-/* A SAP announce address. For each of these, we run the
- * control flow algorithm */
-struct sap_address_t
-{
-    char *psz_address;
-    int i_port;
-    int i_rfd; /* Read socket */
-    int i_wfd; /* Write socket */
-
-    /* Used for flow control */
-    mtime_t t1;
-    vlc_bool_t b_enabled;
-    vlc_bool_t b_ready;
-    int i_interval;
-    int i_buff;
-    int i_limit;
-};
-
 /* A SAP session descriptor, enqueued in the SAP handler queue */
 struct sap_session_t
 {
     char          *psz_sdp;
-    char          *psz_data;
-    int            i_length;
+    uint8_t       *psz_data;
+    unsigned      i_length;
     sap_address_t *p_address;
 
     /* Last and next send */
@@ -317,8 +281,10 @@ struct sap_handler_t
 
     int i_current_session;
 
-    int (*pf_add)  ( sap_handler_t*, session_descriptor_t *,announce_method_t*);
+    int (*pf_add)  ( sap_handler_t*, session_descriptor_t *);
     int (*pf_del)  ( sap_handler_t*, session_descriptor_t *);
+
+    /* private data, not in p_sys as there is one kind of sap_handler_t */
 };
 
 /* The main announce handler object */
@@ -331,38 +297,12 @@ struct announce_handler_t
 
 /* End */
 
-
-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 ) )
-    {
-        p_cfg = p_cfg->p_next;
-    }
-
-    return p_cfg;
-}
-
-static inline char *sout_cfg_find_value( sout_cfg_t *p_cfg, char *psz_name )
-{
-    while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) )
-    {
-        p_cfg = p_cfg->p_next;
-    }
-
-    if( p_cfg && p_cfg->psz_value )
-    {
-        return( p_cfg->psz_value );
-    }
-
-    return NULL;
-}
-
 /* Announce system */
 VLC_EXPORT( int,                sout_AnnounceRegister, (sout_instance_t *,session_descriptor_t*, announce_method_t* ) );
-VLC_EXPORT(session_descriptor_t*,sout_AnnounceRegisterSDP, (sout_instance_t *,char *, announce_method_t* ) );
+VLC_EXPORT(session_descriptor_t*,sout_AnnounceRegisterSDP, (sout_instance_t *,const char *, const char *, announce_method_t* ) );
 VLC_EXPORT( int,                sout_AnnounceUnRegister, (sout_instance_t *,session_descriptor_t* ) );
 
-VLC_EXPORT(session_descriptor_t*,sout_AnnounceSessionCreate, () );
+VLC_EXPORT(session_descriptor_t*,sout_AnnounceSessionCreate, (void) );
 VLC_EXPORT(void,                 sout_AnnounceSessionDestroy, (session_descriptor_t *) );
 VLC_EXPORT(announce_method_t*,   sout_AnnounceMethodCreate, (int) );