/*****************************************************************************
* record.c: record stream output module
*****************************************************************************
- * Copyright (C) 2008 the VideoLAN team
+ * Copyright (C) 2008-2009 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
#include <vlc_plugin.h>
#include <vlc_block.h>
#include <vlc_sout.h>
-#include <vlc_charset.h>
+#include <vlc_fs.h>
#include <assert.h>
/*****************************************************************************
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
- add_string( SOUT_CFG_PREFIX "dst-prefix", "", NULL, DST_PREFIX_TEXT,
+ add_string( SOUT_CFG_PREFIX "dst-prefix", "", DST_PREFIX_TEXT,
DST_PREFIX_LONGTEXT, true )
set_callbacks( Open, Close )
p_sys->i_date_start = -1;
p_sys->i_size = 0;
#ifdef OPTIMIZE_MEMORY
- p_sys->i_max_wait = 5*1000000; /* 5s */
- p_sys->i_max_size = 1*1000000; /* 1 Mbyte */
+ p_sys->i_max_wait = 5*CLOCK_FREQ; /* 5s */
+ p_sys->i_max_size = 1*1024*1024; /* 1 MiB */
#else
- p_sys->i_max_wait = 30*1000000; /* 30s */
- p_sys->i_max_size = 20*1000000; /* 20 Mbyte */
+ p_sys->i_max_wait = 30*CLOCK_FREQ; /* 30s */
+ p_sys->i_max_size = 20*1024*1024; /* 20 MiB */
#endif
p_sys->b_drop = false;
p_sys->i_dts_start = 0;
sout_stream_sys_t *p_sys = p_stream->p_sys;
if( p_sys->p_out )
- sout_StreamDelete( p_sys->p_out );
+ sout_StreamChainDelete( p_sys->p_out, p_sys->p_out );
TAB_CLEAN( p_sys->i_id, p_sys->id );
free( p_sys->psz_prefix );
M( "raw", "mpc", 1, VLC_CODEC_MUSEPACK7, VLC_CODEC_MUSEPACK8 ),
M( "raw", "ape", 1, VLC_CODEC_APE ),
- M( "wav", "wav", 1, VLC_CODEC_U8, VLC_CODEC_S16L,
+ M( "wav", "wav", 1, VLC_CODEC_U8, VLC_CODEC_S16L,
VLC_CODEC_S24L, VLC_CODEC_S32L, VLC_CODEC_FL32 ),
- //M( "ffmpeg{mux=flac}", "flac", 1, VLC_CODEC_FLAC ), BROKEN
+ //M( "avformat{mux=flac}", "flac", 1, VLC_CODEC_FLAC ), BROKEN
- M( "ogg", "ogg", INT_MAX, VLC_CODEC_VORBIS, VLC_CODEC_SPEEX, VLC_CODEC_FLAC,
- VLC_CODEC_SUBT, VLC_CODEC_THEORA, VLC_CODEC_DIRAC ),
+ M( "ogg", "ogg", INT_MAX, VLC_CODEC_VORBIS, VLC_CODEC_SPEEX, VLC_CODEC_FLAC,
+ VLC_CODEC_SUBT, VLC_CODEC_THEORA, VLC_CODEC_DIRAC ),
M( "asf", "asf", 127, VLC_CODEC_WMA1, VLC_CODEC_WMA2, VLC_CODEC_WMAP, VLC_CODEC_WMAL, VLC_CODEC_WMAS,
VLC_CODEC_WMV1, VLC_CODEC_WMV2, VLC_CODEC_WMV3, VLC_CODEC_VC1 ),
VLC_CODEC_DTS,
VLC_CODEC_SPU ),
+ M( "avi", "avi", 100, VLC_CODEC_A52, VLC_CODEC_MPGA,
+ VLC_CODEC_WMA1, VLC_CODEC_WMA2, VLC_CODEC_WMAP, VLC_CODEC_WMAL,
+ VLC_CODEC_U8, VLC_CODEC_S16L, VLC_CODEC_S24L,
+ VLC_CODEC_MP4V ),
+
M( "ts", "ts", 8000, VLC_CODEC_MPGV,
VLC_CODEC_H264,
VLC_CODEC_MPGA, VLC_CODEC_DVD_LPCM, VLC_CODEC_A52,
- VLC_CODEC_DTS, VLC_CODEC_MP4A,
+ VLC_CODEC_DTS, VLC_CODEC_MP4A,
VLC_CODEC_DVBS, VLC_CODEC_TELETEXT ),
+ M( "mkv", "mkv", 32, VLC_CODEC_H264, VLC_CODEC_VP8, VLC_CODEC_MP4V,
+ VLC_CODEC_A52, VLC_CODEC_MP4A, VLC_CODEC_VORBIS, VLC_CODEC_FLAC ),
+
M( NULL, NULL, 0, 0 )
};
#undef M
const char *psz_muxer, const char *psz_prefix, const char *psz_extension )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
- char *psz_file;
- char *psz_output;
+ char *psz_file = NULL;
+ char *psz_output = NULL;
int i_count;
if( asprintf( &psz_file, "%s%s%s",
/* Create the output */
msg_Dbg( p_stream, "Using record output `%s'", psz_output );
- p_sys->p_out = sout_StreamNew( p_stream->p_sout, psz_output );
+ p_sys->p_out = sout_StreamChainNew( p_stream->p_sout, psz_output, NULL, NULL );
if( !p_sys->p_out )
goto error;
const char *psz_muxer = NULL;
const char *psz_extension = NULL;
- /* Look for prefered muxer
+ /* Look for preferred muxer
* TODO we could insert transcode in a few cases like
* s16l <-> s16b
*/
static const char *ppsz_muxers[][2] = {
{ "avi", "avi" }, { "mp4", "mp4" }, { "ogg", "ogg" },
{ "asf", "asf" }, { "ts", "ts" }, { "ps", "mpg" },
+ { "mkv", "mkv" },
#if 0
// XXX ffmpeg sefault really easily if you try an unsupported codec
// mov and avi at least segfault
- { "ffmpeg{mux=avi}", "avi" },
- { "ffmpeg{mux=mov}", "mov" },
- { "ffmpeg{mux=mp4}", "mp4" },
- { "ffmpeg{mux=nsv}", "nsv" },
- { "ffmpeg{mux=flv}", "flv" },
+ { "avformat{mux=avi}", "avi" },
+ { "avformat{mux=mov}", "mov" },
+ { "avformat{mux=mp4}", "mp4" },
+ { "avformat{mux=nsv}", "nsv" },
+ { "avformat{mux=flv}", "flv" },
#endif
{ NULL, NULL }
};
if( i_es < 0 )
{
- utf8_unlink( psz_file );
+ vlc_unlink( psz_file );
free( psz_file );
continue;
}
id->id = NULL;
}
if( p_sys->p_out )
- sout_StreamDelete( p_sys->p_out );
+ sout_StreamChainDelete( p_sys->p_out, p_sys->p_out );
p_sys->p_out = NULL;
if( i_es > i_best_es )
if( i_best_es >= p_sys->i_id )
break;
}
- utf8_unlink( psz_file );
+ vlc_unlink( psz_file );
free( psz_file );
}