Commit 46ff41d4 authored by Laurent Aimar's avatar Laurent Aimar

Added dump alias module to dummy decoder.

It allows replacing --codec dummy --dummy-save-es by --codec dump.
parent c1708e15
...@@ -67,7 +67,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ); ...@@ -67,7 +67,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block );
/***************************************************************************** /*****************************************************************************
* OpenDecoder: Open the decoder * OpenDecoder: Open the decoder
*****************************************************************************/ *****************************************************************************/
int OpenDecoder ( vlc_object_t *p_this ) static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
{ {
decoder_t *p_dec = (decoder_t*)p_this; decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys; decoder_sys_t *p_sys;
...@@ -85,9 +85,13 @@ int OpenDecoder ( vlc_object_t *p_this ) ...@@ -85,9 +85,13 @@ int OpenDecoder ( vlc_object_t *p_this )
snprintf( psz_file, sizeof( psz_file), "stream.%p", p_dec ); snprintf( psz_file, sizeof( psz_file), "stream.%p", p_dec );
#ifndef UNDER_CE #ifndef UNDER_CE
if( !b_force_dump )
{
var_Create( p_dec, "dummy-save-es", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_dec, "dummy-save-es", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_dec, "dummy-save-es", &val ); var_Get( p_dec, "dummy-save-es", &val );
if( val.b_bool ) b_force_dump = val.b_bool;
}
if( b_force_dump )
{ {
p_sys->i_fd = open( psz_file, O_WRONLY | O_CREAT | O_TRUNC, 00644 ); p_sys->i_fd = open( psz_file, O_WRONLY | O_CREAT | O_TRUNC, 00644 );
...@@ -116,6 +120,15 @@ int OpenDecoder ( vlc_object_t *p_this ) ...@@ -116,6 +120,15 @@ int OpenDecoder ( vlc_object_t *p_this )
return VLC_SUCCESS; return VLC_SUCCESS;
} }
int OpenDecoder( vlc_object_t *p_this )
{
return OpenDecoderCommon( p_this, false );
}
int OpenDecoderDump( vlc_object_t *p_this )
{
return OpenDecoderCommon( p_this, true );
}
/**************************************************************************** /****************************************************************************
* RunDecoder: the whole thing * RunDecoder: the whole thing
**************************************************************************** ****************************************************************************
......
...@@ -82,6 +82,12 @@ vlc_module_begin(); ...@@ -82,6 +82,12 @@ vlc_module_begin();
set_capability( "decoder", 0 ); set_capability( "decoder", 0 );
set_callbacks( OpenDecoder, CloseDecoder ); set_callbacks( OpenDecoder, CloseDecoder );
add_bool( "dummy-save-es", 0, NULL, SAVE_TEXT, SAVE_LONGTEXT, true ); add_bool( "dummy-save-es", 0, NULL, SAVE_TEXT, SAVE_LONGTEXT, true );
add_submodule();
set_section( N_( "Dump decoder" ), NULL );
set_description( N_("Dump decoder function") );
set_capability( "decoder", -1 );
set_callbacks( OpenDecoderDump, CloseDecoder );
add_shortcut( "dump" );
add_submodule(); add_submodule();
set_description( N_("Dummy encoder function") ); set_description( N_("Dummy encoder function") );
set_capability( "encoder", 0 ); set_capability( "encoder", 0 );
......
...@@ -32,6 +32,7 @@ int OpenDemux ( vlc_object_t * ); ...@@ -32,6 +32,7 @@ int OpenDemux ( vlc_object_t * );
void CloseDemux ( vlc_object_t * ); void CloseDemux ( vlc_object_t * );
int OpenDecoder ( vlc_object_t * ); int OpenDecoder ( vlc_object_t * );
int OpenDecoderDump( vlc_object_t * );
void CloseDecoder ( vlc_object_t * ); void CloseDecoder ( vlc_object_t * );
int OpenEncoder ( vlc_object_t * ); int OpenEncoder ( vlc_object_t * );
......
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