[Vmaid-devel] Native Codec について。

Back to archive index

ryoma ryoma****@users*****
2005年 11月 21日 (月) 02:19:35 JST


こんばんわ。ryoma です。
# かなりお久しぶりでございます。(^^;


avicore/icm.c に対する ***テスト用*** パッチと、それをテストするための
サンプルを添付しておきます。
# サンプル付属の Makefile は BSD make 形式です…。

とりあず、huffyuv 2.1.1 を移植中なのですが、今は、MinGW
(http://www.mingw.org) で公開されているヘッダファイルから必要な部分を
抜き出して、必要な互換関数?をこしらえて、…なんとも泥臭い事をやってる
のですが、まあ、なんとなく動いてるっぽいです。(^^;;;
# もう少し整理して公開したいと思います。

私は一からコーデックを書くほどの技量はありませんし、ほとんどの場合は 
Windows 向けに書かれたコードを移植する事になるのかなと思っているのです
が、もっとスマートな方法がありましたら、御意見お聞かせください。

-- 
  ryoma <ryoma****@users*****>
-------------- next part --------------
Index: avicore/icm.c
===================================================================
RCS file: /cvsroot/vmaid/vmaid/avicore/icm.c,v
retrieving revision 1.35
diff -u -r1.35 icm.c
--- avicore/icm.c	7 Oct 2005 20:46:24 -0000	1.35
+++ avicore/icm.c	20 Nov 2005 16:23:41 -0000
@@ -19,10 +19,10 @@
 #include "icm.h"
 #include <gdk/gdkkeysyms.h>
 #include "misc/fileio.h"
-#ifdef W32CODECDIR
+#if defined (W32CODECDIR) || defined (NATIVE_CODEC)
 # include "misc/profile.h"
 # include "icm32.h"
-#endif /* W32CODECDIR */
+#endif
 #ifdef G_OS_WIN32
 # include <tchar.h>
 # include <windows.h>
@@ -34,29 +34,40 @@
 # define icm_send_driver_message(icm_object,msg,lParam1,lParam2)            \
     SendDriverMessage(((IcmObject *)(icm_object))->hDrvr,msg,lParam1,lParam2)
 #endif /* G_OS_WIN32 */
-#ifdef W32CODECDIR
+
+#if defined (W32CODECDIR) || defined (NATIVE_CODEC)
 # define icm_send_driver_message(icm_object,msg,lParam1,lParam2)            \
             ((IcmObject *)(icm_object))->icm_driver->DriverProc             \
             (((IcmObject *)(icm_object))->dwDriverId,                       \
             ((IcmObject *)(icm_object))->icm_driver->hLib,msg,lParam1,lParam2)
-#endif /* W32CODECDIR */
+#endif
 
 
 typedef struct _IcmDriver
 {
-#if defined (G_OS_WIN32)
+#if defined (G_OS_WIN32) || defined(NATIVE_CODEC)
   LPWSTR lpszName;
-#elif defined (W32CODECDIR)
+#else
+  guint8 dummy;
+#endif
+
+#ifdef W32CODECDIR
   PE_image *hLib;
   LONG lOpenID;
+#endif
+
+#if defined (W32CODECDIR) || defined(NATIVE_CODEC)
   LONG WINAPI (*DriverProc)(DWORD  dwDriverId,
                             HANDLE hdrvr,
                             UINT   msg,
                             LONG   lParam1,
                             LONG   lParam2);
-#else /* defined (G_OS_WIN32) || defined (W32CODECDIR) */
-  guint8 dummy;
-#endif /* defined (G_OS_WIN32) || defined (W32CODECDIR) */
+  gint attribute;
+#endif
+
+#ifdef NATIVE_CODEC
+  GModule *module;
+#endif
 } IcmDriver;
 
 
@@ -80,11 +91,22 @@
 #ifdef G_OS_WIN32
   HDRVR hDrvr;
 #endif /* G_OS_WIN32 */
-#ifdef W32CODECDIR
+#if defined (W32CODECDIR) || defined(NATIVE_CODEC)
   DWORD dwDriverId;
-#endif /* W32CODECDIR */
+#endif /* defined (W32CODECDIR) || defined(NATIVE_CODEC) */
 };
 
+#ifdef NATIVE_CODEC  /* XXX: */
+typedef HANDLE HDRVR;
+
+#define NATIVE_CODEC_DIR ".vmaid_codec"
+
+struct _codec {
+  LONG (*proc) (DWORD dwDriverId, HDRVR hdrvr, UINT msg, LONG lParam1, LONG lParam2);
+  void (*conf) (void);
+};
+#endif
+
 
 /******************************************************************************
 *                                                                             *
@@ -94,7 +116,7 @@
 static GHashTable *ghash_handler = NULL, *ghash_path = NULL;
 
 
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined (NATIVE_CODEC)
 static guint32
 icm_handler_tolower (const guint32 key)
 {
@@ -198,35 +220,51 @@
             {
               g_free (path);
             }
-# else /* not G_OS_WIN32 */
-          if ((icm_driver = g_malloc0 (sizeof (IcmDriver)))
-                    && (icm_driver->hLib = peimage_create())
-                    && peimage_load (icm_driver->hLib, path)
-                    && (icm_driver->DriverProc
-                        = peimage_resolve (icm_driver->hLib, "DriverProc")))
-            {
-              icm_driver->DriverProc (0, icm_driver->hLib, DRV_LOAD, 0, 0);
-              icm_driver->DriverProc (0, icm_driver->hLib, DRV_ENABLE, 0, 0);
-              icm_driver->lOpenID = icm_driver->DriverProc
-                                (0, icm_driver->hLib, DRV_OPEN, (LONG)L"", 0);
-              g_hash_table_insert (ghash_path, path, icm_driver);
+# endif /* G_OS_WIN32 */
+#ifdef W32CODECDIR
+          if ( 'l' == g_ascii_tolower(path[g_strlen(path) - 1]) ) {
+            if ((icm_driver = g_malloc0 (sizeof (IcmDriver)))
+                && (icm_driver->hLib = peimage_create())
+                && peimage_load (icm_driver->hLib, path)
+                && (icm_driver->DriverProc
+                    = peimage_resolve (icm_driver->hLib, "DriverProc")))
+              {
+                icm_driver->attribute = ICM_ATTR_WIN32;
+                icm_driver->DriverProc (0, icm_driver->hLib, DRV_LOAD, 0, 0);
+                icm_driver->DriverProc (0, icm_driver->hLib, DRV_ENABLE, 0, 0);
+                icm_driver->lOpenID = icm_driver->DriverProc
+                  (0, icm_driver->hLib, DRV_OPEN, (LONG)L"", 0);
+                g_hash_table_insert (ghash_path, path, icm_driver);
+              }
+            else
+              {
+                if (icm_driver->hLib)
+                  peimage_destroy (icm_driver->hLib);
+                g_free (icm_driver);
+                g_free (path);
+                icm_driver = NULL;
+              }
+          }
+#endif /* W32CODECDIR */
+#ifdef NATIVE_CODEC
+          if ( 'o' == g_ascii_tolower(path[g_strlen(path) - 1]) ) {
+            if ( NULL != (icm_driver = g_malloc0(sizeof(IcmDriver))) ) {
+              icm_driver->attribute = ICM_ATTR_NATIVE;
+              icm_driver->lpszName = (LPWSTR)g_strdup(path);
+              g_hash_table_insert(ghash_path, path, icm_driver);
             }
-          else
-            {
-              if (icm_driver->hLib)
-                peimage_destroy (icm_driver->hLib);
-              g_free (icm_driver);
-              g_free (path);
-              icm_driver = NULL;
+            else {
+              g_free(path);
             }
-# endif /* not G_OS_WIN32 */
+          }
+#endif /* NATIVE_CODEC */
         }
       if (icm_driver)   /* ja:登録 */
         g_hash_table_insert (ghash_handler, GUINT_TO_POINTER (handler),
                                                                 icm_driver);
     }
 }
-#endif /* defined (G_OS_WIN32) || defined (W32CODECDIR) */
+#endif /* defined (G_OS_WIN32) || defined (W32CODECDIR) || defined (NATIVE_CODEC)*/
 
 
 /*  ja:ICMを初期化する
@@ -234,17 +272,17 @@
 gboolean
 icm_init (void)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined (NATIVE_CODEC)
   GHashTable *ghash;
-#endif /* defined (G_OS_WIN32) || defined (W32CODECDIR) */
+#endif
 #ifdef G_OS_WIN32
   DWORD dwIndex, dwName, dwType, dwValue;
   HKEY hKey;
   TCHAR szName[MAX_PATH], szValue[MAX_PATH];
 #endif /* G_OS_WIN32 */
-#ifdef W32CODECDIR
+#if defined (W32CODECDIR) || defined (NATIVE_CODEC)
   Profile *profile;
-#endif /* W32CODECDIR */
+#endif
 
   if (ghash_handler || ghash_path)
     return FALSE;
@@ -279,7 +317,7 @@
         g_free (key);
       }
 #endif /* G_OS_WIN32 */
-#ifdef W32CODECDIR
+#if defined (W32CODECDIR) || defined (NATIVE_CODEC)
   /* ja:設定 */
   profile = profile_open (NULL);
   if (profile)
@@ -325,7 +363,16 @@
                         }
                       else
                         {
-                          path = g_build_filename (W32CODECDIR, tmp, NULL);
+                          if ( 'l' == g_ascii_tolower(tmp[g_strlen(tmp) - 1]) ) {
+                            path = g_build_filename (W32CODECDIR, tmp, NULL);
+                          }
+#ifdef NATIVE_CODEC
+                          if ( 'o' == g_ascii_tolower(tmp[g_strlen(tmp) - 1]) ) {
+                            path  = g_build_filename(g_get_home_dir(),
+                                                     NATIVE_CODEC_DIR,  /* XXX: */
+                                                     tmp, NULL);
+                          }
+#endif
                           g_free (tmp);
                         }
                       tmp = path;
@@ -341,13 +388,13 @@
         }
       profile_close (profile);
     }
-#endif /* W32CODECDIR */
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#endif /*  defined (W32CODECDIR) || defined (NATIVE_CODEC) */
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined (NATIVE_CODEC)
   ghash_handler = g_hash_table_new (icm_hash_handler, icm_equal_handler);
   ghash_path = g_hash_table_new (icm_hash_path, icm_equal_path);
   g_hash_table_foreach (ghash, icm_init_callback, ghash);
   g_hash_table_destroy (ghash);
-#endif /* defined (G_OS_WIN32) || defined (W32CODECDIR) */
+#endif
 #ifdef G_OS_WIN32
   return RegCloseKey (hKey) == ERROR_SUCCESS;
 #else /* not G_OS_WIN32 */
@@ -369,16 +416,18 @@
       IcmDriver *icm_driver;
 
       icm_driver = orig_value;
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) || defined(NATIVE_CODEC)
       g_free (icm_driver->lpszName);
-#endif /* G_OS_WIN32 */
-#ifdef W32CODECDIR
+#endif
+#if defined(W32CODECDIR) || defined(NATIVE_CODEC)
       icm_driver->DriverProc (icm_driver->lOpenID,
                                             icm_driver->hLib, DRV_CLOSE, 0, 0);
       icm_driver->DriverProc (0, icm_driver->hLib, DRV_DISABLE, 0, 0);
       icm_driver->DriverProc (0, icm_driver->hLib, DRV_FREE, 0, 0);
-      peimage_destroy (icm_driver->hLib);
-#endif /* W32CODECDIR */
+      if ( ICM_ATTR_WIN32 == icm_driver->attribute ) {
+        peimage_destroy (icm_driver->hLib);
+      }
+#endif
       g_free (icm_driver);
       g_free (orig_key);
     }
@@ -508,7 +557,7 @@
 IcmObject *
 icm_open (const guint32 handler, const gint mode)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   IcmObject *icm_object;
   ICOPEN icopen;
 
@@ -548,8 +597,39 @@
       icm_object->hDrvr = OpenDriver (icm_object->icm_driver->lpszName, NULL,
                                                                 (LONG)&icopen);
 # else /* not G_OS_WIN32 */
-      icm_object->dwDriverId = icm_object->icm_driver->DriverProc
-                (0, icm_object->icm_driver->hLib, DRV_OPEN, 0, (LONG)&icopen);
+#ifdef W32CODECDIR
+      if ( ICM_ATTR_WIN32 == icm_get_attribute(icm_object) ) {
+        icm_object->dwDriverId = icm_object->icm_driver->DriverProc
+          (0, icm_object->icm_driver->hLib, DRV_OPEN, 0, (LONG)&icopen);
+      }
+#endif
+#ifdef NATIVE_CODEC
+      if ( ICM_ATTR_NATIVE == icm_get_attribute(icm_object) ) {
+        struct _codec* Obj;  /* XXX: */
+        icm_object->dwDriverId = 0;
+
+        if (TRUE != g_module_supported()) {
+          g_warning("NATIVE CODEC: TRUE != g_module_supported()\n");
+        }
+        if (NULL ==
+            (icm_object->icm_driver->module =
+             g_module_open((gchar*)icm_object->icm_driver->lpszName, 0)) ) {
+          g_warning("NATIVE CODEC: NULL == g_module_open(%s)\n",
+                    (gchar*)icm_object->icm_driver->lpszName);
+        }
+        if (TRUE != g_module_symbol(icm_object->icm_driver->module
+                                    , "entry", (gpointer*)&Obj)) {
+          g_warning("NATIVE CODEC: TRUE != g_module_symbol()\n");
+          if (TRUE != g_module_close(icm_object->icm_driver->module)) {
+            g_warning("NATIVE CODEC: TRUE != g_module_close()\n");
+          }
+        } else if (NULL != Obj->proc) {
+          icm_object->icm_driver->DriverProc = Obj->proc;
+          icm_object->dwDriverId = icm_object->icm_driver->DriverProc
+            (0, icm_object->icm_driver->hLib, DRV_OPEN, 0, (LONG)&icopen);
+        }
+      }
+#endif /* NATIVE_CODEC */
 # endif /* not G_OS_WIN32 */
     }
 # ifdef G_OS_WIN32
@@ -564,8 +644,13 @@
       icinfo.dwSize = sizeof (ICINFO);
       icm_send_driver_message (icm_object, ICM_GETINFO,
                                             (LONG)&icinfo, sizeof (ICINFO));
-      icm_object->name = g_utf16_to_utf8 (icinfo.szDescription, -1,
-                                                            NULL, NULL, NULL);
+
+      if ( ICM_ATTR_WIN32 == icm_get_attribute(icm_object) ) {
+        icm_object->name = g_utf16_to_utf8 (icinfo.szDescription, -1,
+                                            NULL, NULL, NULL);
+      } else {
+        icm_object->name = g_strdup((gchar*)icinfo.szDescription);
+      }
       icm_object->flags = 0;
       if (icinfo.dwFlags & VIDCF_QUALITY)
         icm_object->flags = ICM_FLAG_QUALITY;
@@ -581,6 +666,7 @@
         icm_object->flags |= ICM_FLAG_FASTTEMPORALC;
       if (icinfo.dwFlags & VIDCF_FASTTEMPORALD)
         icm_object->flags |= ICM_FLAG_FASTTEMPORALD;
+/* XXX: #if defined(W32CODECDIR) || defined(NATIVE_CODEC) */
 # ifdef W32CODECDIR
       if (icinfo.dwFlags & VIDCF_QUALITYTIME)
         icm_object->flags |= ICM_FLAG_QUALITYTIME;
@@ -592,9 +678,9 @@
       icm_object = NULL;
     }
   return icm_object;
-#else /* not defined (G_OS_WIN32) || defined (W32CODECDIR) */
+#else /* not defined (G_OS_WIN32)||defined(W32CODECDIR)||defined(NATIVE_CODEC) */
   return NULL;
-#endif /* not defined (G_OS_WIN32) || defined (W32CODECDIR) */
+#endif /* not defined (G_OS_WIN32)||defined(W32CODECDIR)||defined(NATIVE_CODEC) */
 }
 
 
@@ -609,10 +695,15 @@
 #ifdef G_OS_WIN32
       CloseDriver (icm_object->hDrvr, 0, 0);
 #endif /* G_OS_WIN32 */
-#ifdef W32CODECDIR
+#if defined(W32CODECDIR) || defined(NATIVE_CODEC)
       icm_object->icm_driver->DriverProc (icm_object->dwDriverId,
                                 icm_object->icm_driver->hLib, DRV_CLOSE, 0, 0);
-#endif /* W32CODECDIR */
+#endif
+#ifdef NATIVE_CODEC
+  if (TRUE != g_module_close(icm_object->icm_driver->module)) {
+    g_warning("NATIVE CODEC: TRUE != g_module_close()");
+  }
+#endif
       g_free (icm_object->name);
       g_free (icm_object->bmih_in);
       g_free (icm_object->bmih_out);
@@ -694,7 +785,7 @@
 gint
 icm_get_attribute (IcmObject *icm_object)
 {
-  return ICM_ATTR_WIN32;
+  return icm_object->icm_driver->attribute;
 }
 
 
@@ -709,7 +800,7 @@
 gsize
 icm_get_state_size (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object
                 ? icm_send_driver_message (icm_object, ICM_GETSTATE, 0, 0) : 0;
 #else /* not defined (G_OS_WIN32) || defined (W32CODECDIR) */
@@ -728,7 +819,7 @@
                gpointer   param,
                gsize      param_size)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object && param && param_size > 0
                         && icm_send_driver_message (icm_object, ICM_GETSTATE,
                                         (LPARAM)param, param_size) == ICERR_OK;
@@ -748,7 +839,7 @@
                gpointer   param,
                gsize      param_size)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (icm_object && param && param_size > 0)
     {
       icm_send_driver_message (icm_object, ICM_SETSTATE,
@@ -771,7 +862,7 @@
 gboolean
 icm_is_dialog_about (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object && icm_send_driver_message (icm_object,
                                                 ICM_ABOUT, -1, 0) == ICERR_OK;
 #else /* not defined (G_OS_WIN32) || defined (W32CODECDIR) */
@@ -785,7 +876,7 @@
 void
 icm_dialog_about (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (icm_object)
     icm_send_driver_message (icm_object, ICM_ABOUT, 0, 0);
 #endif /* defined (G_OS_WIN32) || defined (W32CODECDIR) */
@@ -798,7 +889,7 @@
 gboolean
 icm_is_dialog_configure (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object && icm_send_driver_message (icm_object,
                                             ICM_CONFIGURE, -1, 0) == ICERR_OK;
 #else /* not defined (G_OS_WIN32) || defined (W32CODECDIR) */
@@ -812,7 +903,7 @@
 void
 icm_dialog_configure (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (icm_object)
     icm_send_driver_message (icm_object, ICM_CONFIGURE, 0, 0);
 #endif /* defined (G_OS_WIN32) || defined (W32CODECDIR) */
@@ -832,7 +923,7 @@
 icm_compress_query (IcmObject              *icm_object,
                     const BitmapInfoHeader *bmih)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object && bmih && icm_send_driver_message (icm_object,
                                 ICM_COMPRESS_QUERY, (LONG)bmih, 0) == ICERR_OK;
 #else /* not defined (G_OS_WIN32) || defined (W32CODECDIR) */
@@ -847,7 +938,7 @@
 gint
 icm_compress_get_default_key_frame (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (icm_object && (icm_get_flags (icm_object) & ICM_FLAG_TEMPORAL) != 0)
     {
       DWORD dwKeyFrame;
@@ -867,7 +958,7 @@
 gint
 icm_compress_get_default_quality (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
 
   if (icm_object && (icm_get_flags (icm_object) & ICM_FLAG_QUALITY) != 0)
     {
@@ -890,7 +981,7 @@
 icm_compress_get_format_size (IcmObject              *icm_object,
                               const BitmapInfoHeader *bmih)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (!icm_object || !bmih)
     return 0;
   return icm_send_driver_message (icm_object,
@@ -911,7 +1002,7 @@
                          const BitmapInfoHeader *bmih_in,
                          BitmapInfoHeader       *bmih_out)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object && bmih_in && bmih_out
         && icm_send_driver_message (icm_object,
         ICM_COMPRESS_GET_FORMAT, (LONG)bmih_in, (LONG)bmih_out) == ICERR_OK;
@@ -927,7 +1018,7 @@
 gsize
 icm_compress_get_size (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object && icm_object->bmih_in && icm_object->bmih_out
                 ? icm_send_driver_message (icm_object, ICM_COMPRESS_GET_SIZE,
                     (LONG)icm_object->bmih_in, (LONG)icm_object->bmih_out) : 0;
@@ -959,7 +1050,7 @@
                           const guint32           rate,
                           const guint32           scale)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (!icm_object)
     return FALSE;
   if (bmih_in)
@@ -1021,7 +1112,7 @@
 gboolean
 icm_compress_begin (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (!icm_object || !icm_object->bmih_in || icm_object->prev)
     return FALSE;
   if (!icm_object->bmih_out)
@@ -1057,7 +1148,7 @@
 gboolean
 icm_compress_end (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (!icm_object || !icm_object->prev)
     return FALSE;
   g_free (icm_object->prev);
@@ -1082,7 +1173,7 @@
               gpointer   input,
               gpointer   output)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   DWORD dwFlags,dwID;
   ICCOMPRESS iccompress;
 
@@ -1143,7 +1234,7 @@
 icm_decompress_query (IcmObject              *icm_object,
                       const BitmapInfoHeader *bmih)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   return icm_object && bmih
                 && icm_send_driver_message (icm_object,
                             ICM_DECOMPRESS_QUERY, (LONG)bmih, 0) == ICERR_OK;
@@ -1161,7 +1252,7 @@
 icm_decompress_get_format_size (IcmObject              *icm_object,
                                 const BitmapInfoHeader *bmih)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   gsize bmih_size = 0;
 
   if (icm_object && bmih)
@@ -1204,7 +1295,7 @@
                            const BitmapInfoHeader *bmih_in,
                            BitmapInfoHeader       *bmih_out)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (icm_object && bmih_in && bmih_out
         && icm_send_driver_message (icm_object,
         ICM_DECOMPRESS_GET_FORMAT, (LONG)bmih_in, (LONG)bmih_out) == ICERR_OK)
@@ -1236,7 +1327,7 @@
 icm_decompress_begin (IcmObject              *icm_object,
                       const BitmapInfoHeader *bmih)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (!icm_object || !bmih || icm_object->bmih_in || icm_object->bmih_out)
     return FALSE;
   icm_object->bmih_out
@@ -1264,7 +1355,7 @@
 gboolean
 icm_decompress_end (IcmObject *icm_object)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   if (!icm_object || (!icm_object->bmih_in && !icm_object->bmih_out))
     return FALSE;
   g_free (icm_object->bmih_in);
@@ -1291,7 +1382,7 @@
                 gpointer     input,
                 gpointer     output)
 {
-#if defined (G_OS_WIN32) || defined (W32CODECDIR)
+#if defined (G_OS_WIN32) || defined (W32CODECDIR) || defined(NATIVE_CODEC)
   ICDECOMPRESS icdecompress;
 
   if (!icm_object || !input || !output
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: test_codec.tar.bz2
型:         application/octet-stream
サイズ:     3053 バイト
説明:       無し
下载 


Vmaid-devel メーリングリストの案内
Back to archive index