Changeset 4dec9682f6b5b0b6ed2d5187f4652cb680f39000
- Timestamp:
- 13/04/03 22:00:21 (5 years ago)
- git-parent:
- Files:
-
- configure.ac.in (modified) (5 diffs)
- include/input_ext-intf.h (modified) (2 diffs)
- include/stream_output.h (modified) (9 diffs)
- include/vlc_common.h (modified) (2 diffs)
- modules/Makefile.am (modified) (1 diff)
- modules/mux/avi.c (modified) (7 diffs)
- modules/mux/mpeg/ps.c (modified) (3 diffs)
- modules/mux/mpeg/ts.c (modified) (5 diffs)
- modules/mux/ogg.c (modified) (7 diffs)
- modules/packetizer/a52.c (modified) (4 diffs)
- modules/packetizer/copy.c (modified) (7 diffs)
- modules/packetizer/mpeg4audio.c (modified) (4 diffs)
- modules/packetizer/mpeg4video.c (modified) (8 diffs)
- modules/packetizer/mpegaudio.c (modified) (4 diffs)
- modules/packetizer/mpegvideo.c (modified) (8 diffs)
- modules/stream_out/Modules.am (added)
- modules/stream_out/display.c (added)
- modules/stream_out/dummy.c (added)
- modules/stream_out/duplicate.c (added)
- modules/stream_out/es.c (added)
- modules/stream_out/standard.c (added)
- modules/stream_out/transcode.c (added)
- src/input/input_dec.c (modified) (4 diffs)
- src/input/input_programs.c (modified) (2 diffs)
- src/stream_output/stream_output.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
configure.ac.in
rf3bcd92 r4dec968 335 335 AC_CHECK_LIB(m,pow, 336 336 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lm" 337 LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -lm" 337 338 LDFLAGS_imdct="${LDFLAGS_imdct} -lm" 338 339 LDFLAGS_imdct3dn="${LDFLAGS_imdct3dn} -lm" … … 1018 1019 PLUGINS="${PLUGINS} packetizer_copy" 1019 1020 1020 PLUGINS="${PLUGINS} vout_encoder" 1021 PLUGINS="${PLUGINS} stream_out_dummy stream_out_standard stream_out_es" 1022 PLUGINS="${PLUGINS} stream_out_duplicate stream_out_display" 1021 1023 1022 1024 dnl Ogg/ogm … … 1511 1513 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/ffmpeg" 1512 1514 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib" 1515 1516 CPPFLAGS_stream_out_transcode="${CPPFLAGS_stream_out_transcode} -I${with_ffmpeg}/include/ffmpeg" 1517 LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -L${with_ffmpeg}/lib" 1518 1513 1519 fi 1514 1520 … … 1539 1545 dnl Use a custom libffmpeg 1540 1546 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a) 1541 BUILTINS="${BUILTINS} ffmpeg "1547 BUILTINS="${BUILTINS} ffmpeg stream_out_transcode" 1542 1548 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${real_ffmpeg_tree}/libavcodec -lavcodec" 1543 1549 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec" 1550 1551 LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -L${real_ffmpeg_tree}/libavcodec -lavcodec" 1552 CPPFLAGS_stream_out_transcode="${CPPFLAGS_stream_out_transcode} -I${real_ffmpeg_tree}/libavcodec" 1553 1544 1554 else 1545 1555 dnl The given libavcodec wasn't built … … 1551 1561 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}" 1552 1562 AC_CHECK_LIB(avcodec, avcodec_init, [ 1553 BUILTINS="${BUILTINS} ffmpeg" 1554 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" ], 1563 BUILTINS="${BUILTINS} ffmpeg stream_out_transcode" 1564 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" 1565 LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -lavcodec" ], 1555 1566 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ]) 1556 1567 LDFLAGS="${LDFLAGS_save}" include/input_ext-intf.h
r607b74b r4dec968 5 5 ***************************************************************************** 6 6 * Copyright (C) 1999, 2000 VideoLAN 7 * $Id: input_ext-intf.h,v 1.8 7 2003/03/24 17:15:29 gbazinExp $7 * $Id: input_ext-intf.h,v 1.88 2003/04/13 20:00:20 fenrir Exp $ 8 8 * 9 9 * Authors: Christophe Massiot <massiot@via.ecp.fr> … … 72 72 count_t c_packets; /* total packets read */ 73 73 count_t c_invalid_packets; /* invalid packets read */ 74 75 /* XXX hack: to force a decoder instead of mode based on sout */ 76 vlc_bool_t b_force_decoder; 74 77 }; 75 78 include/stream_output.h
r949a4ce r4dec968 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002 VideoLAN 5 * $Id: stream_output.h,v 1. 9 2003/03/11 19:02:30 fenrir Exp $5 * $Id: stream_output.h,v 1.10 2003/04/13 20:00:20 fenrir Exp $ 6 6 * 7 7 * Authors: Christophe Massiot <massiot@via.ecp.fr> … … 58 58 }; 59 59 60 struct sout_ packet_format_t61 { 62 int i_cat; // AUDIO_ES, VIDEO_ES, SPU_ES60 struct sout_format_t 61 { 62 int i_cat; 63 63 vlc_fourcc_t i_fourcc; 64 64 65 void *p_format; // WAVEFORMATEX or BITMAPINFOHEADER 65 /* audio */ 66 int i_sample_rate; 67 int i_channels; 68 int i_block_align; 69 70 /* video */ 71 int i_width; 72 int i_height; 73 74 int i_bitrate; 75 int i_extra_data; 76 uint8_t *p_extra_data; 77 66 78 }; 67 79 … … 76 88 }; 77 89 90 typedef struct sout_stream_id_t sout_stream_id_t; 91 78 92 /* for mux */ 79 93 struct sout_input_t 80 94 { 81 // vlc_mutex_t lock; 82 83 sout_instance_t *p_sout; 84 85 sout_packet_format_t input_format; 86 sout_fifo_t *p_fifo; 87 88 void *p_sys; 89 }; 90 91 /* for packetizr */ 95 sout_instance_t *p_sout; 96 97 sout_format_t *p_fmt; 98 sout_fifo_t *p_fifo; 99 100 void *p_sys; 101 }; 102 103 /* for packetizer */ 92 104 struct sout_packetizer_input_t 93 105 { 94 106 95 sout_instance_t *p_sout; 96 sout_packet_format_t input_format; 97 98 // vlc_mutex_t lock; 99 int i_nb_inputs; 100 sout_input_t **pp_inputs; 101 102 int i_nb_mux; // not really used, just usefull with TAB_* 103 sout_mux_t **pp_mux; 104 105 }; 107 sout_instance_t *p_sout; 108 109 sout_format_t *p_fmt; 110 111 sout_stream_id_t *id; 112 }; 113 106 114 107 115 #define SOUT_METHOD_NONE 0x00 … … 109 117 #define SOUT_METHOD_NETWORK 0x20 110 118 119 typedef struct sout_access_out_sys_t sout_access_out_sys_t; 111 120 struct sout_access_out_t 112 121 { … … 181 190 }; 182 191 192 193 194 struct sout_cfg_t 195 { 196 sout_cfg_t *p_next; 197 198 char *psz_name; 199 char *psz_value; 200 }; 201 202 typedef struct sout_stream_sys_t sout_stream_sys_t; 203 struct sout_stream_t 204 { 205 VLC_COMMON_MEMBERS 206 207 module_t *p_module; 208 sout_instance_t *p_sout; 209 210 char *psz_name; 211 sout_cfg_t *p_cfg; 212 char *psz_next; 213 214 /* add, remove a stream */ 215 sout_stream_id_t * (*pf_add) ( sout_stream_t *, sout_format_t * ); 216 int (*pf_del) ( sout_stream_t *, sout_stream_id_t * ); 217 218 /* manage a packet */ 219 int (*pf_send)( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* ); 220 221 /* private */ 222 sout_stream_sys_t *p_sys; 223 }; 224 183 225 typedef struct sout_instance_sys_t sout_instance_sys_t; 184 226 struct sout_instance_t … … 186 228 VLC_COMMON_MEMBERS 187 229 188 /* complete sout string like udp/ts:239.255.12.42#file/ps://essai.ps */189 230 char * psz_sout; 190 191 /* here are stored the parsed psz_sout */ 192 int i_nb_dest; 193 char **ppsz_dest; 231 char * psz_chain; 194 232 195 233 /* muxer data */ 196 234 int i_preheader; /* max over all muxer */ 197 235 198 int i_nb_mux;199 sout_mux_t **pp_mux;200 201 /* here are all packetizer inputs accepted by at least one muxer */202 236 vlc_mutex_t lock; 203 int i_nb_inputs; 204 sout_packetizer_input_t **pp_inputs; 237 sout_stream_t *p_stream; 205 238 206 239 /* sout private */ … … 208 241 }; 209 242 210 211 212 243 /* some macro */ 244 #define TAB_APPEND( count, tab, p ) \ 245 if( (count) > 0 ) \ 246 { \ 247 (tab) = realloc( (tab), sizeof( void ** ) * ( (count) + 1 ) ); \ 248 } \ 249 else \ 250 { \ 251 (tab) = malloc( sizeof( void ** ) ); \ 252 } \ 253 (void**)(tab)[(count)] = (void*)(p); \ 254 (count)++ 255 256 #define TAB_FIND( count, tab, p, index ) \ 257 { \ 258 int _i_; \ 259 (index) = -1; \ 260 for( _i_ = 0; _i_ < (count); _i_++ ) \ 261 { \ 262 if((void**)(tab)[_i_]==(void*)(p)) \ 263 { \ 264 (index) = _i_; \ 265 break; \ 266 } \ 267 } \ 268 } 269 270 #define TAB_REMOVE( count, tab, p ) \ 271 { \ 272 int i_index; \ 273 TAB_FIND( count, tab, p, i_index ); \ 274 if( i_index >= 0 ) \ 275 { \ 276 if( count > 1 ) \ 277 { \ 278 memmove( ((void**)tab + i_index), \ 279 ((void**)tab + i_index+1), \ 280 ( (count) - i_index - 1 ) * sizeof( void* ) );\ 281 } \ 282 else \ 283 { \ 284 free( tab ); \ 285 (tab) = NULL; \ 286 } \ 287 (count)--; \ 288 } \ 289 } 290 291 static inline sout_cfg_t *sout_cfg_find( sout_cfg_t *p_cfg, char *psz_name ) 292 { 293 while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) ) 294 { 295 p_cfg = p_cfg->p_next; 296 } 297 298 return p_cfg; 299 } 300 301 static inline char *sout_cfg_find_value( sout_cfg_t *p_cfg, char *psz_name ) 302 { 303 while( p_cfg && strcmp( p_cfg->psz_name, psz_name ) ) 304 { 305 p_cfg = p_cfg->p_next; 306 } 307 308 if( p_cfg && p_cfg->psz_value ) 309 { 310 return( p_cfg->psz_value ); 311 } 312 313 return NULL; 314 } 213 315 /***************************************************************************** 214 316 * Prototypes … … 228 330 229 331 #define sout_InputNew( a, b ) __sout_InputNew( VLC_OBJECT(a), b ) 230 VLC_EXPORT( sout_packetizer_input_t *, __sout_InputNew, ( vlc_object_t *, sout_ packet_format_t * ) );332 VLC_EXPORT( sout_packetizer_input_t *, __sout_InputNew, ( vlc_object_t *, sout_format_t * ) ); 231 333 VLC_EXPORT( int, sout_InputDelete, ( sout_packetizer_input_t * ) ); 232 334 VLC_EXPORT( int, sout_InputSendBuffer, ( sout_packetizer_input_t *, sout_buffer_t* ) ); … … 244 346 VLC_EXPORT( int, sout_AccessOutWrite, ( sout_access_out_t *, sout_buffer_t * ) ); 245 347 348 VLC_EXPORT( sout_mux_t *, sout_MuxNew, ( sout_instance_t*, char *, sout_access_out_t * ) ); 349 VLC_EXPORT( sout_input_t *, sout_MuxAddStream, ( sout_mux_t *, sout_format_t * ) ); 350 VLC_EXPORT( void, sout_MuxDeleteStream, ( sout_mux_t *, sout_input_t * ) ); 351 VLC_EXPORT( void, sout_MuxDelete, ( sout_mux_t * ) ); 352 VLC_EXPORT( void, sout_MuxSendBuffer, ( sout_mux_t *, sout_input_t *, sout_buffer_t * ) ); 353 354 VLC_EXPORT( char *, sout_cfg_parser, ( char **, sout_cfg_t **, char * ) ); 355 VLC_EXPORT( sout_stream_t *, sout_stream_new, ( sout_instance_t *, char *psz_chain ) ); 356 VLC_EXPORT( void, sout_stream_delete, ( sout_stream_t *p_stream ) ); 357 include/vlc_common.h
r2b013d3 r4dec968 4 4 ***************************************************************************** 5 5 * Copyright (C) 1998, 1999, 2000 VideoLAN 6 * $Id: vlc_common.h,v 1. 59 2003/03/17 18:02:11 samExp $6 * $Id: vlc_common.h,v 1.60 2003/04/13 20:00:20 fenrir Exp $ 7 7 * 8 8 * Authors: Samuel Hocevar <sam@via.ecp.fr> … … 250 250 typedef struct sout_packetizer_input_t sout_packetizer_input_t; 251 251 typedef struct sout_buffer_t sout_buffer_t; 252 typedef struct sout_packet_format_t sout_packet_format_t;253 252 typedef struct sout_access_out_t sout_access_out_t; 254 253 typedef struct sout_mux_t sout_mux_t; 255 typedef struct sout_access_out_sys_t sout_access_out_sys_t; 256 254 typedef struct sout_stream_t sout_stream_t; 255 typedef struct sout_cfg_t sout_cfg_t; 256 typedef struct sout_format_t sout_format_t; 257 257 /* Decoders */ 258 258 typedef struct decoder_fifo_t decoder_fifo_t; modules/Makefile.am
ra64501f r4dec968 63 63 mux/mpeg/Modules.am \ 64 64 packetizer/Modules.am \ 65 stream_out/Modules.am \ 65 66 video_chroma/Modules.am \ 66 67 video_filter/Modules.am \ modules/mux/avi.c
r8c1b605 r4dec968 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001, 2002 VideoLAN 5 * $Id: avi.c,v 1.1 1 2003/03/31 03:46:11 fenrir Exp $5 * $Id: avi.c,v 1.12 2003/04/13 20:00:21 fenrir Exp $ 6 6 * 7 7 * Authors: Laurent Aimar <fenrir@via.ecp.fr> … … 232 232 (uint64_t)p_stream->i_duration; 233 233 } 234 msg_ Err( p_mux, "stream[%d] duration:%lld totalsize:%lld frames:%d fps:%f kb/s:%d",235 i_stream,236 (int64_t)p_stream->i_duration / (int64_t)1000000,237 p_stream->i_totalsize,238 p_stream->i_frames,239 p_stream->f_fps, p_stream->i_bitrate/1024 );234 msg_Info( p_mux, "stream[%d] duration:%lld totalsize:%lld frames:%d fps:%f kb/s:%d", 235 i_stream, 236 (int64_t)p_stream->i_duration / (int64_t)1000000, 237 p_stream->i_totalsize, 238 p_stream->i_frames, 239 p_stream->f_fps, p_stream->i_bitrate/1024 ); 240 240 } 241 241 … … 267 267 return( -1 ); 268 268 } 269 if( p_input->input_format.p_format == NULL )270 {271 msg_Err( p_mux, "stream descriptor missing" );272 return( -1 );273 }274 269 275 270 msg_Dbg( p_mux, "adding input" ); … … 279 274 p_stream = &p_sys->stream[p_sys->i_streams]; 280 275 281 switch( p_input-> input_format.i_cat )276 switch( p_input->p_fmt->i_cat ) 282 277 { 283 278 case AUDIO_ES: 284 { 285 WAVEFORMATEX *p_wf = 286 (WAVEFORMATEX*)p_input->input_format.p_format; 287 288 p_stream->i_cat = AUDIO_ES; 289 p_stream->fcc[0] = '0' + p_sys->i_streams / 10; 290 p_stream->fcc[1] = '0' + p_sys->i_streams % 10; 291 p_stream->fcc[2] = 'w'; 292 p_stream->fcc[3] = 'b'; 293 294 p_stream->p_bih = NULL; 295 p_stream->p_wf = malloc( sizeof( WAVEFORMATEX ) + p_wf->cbSize ); 296 memcpy( p_stream->p_wf, 297 p_wf, 298 sizeof( WAVEFORMATEX ) + p_wf->cbSize); 299 } 279 p_stream->i_cat = AUDIO_ES; 280 p_stream->fcc[0] = '0' + p_sys->i_streams / 10; 281 p_stream->fcc[1] = '0' + p_sys->i_streams % 10; 282 p_stream->fcc[2] = 'w'; 283 p_stream->fcc[3] = 'b'; 284 285 p_stream->p_bih = NULL; 286 287 p_stream->p_wf = malloc( sizeof( WAVEFORMATEX ) + p_input->p_fmt->i_extra_data ); 288 #define p_wf p_stream->p_wf 289 p_wf->cbSize = p_input->p_fmt->i_extra_data; 290 if( p_wf->cbSize > 0 ) 291 { 292 memcpy( &p_wf[1], 293 p_input->p_fmt->p_extra_data, 294 p_input->p_fmt->i_extra_data ); 295 } 296 p_wf->nChannels = p_input->p_fmt->i_channels; 297 p_wf->nSamplesPerSec = p_input->p_fmt->i_sample_rate; 298 p_wf->nBlockAlign = p_input->p_fmt->i_block_align; 299 p_wf->nAvgBytesPerSec= p_input->p_fmt->i_bitrate / 8; 300 p_wf->wBitsPerSample = 0; 301 302 switch( p_input->p_fmt->i_fourcc ) 303 { 304 case VLC_FOURCC( 'a', '5', '2', ' ' ): 305 p_wf->wFormatTag = WAVE_FORMAT_A52; 306 break; 307 case VLC_FOURCC( 'm', 'p', 'g', 'a' ): 308 p_wf->wFormatTag = WAVE_FORMAT_MPEGLAYER3; 309 break; 310 case VLC_FOURCC( 'w', 'm', 'a', '1' ): 311 p_wf->wFormatTag = WAVE_FORMAT_WMA1; 312 break; 313 case VLC_FOURCC( 'w', 'm', 'a', '2' ): 314 p_wf->wFormatTag = WAVE_FORMAT_WMA2; 315 break; 316 case VLC_FOURCC( 'w', 'm', 'a', '3' ): 317 p_wf->wFormatTag = WAVE_FORMAT_WMA3; 318 break; 319 default: 320 return VLC_EGENERIC; 321 } 322 #undef p_wf 300 323 break; 301 324 case VIDEO_ES: 302 { 303 BITMAPINFOHEADER *p_bih = 304 (BITMAPINFOHEADER*)p_input->input_format.p_format;; 305 306 p_stream->i_cat = VIDEO_ES; 307 p_stream->fcc[0] = '0' + p_sys->i_streams / 10; 308 p_stream->fcc[1] = '0' + p_sys->i_streams % 10; 309 p_stream->fcc[2] = 'd'; 310 p_stream->fcc[3] = 'c'; 311 if( p_sys->i_stream_video < 0 ) 312 { 313 p_sys->i_stream_video = p_sys->i_streams; 314 } 315 p_stream->p_wf = NULL; 316 p_stream->p_bih = malloc( p_bih->biSize ); 317 memcpy( p_stream->p_bih, 318 p_bih, 319 p_bih->biSize ); 320 } 325 p_stream->i_cat = VIDEO_ES; 326 p_stream->fcc[0] = '0' + p_sys->i_streams / 10; 327 p_stream->fcc[1] = '0' + p_sys->i_streams % 10; 328 p_stream->fcc[2] = 'd'; 329 p_stream->fcc[3] = 'c'; 330 if( p_sys->i_stream_video < 0 ) 331 { 332 p_sys->i_stream_video = p_sys->i_streams; 333 } 334 p_stream->p_wf = NULL; 335 p_stream->p_bih = malloc( sizeof( BITMAPINFOHEADER ) + p_input->p_fmt->i_extra_data ); 336 #define p_bih p_stream->p_bih 337 p_bih->biSize = sizeof( BITMAPINFOHEADER ) + p_input->p_fmt->i_extra_data; 338 if( p_input->p_fmt->i_extra_data > 0 ) 339 { 340 memcpy( &p_bih[1], 341 p_input->p_fmt->p_extra_data, 342 p_input->p_fmt->i_extra_data ); 343 } 344 p_bih->biWidth = p_input->p_fmt->i_width; 345 p_bih->biHeight= p_input->p_fmt->i_height; 346 p_bih->biPlanes= 1; 347 p_bih->biBitCount = 24; 348 p_bih->biSizeImage = 0; 349 p_bih->biXPelsPerMeter = 0; 350 p_bih->biYPelsPerMeter = 0; 351 p_bih->biClrUsed = 0; 352 p_bih->biClrImportant = 0; 353 switch( p_input->p_fmt->i_fourcc ) 354 { 355 case VLC_FOURCC( 'm', 'p', '4', 'v' ): 356 p_bih->biCompression = VLC_FOURCC( 'X', 'V', 'I', 'D' ); 357 break; 358 default: 359 p_bih->biCompression = p_input->p_fmt->i_fourcc; 360 break; 361 } 362 #undef p_bih 321 363 break; 322 364 default: 323 return( -1);365 return( VLC_EGENERIC ); 324 366 } 325 367 p_stream->i_totalsize = 0; … … 334 376 335 377 p_sys->i_streams++; 336 return( 0);378 return( VLC_SUCCESS ); 337 379 } 338 380 … … 432 474 } 433 475 476 p_sys->i_movi_size += p_data->i_size; 434 477 sout_AccessOutWrite( p_mux->p_access, p_data ); 435 p_sys->i_movi_size += p_data->i_size;436 478 437 479 i_count--; … … 650 692 { 651 693 i_scale = i_samplesize; 652 i_rate = i_scale *p_stream->i_bitrate / 8;694 i_rate = /*i_scale **/ p_stream->i_bitrate / 8; 653 695 } 654 696 else modules/mux/mpeg/ps.c
r949a4ce r4dec968 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001, 2002 VideoLAN 5 * $Id: ps.c,v 1.1 1 2003/03/11 19:02:30fenrir Exp $5 * $Id: ps.c,v 1.12 2003/04/13 20:00:21 fenrir Exp $ 6 6 * 7 7 * Authors: Laurent Aimar <fenrir@via.ecp.fr> … … 175 175 p_input->p_sys = (void*)p_stream = malloc( sizeof( ps_stream_t ) ); 176 176 p_stream->i_ok = 0; 177 switch( p_input-> input_format.i_cat )177 switch( p_input->p_fmt->i_cat ) 178 178 { 179 179 case VIDEO_ES: 180 180 181 switch( p_input-> input_format.i_fourcc )181 switch( p_input->p_fmt->i_fourcc ) 182 182 { 183 183 case VLC_FOURCC( 'm', 'p', 'g', 'v' ): … … 191 191 break; 192 192 case AUDIO_ES: 193 switch( p_input-> input_format.i_fourcc )193 switch( p_input->p_fmt->i_fourcc ) 194 194 { 195 195 case VLC_FOURCC( 'a', '5', '2', ' ' ): modules/mux/mpeg/ts.c
r949a4ce r4dec968 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001, 2002 VideoLAN 5 * $Id: ts.c,v 1.1 5 2003/03/11 19:02:30fenrir Exp $5 * $Id: ts.c,v 1.16 2003/04/13 20:00:21 fenrir Exp $ 6 6 * 7 7 * Authors: Laurent Aimar <fenrir@via.ecp.fr> … … 224 224 sout_mux_sys_t *p_sys = p_mux->p_sys; 225 225 ts_stream_t *p_stream; 226 BITMAPINFOHEADER *p_bih;227 WAVEFORMATEX *p_wf;228 226 229 227 msg_Dbg( p_mux, "adding input" ); … … 237 235 p_stream->i_continuity_counter = 0; 238 236 239 switch( p_input-> input_format.i_cat )237 switch( p_input->p_fmt->i_cat ) 240 238 { 241 239 case VIDEO_ES: 242 switch( p_input-> input_format.i_fourcc )240 switch( p_input->p_fmt->i_fourcc ) 243 241 { 244 242 case VLC_FOURCC( 'm', 'p','g', 'v' ): … … 270 268 } 271 269 p_sys->i_video_bound++; 272 p_bih = (BITMAPINFOHEADER*)p_input->input_format.p_format; 273 if( p_bih ) 274 { 275 p_stream->i_bih_codec = p_input->input_format.i_fourcc; 276 p_stream->i_bih_width = p_bih->biWidth; 277 p_stream->i_bih_height = p_bih->biHeight; 278 } 279 else 280 { 281 p_stream->i_bih_codec = 0x0; 282 p_stream->i_bih_width = 0; 283 p_stream->i_bih_height = 0; 284 } 285 286 if( p_bih && p_bih->biSize > sizeof( BITMAPINFOHEADER ) ) 287 { 288 p_stream->i_decoder_specific_info_len = 289 p_bih->biSize - sizeof( BITMAPINFOHEADER ); 270 271 p_stream->i_bih_codec = p_input->p_fmt->i_fourcc; 272 p_stream->i_bih_width = p_input->p_fmt->i_width; 273 p_stream->i_bih_height = p_input->p_fmt->i_height; 274 275 p_stream->i_decoder_specific_info_len = p_input->p_fmt->i_extra_data; 276 if( p_stream->i_decoder_specific_info_len > 0 ) 277 { 290 278 p_stream->p_decoder_specific_info = 291 279 malloc( p_stream->i_decoder_specific_info_len ); 292 280 memcpy( p_stream->p_decoder_specific_info, 293 &p_bih[1],294 p_ stream->i_decoder_specific_info_len);281 p_input->p_fmt->p_extra_data, 282 p_input->p_fmt->i_extra_data ); 295 283 } 296 284 else 297 285 { 298 286 p_stream->p_decoder_specific_info = NULL; 299 p_stream->i_decoder_specific_info_len = 0;300 287 } 301 288 break; 289 302 290 case AUDIO_ES: 303 switch( p_input-> input_format.i_fourcc )291 switch( p_input->p_fmt->i_fourcc ) 304 292 { 305 293 case VLC_FOURCC( 'a', '5','2', ' ' ): … … 325 313 } 326 314 p_sys->i_audio_bound++; 327 p_wf = (WAVEFORMATEX*)p_input->input_format.p_format; 328 if( p_wf && p_wf->cbSize > 0 )329 {330 p_stream->i_decoder_specific_info_len = p_wf->cbSize;315 316 p_stream->i_decoder_specific_info_len = p_input->p_fmt->i_extra_data; 317 if( p_stream->i_decoder_specific_info_len > 0 ) 318 { 331 319 p_stream->p_decoder_specific_info = 332 320 malloc( p_stream->i_decoder_specific_info_len ); 333 321 memcpy( p_stream->p_decoder_specific_info, 334 &p_wf[1],335 p_ stream->i_decoder_specific_info_len);322 p_input->p_fmt->p_extra_data, 323 p_input->p_fmt->i_extra_data ); 336 324 } 337 325 else 338 326 { 339 327 p_stream->p_decoder_specific_info = NULL; 340 p_stream->i_decoder_specific_info_len = 0;341 328 } 342 329 break; modules/mux/ogg.c
r8c1b605 r4dec968 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001, 2002 VideoLAN 5 * $Id: ogg.c,v 1. 4 2003/03/31 03:46:11 fenrir Exp $5 * $Id: ogg.c,v 1.5 2003/04/13 20:00:21 fenrir Exp $ 6 6 * 7 7 * Authors: Laurent Aimar <fenrir@via.ecp.fr> … … 210 210 ogg_stream_t *p_stream; 211 211 212 BITMAPINFOHEADER *p_bih;213 WAVEFORMATEX *p_wf;214 215 212 msg_Dbg( p_mux, "adding input" ); 216 213 p_input->p_sys = (void*)p_stream = malloc( sizeof( ogg_stream_t ) ); 217 214 218 p_stream->i_cat = p_input-> input_format.i_cat;219 p_stream->i_fourcc = p_input-> input_format.i_fourcc;215 p_stream->i_cat = p_input->p_fmt->i_cat; 216 p_stream->i_fourcc = p_input->p_fmt->i_fourcc; 220 217 p_stream->i_packet_no = 0; 221 218 222 219 p_stream->header.i_packet_type = PACKET_TYPE_HEADER; 223 switch( p_input-> input_format.i_cat )220 switch( p_input->p_fmt->i_cat ) 224 221 { 225 222 case VIDEO_ES: 226 p_bih = (BITMAPINFOHEADER*)p_input->input_format.p_format; 227 switch( p_input->input_format.i_fourcc ) 223 switch( p_input->p_fmt->i_fourcc ) 228 224 { 229 225 case VLC_FOURCC( 'm', 'p','4', 'v' ): … … 232 228 "video ", 233 229 8 ); 234 if( p_input-> input_format.i_fourcc == VLC_FOURCC( 'm', 'p','4', 'v' ) )230 if( p_input->p_fmt->i_fourcc == VLC_FOURCC( 'm', 'p','4', 'v' ) ) 235 231 { 236 232 memcpy( p_stream->header.sub_type, "XVID", 4 ); 237 233 } 238 else if( p_input-> input_format.i_fourcc == VLC_FOURCC( 'D', 'I','V', '3' ) )234 else if( p_input->p_fmt->i_fourcc == VLC_FOURCC( 'D', 'I','V', '3' ) ) 239 235 { 240 236 memcpy( p_stream->header.sub_type, "DIV3", 4 ); … … 247 243 SetDWLE( &p_stream->header.i_buffer_size, 1024*1024 ); 248 244 SetWLE( &p_stream->header.i_bits_per_sample, 0 ); 249 if( p_bih ) 250 { 251 SetDWLE( &p_stream->header.header.video.i_width, p_bih->biWidth ); 252 SetDWLE( &p_stream->header.header.video.i_height, p_bih->biHeight ); 253 } 254 else 255 { 256 SetDWLE( &p_stream->header.header.video.i_width, 0 ); 257 SetDWLE( &p_stream->header.header.video.i_height, 0 ); 258 } 245 SetDWLE( &p_stream->header.header.video.i_width, p_input->p_fmt->i_width ); 246 SetDWLE( &p_stream->header.header.video.i_height, p_input->p_fmt->i_height ); 259 247 break; 260 248 default: … … 264 252 break; 265 253 case AUDIO_ES: 266 p_wf = (WAVEFORMATEX*)p_input->input_format.p_format; 267 switch( p_input->input_format.i_fourcc ) 254 switch( p_input->p_fmt->i_fourcc ) 268 255 { 269 256 case VLC_FOURCC( 'm', 'p','g', 'a' ): … … 272 259 "audio ", 273 260 8 ); 274 if( p_input-> input_format.i_fourcc == VLC_FOURCC( 'm', 'p','g', 'a' ) )261 if( p_input->p_fmt->i_fourcc == VLC_FOURCC( 'm', 'p','g', 'a' ) ) 275 262 { 276 263 memcpy( p_stream->header.sub_type, "55 ", 4 ); 277 264 } 278 else if( p_input-> input_format.i_fourcc == VLC_FOURCC( 'a', '5','2', ' ' ) )265 else if( p_input->p_fmt->i_fourcc == VLC_FOURCC( 'a', '5','2', ' ' ) ) 279 266 { 280 267 memcpy( p_stream->header.sub_type, "2000", 4 ); … … 284 271 SetDWLE( &p_stream->header.i_default_len, 0 ); /* ??? */ 285 272 SetDWLE( &p_stream->header.i_buffer_size, 30*1024 ); 286 if( p_wf ) 287 { 288 SetQWLE( &p_stream->header.i_samples_per_unit, p_wf->nSamplesPerSec ); 289 SetWLE( &p_stream->header.i_bits_per_sample, p_wf->wBitsPerSample ); 290 SetDWLE( &p_stream->header.header.audio.i_channels, p_wf->nChannels ); 291 SetDWLE( &p_stream->header.header.audio.i_block_align, p_wf->nBlockAlign ); 292 SetDWLE( &p_stream->header.header.audio.i_avgbytespersec, p_wf->nAvgBytesPerSec ); 293 } 294 else 295 { 296 /* perhaps it's better to fail */ 297 SetQWLE( &p_stream->header.i_samples_per_unit, 44100 ); 298 SetWLE( &p_stream->header.i_bits_per_sample, 0 ); 299 SetDWLE( &p_stream->header.header.audio.i_channels, 2 ); 300 SetDWLE( &p_stream->header.header.audio.i_block_align, 0 ); 301 SetDWLE( &p_stream->header.header.audio.i_avgbytespersec, 0 ); 302 } 273 SetQWLE( &p_stream->header.i_samples_per_unit, p_input->p_fmt->i_sample_rate ); 274 SetWLE( &p_stream->header.i_bits_per_sample, 0 ); 275 SetDWLE( &p_stream->header.header.audio.i_channels, p_input->p_fmt->i_channels ); 276 SetDWLE( &p_stream->header.header.audio.i_block_align, p_input->p_fmt->i_block_align ); 277 SetDWLE( &p_stream->header.header.audio.i_avgbytespersec, 0 ); 303 278 break; 304 279 case VLC_FOURCC( 'v', 'o', 'r', 'b' ): modules/packetizer/a52.c
r8c1b605
