changeset 6360:1acda8182b14

win32 dll support (non-working)
author arpi
date Sun, 09 Jun 2002 18:20:27 +0000
parents 25258fe789e8
children 433bc1becbb6
files libmpcodecs/vd_real.c
diffstat 1 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_real.c	Sun Jun 09 17:52:30 2002 +0000
+++ b/libmpcodecs/vd_real.c	Sun Jun 09 18:20:27 2002 +0000
@@ -1,3 +1,5 @@
+//#define USE_WIN32_REAL_CODECS
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -59,6 +61,8 @@
     return CONTROL_UNKNOWN;
 }
 
+#ifndef USE_WIN32_REAL_CODECS
+
 /* exits program when failure */
 int load_syms(char *path) {
 		void *handle;
@@ -100,6 +104,30 @@
 	return 1;
 }
 
+#else
+
+int load_syms(char *path) {
+    void *handle;
+    Setup_LDT_Keeper();
+    rv_handle = handle = LoadLibraryA(path);
+    printf("win32 real codec handle=%p  \n",handle);
+
+    rvyuv_custom_message = GetProcAddress(handle, "RV20toYUV420CustomMessage");
+    rvyuv_free = GetProcAddress(handle, "RV20toYUV420Free");
+    rvyuv_hive_message = GetProcAddress(handle, "RV20toYUV420HiveMessage");
+    rvyuv_init = GetProcAddress(handle, "RV20toYUV420Init");
+    rvyuv_transform = GetProcAddress(handle, "RV20toYUV420Transform");
+    
+    if(rvyuv_custom_message &&
+       rvyuv_free &&
+       rvyuv_hive_message &&
+       rvyuv_init &&
+       rvyuv_transform) return 1;
+    return 0; // error
+}
+
+#endif
+
 /* we need exact positions */
 struct rv_init_t {
 	short unk1;