Commit 05ddee03 authored by Laurent Aimar's avatar Laurent Aimar

* stream output: fixed name inconsistency, added a new exported

functions by muxer.
 * wav: fixed a warning.
parent 96b6dc5c
......@@ -2,7 +2,7 @@
* stream_output.h : stream output module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: stream_output.h,v 1.5 2003/02/16 14:10:44 fenrir Exp $
* $Id: stream_output.h,v 1.6 2003/02/24 10:45:55 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
......@@ -107,6 +107,19 @@ struct sout_access_out_t
int (* pf_write )( sout_access_out_t *,
sout_buffer_t * );
};
/*
* i_query parameter of pf_mux_capacity
*/
/* SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: p_args=NULL, p_answer=&boolean */
#define SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME 0x01
/* SOUT_MUX_CAP_GET_STREAMABLE: p_args=NULL, p_answer=&boolean */
#define SOUT_MUX_CAP_GET_STREAMABLE 0x02
/*
* return error code
*/
#define SOUT_MUX_CAP_ERR_OK 0x00
#define SOUT_MUX_CAP_ERR_UNKNOWN 0x01
#define SOUT_MUX_CAP_ERR_UNIMPLEMENTED 0x02
struct sout_instance_t
{
......@@ -124,6 +137,8 @@ struct sout_instance_t
module_t *p_mux;
void *p_mux_data;
int i_mux_preheader;
int (* pf_mux_capacity) ( sout_instance_t *,
int, void *, void *);
int (* pf_mux_addstream )( sout_instance_t *,
sout_input_t * );
int (* pf_mux_delstream )( sout_instance_t *,
......@@ -169,7 +184,7 @@ VLC_EXPORT( sout_buffer_t*, sout_BufferDuplicate,(sout_instance_t *, sout_buffer
VLC_EXPORT( void, sout_BufferChain, ( sout_buffer_t **, sout_buffer_t * ) );
VLC_EXPORT( sout_access_out_t *, sout_AccessOutNew, ( sout_instance_t *, char *psz_access, char *psz_name ) );
VLC_EXPORT( void, sout_AccessDelete, ( sout_access_out_t * ) );
VLC_EXPORT( int, sout_AccessSeek, ( sout_access_out_t *, off_t ) );
VLC_EXPORT( int, sout_AccessWrite, ( sout_access_out_t *, sout_buffer_t * ) );
VLC_EXPORT( void, sout_AccessOutDelete, ( sout_access_out_t * ) );
VLC_EXPORT( int, sout_AccessOutSeek, ( sout_access_out_t *, off_t ) );
VLC_EXPORT( int, sout_AccessOutWrite, ( sout_access_out_t *, sout_buffer_t * ) );
......@@ -2,7 +2,7 @@
* wav.c : wav file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: wav.c,v 1.11 2003/02/24 09:18:07 fenrir Exp $
* $Id: wav.c,v 1.12 2003/02/24 10:45:55 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -164,6 +164,7 @@ static int SeekAbsolute( input_thread_t *p_input,
{
input_AccessReinit( p_input );
p_input->pf_seek( p_input, i_pos );
return( VLC_SUCCESS );
}
}
......
......@@ -2,7 +2,7 @@
* avi.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: avi.c,v 1.5 2003/02/16 14:10:44 fenrir Exp $
* $Id: avi.c,v 1.6 2003/02/24 10:45:55 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -170,6 +170,7 @@ static int Open( vlc_object_t *p_this )
msg_Info( p_sout, "Open" );
p_sout->pf_mux_capacity = NULL;
p_sout->pf_mux_addstream = AddStream;
p_sout->pf_mux_delstream = DelStream;
p_sout->pf_mux = Mux;
......@@ -179,7 +180,7 @@ static int Open( vlc_object_t *p_this )
/* room to add header at the end */
p_hdr = sout_BufferNew( p_sout, HDR_SIZE );
memset( p_hdr->p_buffer, 0, HDR_SIZE );
sout_AccessWrite( p_sout->p_access, p_hdr );
sout_AccessOutWrite( p_sout->p_access, p_hdr );
return VLC_SUCCESS;
}
......@@ -200,7 +201,7 @@ static void Close( vlc_object_t * p_this )
/* first create idx1 chunk (write at the end of the stream */
p_idx1 = avi_HeaderCreateidx1( p_sout );
p_mux->i_idx1_size = p_idx1->i_size;
sout_AccessWrite( p_sout->p_access, p_idx1 );
sout_AccessOutWrite( p_sout->p_access, p_idx1 );
/* calculate some value for headers creations */
for( i_stream = 0; i_stream < p_mux->i_streams; i_stream++ )
......@@ -232,8 +233,8 @@ static void Close( vlc_object_t * p_this )
}
p_hdr = avi_HeaderCreateRIFF( p_sout );
sout_AccessSeek( p_sout->p_access, 0 );
sout_AccessWrite( p_sout->p_access, p_hdr );
sout_AccessOutSeek( p_sout->p_access, 0 );
sout_AccessOutWrite( p_sout->p_access, p_hdr );
}
......@@ -374,7 +375,7 @@ static int Mux ( sout_instance_t *p_sout )
SetFCC( p_hdr->p_buffer, p_stream->fcc );
SetDWLE( p_hdr->p_buffer + 4, p_data->i_size );
sout_AccessWrite( p_sout->p_access, p_hdr );
sout_AccessOutWrite( p_sout->p_access, p_hdr );
p_mux->i_movi_size += p_hdr->i_size;
}
......@@ -390,7 +391,7 @@ static int Mux ( sout_instance_t *p_sout )
p_data->i_size += 1;
}
sout_AccessWrite( p_sout->p_access, p_data );
sout_AccessOutWrite( p_sout->p_access, p_data );
p_mux->i_movi_size += p_data->i_size;
i_count--;
......
......@@ -2,7 +2,7 @@
* dummy.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: dummy.c,v 1.2 2003/02/16 14:10:44 fenrir Exp $
* $Id: dummy.c,v 1.3 2003/02/24 10:45:55 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -73,6 +73,7 @@ static int Open( vlc_object_t *p_this )
msg_Info( p_sout, "Open" );
p_sout->pf_mux_capacity = NULL;
p_sout->pf_mux_addstream = AddStream;
p_sout->pf_mux_delstream = DelStream;
p_sout->pf_mux = Mux;
......@@ -120,7 +121,7 @@ static int Mux ( sout_instance_t *p_sout )
p_data = sout_FifoGet( p_fifo );
sout_AccessWrite( p_sout->p_access, p_data );
sout_AccessOutWrite( p_sout->p_access, p_data );
i_count--;
}
......
......@@ -2,7 +2,7 @@
* ps.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ps.c,v 1.6 2003/02/16 14:10:44 fenrir Exp $
* $Id: ps.c,v 1.7 2003/02/24 10:45:55 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -116,6 +116,7 @@ static int Open( vlc_object_t *p_this )
p_mux = malloc( sizeof( sout_mux_t ) );
p_sout->pf_mux_capacity = NULL;
p_sout->pf_mux_addstream = AddStream;
p_sout->pf_mux_delstream = DelStream;
p_sout->pf_mux = Mux;
......@@ -148,7 +149,7 @@ static void Close( vlc_object_t * p_this )
p_end = sout_BufferNew( p_sout, 4 );
SetDWBE( p_end->p_buffer, 0x01b9 );
sout_AccessWrite( p_sout->p_access, p_end );
sout_AccessOutWrite( p_sout->p_access, p_end );
free( p_mux );
......@@ -247,7 +248,7 @@ static int MuxWritePackHeader( sout_instance_t *p_sout,
bits_write( &bits, 5, 0x1f ); // FIXME reserved
bits_write( &bits, 3, 0 ); // stuffing bytes
p_hdr->i_size = 14;
sout_AccessWrite( p_sout->p_access, p_hdr );
sout_AccessOutWrite( p_sout->p_access, p_hdr );
return( 0 );
}
......@@ -281,7 +282,7 @@ static int MuxWriteSystemHeader( sout_instance_t *p_sout )
/* FIXME missing stream_id ... */
sout_AccessWrite( p_sout->p_access, p_hdr );
sout_AccessOutWrite( p_sout->p_access, p_hdr );
return( 0 );
}
......@@ -365,7 +366,7 @@ static int Mux ( sout_instance_t *p_sout )
p_data = sout_FifoGet( p_fifo );
E_( EStoPES )( p_sout, &p_data, p_data, p_stream->i_stream_id, 1);
sout_AccessWrite( p_sout->p_access, p_data );
sout_AccessOutWrite( p_sout->p_access, p_data );
p_mux->i_pes_count++;
......
......@@ -2,7 +2,7 @@
* ts.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ts.c,v 1.9 2003/02/23 18:07:30 fenrir Exp $
* $Id: ts.c,v 1.10 2003/02/24 10:45:55 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -158,6 +158,7 @@ static int Open( vlc_object_t *p_this )
p_mux = malloc( sizeof( sout_mux_t ) );
p_sout->pf_mux_capacity = NULL;
p_sout->pf_mux_addstream = AddStream;
p_sout->pf_mux_delstream = DelStream;
p_sout->pf_mux = Mux;
......@@ -603,7 +604,7 @@ static int Mux( sout_instance_t *p_sout )
p_mux->i_ts_packet++;
SetTSDate( p_ts, i_dts, i_length );
sout_AccessWrite( p_sout->p_access, p_ts );
sout_AccessOutWrite( p_sout->p_access, p_ts );
}
return( 0 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment