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