Mercurial > mplayer.hg
annotate loader/qtx/qtxload.c @ 26530:59466c2ce1f0
Add missing #include, fixes the warning:
qtx/qtxload.c:50: warning: implicit declaration of function 'mp_msg_init'
author | diego |
---|---|
date | Mon, 28 Apr 2008 12:03:52 +0000 |
parents | da85ae10987e |
children | 4120a65789a8 |
rev | line source |
---|---|
2501 | 1 #include <stdio.h> |
2796 | 2 #include <stdlib.h> |
3 #include <string.h> | |
4 | |
2501 | 5 #include "qtxsdk/components.h" |
2778 | 6 #include "qtxsdk/select.h" |
26530 | 7 #include "mp_msg.h" |
2501 | 8 |
9 /* ilyen egy sima komponens */ | |
10 ComponentResult ComponentDummy( | |
2778 | 11 ComponentParameters *params, |
2501 | 12 void **globals, |
25589
276d47411414
Fix compilation by replacing a broken macro with in-place code.
diego
parents:
18889
diff
changeset
|
13 ComponentResult (*ComponentDispatch)(ComponentParameters *, void **)) |
2501 | 14 { |
15 printf("ComponentDummy(params: %p, globals: %p, dispatcher: %p) called!\n", | |
16 params, globals, ComponentDispatch); | |
17 printf(" Dummy: global datas: %p\n", *globals); | |
18 printf(" Dummy: returning 0\n"); | |
19 return(0); | |
20 } | |
21 | |
18889
e60c8c7399d2
get_path as const, patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents:
16194
diff
changeset
|
22 char *get_path(const char* x){ return strdup(x);} |
2796 | 23 |
3935 | 24 void* LoadLibraryA(char* name); |
2796 | 25 void* GetProcAddress(void* handle,char* func); |
26 | |
27 #define __stdcall __attribute__((__stdcall__)) | |
28 #define __cdecl __attribute__((__cdecl__)) | |
29 #define APIENTRY | |
2501 | 30 |
3935 | 31 unsigned int* x_table[0x00001837]; |
32 | |
8268 | 33 static OSErr (*InitializeQTML)(long flags); |
34 | |
2796 | 35 int main(int argc, char *argv[]){ |
2501 | 36 void *handler; |
8268 | 37 void *handler2; |
38 void* theqtdp=NULL; | |
39 void* compcall=NULL; | |
40 void* compcallws=NULL; | |
16194 | 41 ComponentResult (*dispatcher)(ComponentParameters *params, Globals glob); |
2796 | 42 ComponentResult ret; |
43 ComponentParameters *params; | |
44 ComponentDescription desc; | |
45 void *globals=NULL; | |
26528
da85ae10987e
Comment out variables only used in commented-out code, fixes the warnings:
diego
parents:
25794
diff
changeset
|
46 //unsigned int esp=0; |
da85ae10987e
Comment out variables only used in commented-out code, fixes the warnings:
diego
parents:
25794
diff
changeset
|
47 //int i; |
2501 | 48 |
8268 | 49 mp_msg_init(); |
25590
62959db3a504
Comment out non-existing mp_msg_set_level function to fix linking.
diego
parents:
25589
diff
changeset
|
50 //mp_msg_set_level(10); |
8268 | 51 |
2501 | 52 Setup_LDT_Keeper(); |
8268 | 53 printf("loading qts\n"); |
54 // handler = LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime.qts"); | |
55 handler = LoadLibraryA("QuickTime.qts"); | |
56 theqtdp = GetProcAddress(handler, "theQuickTimeDispatcher"); | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25593
diff
changeset
|
57 compcall = GetProcAddress(handler, "CallComponent"); |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25593
diff
changeset
|
58 compcallws = GetProcAddress(handler, "CallComponentFunctionWithStorage"); |
8268 | 59 |
60 InitializeQTML = 0x6299e590;//GetProcAddress(handler, "InitializeQTML"); | |
61 InitializeQTML(6+16); | |
62 | |
63 printf("loading svq3\n"); | |
64 handler2= LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime/QuickTimeEssentials.qtx"); | |
65 printf("done\n"); | |
66 dispatcher = GetProcAddress(handler2, "SMD_ComponentDispatch"); | |
25593 | 67 // handler = expLoadLibraryA("/usr/local/lib/codecs/On2_VP3.qtx"); |
2796 | 68 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher"); |
8268 | 69 printf("handler: %p, dispatcher: %p theqtdp: %p\n", handler, dispatcher, theqtdp); |
70 | |
71 // printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher")); | |
2796 | 72 |
8268 | 73 // patch svq3 dll: |
74 *((void**)0x63214c98) = NULL; | |
75 *((void**)0x63214c9c) = theqtdp; // theQt... | |
76 *((void**)0x63214ca0) = compcall; //0xdeadbeef; //dispatcher; // CallCOmponent_ptr | |
77 *((void**)0x63214ca4) = compcallws; //0xdeadbef2; //dispatcher; // CallComponentWithStorage_ptr | |
3935 | 78 |
2796 | 79 desc.componentType=0; |
80 desc.componentSubType=0; | |
81 desc.componentManufacturer=0; | |
82 desc.componentFlags=0; | |
83 desc.componentFlagsMask=0; | |
2501 | 84 |
2796 | 85 params = malloc(sizeof(ComponentParameters)+2048); |
2501 | 86 |
2796 | 87 params->flags = 0; |
8268 | 88 params->paramSize = 4; |
89 params->what = kComponentOpenSelect; | |
90 params->params[0] = 0x830000; //0x820000|i; //(i<<16)|0x24; //0x820024; | |
3935 | 91 ret = dispatcher(params, &globals); |
92 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals); | |
93 | |
94 // memset(x_table,12,4*0x00001837); | |
95 | |
96 //for(i=0;i<=255;i++){ | |
2778 | 97 |
2796 | 98 // params->what = kComponentVersionSelect; |
99 // params->what = kComponentRegisterSelect; | |
8268 | 100 // params->what = kComponentOpenSelect; |
2796 | 101 // params->what = kComponentCanDoSelect; |
2778 | 102 |
2796 | 103 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n", |
104 params->flags, params->paramSize, params->what, params->params[0]); | |
2778 | 105 |
3935 | 106 // __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); |
107 // printf("ESP=%p\n",esp); | |
108 | |
109 *((void**)0x62b7d640) = &x_table[0]; //malloc(0x00001837 * 4); // ugly hack? | |
110 | |
111 printf("params=%p &glob=%p x_table=%p\n",params,&globals, &x_table[0]); | |
2778 | 112 |
2796 | 113 ret = dispatcher(params, &globals); |
114 | |
3935 | 115 // __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); |
116 // printf("ESP=%p\n",esp); | |
2778 | 117 |
3935 | 118 printf("!!! CDComponentDispatch() => %d glob=%p\n",ret,globals); |
119 // if(ret!=-3000) break; | |
120 //} | |
121 | |
122 // for(i=0;i<0x00001837;i++) | |
123 // if(x_table[i]) printf("x_table[0x%X] = %p\n",i,x_table[i]); | |
2501 | 124 |
2796 | 125 Restore_LDT_Keeper(); |
126 exit(0); | |
127 //return 0; | |
2501 | 128 } |