Commit 97034b01 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Some cleanup to the QT decoder. Still doesn't function.

parent dca021c1
...@@ -111,9 +111,10 @@ struct decoder_sys_t ...@@ -111,9 +111,10 @@ struct decoder_sys_t
#ifndef SYS_DARWIN #ifndef SYS_DARWIN
#ifdef LOADER #ifdef LOADER
ldt_fs_t *ldt_fs; ldt_fs_t *ldt_fs;
#endif /* LOADER */ #endif /* LOADER */
HMODULE qtml; HMODULE qtml;
HINSTANCE qtime_qts;
OSErr (*InitializeQTML) ( long flags ); OSErr (*InitializeQTML) ( long flags );
OSErr (*TerminateQTML) ( void ); OSErr (*TerminateQTML) ( void );
#endif /* SYS_DARWIN */ #endif /* SYS_DARWIN */
...@@ -136,7 +137,7 @@ struct decoder_sys_t ...@@ -136,7 +137,7 @@ struct decoder_sys_t
SoundConverter myConverter; SoundConverter myConverter;
SoundComponentData InputFormatInfo, OutputFormatInfo; SoundComponentData InputFormatInfo, OutputFormatInfo;
long FramesToGet; unsigned long FramesToGet;
unsigned int InFrameSize; unsigned int InFrameSize;
unsigned int OutFrameSize; unsigned int OutFrameSize;
...@@ -306,19 +307,18 @@ static void Close( vlc_object_t *p_this ) ...@@ -306,19 +307,18 @@ static void Close( vlc_object_t *p_this )
i_error = p_sys->SoundConverterClose( p_sys->myConverter ); i_error = p_sys->SoundConverterClose( p_sys->myConverter );
msg_Dbg( p_dec, "SoundConverterClose => %d", i_error ); msg_Dbg( p_dec, "SoundConverterClose => %d", i_error );
free( p_sys->p_buffer ); if( p_sys->p_buffer ) free( p_sys->p_buffer );
} }
else if( p_dec->fmt_out.i_cat == VIDEO_ES ) else if( p_dec->fmt_out.i_cat == VIDEO_ES )
{ {
free( p_sys->plane ); if( p_sys->plane) free( p_sys->plane );
} }
#ifndef SYS_DARWIN #ifndef SYS_DARWIN
FreeLibrary( p_sys->qtml ); FreeLibrary( p_sys->qtml );
FreeLibrary( p_sys->qts );
msg_Dbg( p_dec, "FreeLibrary ok." ); msg_Dbg( p_dec, "FreeLibrary ok." );
#endif #else
#ifdef SYS_DARWIN
ExitMovies(); ExitMovies();
#endif #endif
...@@ -561,7 +561,7 @@ static aout_buffer_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block ) ...@@ -561,7 +561,7 @@ static aout_buffer_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
if( p_sys->i_buffer > p_sys->InFrameSize ) if( p_sys->i_buffer > p_sys->InFrameSize )
{ {
int i_frames = p_sys->i_buffer / p_sys->InFrameSize; int i_frames = p_sys->i_buffer / p_sys->InFrameSize;
long i_out_frames, i_out_bytes; unsigned long i_out_frames, i_out_bytes;
var_Get( p_dec->p_libvlc, "qt_mutex", &lockval ); var_Get( p_dec->p_libvlc, "qt_mutex", &lockval );
vlc_mutex_lock( lockval.p_address ); vlc_mutex_lock( lockval.p_address );
...@@ -710,7 +710,7 @@ static int OpenVideo( decoder_t *p_dec ) ...@@ -710,7 +710,7 @@ static int OpenVideo( decoder_t *p_dec )
memset( &icap, 0, sizeof( ImageSubCodecDecompressCapabilities ) ); memset( &icap, 0, sizeof( ImageSubCodecDecompressCapabilities ) );
cres = p_sys->ImageCodecInitialize( p_sys->ci, &icap ); cres = p_sys->ImageCodecInitialize( p_sys->ci, &icap );
/* msg_Dbg( p_dec->p_fifo, "ImageCodecInitialize->%p size=%d (%d)\n",cres,icap.recordSize,icap.decompressRecordSize); */ msg_Dbg( p_dec, "ImageCodecInitialize->0x%X size=%ld (%ld)\n",(int)cres,icap.recordSize,icap.decompressRecordSize);
memset( &cinfo, 0, sizeof( CodecInfo ) ); memset( &cinfo, 0, sizeof( CodecInfo ) );
cres = p_sys->ImageCodecGetCodecInfo( p_sys->ci, &cinfo ); cres = p_sys->ImageCodecGetCodecInfo( p_sys->ci, &cinfo );
...@@ -753,12 +753,13 @@ static int OpenVideo( decoder_t *p_dec ) ...@@ -753,12 +753,13 @@ static int OpenVideo( decoder_t *p_dec )
} }
msg_Dbg( p_dec, "idSize=%ld ver=%d rev=%d vendor=%ld tempQ=%d " msg_Dbg( p_dec, "idSize=%ld ver=%d rev=%d vendor=%ld tempQ=%d "
"spaQ=%d w=%d h=%d dpi=%d%d dataSize=%d frameCount=%d clutID=%d", "spaQ=%d w=%d h=%d dpi=%d%d dataSize=%d depth=%d frameCount=%d clutID=%d",
id->idSize, id->version, id->revisionLevel, id->vendor, id->idSize, id->version, id->revisionLevel, id->vendor,
(int)id->temporalQuality, (int)id->spatialQuality, (int)id->temporalQuality, (int)id->spatialQuality,
id->width, id->height, id->width, id->height,
(int)id->hRes, (int)id->vRes, (int)id->hRes, (int)id->vRes,
(int)id->dataSize, (int)id->dataSize,
id->depth,
id->frameCount, id->frameCount,
id->clutID ); id->clutID );
...@@ -826,6 +827,7 @@ exit_error: ...@@ -826,6 +827,7 @@ exit_error:
static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
{ {
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
vlc_value_t lockval;
block_t *p_block; block_t *p_block;
picture_t *p_pic; picture_t *p_pic;
mtime_t i_pts; mtime_t i_pts;
...@@ -852,7 +854,12 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) ...@@ -852,7 +854,12 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
p_block = *pp_block; p_block = *pp_block;
*pp_block = NULL;
if( !p_block->i_buffer )
{
block_Release( p_block );
return NULL;
}
i_pts = p_block->i_pts ? p_block->i_pts : p_block->i_dts; i_pts = p_block->i_pts ? p_block->i_pts : p_block->i_dts;
...@@ -864,6 +871,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) ...@@ -864,6 +871,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
{ {
p_sys->i_late = 0; p_sys->i_late = 0;
} }
msg_Dbg( p_dec, "bufsize: %d",p_block->i_buffer);
if( p_sys->i_late > 10 ) if( p_sys->i_late > 10 )
{ {
...@@ -872,18 +880,16 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) ...@@ -872,18 +880,16 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
var_Get( p_dec->p_libvlc, "qt_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
if( ( p_pic = p_dec->pf_vout_buffer_new( p_dec ) ) ) if( ( p_pic = p_dec->pf_vout_buffer_new( p_dec ) ) )
{ {
vlc_value_t lockval; p_sys->decpar.data = (Ptr)p_block->p_buffer;
p_sys->decpar.data = p_block->p_buffer;
p_sys->decpar.bufferSize = p_block->i_buffer; p_sys->decpar.bufferSize = p_block->i_buffer;
(**p_sys->framedescHandle).dataSize = p_block->i_buffer; (**p_sys->framedescHandle).dataSize = p_block->i_buffer;
var_Get( p_dec->p_libvlc, "qt_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
cres = p_sys->ImageCodecBandDecompress( p_sys->ci, &p_sys->decpar ); cres = p_sys->ImageCodecBandDecompress( p_sys->ci, &p_sys->decpar );
vlc_mutex_unlock( lockval.p_address );
++p_sys->decpar.frameNumber; ++p_sys->decpar.frameNumber;
...@@ -898,8 +904,11 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) ...@@ -898,8 +904,11 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 2 ); p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 2 );
p_pic->date = i_pts; p_pic->date = i_pts;
} }
block_Release( p_block ); else
vlc_mutex_unlock( lockval.p_address );
block_Release( p_block );
return p_pic; return p_pic;
} }
#endif /* !WIN32 */ #endif /* !WIN32 */
...@@ -925,6 +934,12 @@ static int QTAudioInit( decoder_t *p_dec ) ...@@ -925,6 +934,12 @@ static int QTAudioInit( decoder_t *p_dec )
p_sys->ldt_fs = Setup_LDT_Keeper(); p_sys->ldt_fs = Setup_LDT_Keeper();
#endif /* LOADER */ #endif /* LOADER */
p_sys->qts = LoadLibraryA( "QuickTime.qts" );
if( p_sys->qts == NULL )
{
msg_Dbg( p_dec, "failed loading QuickTime.qts" );
return VLC_EGENERIC;
}
p_sys->qtml = LoadLibraryA( "qtmlClient.dll" ); p_sys->qtml = LoadLibraryA( "qtmlClient.dll" );
if( p_sys->qtml == NULL ) if( p_sys->qtml == NULL )
{ {
...@@ -988,6 +1003,13 @@ static int QTVideoInit( decoder_t *p_dec ) ...@@ -988,6 +1003,13 @@ static int QTVideoInit( decoder_t *p_dec )
#ifdef LOADER #ifdef LOADER
p_sys->ldt_fs = Setup_LDT_Keeper(); p_sys->ldt_fs = Setup_LDT_Keeper();
#endif /* LOADER */ #endif /* LOADER */
p_sys->qts = LoadLibraryA( "QuickTime.qts" );
if( p_sys->qts == NULL )
{
msg_Dbg( p_dec, "failed loading QuickTime.qts" );
return VLC_EGENERIC;
}
msg_Dbg( p_dec, "QuickTime.qts loaded" );
p_sys->qtml = LoadLibraryA( "qtmlClient.dll" ); p_sys->qtml = LoadLibraryA( "qtmlClient.dll" );
if( p_sys->qtml == NULL ) if( p_sys->qtml == 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