X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fquicktime.c;h=976c8c7202dca3f04868620ca86af5816be0fe05;hb=89b6530d8abd99b96b9f33af022022241fe97ee2;hp=b9ef7aea4033531aa087918db6d648dd2abcc1ed;hpb=91bf0f045482a9455dbe1409e9ed79245c44a52c;p=vlc diff --git a/modules/codec/quicktime.c b/modules/codec/quicktime.c index b9ef7aea40..976c8c7202 100644 --- a/modules/codec/quicktime.c +++ b/modules/codec/quicktime.c @@ -1,7 +1,7 @@ /***************************************************************************** * quicktime.c: a quicktime decoder that uses the QT library/dll ***************************************************************************** - * Copyright (C) 2003 the VideoLAN team + * Copyright (C) 2003, 2008 - 2009 the VideoLAN team * $Id$ * * Authors: Laurent Aimar @@ -234,37 +234,36 @@ static int Open( vlc_object_t *p_this ) err = Gestalt(gestaltQuickTimeVersion, &qtVersion); err = Gestalt(gestaltSystemVersion, &macosversion); #ifndef NDEBUG - msg_Dbg( p_this, "mac os version is %#lx", macosversion ); - msg_Dbg( p_this, "quicktime version is %#lx", qtVersion ); + msg_Dbg( p_this, "Mac OS version is %#lx", macosversion ); + msg_Dbg( p_this, "Quicktime version is %#lx", qtVersion ); #endif + + /* bail out. This plugin is soo Carbon, that it can't be used on 10.5 at all */ + msg_Info( p_dec, "Your Mac OS version is to new to use this plugin for anything." ); + return VLC_EGENERIC; #endif switch( p_dec->fmt_in.i_codec ) { - case VLC_FOURCC('h','2','6','4'): /* H.264 */ - case VLC_FOURCC('c','v','i','d'): /* Cinepak */ + case VLC_CODEC_H264: + case VLC_CODEC_CINEPAK: case VLC_FOURCC('I','V','4','1'): /* Indeo Video IV */ case VLC_FOURCC('i','v','4','1'): /* dto. */ #ifdef __APPLE__ case VLC_FOURCC('p','x','l','t'): /* Pixlet */ #endif - case VLC_FOURCC('d','v','1','n'): /* DVC Pro 100 NTSC */ - case VLC_FOURCC('d','v','1','p'): /* DVC Pro 100 PAL */ - case VLC_FOURCC('d','v','h','p'): /* DVC PRO HD 720p */ - case VLC_FOURCC('d','v','h','6'): /* DVC PRO HD 1080i 60 */ - case VLC_FOURCC('d','v','h','5'): /* DVC PRO HD 1080i 50 */ - - case VLC_FOURCC('S','V','Q','3'): /* Sorenson v3 */ - /* case VLC_FOURCC('S','V','Q','1'): Sorenson v1 + case VLC_CODEC_DV: + case VLC_CODEC_SVQ3: /* Sorenson v3 */ + /* case VLC_CODEC_SVQ1: Sorenson v1 case VLC_FOURCC('Z','y','G','o'): case VLC_FOURCC('V','P','3','1'): case VLC_FOURCC('3','I','V','1'): */ - case VLC_FOURCC('r','l','e',' '): /* QuickTime animation (RLE) */ - case VLC_FOURCC('r','p','z','a'): /* QuickTime Apple Video */ - case VLC_FOURCC('a','z','p','r'): /* QuickTime animation (RLE) */ + case VLC_CODEC_QTRLE: + case VLC_CODEC_RPZA: #ifdef LOADER p_dec->p_sys = NULL; p_dec->pf_decode_video = DecodeVideo; + p_dec->fmt_out.i_cat = VIDEO_ES; return VLC_SUCCESS; #else return OpenVideo( p_dec ); @@ -278,23 +277,23 @@ static int Open( vlc_object_t *p_this ) if ((err != noErr) || (qtVersion < 0x07500000)) return VLC_EGENERIC; #endif - case VLC_FOURCC('s','a','m','r'): /* 3GPP AMR audio */ + case VLC_CODEC_AMR_NB: /* 3GPP AMR audio */ case VLC_FOURCC('s','a','m','b'): /* 3GPP AMR-WB audio */ - case VLC_FOURCC('m','p','4','a'): /* MPEG-4 audio */ + case VLC_CODEC_MP4A: /* MPEG-4 audio */ case VLC_FOURCC('Q','D','M','C'): /* QDesign */ - case VLC_FOURCC('Q','D','M','2'): /* QDesign* 2 */ - case VLC_FOURCC('Q','c','l','p'): /* Qualcomm Purevoice Codec */ + case VLC_CODEC_QDM2: /* QDesign* 2 */ + case VLC_CODEC_QCELP: /* Qualcomm Purevoice Codec */ case VLC_FOURCC('Q','C','L','P'): /* Qualcomm Purevoice Codec */ - case VLC_FOURCC('M','A','C','3'): /* MACE3 audio decoder */ - case VLC_FOURCC('M','A','C','6'): /* MACE6 audio decoder */ + case VLC_CODEC_MACE3: /* MACE3 audio decoder */ + case VLC_CODEC_MACE6: /* MACE6 audio decoder */ case VLC_FOURCC('d','v','c','a'): /* DV Audio */ case VLC_FOURCC('s','o','w','t'): /* 16-bit Little Endian */ case VLC_FOURCC('t','w','o','s'): /* 16-bit Big Endian */ - case VLC_FOURCC('a','l','a','w'): /* ALaw 2:1 */ + case VLC_CODEC_ALAW: /* ALaw 2:1 */ case VLC_FOURCC('u','l','a','w'): /* mu-Law 2:1 */ case VLC_FOURCC('r','a','w',' '): /* 8-bit offset binaries */ - case VLC_FOURCC('f','l','3','2'): /* 32-bit Floating Point */ - case VLC_FOURCC('f','l','6','4'): /* 64-bit Floating Point */ + case VLC_CODEC_FL32: /* 32-bit Floating Point */ + case VLC_CODEC_FL64: /* 64-bit Floating Point */ case VLC_FOURCC('i','n','2','4'): /* 24-bit Interger */ case VLC_FOURCC('i','n','3','2'): /* 32-bit Integer */ case 0x0011: /* DVI IMA */ @@ -303,21 +302,9 @@ static int Open( vlc_object_t *p_this ) #ifdef LOADER p_dec->p_sys = NULL; p_dec->pf_decode_audio = DecodeAudio; + p_dec->fmt_out.i_cat = AUDIO_ES; return VLC_SUCCESS; #else - -#ifdef __APPLE__ - /* FIXME: right now, we don't support audio decoding on 10.5 and later - because we are still using the hardcore-outdated SoundManager API, - which was removed after 10.4 */ - - if( macosversion >= 0x1050 || err != noErr ) - { - msg_Warn( p_dec, "Your Mac OS version doesn't have SoundManager anymore. " - "You can't use this plugin for audio." ); - return VLC_EGENERIC; - } -#endif return OpenAudio( p_dec ); #endif @@ -401,7 +388,10 @@ static int OpenAudio( decoder_t *p_dec ) p_dec->p_sys = p_sys; p_dec->pf_decode_audio = DecodeAudio; - memcpy( fcc, &p_dec->fmt_in.i_codec, 4 ); + if( p_dec->fmt_in.i_original_fourcc ) + memcpy( fcc, &p_dec->fmt_in.i_original_fourcc, 4 ); + else + memcpy( fcc, &p_dec->fmt_in.i_codec, 4 ); #ifdef __APPLE__ EnterMovies(); @@ -496,7 +486,7 @@ static int OpenAudio( decoder_t *p_dec ) } - es_format_Init( &p_dec->fmt_out, AUDIO_ES, AOUT_FMT_S16_NE ); + es_format_Init( &p_dec->fmt_out, AUDIO_ES, VLC_CODEC_S16N ); p_dec->fmt_out.audio.i_rate = p_sys->OutputFormatInfo.sampleRate; p_dec->fmt_out.audio.i_channels = p_sys->OutputFormatInfo.numChannels; p_dec->fmt_out.audio.i_physical_channels = @@ -701,7 +691,11 @@ static int OpenVideo( decoder_t *p_dec ) return VLC_EGENERIC; } - memcpy( fcc, &p_dec->fmt_in.i_codec, 4 ); + if( p_dec->fmt_in.i_original_fourcc ) + memcpy( fcc, &p_dec->fmt_in.i_original_fourcc, 4 ); + else + memcpy( fcc, &p_dec->fmt_in.i_codec, 4 ); + msg_Dbg( p_dec, "quicktime_video %4.4s %dx%d", fcc, p_dec->fmt_in.video.i_width, p_dec->fmt_in.video.i_height ); @@ -746,17 +740,17 @@ static int OpenVideo( decoder_t *p_dec ) memset( &icap, 0, sizeof( ImageSubCodecDecompressCapabilities ) ); cres = p_sys->ImageCodecInitialize( p_sys->ci, &icap ); - msg_Dbg( p_dec, "ImageCodecInitialize->0x%X size=%d (%d)\n", + msg_Dbg( p_dec, "ImageCodecInitialize->0x%X size=%d (%d)", (int)cres, (int)icap.recordSize, (int)icap.decompressRecordSize); memset( &cinfo, 0, sizeof( CodecInfo ) ); cres = p_sys->ImageCodecGetCodecInfo( p_sys->ci, &cinfo ); msg_Dbg( p_dec, - "Flags: compr: 0x%x decomp: 0x%x format: 0x%x\n", + "Flags: compr: 0x%x decomp: 0x%x format: 0x%x", (unsigned int)cinfo.compressFlags, (unsigned int)cinfo.decompressFlags, (unsigned int)cinfo.formatFlags ); - msg_Dbg( p_dec, "quicktime_video: Codec name: %.*s\n", + msg_Dbg( p_dec, "quicktime_video: Codec name: %.*s", ((unsigned char*)&cinfo.typeName)[0], ((unsigned char*)&cinfo.typeName)+1 ); @@ -822,7 +816,7 @@ static int OpenVideo( decoder_t *p_dec ) p_sys->plane, p_dec->fmt_in.video.i_width * 2 ); - msg_Dbg( p_dec, "NewGWorldFromPtr returned:%ld\n", + msg_Dbg( p_dec, "NewGWorldFromPtr returned:%ld", 65536 - ( i_result&0xffff ) ); memset( &p_sys->decpar, 0, sizeof( CodecDecompressParams ) ); @@ -840,10 +834,10 @@ static int OpenVideo( decoder_t *p_dec ) p_sys->decpar.dstPixMap = **p_sys->GetGWorldPixMap( p_sys->OutBufferGWorld );/*destPixmap; */ cres = p_sys->ImageCodecPreDecompress( p_sys->ci, &p_sys->decpar ); - msg_Dbg( p_dec, "quicktime_video: ImageCodecPreDecompress cres=0x%X\n", + msg_Dbg( p_dec, "quicktime_video: ImageCodecPreDecompress cres=0x%X", (int)cres ); - es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'Y', 'U', 'Y', '2' )); + es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_YUYV); p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width; p_dec->fmt_out.video.i_height= p_dec->fmt_in.video.i_height; p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->fmt_in.video.i_width / p_dec->fmt_in.video.i_height; @@ -937,7 +931,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) if( cres &0xFFFF ) { msg_Dbg( p_dec, "quicktime_video: ImageCodecBandDecompress" - " cres=0x%X (-0x%X) %d :(\n", + " cres=0x%X (-0x%X) %d :(", (int)cres,(int)-cres, (int)cres ); }