Update after filrs added and renamed
[vlc.git] / include / vlc_streaming.h
blobfa08252ba8ee8752f5a98d041228eef7a63ee897
1 /*****************************************************************************
2 * vlc_streaming.h: Methods and descriptions for Streaming profiles
3 *****************************************************************************
4 * Copyright (C) 2002-2005 the VideoLAN team
5 * $Id$
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #if !defined( __LIBVLC__ )
25 #error You are not libvlc or one of its plugins. You cannot include this file
26 #endif
28 #ifndef _VLC_STREAMING_H_
29 #define _VLC_STREAMING_H_
31 #include <vlc/vlc.h>
33 /***********************************************************************
34 * Predefined lists of streaming data
35 ***********************************************************************/
37 #ifdef WIN32
38 #define VCODECS_NUMBER 13
39 #else
40 #define VCODECS_NUMBER 12
41 #endif
43 #define ACODECS_NUMBER 9
45 /// Keep this up to date !
46 #define MUXERS_NUMBER 10
47 enum
49 MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_RAW,
50 MUX_ASF, MUX_AVI, MUX_MP4, MUX_MOV, MUX_WAV,
53 enum { ACCESS_HTTP, ACCESS_UDP, ACCESS_MMS, ACCESS_RTP, ACCESS_FILE };
55 struct codec_desc_t {
56 char *psz_display;
57 char *psz_codec;
58 char *psz_descr;
59 int muxers[MUXERS_NUMBER];
61 //extern const struct codec vcodecs_array[];
62 //extern const struct codec acodecs_array[];
64 struct method_desc_t {
65 char *psz_access;
66 char *psz_method;
67 char *psz_descr;
68 char *psz_address;
69 int muxers[MUXERS_NUMBER];
71 //xtern const struct method methods_array[];
73 struct mux_desc_t {
74 int id;
75 char *psz_mux;
76 char *psz_encap;
77 char *psz_descr;
79 //extern const struct mux_desc_t muxers_array[];
82 /* Standard bitrates arrays */
83 //static const char * vbitrates_array[] =
84 //{ "3072", "2048", "1024", "768", "512", "384", "256", "192", "128", "96",
85 // "64" };
87 //static const char *abitrates_array[] =
88 //{ "512", "256", "192", "128", "96", "64", "32", "16" } ;
92 /***********************************************************************
93 * Streaming profiles
94 ***********************************************************************/
96 /****************** Parameters handling *********************/
97 struct sout_param_t
99 int i_type;
100 int i_element;
101 char *psz_id;
102 char *psz_string;
103 vlc_value_t value;
106 struct sout_pcat_t
108 char *psz_name;
109 int i_params;
110 sout_param_t **pp_params;
113 void streaming_ParameterApply( sout_param_t *p_param, char **ppsz_dest,
114 int *pi_dest, float *pf_dest, vlc_bool_t *pb_dest );
117 /******** Module types definitions and parametrable elements ***************/
119 /* Transcode */
120 enum { I_VB, I_AB, I_CHANNELS, F_SCALE, B_SOVERLAY, PSZ_VC, PSZ_AC, PSZ_SC,
121 PSZ_VE, PSZ_AE };
122 struct sout_transcode_t
124 int32_t i_vb;
125 int32_t i_ab;
126 int32_t i_channels;
127 float f_scale;
128 vlc_bool_t b_soverlay;
129 char *psz_vcodec;
130 char *psz_acodec;
131 char *psz_scodec;
132 char *psz_venc;
133 char *psz_aenc;
134 char *psz_additional;
136 int32_t i_params;
137 sout_param_t **pp_params;
139 void streaming_TranscodeParametersApply( sout_transcode_t *p_module );
141 /* Standard */
142 enum { PSZ_MUX, PSZ_ACCESS, PSZ_URL, PSZ_NAME, PSZ_GROUP };
143 struct sout_std_t
145 char *psz_mux;
146 char *psz_access;
147 char *psz_url;
148 char *psz_name;
149 char *psz_group;
150 int i_params;
151 sout_param_t **pp_params;
153 void streaming_StdParametersApply( sout_std_t *p_module );
155 /* Display */
156 struct sout_display_t
160 /* Duplicate */
161 struct sout_duplicate_t
163 int i_children;
164 int i_conditions;
165 sout_chain_t **pp_children;
166 char **ppsz_conditions;
169 /******* Generic profile structures and manipulation functions ********/
170 typedef union
172 sout_transcode_t *p_transcode;
173 sout_std_t *p_std;
174 sout_duplicate_t *p_duplicate;
175 sout_display_t *p_display;
176 } sout_module_type_t;
178 struct sout_module_t
180 int i_type;
181 sout_module_type_t typed;
182 sout_module_t *p_parent;
185 enum { SOUT_MOD_TRANSCODE, SOUT_MOD_STD, SOUT_MOD_RTP, SOUT_MOD_DUPLICATE,
186 SOUT_MOD_DISPLAY };
188 struct sout_chain_t
190 int i_modules;
191 sout_module_t **pp_modules;
193 int i_options;
194 char **ppsz_options;
196 int i_pcats;
197 sout_pcat_t **pp_pcats;
200 static inline sout_chain_t *streaming_ChainNew(void)
202 DECMALLOC_NULL( p_chain, sout_chain_t );
203 memset( p_chain, 0, sizeof( sout_chain_t ) );
204 p_chain->i_options = 0;
205 return p_chain;
208 struct streaming_profile_t
210 char *psz_title;
211 char *psz_description;
212 sout_chain_t *p_chain;
215 /** struct for holding account information needed to access the services */
216 struct streaming_account_t
218 char *psz_username; /*< username of account */
219 char *psz_password; /*< password of account */
222 /**************** GUI interaction *****************/
223 /** struct to hold user interface information */
224 struct sout_gui_descr_t
226 /* Access types */
227 vlc_bool_t b_local; /*< local access module */
228 vlc_bool_t b_file; /*< file access module */
229 vlc_bool_t b_http; /*< http access module */
230 vlc_bool_t b_mms; /*< mms access module */
231 vlc_bool_t b_rtp; /*< rtp access module */
232 vlc_bool_t b_udp; /*< udp access module */
233 vlc_bool_t b_dump; /*< dump access module */
234 vlc_bool_t b_icecast; /*< icecast access module */
236 char *psz_file; /*< filename */
237 char *psz_http; /*< HTTP servername or ipaddress */
238 char *psz_mms; /*< MMS servername or ipaddress */
239 char *psz_rtp; /*< RTP servername or ipaddress */
240 char *psz_udp; /*< UDP servername or ipaddress */
241 char *psz_icecast; /*< Icecast servername or ipaddress*/
243 int32_t i_http; /*< http port number */
244 int32_t i_mms; /*< mms port number */
245 int32_t i_rtp; /*< rtp port number */
246 int32_t i_udp; /*< udp port number */
247 int32_t i_icecast; /*< icecast port number */
249 /* Mux */
250 char *psz_mux; /*< name of muxer to use in streaming */
252 /* Transcode */
253 vlc_bool_t b_soverlay; /*< enable burning overlay in the video */
254 char *psz_vcodec; /*< video codec to use in transcoding */
255 char *psz_acodec; /*< audio codec to use in transcoding */
256 char *psz_scodec; /*< subtitle codec to use in transcoding */
257 int32_t i_vb; /*< video bitrate to use in transcoding */
258 int32_t i_ab; /*< audio bitrate to use in transcoding */
259 int32_t i_channels; /*< number of audio channels to use in transcoding */
260 float f_scale; /*< scaling factor to use in transcoding */
262 /* Misc */
263 vlc_bool_t b_sap; /*< send SAP announcement */
264 vlc_bool_t b_all_es;/*< send all elementary streams from source stream */
265 char *psz_group; /*< SAP Group name */
266 char *psz_name; /*< SAP name */
267 int32_t i_ttl; /*< Time To Live (TTL) for network traversal */
269 /* Icecast */
270 char *psz_icecast_mountpoint;/*< path to Icecast mountpoint */
271 struct streaming_account_t sa_icecast; /*< Icecast account information */
274 VLC_EXPORT(void, streaming_GuiDescToChain,(vlc_object_t*, sout_chain_t*, sout_gui_descr_t*));
275 VLC_EXPORT(char*, streaming_ChainToPsz,(sout_chain_t*));
277 /***************** Profile parsing ***********************/
279 struct profile_parser_t
281 char *psz_profile;
282 streaming_profile_t *p_profile;
285 #endif