X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fquicktime.c;h=054d57e190cad705823e48b4fad8d0037328a585;hb=9efef82d6080eb9f0b8b38f5326fc86d7f61fb24;hp=f61c4ffa39c3bd4fc07c37a1490184683eef00c3;hpb=724461bdf250e856eb32f6c0b7c51b065e482982;p=vlc diff --git a/modules/codec/quicktime.c b/modules/codec/quicktime.c index f61c4ffa39..054d57e190 100644 --- a/modules/codec/quicktime.c +++ b/modules/codec/quicktime.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #if !defined (__APPLE__) && !defined(WIN32) @@ -81,7 +80,9 @@ static int OpenAudio( decoder_t * ); static int OpenVideo( decoder_t * ); static aout_buffer_t *DecodeAudio( decoder_t *, block_t ** ); +#ifndef WIN32 static picture_t *DecodeVideo( decoder_t *, block_t ** ); +#endif #define FCC( a, b , c, d ) \ ((uint32_t)( ((a)<<24)|((b)<<16)|((c)<<8)|(d))) @@ -188,7 +189,7 @@ struct decoder_sys_t /* Output properties */ uint8_t * plane; mtime_t pts; - audio_date_t date; + date_t date; int i_late; /* video */ @@ -215,7 +216,9 @@ static const int pi_channels_maps[6] = }; static int QTAudioInit( decoder_t * ); +#ifndef WIN32 static int QTVideoInit( decoder_t * ); +#endif /***************************************************************************** * Open: probe the decoder and return score @@ -230,7 +233,7 @@ static int Open( vlc_object_t *p_this ) #ifdef __APPLE__ OSErr err; SInt32 qtVersion, macosversion; - + err = Gestalt(gestaltQuickTimeVersion, &qtVersion); err = Gestalt(gestaltSystemVersion, &macosversion); #ifndef NDEBUG @@ -245,27 +248,21 @@ static int Open( vlc_object_t *p_this ) switch( p_dec->fmt_in.i_codec ) { - case VLC_CODEC_H264: /* 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_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_CODEC_QTRLE: /* QuickTime animation (RLE) */ - case VLC_CODEC_RPZA: /* 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; @@ -394,7 +391,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(); @@ -489,14 +489,14 @@ 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 = p_dec->fmt_out.audio.i_original_channels = pi_channels_maps[p_sys->OutputFormatInfo.numChannels]; - aout_DateInit( &p_sys->date, p_dec->fmt_out.audio.i_rate ); + date_Init( &p_sys->date, p_dec->fmt_out.audio.i_rate, 1 ); p_sys->i_buffer = 0; p_sys->i_buffer_size = 100*1000; @@ -619,11 +619,11 @@ static aout_buffer_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block ) } if( p_sys->pts != 0 && - p_sys->pts != aout_DateGet( &p_sys->date ) ) + p_sys->pts != date_Get( &p_sys->date ) ) { - aout_DateSet( &p_sys->date, p_sys->pts ); + date_Set( &p_sys->date, p_sys->pts ); } - else if( !aout_DateGet( &p_sys->date ) ) + else if( !date_Get( &p_sys->date ) ) { return NULL; } @@ -646,8 +646,8 @@ static aout_buffer_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block ) if( p_out ) { - p_out->start_date = aout_DateGet( &p_sys->date ); - p_out->end_date = aout_DateIncrement( &p_sys->date, i_frames ); + p_out->start_date = date_Get( &p_sys->date ); + p_out->end_date = date_Increment( &p_sys->date, i_frames ); memcpy( p_out->p_buffer, &p_sys->out_buffer[2 * p_sys->i_out * p_dec->fmt_out.audio.i_channels], @@ -694,7 +694,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 ); @@ -840,7 +844,7 @@ static int OpenVideo( decoder_t *p_dec ) 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; - + vlc_mutex_unlock( &qt_mutex ); return VLC_SUCCESS; @@ -850,6 +854,8 @@ exit_error: #endif vlc_mutex_unlock( &qt_mutex ); +#else + VLC_UNUSED( p_dec ); #endif /* !WIN32 */ return VLC_EGENERIC;