Commit f96a0b41 authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Paul Saman

Clean up davinci codec debugging messages

Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent 519cac7a
......@@ -343,9 +343,8 @@ static aout_buffer_t *DecodeAudioBlock( decoder_t *p_dec, block_t **pp_block )
i = AUDDEC_process( p_sys->d, &p_sys->in, &p_sys->out, &in_args, &out_args );
if( i != AUDDEC_EOK )
{
msg_Err( p_dec, "Audio decoding failed (Error code: %d, "
"Extended error: %x)", i, (int)out_args.extendedError );
PrintExtendedError( p_dec, out_args.extendedError );
msg_Err( p_dec, "Audio decoding failed: %s",
davinci_GetExtendedError( out_args.extendedError ) );
if( i == AUDDEC_ERUNTIME || out_args.bytesConsumed == 0 ||
XDM_ISFATALERROR( out_args.extendedError ) )
{
......
......@@ -197,22 +197,24 @@ const char *ppsz_engine_error[] = {
//[Engine_ENOTFOUND] = "Entity was not found",
};
void __PrintExtendedError( vlc_object_t *p_this, XDAS_Int32 error )
const char * davinci_GetExtendedError( XDAS_Int32 error )
{
if( XDM_ISAPPLIEDCONCEALMENT( error ) )
msg_Err( p_this, " Applied bit concealment" );
return "Applied bit concealment";
if( XDM_ISINSUFFICIENTDATA( error ) )
msg_Err( p_this, " Insufficient data" );
return "Insufficient data";
if( XDM_ISCORRUPTEDDATA( error ) )
msg_Err( p_this, " Corrupted data" );
return "Corrupted data";
if( XDM_ISCORRUPTEDHEADER( error ) )
msg_Err( p_this, " Corrupted header" );
return "Corrupted header";
if( XDM_ISUNSUPPORTEDINPUT( error ) )
msg_Err( p_this, " Unsupported input" );
return "Unsupported input";
if( XDM_ISUNSUPPORTEDPARAM( error ) )
msg_Err( p_this, " Unsupported param" );
return "Unsupported param";
if( XDM_ISFATALERROR( error ) )
msg_Err( p_this, " Fatal error" );
return "Fatal error";
return "";
}
void __PrintAvailableAlgorithms( vlc_object_t *p_this, const char *psz_engine )
......
......@@ -51,8 +51,7 @@ void CloseVideoEncoder( vlc_object_t * );
int __AllocateBuffer( vlc_object_t *, XDAS_Int32, XDAS_Int32 *, XDM_BufDesc * );
#define AllocateBuffer( a, b, c, d ) __AllocateBuffer( VLC_OBJECT( a ), b, c, d )
void FreeBuffer( XDM_BufDesc * );
void __PrintExtendedError( vlc_object_t *, XDAS_Int32 );
#define PrintExtendedError( a, b ) __PrintExtendedError( VLC_OBJECT( a ), b )
const char *davinci_GetExtendedError( XDAS_Int32 );
void __PrintAvailableAlgorithms( vlc_object_t *, const char * );
#define PrintAvailableAlgorithms( a, b ) __PrintAvailableAlgorithms( VLC_OBJECT( a ), b )
XDAS_Int32 VlcChromaToXdm( vlc_fourcc_t );
......
......@@ -319,12 +319,25 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
if( ( i = VIDDEC_process( p_sys->d, &p_sys->in, &p_sys->out, &in_args, &out_args ) )
!= VIDDEC_EOK )
{
msg_Err( p_dec, "Video decoding failed (Error code: %d, "
"Extended error: %x)", i, (int)out_args.extendedError );
PrintExtendedError( p_dec, out_args.extendedError );
if( i_extra == 0 && p_dec->fmt_in.i_extra > 0 )
msg_Err( p_dec, "Video decoding failed: %s",
davinci_GetExtendedError(out_args.extendedError ) );
#if 0
if( (unsigned int)out_args.extendedError == 0x402 )
{
msg_Err( p_dec, "Trying again with p_extra" );
printf("frame was %d bytes\n",(unsigned int)in_args.numBytes);
unsigned int j;
for(j=0;j<(unsigned int)in_args.numBytes;j++)
printf("%.2x ",p_sys->in.bufs[0][j]&0xff);
printf("\n");
CERuntime_exit();
abort();
}
#endif
if( i_extra == 0 && p_dec->fmt_in.i_extra > 0 )
{ /* FIXME : make sure this is correct with the API */
msg_Dbg( p_dec, "Trying again with p_extra" );
return DecodeVideoBlockInner( p_dec, pp_block, p_dec->fmt_in.i_extra );
}
goto error;
......@@ -336,9 +349,8 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
goto error;
}
#ifdef DEBUG_DAVINCI
msg_Dbg( p_dec, "Bytes consumed: %d", (int)out_args.bytesConsumed );
#endif
if( in_args.numBytes > out_args.bytesConsumed )
msg_Err( p_dec, "%d bytes were not consumed", (int)(out_args.bytesConsumed - in_args.numBytes) );
p_block->p_buffer += out_args.bytesConsumed - i_extra;
p_block->i_buffer -= out_args.bytesConsumed - i_extra;
......
......@@ -26,7 +26,7 @@
*****************************************************************************/
#include "davinci.h"
#include <assert.h>
#include <ti/sdo/ce/video/videnc.h>
/*****************************************************************************
......@@ -275,11 +275,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pic )
}
/* Copy input picture */
if( p_pic->i_planes != p_sys->in.numBufs )
{
msg_Err( p_enc, "Ahem ... looks like I assumed something wrong. Please investigate." );
goto error;
}
assert( p_pic->i_planes == p_sys->in.numBufs );
for( i = 0; i < p_pic->i_planes; i++ )
{
......@@ -289,7 +285,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pic )
/* Configure input */
in_args.size = sizeof( in_args );
/* Heh, that was useless ... */
/* Configure output */
memset( &out_args, 0, sizeof( out_args ) );
......@@ -300,15 +295,13 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pic )
&in_args, &out_args );
if( i != VIDENC_EOK )
{
msg_Err( p_enc, "Video encoding failed (Error code: %d, "
"Extended erorr: %x)", i, (int)out_args.extendedError );
PrintExtendedError( p_enc, out_args.extendedError );
msg_Err( p_enc, "Video encoding failed: %s",
davinci_GetExtendedError( out_args.extendedError ) );
goto error;
}
/* Print some info */
msg_Info( p_enc, "Encoder info:" );
msg_Info( p_enc, " Bytes generated: %d", (int)out_args.bytesGenerated );
msg_Info( p_enc, "Bytes generated: %d", (int)out_args.bytesGenerated );
/* Put everything in the block */
if( out_args.bytesGenerated <= 0 )
......@@ -346,11 +339,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pic )
p_enc->fmt_in.video.i_frame_rate_base /
p_enc->fmt_in.video.i_frame_rate;
/* Looks like we're done */
#ifdef DEBUG_DAVINCI
msg_Info( p_enc, "Yay! Frame encoded correctly" );
#endif
return p_block;
error:
......
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