Mercurial > mplayer.hg
annotate loader/qtx/qtxload.c @ 33263:5f527a9a9521
Add an exit function.
This function will allow performing clean-up operations.
(MPlayer calls guiDone() before exiting, but only if the GUI has been
initialized, i.e. if guiInit() has been called successfully. Any
exit_player()/exit_player_with_rc() after GUI's cfg_read() until
guiInit(), or any exit_player() during guiInit() itself will end the GUI
without calling guiDone(). This exit function will at least handle
abortions during guiInit() itself. It will be called twice in case of an
guiExit() after GUI initialization - first directly, next by guiDone()
via MPlayer's exit_player_with_rc().)
author | ib |
---|---|
date | Tue, 03 May 2011 12:19:22 +0000 |
parents | 2a681e243c4c |
children |
rev | line source |
---|---|
30452
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
1 /* |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
2 * This file is part of MPlayer. |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
3 * |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
7 * (at your option) any later version. |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
8 * |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
12 * GNU General Public License for more details. |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
13 * |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
17 */ |
fee09b258e8a
Add missing license headers to test programs for external libraries.
diego
parents:
30170
diff
changeset
|
18 |
2501 | 19 #include <stdio.h> |
2796 | 20 #include <stdlib.h> |
21 #include <string.h> | |
22 | |
2501 | 23 #include "qtxsdk/components.h" |
2778 | 24 #include "qtxsdk/select.h" |
30170
008338d7679f
Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents:
29263
diff
changeset
|
25 #include "loader/ldt_keeper.h" |
31344
5d0b3552ea01
Replace forward declarations by loader/wine/winbase.h #include.
diego
parents:
31343
diff
changeset
|
26 #include "loader/wine/winbase.h" |
26530 | 27 #include "mp_msg.h" |
2501 | 28 |
3935 | 29 unsigned int* x_table[0x00001837]; |
30 | |
8268 | 31 static OSErr (*InitializeQTML)(long flags); |
32 | |
28599
3ff0da40013d
cosmetics: Replace unused 'argc/argv' in main declarations by 'void'.
diego
parents:
27772
diff
changeset
|
33 int main(void) { |
2501 | 34 void *handler; |
8268 | 35 void *handler2; |
36 void* theqtdp=NULL; | |
37 void* compcall=NULL; | |
38 void* compcallws=NULL; | |
16194 | 39 ComponentResult (*dispatcher)(ComponentParameters *params, Globals glob); |
2796 | 40 ComponentResult ret; |
41 ComponentParameters *params; | |
42 ComponentDescription desc; | |
43 void *globals=NULL; | |
26528
da85ae10987e
Comment out variables only used in commented-out code, fixes the warnings:
diego
parents:
25794
diff
changeset
|
44 //unsigned int esp=0; |
da85ae10987e
Comment out variables only used in commented-out code, fixes the warnings:
diego
parents:
25794
diff
changeset
|
45 //int i; |
2501 | 46 |
8268 | 47 mp_msg_init(); |
25590
62959db3a504
Comment out non-existing mp_msg_set_level function to fix linking.
diego
parents:
25589
diff
changeset
|
48 //mp_msg_set_level(10); |
8268 | 49 |
2501 | 50 Setup_LDT_Keeper(); |
8268 | 51 printf("loading qts\n"); |
52 // handler = LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime.qts"); | |
53 handler = LoadLibraryA("QuickTime.qts"); | |
54 theqtdp = GetProcAddress(handler, "theQuickTimeDispatcher"); | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25593
diff
changeset
|
55 compcall = GetProcAddress(handler, "CallComponent"); |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
25593
diff
changeset
|
56 compcallws = GetProcAddress(handler, "CallComponentFunctionWithStorage"); |
8268 | 57 |
58 InitializeQTML = 0x6299e590;//GetProcAddress(handler, "InitializeQTML"); | |
59 InitializeQTML(6+16); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28599
diff
changeset
|
60 |
8268 | 61 printf("loading svq3\n"); |
62 handler2= LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime/QuickTimeEssentials.qtx"); | |
63 printf("done\n"); | |
64 dispatcher = GetProcAddress(handler2, "SMD_ComponentDispatch"); | |
25593 | 65 // handler = expLoadLibraryA("/usr/local/lib/codecs/On2_VP3.qtx"); |
2796 | 66 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher"); |
8268 | 67 printf("handler: %p, dispatcher: %p theqtdp: %p\n", handler, dispatcher, theqtdp); |
68 | |
69 // printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher")); | |
2796 | 70 |
8268 | 71 // patch svq3 dll: |
72 *((void**)0x63214c98) = NULL; | |
73 *((void**)0x63214c9c) = theqtdp; // theQt... | |
74 *((void**)0x63214ca0) = compcall; //0xdeadbeef; //dispatcher; // CallCOmponent_ptr | |
75 *((void**)0x63214ca4) = compcallws; //0xdeadbef2; //dispatcher; // CallComponentWithStorage_ptr | |
3935 | 76 |
2796 | 77 desc.componentType=0; |
78 desc.componentSubType=0; | |
79 desc.componentManufacturer=0; | |
80 desc.componentFlags=0; | |
81 desc.componentFlagsMask=0; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28599
diff
changeset
|
82 |
2796 | 83 params = malloc(sizeof(ComponentParameters)+2048); |
2501 | 84 |
2796 | 85 params->flags = 0; |
8268 | 86 params->paramSize = 4; |
87 params->what = kComponentOpenSelect; | |
88 params->params[0] = 0x830000; //0x820000|i; //(i<<16)|0x24; //0x820024; | |
3935 | 89 ret = dispatcher(params, &globals); |
90 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals); | |
91 | |
92 // memset(x_table,12,4*0x00001837); | |
93 | |
94 //for(i=0;i<=255;i++){ | |
2778 | 95 |
2796 | 96 // params->what = kComponentVersionSelect; |
97 // params->what = kComponentRegisterSelect; | |
8268 | 98 // params->what = kComponentOpenSelect; |
2796 | 99 // params->what = kComponentCanDoSelect; |
2778 | 100 |
2796 | 101 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n", |
102 params->flags, params->paramSize, params->what, params->params[0]); | |
2778 | 103 |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26757
diff
changeset
|
104 // __asm__ volatile ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); |
3935 | 105 // printf("ESP=%p\n",esp); |
106 | |
107 *((void**)0x62b7d640) = &x_table[0]; //malloc(0x00001837 * 4); // ugly hack? | |
108 | |
109 printf("params=%p &glob=%p x_table=%p\n",params,&globals, &x_table[0]); | |
2778 | 110 |
2796 | 111 ret = dispatcher(params, &globals); |
112 | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26757
diff
changeset
|
113 // __asm__ volatile ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); |
3935 | 114 // printf("ESP=%p\n",esp); |
2778 | 115 |
3935 | 116 printf("!!! CDComponentDispatch() => %d glob=%p\n",ret,globals); |
117 // if(ret!=-3000) break; | |
118 //} | |
119 | |
120 // for(i=0;i<0x00001837;i++) | |
121 // if(x_table[i]) printf("x_table[0x%X] = %p\n",i,x_table[i]); | |
26538
1b05ff23d572
Remove calls to Restore_LDT_Keeper, exit() is called immediately afterwards
diego
parents:
26537
diff
changeset
|
122 |
2796 | 123 exit(0); |
124 //return 0; | |
2501 | 125 } |