Commit 4833310d authored by Laurent Aimar's avatar Laurent Aimar

Reduce schroedinger verbosity (at compil time).

parent d587aa48
...@@ -39,6 +39,26 @@ ...@@ -39,6 +39,26 @@
#include <schroedinger/schro.h> #include <schroedinger/schro.h>
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static int OpenDecoder ( vlc_object_t * );
static void CloseDecoder ( vlc_object_t * );
vlc_module_begin();
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_VCODEC );
set_description( N_("Schroedinger video decoder") );
set_capability( "decoder", 200 );
set_callbacks( OpenDecoder, CloseDecoder );
add_shortcut( "schroedinger" );
vlc_module_end();
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static picture_t *DecodeBlock ( decoder_t *p_dec, block_t **pp_block );
/***************************************************************************** /*****************************************************************************
* picture_pts_t : store pts alongside picture number, not carried through * picture_pts_t : store pts alongside picture number, not carried through
* decoder * decoder
...@@ -67,25 +87,7 @@ struct decoder_sys_t ...@@ -67,25 +87,7 @@ struct decoder_sys_t
int i_ts_resync_hack; int i_ts_resync_hack;
}; };
/***************************************************************************** //#define TRACE
* Local prototypes
*****************************************************************************/
static int OpenDecoder ( vlc_object_t * );
static void CloseDecoder ( vlc_object_t * );
static picture_t *DecodeBlock ( decoder_t *p_dec, block_t **pp_block );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_VCODEC );
set_description( N_("Schroedinger video decoder") );
set_capability( "decoder", 200 );
set_callbacks( OpenDecoder, CloseDecoder );
add_shortcut( "schroedinger" );
vlc_module_end();
/***************************************************************************** /*****************************************************************************
* ResetPTStlb: Purge all entries in @p_dec@'s PTS-tlb * ResetPTStlb: Purge all entries in @p_dec@'s PTS-tlb
...@@ -384,7 +386,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -384,7 +386,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* reset the decoder when seeking as the decode in progress is invalid */ /* reset the decoder when seeking as the decode in progress is invalid */
/* discard the block as it is just a null magic block */ /* discard the block as it is just a null magic block */
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) { if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) {
#ifdef TRACE
msg_Dbg( p_dec, "SCHRO_DECODER_RESET" ); msg_Dbg( p_dec, "SCHRO_DECODER_RESET" );
#endif
schro_decoder_reset( p_sys->p_schro ); schro_decoder_reset( p_sys->p_schro );
ResetPTStlb( p_dec ); ResetPTStlb( p_dec );
...@@ -450,8 +454,10 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -450,8 +454,10 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
b_bail = 1; b_bail = 1;
} }
#ifdef TRACE
msg_Dbg( p_dec, "Inserting bytes into decoder len=%zu of %zu pts=%"PRId64, msg_Dbg( p_dec, "Inserting bytes into decoder len=%zu of %zu pts=%"PRId64,
i_pulen, p_block->i_buffer, p_block->i_pts); i_pulen, p_block->i_buffer, p_block->i_pts);
#endif
/* this stops the same block being fed back into this function if /* this stops the same block being fed back into this function if
* we were on the next iteration of this loop to output a picture */ * we were on the next iteration of this loop to output a picture */
*pp_block = NULL; *pp_block = NULL;
...@@ -462,7 +468,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -462,7 +468,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
i_bufused += i_pulen; i_bufused += i_pulen;
if( state == SCHRO_DECODER_FIRST_ACCESS_UNIT ) { if( state == SCHRO_DECODER_FIRST_ACCESS_UNIT ) {
#ifdef TRACE
msg_Dbg( p_dec, "SCHRO_DECODER_FIRST_ACCESS_UNIT"); msg_Dbg( p_dec, "SCHRO_DECODER_FIRST_ACCESS_UNIT");
#endif
SetVideoFormat( p_dec ); SetVideoFormat( p_dec );
ResetPTStlb( p_dec ); ResetPTStlb( p_dec );
} }
...@@ -479,11 +487,15 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -479,11 +487,15 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
switch( state ) switch( state )
{ {
case SCHRO_DECODER_NEED_BITS: case SCHRO_DECODER_NEED_BITS:
#ifdef TRACE
msg_Dbg( p_dec, "SCHRO_DECODER_NEED_BITS" ); msg_Dbg( p_dec, "SCHRO_DECODER_NEED_BITS" );
#endif
return NULL; return NULL;
case SCHRO_DECODER_NEED_FRAME: case SCHRO_DECODER_NEED_FRAME:
#ifdef TRACE
msg_Dbg( p_dec, "SCHRO_DECODER_NEED_FRAME" ); msg_Dbg( p_dec, "SCHRO_DECODER_NEED_FRAME" );
#endif
p_schroframe = CreateSchroFrameFromPic( p_dec ); p_schroframe = CreateSchroFrameFromPic( p_dec );
if( !p_schroframe ) if( !p_schroframe )
...@@ -512,24 +524,27 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -512,24 +524,27 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_pic->date = p_sys->i_lastpts + p_sys->i_frame_pts_delta; p_pic->date = p_sys->i_lastpts + p_sys->i_frame_pts_delta;
p_sys->i_lastpts = p_pic->date; p_sys->i_lastpts = p_pic->date;
#ifdef TRACE
msg_Dbg( p_dec, "SCHRO_DECODER_OK num=%u date=%"PRId64, msg_Dbg( p_dec, "SCHRO_DECODER_OK num=%u date=%"PRId64,
u_pnum, p_pic->date); u_pnum, p_pic->date);
#endif
return p_pic; return p_pic;
case SCHRO_DECODER_EOS: case SCHRO_DECODER_EOS:
#ifdef TRACE
msg_Dbg( p_dec, "SCHRO_DECODER_EOS"); msg_Dbg( p_dec, "SCHRO_DECODER_EOS");
#endif
/* reset the decoder -- schro doesn't do this itself automatically */ /* reset the decoder -- schro doesn't do this itself automatically */
/* there are no more pictures in the output buffer at this point */ /* there are no more pictures in the output buffer at this point */
schro_decoder_reset( p_sys->p_schro ); schro_decoder_reset( p_sys->p_schro );
break; break;
case SCHRO_DECODER_ERROR: case SCHRO_DECODER_ERROR:
#ifdef TRACE
msg_Dbg( p_dec, "SCHRO_DECODER_ERROR"); msg_Dbg( p_dec, "SCHRO_DECODER_ERROR");
#endif
return NULL; return NULL;
} }
} }
/* Never reached */
return NULL;
} }
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