Commit a16542e6 authored by Antoine Cellerier's avatar Antoine Cellerier Committed by Jean-Paul Saman

Random stuff. No functional difference.

Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent 76a4102f
...@@ -291,6 +291,10 @@ static void CloseVideoDecoder( vlc_object_t *p_this ) ...@@ -291,6 +291,10 @@ static void CloseVideoDecoder( vlc_object_t *p_this )
/* Exit the codec engine */ /* Exit the codec engine */
CERuntime_exit(); CERuntime_exit();
/* Free 'DaVinci compliant' buffers */
FreeBuffer( &p_sys->in );
FreeBuffer( &p_sys->out );
free( p_sys ); free( p_sys );
} }
...@@ -359,23 +363,17 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -359,23 +363,17 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
goto error; goto error;
} }
/* Setup input arguments */
in_args.size = sizeof( in_args );
in_args.numBytes = __MIN( p_block->i_buffer, p_sys->in.bufSizes[0] );
in_args.inputID = 0; /* FIXME? */
/* Setup input buffer */ /* Setup input buffer */
if( p_block->i_buffer > p_sys->in.bufSizes[0] )
{
#ifdef DEBUG_DAVINCI #ifdef DEBUG_DAVINCI
if( p_block->i_buffer > p_sys->in.bufSizes[0] )
msg_Dbg( p_dec, "Woah! Not enough room to store the whole block" ); msg_Dbg( p_dec, "Woah! Not enough room to store the whole block" );
#endif #endif
memcpy( p_sys->in.bufs[0], p_block->p_buffer, p_sys->in.bufSizes[0] ); memcpy( p_sys->in.bufs[0], p_block->p_buffer, in_args.numBytes );
}
else
{
memcpy( p_sys->in.bufs[0], p_block->p_buffer, p_block->i_buffer );
}
/* Setup input arguments */
in_args.size = sizeof( in_args );
in_args.numBytes = __MIN( p_block->i_buffer, p_sys->in.bufSizes[0] );
in_args.inputID = 0; /* FIXME */
#if 0 #if 0
/* This obviously doesn't work (at least for mpeg2 video */ /* This obviously doesn't work (at least for mpeg2 video */
...@@ -439,12 +437,14 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -439,12 +437,14 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
/* That was easy :p */ /* That was easy :p */
/* Decode the video */ /* Decode the video */
printf("%s %s %d\n", __FILE__, __func__, __LINE__);
if( ( i = VIDDEC_process( p_sys->d, &p_sys->in, &p_sys->out, &in_args, &out_args ) ) if( ( i = VIDDEC_process( p_sys->d, &p_sys->in, &p_sys->out, &in_args, &out_args ) )
!= VIDDEC_EOK ) != VIDDEC_EOK )
{ {
msg_Err( p_dec, "Video decoding failed (Error code: %ld, Extended erorr: %lx)", i, out_args.extendedError ); msg_Err( p_dec, "Video decoding failed (Error code: %ld, Extended erorr: %lx)", i, out_args.extendedError );
goto error; goto error;
} }
printf("%s %s %d\n", __FILE__, __func__, __LINE__);
#ifdef DEBUG_DAVINCI #ifdef DEBUG_DAVINCI
msg_Info( p_dec, "%s %d", __func__, __LINE__ ); msg_Info( p_dec, "%s %d", __func__, __LINE__ );
...@@ -546,7 +546,9 @@ static int AllocateBuffer( decoder_t *p_dec, XDAS_Int32 i_num, ...@@ -546,7 +546,9 @@ static int AllocateBuffer( decoder_t *p_dec, XDAS_Int32 i_num,
{ {
int i; int i;
#ifdef DEBUG_DAVINCI
msg_Info( p_dec, "Allocating buffers:" ); msg_Info( p_dec, "Allocating buffers:" );
#endif
buf->numBufs = i_num; buf->numBufs = i_num;
buf->bufs = (XDAS_Int8 **)malloc( buf->numBufs * sizeof( XDAS_Int8 * ) ); buf->bufs = (XDAS_Int8 **)malloc( buf->numBufs * sizeof( XDAS_Int8 * ) );
...@@ -566,12 +568,16 @@ static int AllocateBuffer( decoder_t *p_dec, XDAS_Int32 i_num, ...@@ -566,12 +568,16 @@ static int AllocateBuffer( decoder_t *p_dec, XDAS_Int32 i_num,
for( i = 0; i < i_num; i++ ) for( i = 0; i < i_num; i++ )
{ {
#ifdef DEBUG_DAVINCI
msg_Info( p_dec, " %d: size %d Bytes", i, (int)pi_sizes[i] ); msg_Info( p_dec, " %d: size %d Bytes", i, (int)pi_sizes[i] );
#endif
buf->bufSizes[i] = pi_sizes[i]; buf->bufSizes[i] = pi_sizes[i];
buf->bufs[i] = Memory_contigAlloc( pi_sizes[i], Memory_DEFAULTALIGNMENT ); buf->bufs[i] = Memory_contigAlloc( pi_sizes[i], Memory_DEFAULTALIGNMENT );
if( !buf->bufs[i] ) if( !buf->bufs[i] )
{ {
#ifdef DEBUG_DAVINCI
msg_Err( p_dec, "Failed to allocate buffer" ); msg_Err( p_dec, "Failed to allocate buffer" );
#endif
for( i--; i >= 0; i-- ) for( i--; i >= 0; i-- )
{ {
Memory_contigFree( buf->bufs[i], buf->bufSizes[i] ); Memory_contigFree( buf->bufs[i], buf->bufSizes[i] );
...@@ -587,10 +593,13 @@ static int AllocateBuffer( decoder_t *p_dec, XDAS_Int32 i_num, ...@@ -587,10 +593,13 @@ static int AllocateBuffer( decoder_t *p_dec, XDAS_Int32 i_num,
static void FreeBuffer( XDM_BufDesc *buf ) static void FreeBuffer( XDM_BufDesc *buf )
{ {
int i; if( buf->numBufs != 0 )
for( i = 0; i < buf->numBufs; i++ ) {
Memory_contigFree( buf->bufs[i], buf->bufSizes[i] ); int i;
free( buf->bufs ); for( i = 0; i < buf->numBufs; i++ )
free( buf->bufSizes ); Memory_contigFree( buf->bufs[i], buf->bufSizes[i] );
buf->numBufs = 0; free( buf->bufs );
free( buf->bufSizes );
buf->numBufs = 0;
}
} }
...@@ -76,7 +76,7 @@ struct chroma_sys_t ...@@ -76,7 +76,7 @@ struct chroma_sys_t
*****************************************************************************/ *****************************************************************************/
vlc_module_begin(); vlc_module_begin();
set_description( _("Conversions using /dev/davinci_resizer") ); set_description( _("Conversions using /dev/davinci_resizer") );
set_capability( "chroma", 200 ); set_capability( "chroma", 0 /* FIXME once this module works */ );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
vlc_module_end(); vlc_module_end();
...@@ -87,11 +87,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -87,11 +87,6 @@ static int Open( vlc_object_t *p_this )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
}
switch( p_vout->render.i_chroma ) switch( p_vout->render.i_chroma )
{ {
case VLC_FOURCC('Y','V','1','2'): case VLC_FOURCC('Y','V','1','2'):
......
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