]> git.sesse.net Git - vlc/blobdiff - modules/codec/quicktime.c
* backport [13154]
[vlc] / modules / codec / quicktime.c
index 177ce446b1964be2c534405c4dc1747d2fefbc2e..32ac67b139f730631c2f94ab0d4ae4357dd6dd4f 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * quicktime.c: a quicktime decoder that uses the QT library/dll
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: quicktime.c,v 1.19 2003/11/23 22:18:08 hartman Exp $
+ * Copyright (C) 2003 the VideoLAN team
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir at via.ecp.fr>
  *          Derk-Jan Hartman <thedj at users.sf.net>
 #include <vlc/vout.h>
 #include <vlc/decoder.h>
 
+#if !defined (SYS_DARWIN) && !defined(WIN32)
+# define LOADER 1
+#endif
+
 #ifdef SYS_DARWIN
 #include <QuickTime/QuickTimeComponents.h>
 #include <QuickTime/Movies.h>
@@ -39,9 +43,9 @@
 
 /* for windows do we require Quicktime compents header? */
 #ifdef LOADER
-#include "w32dll/loader/qtx/qtxsdk/components.h"
-#include "w32dll/loader/wine/windef.h"
-#include "w32dll/loader/ldt_keeper.h"
+#include "qtx/qtxsdk/components.h"
+#include "wine/windef.h"
+#include "ldt_keeper.h"
 
 HMODULE   WINAPI LoadLibraryA(LPCSTR);
 FARPROC   WINAPI GetProcAddress(HMODULE,LPCSTR);
@@ -58,6 +62,8 @@ static void Close( vlc_object_t * );
 vlc_module_begin();
     set_description( _("QuickTime library decoder") );
     set_capability( "decoder", 10 );
+    set_category( CAT_INPUT );
+    set_subcategory( SUBCAT_INPUT_VCODEC );
     set_callbacks( Open, Close );
 
     /* create a mutex */
@@ -134,6 +140,7 @@ struct decoder_sys_t
     unsigned int    InFrameSize;
     unsigned int    OutFrameSize;
 
+#ifndef WIN32
     /* Video */
     Component         (*FindNextComponent)
         ( Component prev, ComponentDescription* desc );
@@ -172,7 +179,7 @@ struct decoder_sys_t
 
     CodecDecompressParams   decpar;          /* for ImageCodecPreDecompress()*/
     CodecCapabilities       codeccap;        /* for decpar */
-
+#endif
 
     /* Output properties */
     uint8_t *           plane;
@@ -373,7 +380,7 @@ static int OpenAudio( decoder_t *p_dec )
 #ifndef SYS_DARWIN
     if( ( i_error = p_sys->InitializeQTML( 6 + 16 ) ) )
     {
-        msg_Dbg( p_dec, "error while InitializeQTML = %d", i_error );
+        msg_Dbg( p_dec, "error on InitializeQTML = %d", i_error );
         goto exit_error;
     }
 #endif
@@ -404,7 +411,7 @@ static int OpenAudio( decoder_t *p_dec )
                                          &p_sys->myConverter );
     if( i_error )
     {
-        msg_Err( p_dec, "error while SoundConverterOpen = %d", i_error );
+        msg_Err( p_dec, "error on SoundConverterOpen = %d", i_error );
         goto exit_error;
     }
 
@@ -420,7 +427,7 @@ static int OpenAudio( decoder_t *p_dec )
                                                 FCC( 'w', 'a', 'v', 'e' ),
                                                 ((uint8_t*)p_dec->fmt_in.p_extra) + 36 + 8 );
 
-        msg_Dbg( p_dec, "error while SoundConverterSetInfo = %d", i_error );
+        msg_Dbg( p_dec, "error on SoundConverterSetInfo = %d", i_error );
     }
 
     WantedBufferSize = p_sys->OutputFormatInfo.numChannels *
@@ -448,7 +455,7 @@ static int OpenAudio( decoder_t *p_dec )
     if( (i_error = p_sys->SoundConverterBeginConversion(p_sys->myConverter)) )
     {
         msg_Err( p_dec,
-                 "error while SoundConverterBeginConversion = %d", i_error );
+                 "error on SoundConverterBeginConversion = %d", i_error );
         goto exit_error;
     }
 
@@ -484,6 +491,8 @@ exit_error:
     vlc_mutex_unlock( &p_dec->p_vlc->quicktime_lock );
 #endif
     vlc_mutex_unlock( lockval.p_address );
+
+    free( p_sys );
     return VLC_EGENERIC;
 }
 
@@ -630,6 +639,7 @@ static int OpenVideo( decoder_t *p_dec )
 {
     decoder_sys_t *p_sys = malloc( sizeof( decoder_sys_t ) );
 
+#ifndef WIN32
     vlc_value_t                         lockval;
     long                                i_result;
     ComponentDescription                desc;
@@ -675,7 +685,7 @@ static int OpenVideo( decoder_t *p_dec )
 #ifndef SYS_DARWIN
     if( ( i_result = p_sys->InitializeQTML( 6 + 16 ) ) )
     {
-        msg_Dbg( p_dec, "error while InitializeQTML = %d", (int)i_result );
+        msg_Dbg( p_dec, "error on InitializeQTML = %d", (int)i_result );
         goto exit_error;
     }
 #endif
@@ -803,9 +813,13 @@ exit_error:
     Restore_LDT_Keeper( p_sys->ldt_fs );
 #endif
     vlc_mutex_unlock( lockval.p_address );
+
+#endif /* !WIN32 */
+
     return VLC_EGENERIC;
 }
 
+#ifndef WIN32
 /*****************************************************************************
  * DecodeVideo:
  *****************************************************************************/
@@ -888,6 +902,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
     return p_pic;
 }
+#endif /* !WIN32 */
 
 /*****************************************************************************
  * QTAudioInit:
@@ -929,7 +944,7 @@ static int QTAudioInit( decoder_t *p_dec )
 
     if( p_sys->InitializeQTML == NULL )
     {
-        msg_Err( p_dec, "failed geting proc address InitializeQTML" );
+        msg_Err( p_dec, "failed getting proc address InitializeQTML" );
         return VLC_EGENERIC;
     }
     if( p_sys->SoundConverterOpen == NULL ||
@@ -940,7 +955,7 @@ static int QTAudioInit( decoder_t *p_dec )
         p_sys->SoundConverterEndConversion == NULL ||
         p_sys->SoundConverterBeginConversion == NULL )
     {
-        msg_Err( p_dec, "failed geting proc address" );
+        msg_Err( p_dec, "failed getting proc address" );
         return VLC_EGENERIC;
     }
 
@@ -950,7 +965,7 @@ static int QTAudioInit( decoder_t *p_dec )
     return VLC_SUCCESS;
 }
 
-
+#ifndef WIN32
 /*****************************************************************************
  * QTVideoInit:
  *****************************************************************************/
@@ -995,7 +1010,7 @@ static int QTVideoInit( decoder_t *p_dec )
 
     if( p_sys->InitializeQTML == NULL )
     {
-        msg_Dbg( p_dec, "failed geting proc address InitializeQTML" );
+        msg_Dbg( p_dec, "failed getting proc address InitializeQTML" );
         return VLC_EGENERIC;
     }
     if( p_sys->FindNextComponent == NULL ||
@@ -1008,12 +1023,11 @@ static int QTVideoInit( decoder_t *p_dec )
         p_sys->QTNewGWorldFromPtr == NULL ||
         p_sys->NewHandleClear == NULL )
     {
-        msg_Err( p_dec, "failed geting proc address" );
+        msg_Err( p_dec, "failed getting proc address" );
         return VLC_EGENERIC;
     }
 #endif /* SYS_DARWIN */
 
     return VLC_SUCCESS;
 }
-
-
+#endif /* !WIN32 */