]> git.sesse.net Git - vlc/blob - src/stream_output/stream_output.h
41129d7deecc5d223ffa3f8f7575f81ab588910b
[vlc] / src / stream_output / stream_output.h
1 /*****************************************************************************
2  * stream_output.h : internal stream output
3  *****************************************************************************
4  * Copyright (C) 2002-2005 the VideoLAN team
5  * $Id: stream_output.h 16916 2006-10-01 16:08:37Z dionoea $
6  *
7  * Authors: Christophe Massiot <massiot@via.ecp.fr>
8  *          Laurent Aimar <fenrir@via.ecp.fr>
9  *          Eric Petit <titer@videolan.org>
10  *          Jean-Paul Saman <jpsaman #_at_# m2x.nl>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. ***************************************************************************/
25
26 #include <vlc_sout.h>
27
28 /****************************************************************************
29  * sout_packetizer_input_t: p_sout <-> p_packetizer
30  ****************************************************************************/
31 struct sout_packetizer_input_t
32 {
33     sout_instance_t     *p_sout;
34
35     es_format_t         *p_fmt;
36
37     sout_stream_id_t    *id;
38 };
39
40 #define sout_NewInstance(a,b) __sout_NewInstance(VLC_OBJECT(a),b)
41 VLC_EXPORT( sout_instance_t *,  __sout_NewInstance,  ( vlc_object_t *, char * ) );
42 VLC_EXPORT( void,               sout_DeleteInstance, ( sout_instance_t * ) );
43
44 VLC_EXPORT( sout_packetizer_input_t *, sout_InputNew,( sout_instance_t *, es_format_t * ) );
45 VLC_EXPORT( int,                sout_InputDelete,      ( sout_packetizer_input_t * ) );
46 VLC_EXPORT( int,                sout_InputSendBuffer,  ( sout_packetizer_input_t *, block_t* ) );
47
48 /* Announce system */
49
50 /* The SAP handler, running in a separate thread */
51 struct sap_handler_t
52 {
53     VLC_COMMON_MEMBERS /* needed to create a thread */
54
55     sap_session_t **pp_sessions;
56     sap_address_t **pp_addresses;
57
58     vlc_bool_t b_control;
59
60     int i_sessions;
61     int i_addresses;
62
63     int i_current_session;
64
65     int (*pf_add)  ( sap_handler_t*, session_descriptor_t *);
66     int (*pf_del)  ( sap_handler_t*, session_descriptor_t *);
67
68     /* private data, not in p_sys as there is one kind of sap_handler_t */
69 };
70
71 struct session_descriptor_t
72 {
73     char *psz_name;
74     char *psz_group;
75
76     char *description;
77     char *url; // meta URL for SAP, potentially real URL for other cases
78     char *email;
79     char *phone;
80
81     struct sockaddr_storage orig;
82     socklen_t origlen;
83     struct sockaddr_storage addr;
84     socklen_t addrlen;
85
86     int i_payload;   /* SAP Payload type */
87
88     char *psz_sdp;
89     vlc_bool_t b_rtp;
90     vlc_bool_t b_ssm;
91 };
92
93 /* The main announce handler object */
94 struct announce_handler_t
95 {
96     VLC_COMMON_MEMBERS
97
98     sap_handler_t *p_sap;
99 };
100
101 #define announce_HandlerCreate(a) __announce_HandlerCreate(VLC_OBJECT(a))
102 announce_handler_t*  __announce_HandlerCreate( vlc_object_t *);
103
104 /* Private functions for the announce handler */
105 int announce_HandlerDestroy( announce_handler_t * );
106 int announce_Register( announce_handler_t *p_announce,
107                        session_descriptor_t *p_session,
108                        announce_method_t *p_method );
109 int announce_UnRegister( announce_handler_t *p_announce,
110                          session_descriptor_t *p_session );
111
112 sap_handler_t *announce_SAPHandlerCreate( announce_handler_t *p_announce );
113 void announce_SAPHandlerDestroy( sap_handler_t *p_sap );
114
115 char *StartSDP (const char *name, const char *description, const char *url,
116                 const char *email, const char *phone,
117                 const struct sockaddr *orig, socklen_t origlen,
118                 const struct sockaddr *addr, socklen_t addrlen);
119