Commit c53866c7 authored by Jean-Paul Saman's avatar Jean-Paul Saman

davinci: video.c: improvements for readability

Improvements for readability:
- Renamed p_sys->e to p_sys_>engine
- Renamed p_sys->d to p_sys->handle
parent 4aef7755
......@@ -52,8 +52,8 @@ static picture_t *DecodeVideoBlock( decoder_t *, block_t ** );
struct decoder_sys_t
{
char *psz_ti_engine;
Engine_Handle e;
VIDDEC_Handle d;
Engine_Handle engine;
VIDDEC_Handle handle;
XDM_BufDesc in;
XDM_BufDesc out;
......@@ -103,7 +103,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
davinci_RuntimeInit( p_this );
/* Create an engine handle */
p_sys->e = Engine_open( p_sys->psz_ti_engine, NULL /*&Engine_ATTRS*/, &err );
p_sys->engine = Engine_open( p_sys->psz_ti_engine, NULL /*&Engine_ATTRS*/, &err );
if( err != Engine_EOK )
{
msg_Err( p_dec, "Error while opening engine `%s': %s",
......@@ -148,8 +148,8 @@ int OpenVideoDecoder( vlc_object_t *p_this )
goto error;
}
p_sys->d = VIDDEC_create( p_sys->e, (String)psz_codec, &params );
if( !p_sys->d )
p_sys->handle = VIDDEC_create( p_sys->engine, (String)psz_codec, &params );
if( !p_sys->handle )
{
msg_Err( p_dec, "Failed to create video decoder (%s) for %s",
psz_codec, psz_namecodec );
......@@ -172,7 +172,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
return VLC_SUCCESS;
error:
if( p_sys->e ) Engine_close( p_sys->e );
if( p_sys->engine ) Engine_close( p_sys->engine );
free( p_sys->psz_ti_engine );
free( p_sys );
return VLC_EGENERIC;
......@@ -187,10 +187,10 @@ void CloseVideoDecoder( vlc_object_t *p_this )
decoder_sys_t *p_sys = p_dec->p_sys;
/* Close our codec handle */
VIDDEC_delete( p_sys->d );
VIDDEC_delete( p_sys->handle );
/* Close our engine handle */
Engine_close( p_sys->e );
Engine_close( p_sys->engine );
/* Exit the codec engine */
davinci_RuntimeExit( p_this );
......@@ -247,7 +247,7 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
if( p_sys->in.numBufs == 0 || p_sys->out.numBufs == 0 )
{
if( VIDDEC_control( p_sys->d, XDM_GETBUFINFO, &dparams, &status )
if( VIDDEC_control( p_sys->handle, XDM_GETBUFINFO, &dparams, &status )
!= VIDDEC_EOK )
{
msg_Err( p_dec, "Failed to get buffer info" );
......@@ -279,7 +279,7 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
}
#ifdef DAVINCI_DEBUG
if( VIDDEC_control( p_sys->d, XDM_GETSTATUS, &dparams, &status )
if( VIDDEC_control( p_sys->handle, XDM_GETSTATUS, &dparams, &status )
!= VIDDEC_EOK )
{
msg_Err( p_dec, "Failed to get decoder status" );
......@@ -316,14 +316,14 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
out_args.size = sizeof( out_args );
/* Decode the video */
if( VIDDEC_process( p_sys->d, &p_sys->in, &p_sys->out, &in_args, &out_args ) != VIDDEC_EOK )
if( VIDDEC_process( p_sys->handle, &p_sys->in, &p_sys->out, &in_args, &out_args ) != VIDDEC_EOK )
{
msg_Err( p_dec, "Video decoding failed: %s",
davinci_GetExtendedError(out_args.extendedError ) );
goto error;
}
if( VIDDEC_control( p_sys->d, XDM_GETSTATUS, &dparams, &status ) != VIDDEC_EOK )
if( VIDDEC_control( p_sys->handle, XDM_GETSTATUS, &dparams, &status ) != VIDDEC_EOK )
{
msg_Err( p_dec, "Failed to get decoder status" );
goto 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