* stream_output.h : stream output module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: stream_output.h,v 1.15 2003/11/07 16:53:54 massiot Exp $
+ * $Id: stream_output.h,v 1.16 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
* 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
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 */
{
sout_instance_t *p_sout;
- sout_format_t *p_fmt;
+ es_format_t *p_fmt;
sout_fifo_t *p_fifo;
void *p_sys;
sout_instance_t *p_sout;
- sout_format_t *p_fmt;
+ es_format_t *p_fmt;
sout_stream_id_t *id;
};
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 */
#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, ( vlc_object_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* ) );
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 * ) );
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.87 2003/11/21 00:38:01 gbazin Exp $
+ * $Id: vlc_common.h,v 1.88 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
typedef struct stream_descriptor_t stream_descriptor_t;
typedef struct stream_sys_t stream_sys_t;
+/* Format */
+typedef struct audio_format_t audio_format_t;
+typedef struct video_format_t video_format_t;
+typedef struct subs_format_t subs_format_t;
+typedef struct es_format_t es_format_t;
+
/* NInput */
typedef struct stream_t stream_t;
typedef struct es_out_t es_out_t;
typedef struct aout_fifo_t aout_fifo_t;
typedef struct aout_input_t aout_input_t;
typedef struct aout_buffer_t aout_buffer_t;
-typedef struct audio_format_t audio_format_t;
typedef audio_format_t audio_sample_format_t;
typedef struct audio_date_t audio_date_t;
typedef struct aout_filter_t aout_filter_t;
typedef struct vout_thread_t vout_thread_t;
typedef struct vout_sys_t vout_sys_t;
typedef struct chroma_sys_t chroma_sys_t;
-typedef struct video_format_t video_format_t;
typedef video_format_t video_frame_format_t;
typedef struct picture_t picture_t;
typedef struct picture_sys_t picture_sys_t;
typedef struct sout_mux_t sout_mux_t;
typedef struct sout_stream_t sout_stream_t;
typedef struct sout_cfg_t sout_cfg_t;
-typedef struct sout_format_t sout_format_t;
/*typedef struct sap_session_t sap_session_t;
typedef struct slp_session_t slp_session_t;*/
* vlc_es.h
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: vlc_es.h,v 1.1 2003/11/20 22:10:55 fenrir Exp $
+ * $Id: vlc_es.h,v 1.2 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/**
* Description of subs
*/
-typedef struct subs_format_t
+struct subs_format_t
{
char *psz_encoding;
-} subs_format_t;
+};
/**
* ES definition
*/
-typedef struct
+struct es_format_t
{
int i_cat;
vlc_fourcc_t i_codec;
int i_extra;
void *p_extra;
-} es_format_t;
+};
static inline void es_format_Init( es_format_t *fmt,
int i_cat, vlc_fourcc_t i_codec )
* asf.c
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: asf.c,v 1.7 2003/08/29 19:49:33 fenrir Exp $
+ * $Id: asf.c,v 1.8 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
{
case AUDIO_ES:
{
- int i_blockalign = p_input->p_fmt->i_block_align;
+ int i_blockalign = p_input->p_fmt->audio.i_blockalign;
int i_bitspersample = 0;
int i_extra = 0;
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'a', '5', '2', ' ' ):
tk->i_tag = WAVE_FORMAT_A52;
case VLC_FOURCC( 'u', '8', ' ', ' ' ):
tk->psz_name = "Raw audio 8bits";
tk->i_tag = WAVE_FORMAT_PCM;
- i_blockalign= p_input->p_fmt->i_channels;
+ i_blockalign= p_input->p_fmt->audio.i_channels;
i_bitspersample = 8;
break;
case VLC_FOURCC( 's', '1', '6', 'l' ):
tk->psz_name = "Raw audio 16bits";
tk->i_tag = WAVE_FORMAT_PCM;
- i_blockalign= 2 * p_input->p_fmt->i_channels;
+ i_blockalign= 2 * p_input->p_fmt->audio.i_channels;
i_bitspersample = 16;
break;
case VLC_FOURCC( 's', '2', '4', 'l' ):
tk->psz_name = "Raw audio 24bits";
tk->i_tag = WAVE_FORMAT_PCM;
- i_blockalign= 3 * p_input->p_fmt->i_channels;
+ i_blockalign= 3 * p_input->p_fmt->audio.i_channels;
i_bitspersample = 24;
break;
case VLC_FOURCC( 's', '3', '2', 'l' ):
tk->psz_name = "Raw audio 32bits";
tk->i_tag = WAVE_FORMAT_PCM;
- i_blockalign= 4 * p_input->p_fmt->i_channels;
+ i_blockalign= 4 * p_input->p_fmt->audio.i_channels;
i_bitspersample = 32;
break;
default:
tk->i_extra = sizeof( WAVEFORMATEX ) +
- p_input->p_fmt->i_extra_data + i_extra;
+ p_input->p_fmt->i_extra + i_extra;
tk->p_extra = malloc( tk->i_extra );
bo_init( &bo, tk->p_extra, tk->i_extra );
bo_addle_u16( &bo, tk->i_tag );
- bo_addle_u16( &bo, p_input->p_fmt->i_channels );
- bo_addle_u32( &bo, p_input->p_fmt->i_sample_rate );
+ bo_addle_u16( &bo, p_input->p_fmt->audio.i_channels );
+ bo_addle_u32( &bo, p_input->p_fmt->audio.i_rate );
bo_addle_u32( &bo, p_input->p_fmt->i_bitrate / 8 );
bo_addle_u16( &bo, i_blockalign );
bo_addle_u16( &bo, i_bitspersample );
- if( p_input->p_fmt->i_extra_data > 0 )
+ if( p_input->p_fmt->i_extra > 0 )
{
- bo_addle_u16( &bo, p_input->p_fmt->i_extra_data );
- bo_add_mem ( &bo, p_input->p_fmt->p_extra_data,
- p_input->p_fmt->i_extra_data );
+ bo_addle_u16( &bo, p_input->p_fmt->i_extra );
+ bo_add_mem ( &bo, p_input->p_fmt->p_extra,
+ p_input->p_fmt->i_extra );
}
else
{
msg_Dbg( p_mux, "adding mp2 header" );
bo_addle_u16( &bo, 2 ); /* fwHeadLayer */
bo_addle_u32( &bo, p_input->p_fmt->i_bitrate );
- bo_addle_u16( &bo, p_input->p_fmt->i_channels == 2 ?1:8 );
+ bo_addle_u16( &bo, p_input->p_fmt->audio.i_channels == 2 ?1:8 );
bo_addle_u16( &bo, 0 ); /* fwHeadModeExt */
bo_addle_u16( &bo, 1 ); /* wHeadEmphasis */
bo_addle_u16( &bo, 16 ); /* fwHeadFlags */
case VIDEO_ES:
{
tk->i_extra = 11 + sizeof( BITMAPINFOHEADER ) +
- p_input->p_fmt->i_extra_data;
+ p_input->p_fmt->i_extra;
tk->p_extra = malloc( tk->i_extra );
bo_init( &bo, tk->p_extra, tk->i_extra );
- bo_addle_u32( &bo, p_input->p_fmt->i_width );
- bo_addle_u32( &bo, p_input->p_fmt->i_height );
+ bo_addle_u32( &bo, p_input->p_fmt->video.i_width );
+ bo_addle_u32( &bo, p_input->p_fmt->video.i_height );
bo_add_u8 ( &bo, 0x02 ); /* flags */
bo_addle_u16( &bo, sizeof( BITMAPINFOHEADER ) +
- p_input->p_fmt->i_extra_data );
+ p_input->p_fmt->i_extra );
bo_addle_u32( &bo, sizeof( BITMAPINFOHEADER ) +
- p_input->p_fmt->i_extra_data );
- bo_addle_u32( &bo, p_input->p_fmt->i_width );
- bo_addle_u32( &bo, p_input->p_fmt->i_height );
+ p_input->p_fmt->i_extra );
+ bo_addle_u32( &bo, p_input->p_fmt->video.i_width );
+ bo_addle_u32( &bo, p_input->p_fmt->video.i_height );
bo_addle_u16( &bo, 1 );
bo_addle_u16( &bo, 24 );
- if( p_input->p_fmt->i_fourcc == VLC_FOURCC('m','p','4','v') )
+ if( p_input->p_fmt->i_codec == VLC_FOURCC('m','p','4','v') )
{
tk->psz_name = "MPEG-4 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', '4', 'S' );
}
- else if( p_input->p_fmt->i_fourcc == VLC_FOURCC('D','I','V','3') )
+ else if( p_input->p_fmt->i_codec == VLC_FOURCC('D','I','V','3') )
{
tk->psz_name = "MSMPEG-4 V3 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', '4', '3' );
}
- else if( p_input->p_fmt->i_fourcc == VLC_FOURCC('D','I','V','2') )
+ else if( p_input->p_fmt->i_codec == VLC_FOURCC('D','I','V','2') )
{
tk->psz_name = "MSMPEG-4 V2 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', '4', '2' );
}
- else if( p_input->p_fmt->i_fourcc == VLC_FOURCC('D','I','V','1') )
+ else if( p_input->p_fmt->i_codec == VLC_FOURCC('D','I','V','1') )
{
tk->psz_name = "MSMPEG-4 V1 Video";
tk->i_fourcc = VLC_FOURCC( 'M', 'P', 'G', '4' );
}
- else if( p_input->p_fmt->i_fourcc == VLC_FOURCC('W','M','V','1') )
+ else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','1') )
{
tk->psz_name = "Windows Media Video 1";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '1' );
}
- else if( p_input->p_fmt->i_fourcc == VLC_FOURCC('W','M','V','2') )
+ else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','2') )
{
tk->psz_name = "Windows Media Video 2";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '2' );
else
{
tk->psz_name = "Unknow Video";
- tk->i_fourcc = p_input->p_fmt->i_fourcc;
+ tk->i_fourcc = p_input->p_fmt->i_codec;
}
bo_add_mem( &bo, (uint8_t*)&tk->i_fourcc, 4 );
bo_addle_u32( &bo, 0 );
bo_addle_u32( &bo, 0 );
bo_addle_u32( &bo, 0 );
bo_addle_u32( &bo, 0 );
- if( p_input->p_fmt->i_extra_data > 0 )
+ if( p_input->p_fmt->i_extra > 0 )
{
- bo_add_mem ( &bo, p_input->p_fmt->p_extra_data,
- p_input->p_fmt->i_extra_data );
+ bo_add_mem ( &bo, p_input->p_fmt->p_extra,
+ p_input->p_fmt->i_extra );
}
if( p_input->p_fmt->i_bitrate > 50000 )
* avi.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: avi.c,v 1.15 2003/08/17 18:44:26 fenrir Exp $
+ * $Id: avi.c,v 1.16 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_stream->p_bih = NULL;
p_stream->p_wf = malloc( sizeof( WAVEFORMATEX ) +
- p_input->p_fmt->i_extra_data );
+ p_input->p_fmt->i_extra );
#define p_wf p_stream->p_wf
- p_wf->cbSize = p_input->p_fmt->i_extra_data;
+ p_wf->cbSize = p_input->p_fmt->i_extra;
if( p_wf->cbSize > 0 )
{
memcpy( &p_wf[1],
- p_input->p_fmt->p_extra_data,
- p_input->p_fmt->i_extra_data );
+ p_input->p_fmt->p_extra,
+ p_input->p_fmt->i_extra );
}
- p_wf->nChannels = p_input->p_fmt->i_channels;
- p_wf->nSamplesPerSec = p_input->p_fmt->i_sample_rate;
- p_wf->nBlockAlign = p_input->p_fmt->i_block_align;
+ p_wf->nChannels = p_input->p_fmt->audio.i_channels;
+ p_wf->nSamplesPerSec = p_input->p_fmt->audio.i_rate;
+ p_wf->nBlockAlign = p_input->p_fmt->audio.i_blockalign;
p_wf->nAvgBytesPerSec= p_input->p_fmt->i_bitrate / 8;
p_wf->wBitsPerSample = 0;
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'a', '5', '2', ' ' ):
p_wf->wFormatTag = WAVE_FORMAT_A52;
}
p_stream->p_wf = NULL;
p_stream->p_bih = malloc( sizeof( BITMAPINFOHEADER ) +
- p_input->p_fmt->i_extra_data );
+ p_input->p_fmt->i_extra );
#define p_bih p_stream->p_bih
p_bih->biSize = sizeof( BITMAPINFOHEADER ) +
- p_input->p_fmt->i_extra_data;
- if( p_input->p_fmt->i_extra_data > 0 )
+ p_input->p_fmt->i_extra;
+ if( p_input->p_fmt->i_extra > 0 )
{
memcpy( &p_bih[1],
- p_input->p_fmt->p_extra_data,
- p_input->p_fmt->i_extra_data );
+ p_input->p_fmt->p_extra,
+ p_input->p_fmt->i_extra );
}
- p_bih->biWidth = p_input->p_fmt->i_width;
- p_bih->biHeight= p_input->p_fmt->i_height;
+ p_bih->biWidth = p_input->p_fmt->video.i_width;
+ p_bih->biHeight= p_input->p_fmt->video.i_height;
p_bih->biPlanes= 1;
p_bih->biBitCount = 24;
p_bih->biSizeImage = 0;
p_bih->biYPelsPerMeter = 0;
p_bih->biClrUsed = 0;
p_bih->biClrImportant = 0;
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p', '4', 'v' ):
p_bih->biCompression = VLC_FOURCC( 'X', 'V', 'I', 'D' );
break;
default:
- p_bih->biCompression = p_input->p_fmt->i_fourcc;
+ p_bih->biCompression = p_input->p_fmt->i_codec;
break;
}
#undef p_bih
* mp4.c: mp4/mov muxer
*****************************************************************************
* Copyright (C) 2001, 2002, 2003 VideoLAN
- * $Id: mp4.c,v 1.6 2003/10/17 16:40:08 gbazin Exp $
+ * $Id: mp4.c,v 1.7 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
typedef struct
{
- sout_format_t *p_fmt;
+ es_format_t *p_fmt;
int i_track_id;
/* index */
int i_object_type_indication;
int i_decoder_specific_info_size;
- if( p_stream->p_fmt->i_extra_data > 0 )
+ if( p_stream->p_fmt->i_extra > 0 )
{
i_decoder_specific_info_size =
- GetDescrLength( p_stream->p_fmt->i_extra_data );
+ GetDescrLength( p_stream->p_fmt->i_extra );
}
else
{
/* DecoderConfigDescr */
bo_add_descr( esds, 0x04, 13 + i_decoder_specific_info_size );
- switch( p_stream->p_fmt->i_fourcc )
+ switch( p_stream->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p', '4', 'v' ):
i_object_type_indication = 0x20;
break;
case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
i_object_type_indication =
- p_stream->p_fmt->i_sample_rate < 32000 ? 0x69 : 0x6b;
+ p_stream->p_fmt->audio.i_rate < 32000 ? 0x69 : 0x6b;
break;
default:
i_object_type_indication = 0x00;
bo_add_32be( esds, 0x7fffffff ); // maxBitrate
bo_add_32be( esds, 0 ); // avgBitrate
- if( p_stream->p_fmt->i_extra_data > 0 )
+ if( p_stream->p_fmt->i_extra > 0 )
{
int i;
/* DecoderSpecificInfo */
- bo_add_descr( esds, 0x05, p_stream->p_fmt->i_extra_data );
+ bo_add_descr( esds, 0x05, p_stream->p_fmt->i_extra );
- for( i = 0; i < p_stream->p_fmt->i_extra_data; i++ )
+ for( i = 0; i < p_stream->p_fmt->i_extra; i++ )
{
- bo_add_8( esds, p_stream->p_fmt->p_extra_data[i] );
+ bo_add_8( esds, ((uint8_t*)p_stream->p_fmt->p_extra)[i] );
}
}
}
if( p_stream->p_fmt->i_cat == AUDIO_ES )
{
- i_timescale = p_stream->p_fmt->i_sample_rate;
+ i_timescale = p_stream->p_fmt->audio.i_rate;
}
else
{
}
else
{
- bo_add_32be( tkhd, p_stream->p_fmt->i_width << 16 ); // width (presentation)
- bo_add_32be( tkhd, p_stream->p_fmt->i_height << 16 ); // height(presentation)
+ bo_add_32be( tkhd, p_stream->p_fmt->video.i_width << 16 ); // width (presentation)
+ bo_add_32be( tkhd, p_stream->p_fmt->video.i_height << 16 ); // height(presentation)
}
box_fix( tkhd );
box_gather( trak, tkhd );
int i;
vlc_bool_t b_mpeg4_hdr;
- switch( p_stream->p_fmt->i_fourcc )
+ switch( p_stream->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p', '4', 'a' ):
memcpy( fcc, "mp4a", 4 );
break;
default:
- memcpy( fcc, (char*)&p_stream->p_fmt->i_fourcc, 4 );
+ memcpy( fcc, (char*)&p_stream->p_fmt->i_codec, 4 );
b_mpeg4_hdr = VLC_FALSE;
break;
}
bo_add_16be( soun, 0 ); // version;
bo_add_16be( soun, 0 ); // revision level (0)
bo_add_32be( soun, 0 ); // vendor
- bo_add_16be( soun, p_stream->p_fmt->i_channels ); // channel-count
+ bo_add_16be( soun, p_stream->p_fmt->audio.i_channels ); // channel-count
bo_add_16be( soun, 16); // FIXME sample size
bo_add_16be( soun, -2 ); // compression id
bo_add_16be( soun, 0 ); // packet size (0)
- bo_add_16be( soun, p_stream->p_fmt->i_sample_rate ); // sampleratehi
+ bo_add_16be( soun, p_stream->p_fmt->audio.i_rate ); // sampleratehi
bo_add_16be( soun, 0 ); // sampleratelo
/* add an ES Descriptor */
int i;
vlc_bool_t b_mpeg4_hdr;
- switch( p_stream->p_fmt->i_fourcc )
+ switch( p_stream->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p', '4', 'v' ):
case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
break;
default:
- memcpy( fcc, (char*)&p_stream->p_fmt->i_fourcc, 4 );
+ memcpy( fcc, (char*)&p_stream->p_fmt->i_codec, 4 );
b_mpeg4_hdr = VLC_FALSE;
break;
}
bo_add_32be( vide, 0 ); // predefined;
}
- bo_add_16be( vide, p_stream->p_fmt->i_width ); // i_width
- bo_add_16be( vide, p_stream->p_fmt->i_height ); // i_height
+ bo_add_16be( vide, p_stream->p_fmt->video.i_width ); // i_width
+ bo_add_16be( vide, p_stream->p_fmt->video.i_height ); // i_height
bo_add_32be( vide, 0x00480000 ); // h 72dpi
bo_add_32be( vide, 0x00480000 ); // v 72dpi
p_stream = p_sys->pp_streams[i_trak];
- if( p_stream->p_fmt->p_extra_data )
+ if( p_stream->p_fmt->p_extra )
{
- free( p_stream->p_fmt->p_extra_data );
+ free( p_stream->p_fmt->p_extra );
}
free( p_stream->p_fmt );
free( p_stream->entry );
sout_mux_sys_t *p_sys = p_mux->p_sys;
mp4_stream_t *p_stream;
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p', '4', 'a' ):
case VLC_FOURCC( 'm', 'p', '4', 'v' ):
break;
default:
msg_Err( p_mux, "unsupported codec %4.4s in mp4",
- (char*)&p_input->p_fmt->i_fourcc );
+ (char*)&p_input->p_fmt->i_codec );
return VLC_EGENERIC;
}
p_stream = malloc( sizeof( mp4_stream_t ) );
- p_stream->p_fmt = malloc( sizeof( sout_format_t ) );
- memcpy( p_stream->p_fmt, p_input->p_fmt, sizeof( sout_format_t ) );
- if( p_stream->p_fmt->i_extra_data )
+ p_stream->p_fmt = malloc( sizeof( es_format_t ) );
+ memcpy( p_stream->p_fmt, p_input->p_fmt, sizeof( es_format_t ) );
+ if( p_stream->p_fmt->i_extra )
{
- p_stream->p_fmt->p_extra_data =
- malloc( p_stream->p_fmt->i_extra_data );
- memcpy( p_stream->p_fmt->p_extra_data,
- p_input->p_fmt->p_extra_data,
- p_input->p_fmt->i_extra_data );
+ p_stream->p_fmt->p_extra =
+ malloc( p_stream->p_fmt->i_extra );
+ memcpy( p_stream->p_fmt->p_extra,
+ p_input->p_fmt->p_extra,
+ p_input->p_fmt->i_extra );
}
p_stream->i_track_id = p_sys->i_nb_streams + 1;
p_stream->i_entry_count = 0;
* multiplexer module for vlc
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ps.c,v 1.15 2003/08/02 01:33:53 fenrir Exp $
+ * $Id: ps.c,v 1.16 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
sout_mux_sys_t *p_sys = p_mux->p_sys;
ps_stream_t *p_stream;
- msg_Dbg( p_mux, "adding input codec=%4.4s", (char*)&p_input->p_fmt->i_fourcc );
+ msg_Dbg( p_mux, "adding input codec=%4.4s", (char*)&p_input->p_fmt->i_codec );
p_input->p_sys = (void*)p_stream = malloc( sizeof( ps_stream_t ) );
/* Init this new stream */
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
p_stream->i_stream_id = StreamIdGet( p_sys->stream_id_mpgv, 0xe0, 0xef );
ps_stream_t *p_stream =(ps_stream_t*)p_input->p_sys;
msg_Dbg( p_mux, "removing input" );
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p', 'g', 'v' ):
StreamIdRelease( p_sys->stream_id_mpgv, 0xe0, p_stream->i_stream_id);
* ts.c: MPEG-II TS Muxer
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ts.c,v 1.36 2003/11/20 18:26:44 fenrir Exp $
+ * $Id: ts.c,v 1.37 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
sout_mux_sys_t *p_sys = p_mux->p_sys;
ts_stream_t *p_stream;
- msg_Dbg( p_mux, "adding input codec=%4.4s", (char*)&p_input->p_fmt->i_fourcc );
+ msg_Dbg( p_mux, "adding input codec=%4.4s", (char*)&p_input->p_fmt->i_codec );
p_input->p_sys = (void*)p_stream = malloc( sizeof( ts_stream_t ) );
switch( p_input->p_fmt->i_cat )
{
case VIDEO_ES:
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p','g', 'v' ):
/* TODO: do we need to check MPEG-I/II ? */
case VLC_FOURCC( 'M', 'J', 'P', 'G' ):
p_stream->i_stream_type = 0xa0; // private
p_stream->i_stream_id = 0xa0; // beurk
- p_stream->i_bih_codec = p_input->p_fmt->i_fourcc;
- p_stream->i_bih_width = p_input->p_fmt->i_width;
- p_stream->i_bih_height = p_input->p_fmt->i_height;
+ p_stream->i_bih_codec = p_input->p_fmt->i_codec;
+ p_stream->i_bih_width = p_input->p_fmt->video.i_width;
+ p_stream->i_bih_height = p_input->p_fmt->video.i_height;
break;
default:
free( p_stream );
break;
case AUDIO_ES:
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 'm', 'p','g', 'a' ):
- p_stream->i_stream_type = p_input->p_fmt->i_sample_rate >= 32000 ? 0x03 : 0x04;
+ p_stream->i_stream_type = p_input->p_fmt->audio.i_rate >= 32000 ? 0x03 : 0x04;
p_stream->i_stream_id = p_sys->i_stream_id_mpga;
p_sys->i_stream_id_mpga++;
break;
break;
case SPU_ES:
- switch( p_input->p_fmt->i_fourcc )
+ switch( p_input->p_fmt->i_codec )
{
case VLC_FOURCC( 's', 'p','u', ' ' ):
p_stream->i_stream_type = 0x82;
}
/* Copy extra data (VOL for MPEG-4 and extra BitMapInfoHeader for VFW */
- p_stream->i_decoder_specific_info = p_input->p_fmt->i_extra_data;
+ p_stream->i_decoder_specific_info = p_input->p_fmt->i_extra;
if( p_stream->i_decoder_specific_info > 0 )
{
p_stream->p_decoder_specific_info =
malloc( p_stream->i_decoder_specific_info );
memcpy( p_stream->p_decoder_specific_info,
- p_input->p_fmt->p_extra_data,
- p_input->p_fmt->i_extra_data );
+ p_input->p_fmt->p_extra,
+ p_input->p_fmt->i_extra );
}
/* Init pes chain */
* ogg.c: ogg muxer module for vlc
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ogg.c,v 1.20 2003/11/21 13:01:05 gbazin Exp $
+ * $Id: ogg.c,v 1.21 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
p_input->p_sys = (void *)p_stream = malloc( sizeof( ogg_stream_t ) );
p_stream->i_cat = p_input->p_fmt->i_cat;
- p_stream->i_fourcc = p_input->p_fmt->i_fourcc;
+ p_stream->i_fourcc = p_input->p_fmt->i_codec;
p_stream->i_serial_no = p_sys->i_next_serial_no++;
p_stream->i_packet_no = 0;
SetDWLE( &p_stream->oggds_header.i_buffer_size, 1024*1024 );
SetWLE( &p_stream->oggds_header.i_bits_per_sample, 0 );
SetDWLE( &p_stream->oggds_header.header.video.i_width,
- p_input->p_fmt->i_width );
+ p_input->p_fmt->video.i_width );
SetDWLE( &p_stream->oggds_header.header.video.i_height,
- p_input->p_fmt->i_height );
+ p_input->p_fmt->video.i_height );
msg_Dbg( p_mux, "mp4v/div3 stream" );
break;
SetDWLE( &p_stream->oggds_header.i_default_len, 1 );
SetDWLE( &p_stream->oggds_header.i_buffer_size, 30*1024 );
SetQWLE( &p_stream->oggds_header.i_samples_per_unit,
- p_input->p_fmt->i_sample_rate );
+ p_input->p_fmt->audio.i_rate );
SetWLE( &p_stream->oggds_header.i_bits_per_sample, 0 );
SetDWLE( &p_stream->oggds_header.header.audio.i_channels,
- p_input->p_fmt->i_channels );
+ p_input->p_fmt->audio.i_channels );
SetDWLE( &p_stream->oggds_header.header.audio.i_block_align,
- p_input->p_fmt->i_block_align );
+ p_input->p_fmt->audio.i_blockalign );
SetDWLE( &p_stream->oggds_header.header.audio.i_avgbytespersec, 0);
msg_Dbg( p_mux, "mpga/a52 stream" );
break;
/* Special case for mp4v */
if( p_stream->i_fourcc == VLC_FOURCC( 'm', 'p', '4', 'v' ) &&
- p_mux->pp_inputs[i]->p_fmt->i_extra_data )
+ p_mux->pp_inputs[i]->p_fmt->i_extra )
{
/* Send a packet with the VOL data */
- op.bytes = p_mux->pp_inputs[i]->p_fmt->i_extra_data;
- op.packet = p_mux->pp_inputs[i]->p_fmt->p_extra_data;
+ op.bytes = p_mux->pp_inputs[i]->p_fmt->i_extra;
+ op.packet = p_mux->pp_inputs[i]->p_fmt->p_extra;
op.b_o_s = 0;
op.e_o_s = 0;
op.granulepos = 0;
/* number of sample from begining + current packet */
op.granulepos =
( i_dts + p_data->i_length - p_sys->i_start_dts ) *
- p_input->p_fmt->i_sample_rate / I64C(1000000);
+ p_input->p_fmt->audio.i_rate / I64C(1000000);
}
else
{
* mpegvideo.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: mpegvideo.c,v 1.20 2003/11/07 16:53:54 massiot Exp $
+ * $Id: mpegvideo.c,v 1.21 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
/* Output properties */
sout_packetizer_input_t *p_sout_input;
- sout_format_t output_format;
+ es_format_t output_format;
mtime_t i_interpolated_dts;
mtime_t i_old_duration;
{
p_pack->output_format.i_cat = VIDEO_ES;
- p_pack->output_format.i_fourcc = VLC_FOURCC( 'm', 'p', 'g', 'v');
- p_pack->output_format.i_width = 0;
- p_pack->output_format.i_height = 0;
+ p_pack->output_format.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'v');
+ p_pack->output_format.video.i_width = 0;
+ p_pack->output_format.video.i_height = 0;
p_pack->output_format.i_bitrate= 0;
- p_pack->output_format.i_extra_data = 0;
- p_pack->output_format.p_extra_data = NULL;
+ p_pack->output_format.i_extra = 0;
+ p_pack->output_format.p_extra = NULL;
p_pack->b_expect_discontinuity = 0;
p_pack->p_sout_input = NULL;
GetChunk( &p_pack->bit_stream, p_temp, 4 ); i_pos += 4;
/* horizontal_size_value */
- p_pack->output_format.i_width = ShowBits( &p_pack->bit_stream, 12 );
+ p_pack->output_format.video.i_width = ShowBits( &p_pack->bit_stream, 12 );
/* vertical_size_value */
- p_pack->output_format.i_height= ShowBits( &p_pack->bit_stream, 24 ) & 0xFFF;
+ p_pack->output_format.video.i_height= ShowBits( &p_pack->bit_stream, 24 ) & 0xFFF;
/* frame_rate_code */
i_frame_rate_code = ShowBits( &p_pack->bit_stream, 32 ) & 0xF;
msg_Warn( p_pack->p_fifo,
"creating input (image size %dx%d, frame rate %.2f)",
- p_pack->output_format.i_width,
- p_pack->output_format.i_height,
+ p_pack->output_format.video.i_width,
+ p_pack->output_format.video.i_height,
p_pack->d_frame_rate );
/* now we have informations to create the input */
* display.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: display.c,v 1.6 2003/11/18 16:46:31 fenrir Exp $
+ * $Id: display.c,v 1.7 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
};
-static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add ( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
return NULL;
}
id->p_es->i_stream_id = 1;
- id->p_es->i_fourcc = p_fmt->i_fourcc;
+ id->p_es->i_fourcc = p_fmt->i_codec;
id->p_es->b_force_decoder = VLC_TRUE;
switch( p_fmt->i_cat )
{
case AUDIO_ES:
id->p_es->p_bitmapinfoheader = NULL;
id->p_es->p_waveformatex =
- malloc( sizeof( WAVEFORMATEX ) + p_fmt->i_extra_data );
+ malloc( sizeof( WAVEFORMATEX ) + p_fmt->i_extra );
#define p_wf ((WAVEFORMATEX*)id->p_es->p_waveformatex)
p_wf->wFormatTag = WAVE_FORMAT_UNKNOWN;
- p_wf->nChannels = p_fmt->i_channels;
- p_wf->nSamplesPerSec = p_fmt->i_sample_rate;
+ p_wf->nChannels = p_fmt->audio.i_channels;
+ p_wf->nSamplesPerSec = p_fmt->audio.i_rate;
p_wf->nAvgBytesPerSec= p_fmt->i_bitrate / 8;
- p_wf->nBlockAlign = p_fmt->i_block_align;
+ p_wf->nBlockAlign = p_fmt->audio.i_blockalign;
p_wf->wBitsPerSample = 0;
- p_wf->cbSize = p_fmt->i_extra_data;
- if( p_fmt->i_extra_data > 0 )
+ p_wf->cbSize = p_fmt->i_extra;
+ if( p_fmt->i_extra > 0 )
{
memcpy( &p_wf[1],
- p_fmt->p_extra_data,
- p_fmt->i_extra_data );
+ p_fmt->p_extra,
+ p_fmt->i_extra );
}
#undef p_wf
break;
case VIDEO_ES:
id->p_es->p_waveformatex = NULL;
- id->p_es->p_bitmapinfoheader = malloc( sizeof( BITMAPINFOHEADER ) + p_fmt->i_extra_data );
+ id->p_es->p_bitmapinfoheader = malloc( sizeof( BITMAPINFOHEADER ) + p_fmt->i_extra );
#define p_bih ((BITMAPINFOHEADER*)id->p_es->p_bitmapinfoheader)
- p_bih->biSize = sizeof( BITMAPINFOHEADER ) + p_fmt->i_extra_data;
- p_bih->biWidth = p_fmt->i_width;
- p_bih->biHeight = p_fmt->i_height;
+ p_bih->biSize = sizeof( BITMAPINFOHEADER ) + p_fmt->i_extra;
+ p_bih->biWidth = p_fmt->video.i_width;
+ p_bih->biHeight = p_fmt->video.i_height;
p_bih->biPlanes = 0;
p_bih->biBitCount = 0;
p_bih->biCompression = 0;
p_bih->biYPelsPerMeter = 0;
p_bih->biClrUsed = 0;
p_bih->biClrImportant = 0;
- if( p_fmt->i_extra_data > 0 )
+ if( p_fmt->i_extra > 0 )
{
memcpy( &p_bih[1],
- p_fmt->p_extra_data,
- p_fmt->i_extra_data );
+ p_fmt->p_extra,
+ p_fmt->i_extra );
}
#undef p_bih
break;
* dummy.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: dummy.c,v 1.1 2003/04/13 20:00:21 fenrir Exp $
+ * $Id: dummy.c,v 1.2 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
};
-static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add ( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_id_t *id;
* duplicate.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: duplicate.c,v 1.4 2003/09/21 11:48:58 gbazin Exp $
+ * $Id: duplicate.c,v 1.5 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *,
sout_buffer_t* );
free( p_sys );
}
-static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
* es.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: es.c,v 1.3 2003/07/05 21:31:02 alexis Exp $
+ * $Id: es.c,v 1.4 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
return( psz_url );
}
-static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add ( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_instance_t *p_sout = p_stream->p_sout;
/* *** get url (%d expanded as a codec count, %c expanded as codec fcc ) *** */
if( p_fmt->i_cat == AUDIO_ES && p_sys->psz_url_audio )
{
- psz_url = es_print_url( p_sys->psz_url_audio, p_fmt->i_fourcc, p_sys->i_count_audio, psz_access, psz_mux );
+ psz_url = es_print_url( p_sys->psz_url_audio, p_fmt->i_codec, p_sys->i_count_audio, psz_access, psz_mux );
}
else if( p_fmt->i_cat == VIDEO_ES && p_sys->psz_url_video )
{
- psz_url = es_print_url( p_sys->psz_url_video, p_fmt->i_fourcc, p_sys->i_count_video, psz_access, psz_mux );
+ psz_url = es_print_url( p_sys->psz_url_video, p_fmt->i_codec, p_sys->i_count_video, psz_access, psz_mux );
}
else
{
i_count = p_sys->i_count;
}
- psz_url = es_print_url( p_sys->psz_url, p_fmt->i_fourcc, i_count, psz_access, psz_mux );
+ psz_url = es_print_url( p_sys->psz_url, p_fmt->i_codec, i_count, psz_access, psz_mux );
}
p_sys->i_count++;
* gather.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: gather.c,v 1.1 2003/09/07 20:12:44 fenrir Exp $
+ * $Id: gather.c,v 1.2 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
{
vlc_bool_t b_used;
- sout_format_t fmt;
+ es_format_t fmt;
void *id;
};
/*****************************************************************************
* Add:
*****************************************************************************/
-static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
id = p_sys->id[i];
if( !id->b_used &&
id->fmt.i_cat == p_fmt->i_cat &&
- id->fmt.i_fourcc == p_fmt->i_fourcc &&
+ id->fmt.i_codec == p_fmt->i_codec &&
( ( id->fmt.i_cat == AUDIO_ES &&
- id->fmt.i_sample_rate == p_fmt->i_sample_rate &&
- id->fmt.i_channels == p_fmt->i_channels &&
- id->fmt.i_block_align == p_fmt->i_block_align ) ||
+ id->fmt.audio.i_rate == p_fmt->audio.i_rate &&
+ id->fmt.audio.i_channels == p_fmt->audio.i_channels &&
+ id->fmt.audio.i_blockalign == p_fmt->audio.i_blockalign ) ||
( id->fmt.i_cat == VIDEO_ES &&
- id->fmt.i_width == p_fmt->i_width &&
- id->fmt.i_height == p_fmt->i_height ) ) )
+ id->fmt.video.i_width == p_fmt->video.i_width &&
+ id->fmt.video.i_height == p_fmt->video.i_height ) ) )
{
msg_Dbg( p_stream, "reusing already opened output" );
id->b_used = VLC_TRUE;
id = malloc( sizeof( sout_stream_id_t ) );
msg_Dbg( p_stream, "creating new output" );
- memcpy( &id->fmt, p_fmt, sizeof( sout_format_t ) );
- id->fmt.i_extra_data = 0;
- id->fmt.p_extra_data = NULL;
+ memcpy( &id->fmt, p_fmt, sizeof( es_format_t ) );
+ id->fmt.i_extra = 0;
+ id->fmt.p_extra = NULL;
id->b_used = VLC_TRUE;
id->id = p_sys->p_out->pf_add( p_sys->p_out, p_fmt );
if( id->id == NULL )
* rtp.c
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: rtp.c,v 1.6 2003/11/07 18:32:24 fenrir Exp $
+ * $Id: rtp.c,v 1.7 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
s[2*i_data] = '\0';
}
-static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add ( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_instance_t *p_sout = p_stream->p_sout;
sout_stream_sys_t *p_sys = p_stream->p_sys;
id->psz_destination = strdup( p_sys->psz_destination );
id->i_port = p_sys->i_port;
- switch( p_fmt->i_fourcc )
+ switch( p_fmt->i_codec )
{
case VLC_FOURCC( 's', '1', '6', 'b' ):
- if( p_fmt->i_channels == 1 && p_fmt->i_sample_rate == 44100 )
+ if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 44100 )
{
id->i_payload_type = 11;
}
- else if( p_fmt->i_channels == 2 && p_fmt->i_sample_rate == 44100 )
+ else if( p_fmt->audio.i_channels == 2 && p_fmt->audio.i_rate == 44100 )
{
id->i_payload_type = 10;
}
id->i_payload_type = p_sys->i_payload_type++;
}
id->psz_rtpmap = malloc( strlen( "L16/*/*" ) + 20+1 );
- sprintf( id->psz_rtpmap, "L16/%d/%d", p_fmt->i_sample_rate, p_fmt->i_channels );
- id->i_clock_rate = p_fmt->i_sample_rate;
+ sprintf( id->psz_rtpmap, "L16/%d/%d", p_fmt->audio.i_rate, p_fmt->audio.i_channels );
+ id->i_clock_rate = p_fmt->audio.i_rate;
id->pf_packetize = rtp_packetize_l16;
break;
case VLC_FOURCC( 'u', '8', ' ', ' ' ):
id->i_payload_type = p_sys->i_payload_type++;
id->psz_rtpmap = malloc( strlen( "L8/*/*" ) + 20+1 );
- sprintf( id->psz_rtpmap, "L8/%d/%d", p_fmt->i_sample_rate, p_fmt->i_channels );
- id->i_clock_rate = p_fmt->i_sample_rate;
+ sprintf( id->psz_rtpmap, "L8/%d/%d", p_fmt->audio.i_rate, p_fmt->audio.i_channels );
+ id->i_clock_rate = p_fmt->audio.i_rate;
id->pf_packetize = rtp_packetize_l8;
break;
case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
break;
case VLC_FOURCC( 'm', 'p', '4', 'v' ):
{
- char hexa[2*p_fmt->i_extra_data +1];
+ char hexa[2*p_fmt->i_extra +1];
id->i_payload_type = p_sys->i_payload_type++;
id->i_clock_rate = 90000;
id->psz_rtpmap = strdup( "MP4V-ES/90000" );
id->pf_packetize = rtp_packetize_split;
- if( p_fmt->i_extra_data > 0 )
+ if( p_fmt->i_extra > 0 )
{
- id->psz_fmtp = malloc( 100 + 2 * p_fmt->i_extra_data );
- sprintf_hexa( hexa, p_fmt->p_extra_data, p_fmt->i_extra_data );
+ id->psz_fmtp = malloc( 100 + 2 * p_fmt->i_extra );
+ sprintf_hexa( hexa, p_fmt->p_extra, p_fmt->i_extra );
sprintf( id->psz_fmtp,
"profile-level-id=3; config=%s", hexa );
}
}
case VLC_FOURCC( 'm', 'p', '4', 'a' ):
{
- char hexa[2*p_fmt->i_extra_data +1];
+ char hexa[2*p_fmt->i_extra +1];
id->i_payload_type = p_sys->i_payload_type++;
- id->i_clock_rate = p_fmt->i_sample_rate;
+ id->i_clock_rate = p_fmt->audio.i_rate;
id->psz_rtpmap = malloc( strlen( "mpeg4-generic/" ) + 12 );
- sprintf( id->psz_rtpmap, "mpeg4-generic/%d", p_fmt->i_sample_rate );
+ sprintf( id->psz_rtpmap, "mpeg4-generic/%d", p_fmt->audio.i_rate );
id->pf_packetize = rtp_packetize_mp4a;
- id->psz_fmtp = malloc( 200 + 2 * p_fmt->i_extra_data );
- sprintf_hexa( hexa, p_fmt->p_extra_data, p_fmt->i_extra_data );
+ id->psz_fmtp = malloc( 200 + 2 * p_fmt->i_extra );
+ sprintf_hexa( hexa, p_fmt->p_extra, p_fmt->i_extra );
sprintf( id->psz_fmtp,
"streamtype=5; profile-level-id=15; mode=AAC-hbr; config=%s; "
"SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;", hexa );
}
default:
- msg_Err( p_stream, "cannot add this stream (unsupported codec:%4.4s)", (char*)&p_fmt->i_fourcc );
+ msg_Err( p_stream, "cannot add this stream (unsupported codec:%4.4s)", (char*)&p_fmt->i_codec );
free( id );
return NULL;
}
* standard.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: standard.c,v 1.15 2003/09/13 17:44:13 fenrir Exp $
+ * $Id: standard.c,v 1.16 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
};
-static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
* transcode.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.51 2003/11/17 02:55:22 fenrir Exp $
+ * $Id: transcode.c,v 1.52 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
struct sout_stream_id_t
{
vlc_fourcc_t b_transcode;
- sout_format_t f_src; /* only if transcoding */
- sout_format_t f_dst; /* " " " */
+ es_format_t f_src; /* only if transcoding */
+ es_format_t f_dst; /* " " " */
unsigned int i_inter_pixfmt; /* intermediary format when transcoding */
/* id of the out stream */
};
-static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
{
msg_Dbg( p_stream,
"creating audio transcoding from fcc=`%4.4s' to fcc=`%4.4s'",
- (char*)&p_fmt->i_fourcc,
+ (char*)&p_fmt->i_codec,
(char*)&p_sys->i_acodec );
/* src format */
- memcpy( &id->f_src, p_fmt, sizeof( sout_format_t ) );
+ memcpy( &id->f_src, p_fmt, sizeof( es_format_t ) );
/* create dst format */
id->f_dst.i_cat = AUDIO_ES;
- id->f_dst.i_fourcc = p_sys->i_acodec;
- id->f_dst.i_sample_rate = p_sys->i_sample_rate > 0 ? p_sys->i_sample_rate : id->f_src.i_sample_rate;
- id->f_dst.i_channels = p_sys->i_channels > 0 ? p_sys->i_channels : id->f_src.i_channels;
+ id->f_dst.i_codec = p_sys->i_acodec;
+ id->f_dst.audio.i_rate = p_sys->i_sample_rate > 0 ? p_sys->i_sample_rate : id->f_src.audio.i_rate;
+ id->f_dst.audio.i_channels = p_sys->i_channels > 0 ? p_sys->i_channels : id->f_src.audio.i_channels;
id->f_dst.i_bitrate = p_sys->i_abitrate > 0 ? p_sys->i_abitrate : 64000;
- id->f_dst.i_block_align = 0;
- id->f_dst.i_extra_data = 0;
- id->f_dst.p_extra_data = NULL;
+ id->f_dst.audio.i_blockalign = 0;
+ id->f_dst.i_extra = 0;
+ id->f_dst.p_extra = NULL;
/* build decoder -> filter -> encoder */
if( transcode_audio_ffmpeg_new( p_stream, id ) )
{
msg_Dbg( p_stream,
"creating video transcoding from fcc=`%4.4s' to fcc=`%4.4s'",
- (char*)&p_fmt->i_fourcc,
+ (char*)&p_fmt->i_codec,
(char*)&p_sys->i_vcodec );
- memcpy( &id->f_src, p_fmt, sizeof( sout_format_t ) );
+ memcpy( &id->f_src, p_fmt, sizeof( es_format_t ) );
/* create dst format */
id->f_dst.i_cat = VIDEO_ES;
- id->f_dst.i_fourcc = p_sys->i_vcodec;
- id->f_dst.i_width = p_sys->i_width ; /* > 0 ? p_sys->i_width : id->f_src.i_width; */
- id->f_dst.i_height = p_sys->i_height; /* > 0 ? p_sys->i_height: id->f_src.i_height; */
+ id->f_dst.i_codec = p_sys->i_vcodec;
+ id->f_dst.video.i_width = p_sys->i_width ; /* > 0 ? p_sys->i_width : id->f_src.i_width; */
+ id->f_dst.video.i_height= p_sys->i_height; /* > 0 ? p_sys->i_height: id->f_src.i_height; */
id->f_dst.i_bitrate = p_sys->i_vbitrate > 0 ? p_sys->i_vbitrate : 800*1000;
- id->f_dst.i_extra_data = 0;
- id->f_dst.p_extra_data = NULL;
+ id->f_dst.i_extra = 0;
+ id->f_dst.p_extra = NULL;
/* build decoder -> filter -> encoder */
if( transcode_video_ffmpeg_new( p_stream, id ) )
}
else
{
- msg_Dbg( p_stream, "not transcoding a stream (fcc=`%4.4s')", (char*)&p_fmt->i_fourcc );
+ msg_Dbg( p_stream, "not transcoding a stream (fcc=`%4.4s')", (char*)&p_fmt->i_codec );
id->id = p_sys->p_out->pf_add( p_sys->p_out, p_fmt );
id->b_transcode = VLC_FALSE;
{
int i_ff_codec;
- if( id->f_src.i_fourcc == VLC_FOURCC('s','1','6','l') ||
- id->f_src.i_fourcc == VLC_FOURCC('s','1','6','b') ||
- id->f_src.i_fourcc == VLC_FOURCC('s','8',' ',' ') ||
- id->f_src.i_fourcc == VLC_FOURCC('u','8',' ',' ') )
+ if( id->f_src.i_codec == VLC_FOURCC('s','1','6','l') ||
+ id->f_src.i_codec == VLC_FOURCC('s','1','6','b') ||
+ id->f_src.i_codec == VLC_FOURCC('s','8',' ',' ') ||
+ id->f_src.i_codec == VLC_FOURCC('u','8',' ',' ') )
{
id->ff_dec = NULL;
id->ff_dec_c = avcodec_alloc_context();
- id->ff_dec_c->sample_rate = id->f_src.i_sample_rate;
- id->ff_dec_c->channels = id->f_src.i_channels;
- id->ff_dec_c->block_align = id->f_src.i_block_align;
+ id->ff_dec_c->sample_rate = id->f_src.audio.i_rate;
+ id->ff_dec_c->channels = id->f_src.audio.i_channels;
+ id->ff_dec_c->block_align = id->f_src.audio.i_blockalign;
id->ff_dec_c->bit_rate = id->f_src.i_bitrate;
}
else
{
/* find decoder */
- i_ff_codec = get_ff_codec( id->f_src.i_fourcc );
+ i_ff_codec = get_ff_codec( id->f_src.i_codec );
if( i_ff_codec == 0 )
{
msg_Err( p_stream, "cannot find decoder id" );
}
id->ff_dec_c = avcodec_alloc_context();
- id->ff_dec_c->sample_rate = id->f_src.i_sample_rate;
- id->ff_dec_c->channels = id->f_src.i_channels;
- id->ff_dec_c->block_align = id->f_src.i_block_align;
+ id->ff_dec_c->sample_rate = id->f_src.audio.i_rate;
+ id->ff_dec_c->channels = id->f_src.audio.i_channels;
+ id->ff_dec_c->block_align = id->f_src.audio.i_blockalign;
id->ff_dec_c->bit_rate = id->f_src.i_bitrate;
- id->ff_dec_c->extradata_size = id->f_src.i_extra_data;
- id->ff_dec_c->extradata = id->f_src.p_extra_data;
+ id->ff_dec_c->extradata_size = id->f_src.i_extra;
+ id->ff_dec_c->extradata = id->f_src.p_extra;
if( avcodec_open( id->ff_dec_c, id->ff_dec ) )
{
msg_Err( p_stream, "cannot open decoder" );
id->p_buffer = malloc( id->i_buffer );
/* Sanity check for audio channels */
- id->f_dst.i_channels = __MIN( id->f_dst.i_channels, id->f_src.i_channels );
+ id->f_dst.audio.i_channels = __MIN( id->f_dst.audio.i_channels, id->f_src.audio.i_channels );
/* find encoder */
id->p_encoder = vlc_object_create( p_stream, VLC_OBJECT_ENCODER );
/* Initialization of encoder format structures */
es_format_Init( &id->p_encoder->fmt_in, AUDIO_ES, AOUT_FMT_S16_NE );
id->p_encoder->fmt_in.audio.i_format = AOUT_FMT_S16_NE;
- id->p_encoder->fmt_in.audio.i_rate = id->f_dst.i_sample_rate;
+ id->p_encoder->fmt_in.audio.i_rate = id->f_dst.audio.i_rate;
id->p_encoder->fmt_in.audio.i_physical_channels =
id->p_encoder->fmt_in.audio.i_original_channels =
- pi_channels_maps[id->f_dst.i_channels];
- id->p_encoder->fmt_in.audio.i_channels = id->f_dst.i_channels;
+ pi_channels_maps[id->f_dst.audio.i_channels];
+ id->p_encoder->fmt_in.audio.i_channels = id->f_dst.audio.i_channels;
id->p_encoder->fmt_out = id->p_encoder->fmt_in;
- id->p_encoder->fmt_out.i_codec = id->f_dst.i_fourcc;
+ id->p_encoder->fmt_out.i_codec = id->f_dst.i_codec;
id->p_encoder->fmt_out.i_bitrate = id->f_dst.i_bitrate;
id->p_encoder->p_module =
id->b_enc_inited = VLC_FALSE;
- id->f_dst.i_extra_data = id->p_encoder->fmt_out.i_extra;
- id->f_dst.p_extra_data = id->p_encoder->fmt_out.p_extra;
+ id->f_dst.i_extra = id->p_encoder->fmt_out.i_extra;
+ id->f_dst.p_extra = id->p_encoder->fmt_out.p_extra;
/* Hack for mp3 transcoding support */
- if( id->f_dst.i_fourcc == VLC_FOURCC( 'm','p','3',' ' ) )
+ if( id->f_dst.i_codec == VLC_FOURCC( 'm','p','3',' ' ) )
{
- id->f_dst.i_fourcc = VLC_FOURCC( 'm','p','g','a' );
+ id->f_dst.i_codec = VLC_FOURCC( 'm','p','g','a' );
}
return VLC_SUCCESS;
{
int16_t *sout = (int16_t*)id->p_buffer;
- if( id->f_src.i_fourcc == VLC_FOURCC( 's', '8', ' ', ' ' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'u', '8', ' ', ' ' ) )
+ if( id->f_src.i_codec == VLC_FOURCC( 's', '8', ' ', ' ' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'u', '8', ' ', ' ' ) )
{
int8_t *sin = (int8_t*)p_buffer;
int i_used = __MIN( id->i_buffer/2, i_buffer );
int i_samples = i_used;
- if( id->f_src.i_fourcc == VLC_FOURCC( 's', '8', ' ', ' ' ) )
+ if( id->f_src.i_codec == VLC_FOURCC( 's', '8', ' ', ' ' ) )
while( i_samples > 0 )
{
*sout++ = ( *sin++ ) << 8;
p_buffer += i_used;
id->i_buffer_pos = i_used * 2;
}
- else if( id->f_src.i_fourcc == VLC_FOURCC( 's', '1', '6', 'l' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 's', '1', '6', 'b' ) )
+ else if( id->f_src.i_codec == VLC_FOURCC( 's', '1', '6', 'l' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 's', '1', '6', 'b' ) )
{
int16_t *sin = (int16_t*)p_buffer;
int i_used = __MIN( id->i_buffer, i_buffer );
int i_samples = i_used / 2;
int b_invert_indianness;
- if( id->f_src.i_fourcc == VLC_FOURCC( 's', '1', '6', 'l' ) )
+ if( id->f_src.i_codec == VLC_FOURCC( 's', '1', '6', 'l' ) )
#ifdef WORDS_BIGENDIAN
b_invert_indianness = 1;
#else
aout_buf.p_buffer = id->p_buffer;
aout_buf.i_nb_bytes = id->i_buffer_pos;
- aout_buf.i_nb_samples = id->i_buffer_pos / 2 / id->f_src.i_channels;
+ aout_buf.i_nb_samples = id->i_buffer_pos / 2 / id->f_src.audio.i_channels;
aout_buf.start_date = id->i_dts;
aout_buf.end_date = id->i_dts;
id->i_dts += ( I64C(1000000) * id->i_buffer_pos / 2 /
- id->f_src.i_channels / id->f_src.i_sample_rate );
+ id->f_src.audio.i_channels / id->f_src.audio.i_rate );
p_block = id->p_encoder->pf_encode_audio( id->p_encoder, &aout_buf );
while( p_block )
int i_ff_codec;
/* Open decoder */
- if( id->f_src.i_fourcc == VLC_FOURCC( 'I', '4', '2', '0' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'I', '4', '2', '2' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'I', '4', '4', '4' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'Y', 'U', 'Y', '2' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'R', 'V', '1', '5' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'R', 'V', '1', '6' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'R', 'V', '2', '4' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'R', 'V', '3', '2' ) ||
- id->f_src.i_fourcc == VLC_FOURCC( 'G', 'R', 'E', 'Y' ) )
+ if( id->f_src.i_codec == VLC_FOURCC( 'I', '4', '2', '0' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'I', '4', '2', '2' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'I', '4', '4', '4' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'Y', 'U', 'Y', '2' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'R', 'V', '1', '5' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'R', 'V', '1', '6' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'R', 'V', '2', '4' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'R', 'V', '3', '2' ) ||
+ id->f_src.i_codec == VLC_FOURCC( 'G', 'R', 'E', 'Y' ) )
{
id->ff_dec = NULL;
id->ff_dec_c = avcodec_alloc_context();
- id->ff_dec_c->width = id->f_src.i_width;
- id->ff_dec_c->height = id->f_src.i_height;
- id->ff_dec_c->pix_fmt = get_ff_chroma( id->f_src.i_fourcc );
+ id->ff_dec_c->width = id->f_src.video.i_width;
+ id->ff_dec_c->height = id->f_src.video.i_height;
+ id->ff_dec_c->pix_fmt = get_ff_chroma( id->f_src.i_codec );
}
else
{
/* find decoder */
- i_ff_codec = get_ff_codec( id->f_src.i_fourcc );
+ i_ff_codec = get_ff_codec( id->f_src.i_codec );
if( i_ff_codec == 0 )
{
msg_Err( p_stream, "cannot find decoder" );
}
id->ff_dec_c = avcodec_alloc_context();
- id->ff_dec_c->width = id->f_src.i_width;
- id->ff_dec_c->height = id->f_src.i_height;
+ id->ff_dec_c->width = id->f_src.video.i_width;
+ id->ff_dec_c->height = id->f_src.video.i_height;
/* id->ff_dec_c->bit_rate = id->f_src.i_bitrate; */
- id->ff_dec_c->extradata_size= id->f_src.i_extra_data;
- id->ff_dec_c->extradata = id->f_src.p_extra_data;
+ id->ff_dec_c->extradata_size= id->f_src.i_extra;
+ id->ff_dec_c->extradata = id->f_src.p_extra;
id->ff_dec_c->workaround_bugs = FF_BUG_AUTODETECT;
id->ff_dec_c->error_resilience= -1;
id->ff_dec_c->get_buffer = transcode_video_ffmpeg_getframebuf;
es_format_Init( &id->p_encoder->fmt_in,
id->f_src.i_cat, get_vlc_chroma(id->ff_dec_c->pix_fmt) );
- id->p_encoder->fmt_in.video.i_width = id->f_dst.i_width;
- id->p_encoder->fmt_in.video.i_height = id->f_dst.i_height;
+ id->p_encoder->fmt_in.video.i_width = id->f_dst.video.i_width;
+ id->p_encoder->fmt_in.video.i_height = id->f_dst.video.i_height;
if( id->p_encoder->fmt_in.video.i_width <= 0 )
{
- id->p_encoder->fmt_in.video.i_width = id->f_dst.i_width =
+ id->p_encoder->fmt_in.video.i_width = id->f_dst.video.i_width =
id->ff_dec_c->width - p_sys->i_crop_left - p_sys->i_crop_right;
}
if( id->p_encoder->fmt_in.video.i_height <= 0 )
{
- id->p_encoder->fmt_in.video.i_height = id->f_dst.i_height =
+ id->p_encoder->fmt_in.video.i_height = id->f_dst.video.i_height =
id->ff_dec_c->height - p_sys->i_crop_top - p_sys->i_crop_bottom;
}
}
id->p_encoder->fmt_out = id->p_encoder->fmt_in;
- id->p_encoder->fmt_out.i_codec = id->f_dst.i_fourcc;
+ id->p_encoder->fmt_out.i_codec = id->f_dst.i_codec;
id->p_encoder->fmt_out.i_bitrate = id->f_dst.i_bitrate;
id->p_encoder->i_vtolerance = p_sys->i_vtolerance;
if( id->p_encoder->fmt_in.video.i_width <= 0 )
{
id->p_encoder->fmt_in.video.i_width =
- id->p_encoder->fmt_out.video.i_width = id->f_dst.i_width =
+ id->p_encoder->fmt_out.video.i_width = id->f_dst.video.i_width =
id->ff_dec_c->width - p_sys->i_crop_left -
p_sys->i_crop_right;
}
if( id->p_encoder->fmt_in.video.i_height <= 0 )
{
id->p_encoder->fmt_in.video.i_height =
- id->p_encoder->fmt_out.video.i_height = id->f_dst.i_height =
+ id->p_encoder->fmt_out.video.i_height = id->f_dst.video.i_height =
id->ff_dec_c->height - p_sys->i_crop_top -
p_sys->i_crop_bottom;
}
return VLC_EGENERIC;
}
- id->f_dst.i_extra_data = id->p_encoder->fmt_out.i_extra;
- id->f_dst.p_extra_data = id->p_encoder->fmt_out.p_extra;
+ id->f_dst.i_extra = id->p_encoder->fmt_out.i_extra;
+ id->f_dst.p_extra = id->p_encoder->fmt_out.p_extra;
/* Hack for mp2v/mp1v transcoding support */
- if( id->f_dst.i_fourcc == VLC_FOURCC( 'm','p','1','v' ) ||
- id->f_dst.i_fourcc == VLC_FOURCC( 'm','p','2','v' ) )
+ if( id->f_dst.i_codec == VLC_FOURCC( 'm','p','1','v' ) ||
+ id->f_dst.i_codec == VLC_FOURCC( 'm','p','2','v' ) )
{
- id->f_dst.i_fourcc = VLC_FOURCC( 'm','p','g','v' );
+ id->f_dst.i_codec = VLC_FOURCC( 'm','p','g','v' );
}
if( !( id->id =
}
/* convert size and crop */
- if( id->ff_dec_c->width != id->f_dst.i_width ||
- id->ff_dec_c->height != id->f_dst.i_height ||
+ if( id->ff_dec_c->width != id->f_dst.video.i_width ||
+ id->ff_dec_c->height != id->f_dst.video.i_height ||
p_sys->i_crop_top > 0 || p_sys->i_crop_bottom > 0 ||
p_sys->i_crop_left > 0 || p_sys->i_crop_right )
{
uint8_t *buf;
id->p_ff_pic_tmp2 = avcodec_alloc_frame();
i_size = avpicture_get_size( id->i_inter_pixfmt,
- id->f_dst.i_width,
- id->f_dst.i_height );
+ id->f_dst.video.i_width,
+ id->f_dst.video.i_height );
buf = malloc( i_size );
avpicture_fill( (AVPicture*)id->p_ff_pic_tmp2, buf,
id->i_inter_pixfmt,
- id->f_dst.i_width, id->f_dst.i_height );
+ id->f_dst.video.i_width, id->f_dst.video.i_height );
id->p_vresample =
- img_resample_full_init( id->f_dst.i_width,
- id->f_dst.i_height,
+ img_resample_full_init( id->f_dst.video.i_width,
+ id->f_dst.video.i_height,
id->ff_dec_c->width, id->ff_dec_c->height,
p_stream->p_sys->i_crop_top,
p_stream->p_sys->i_crop_bottom,
/* Encoding */
vout_InitPicture( VLC_OBJECT(p_stream), &pic,
id->p_encoder->fmt_in.i_codec,
- id->f_dst.i_width, id->f_dst.i_height,
- id->f_dst.i_width * VOUT_ASPECT_FACTOR /
- id->f_dst.i_height );
+ id->f_dst.video.i_width, id->f_dst.video.i_height,
+ id->f_dst.video.i_width * VOUT_ASPECT_FACTOR /
+ id->f_dst.video.i_height );
for( i_plane = 0; i_plane < pic.i_planes; i_plane++ )
{
* Copyright (C) 2003 Antoine Missout
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- * $Id: transrate.c,v 1.2 2003/11/12 18:13:31 fenrir Exp $
+ * $Id: transrate.c,v 1.3 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
+static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t * );
};
-static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
id->id = NULL;
if( p_fmt->i_cat == VIDEO_ES
- && p_fmt->i_fourcc == VLC_FOURCC('m', 'p', 'g', 'v') )
+ && p_fmt->i_codec == VLC_FOURCC('m', 'p', 'g', 'v') )
{
msg_Dbg( p_stream,
"creating video transrating for fcc=`%4.4s'",
- (char*)&p_fmt->i_fourcc );
+ (char*)&p_fmt->i_codec );
id->p_current_buffer = NULL;
id->p_next_gop = NULL;
}
else
{
- msg_Dbg( p_stream, "not transrating a stream (fcc=`%4.4s')", (char*)&p_fmt->i_fourcc );
+ msg_Dbg( p_stream, "not transrating a stream (fcc=`%4.4s')", (char*)&p_fmt->i_codec );
id->id = p_sys->p_out->pf_add( p_sys->p_out, p_fmt );
id->b_transrate = VLC_FALSE;
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dec.c,v 1.71 2003/11/18 22:48:46 fenrir Exp $
+ * $Id: input_dec.c,v 1.72 2003/11/21 15:32:08 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
vout_thread_t *p_vout;
sout_packetizer_input_t *p_sout;
- sout_format_t sout_format;
/* Current format in use by the output */
video_format_t video;
- audio_format_t audio;
+ audio_format_t audio;
+ es_format_t sout;
};
/*****************************************************************************
{
if( !p_dec->p_owner->p_sout )
{
- sout_format_t *p_format = &p_dec->p_owner->sout_format;
-
- p_format->i_cat = p_dec->fmt_out.i_cat;
- p_format->i_fourcc = p_dec->fmt_out.i_codec;
- p_format->i_sample_rate =
- p_dec->fmt_out.audio.i_rate;
- p_format->i_channels =
- p_dec->fmt_out.audio.i_channels;
- p_format->i_block_align =
- p_dec->fmt_out.audio.i_blockalign;
- p_format->i_width =
- p_dec->fmt_out.video.i_width;
- p_format->i_height =
- p_dec->fmt_out.video.i_height;
- p_format->i_bitrate = p_dec->fmt_out.i_bitrate;
- p_format->i_extra_data = p_dec->fmt_out.i_extra;
- p_format->p_extra_data = p_dec->fmt_out.p_extra;
+ es_format_Copy( &p_dec->p_owner->sout, &p_dec->fmt_out );
p_dec->p_owner->p_sout =
- sout_InputNew( p_dec, p_format );
+ sout_InputNew( p_dec, &p_dec->p_owner->sout );
if( p_dec->p_owner->p_sout == NULL )
{
* stream_output.c : stream output module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: stream_output.c,v 1.34 2003/09/07 22:43:17 fenrir Exp $
+ * $Id: stream_output.c,v 1.35 2003/11/21 15:32:09 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
* Packetizer/Input
*****************************************************************************/
sout_packetizer_input_t *__sout_InputNew( vlc_object_t *p_this,
- sout_format_t *p_fmt )
+ es_format_t *p_fmt )
{
sout_instance_t *p_sout = NULL;
sout_packetizer_input_t *p_input;
p_input->p_sout = p_sout;
p_input->p_fmt = p_fmt;
- if( p_fmt->i_fourcc == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
+ if( p_fmt->i_codec == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
{
vlc_object_release( p_sout );
return p_input;
msg_Dbg( p_sout, "removing an input" );
- if( p_input->p_fmt->i_fourcc != VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
+ if( p_input->p_fmt->i_codec != VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
{
vlc_mutex_lock( &p_sout->lock );
p_sout->p_stream->pf_del( p_sout->p_stream, p_input->id );
sout_instance_t *p_sout = p_input->p_sout;
int i_ret;
- if( p_input->p_fmt->i_fourcc == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
+ if( p_input->p_fmt->i_codec == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
{
sout_BufferDelete( p_input->p_sout, p_buffer );
return VLC_SUCCESS;
}
sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux,
- sout_format_t *p_fmt )
+ es_format_t *p_fmt )
{
sout_input_t *p_input;