annotate loader/qtx/qtxload.c @ 34565:25acb5f98cb4

Support v408 and AYUV decoding via FFmpeg.
author cehoyos
date Sun, 05 Feb 2012 21:20:51 +0000
parents 2a681e243c4c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
alex
parents:
diff changeset
19 #include <stdio.h>
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
20 #include <stdlib.h>
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
21 #include <string.h>
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
22
2501
alex
parents:
diff changeset
23 #include "qtxsdk/components.h"
2778
arpi
parents: 2768
diff changeset
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
59466c2ce1f0 Add missing #include, fixes the warning:
diego
parents: 26528
diff changeset
27 #include "mp_msg.h"
2501
alex
parents:
diff changeset
28
3935
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
29 unsigned int* x_table[0x00001837];
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
30
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
31 static OSErr (*InitializeQTML)(long flags);
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
32
28599
3ff0da40013d cosmetics: Replace unused 'argc/argv' in main declarations by 'void'.
diego
parents: 27772
diff changeset
33 int main(void) {
2501
alex
parents:
diff changeset
34 void *handler;
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
35 void *handler2;
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
36 void* theqtdp=NULL;
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
37 void* compcall=NULL;
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
38 void* compcallws=NULL;
16194
167342641f0b Remove stray MSDOS linebreaks
ivo
parents: 8268
diff changeset
39 ComponentResult (*dispatcher)(ComponentParameters *params, Globals glob);
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
40 ComponentResult ret;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
41 ComponentParameters *params;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
42 ComponentDescription desc;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
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
alex
parents:
diff changeset
46
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
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
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
49
2501
alex
parents:
diff changeset
50 Setup_LDT_Keeper();
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
51 printf("loading qts\n");
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
52 // handler = LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime.qts");
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
53 handler = LoadLibraryA("QuickTime.qts");
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
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
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
57
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
58 InitializeQTML = 0x6299e590;//GetProcAddress(handler, "InitializeQTML");
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
59 InitializeQTML(6+16);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28599
diff changeset
60
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
61 printf("loading svq3\n");
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
62 handler2= LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime/QuickTimeEssentials.qtx");
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
63 printf("done\n");
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
64 dispatcher = GetProcAddress(handler2, "SMD_ComponentDispatch");
25593
96ce0ca753ff /usr/lib/win32 --> /usr/local/lib/codecs
diego
parents: 25592
diff changeset
65 // handler = expLoadLibraryA("/usr/local/lib/codecs/On2_VP3.qtx");
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
66 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher");
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
67 printf("handler: %p, dispatcher: %p theqtdp: %p\n", handler, dispatcher, theqtdp);
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
68
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
69 // printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher"));
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
70
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
71 // patch svq3 dll:
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
72 *((void**)0x63214c98) = NULL;
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
73 *((void**)0x63214c9c) = theqtdp; // theQt...
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
74 *((void**)0x63214ca0) = compcall; //0xdeadbeef; //dispatcher; // CallCOmponent_ptr
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
75 *((void**)0x63214ca4) = compcallws; //0xdeadbef2; //dispatcher; // CallComponentWithStorage_ptr
3935
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
76
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
77 desc.componentType=0;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
78 desc.componentSubType=0;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
79 desc.componentManufacturer=0;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
80 desc.componentFlags=0;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
81 desc.componentFlagsMask=0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28599
diff changeset
82
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
83 params = malloc(sizeof(ComponentParameters)+2048);
2501
alex
parents:
diff changeset
84
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
85 params->flags = 0;
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
86 params->paramSize = 4;
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
87 params->what = kComponentOpenSelect;
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
88 params->params[0] = 0x830000; //0x820000|i; //(i<<16)|0x24; //0x820024;
3935
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
89 ret = dispatcher(params, &globals);
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
90 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals);
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
91
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
92 // memset(x_table,12,4*0x00001837);
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
93
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
94 //for(i=0;i<=255;i++){
2778
arpi
parents: 2768
diff changeset
95
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
96 // params->what = kComponentVersionSelect;
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
97 // params->what = kComponentRegisterSelect;
8268
a85040e4b1a0 some new experiments
arpi
parents: 3935
diff changeset
98 // params->what = kComponentOpenSelect;
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
99 // params->what = kComponentCanDoSelect;
2778
arpi
parents: 2768
diff changeset
100
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
101 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n",
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
102 params->flags, params->paramSize, params->what, params->params[0]);
2778
arpi
parents: 2768
diff changeset
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
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
105 // printf("ESP=%p\n",esp);
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
106
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
107 *((void**)0x62b7d640) = &x_table[0]; //malloc(0x00001837 * 4); // ugly hack?
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
108
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
109 printf("params=%p &glob=%p x_table=%p\n",params,&globals, &x_table[0]);
2778
arpi
parents: 2768
diff changeset
110
2796
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
111 ret = dispatcher(params, &globals);
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
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
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
114 // printf("ESP=%p\n",esp);
2778
arpi
parents: 2768
diff changeset
115
3935
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
116 printf("!!! CDComponentDispatch() => %d glob=%p\n",ret,globals);
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
117 // if(ret!=-3000) break;
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
118 //}
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
119
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
120 // for(i=0;i<0x00001837;i++)
422d65c712a0 more mess
arpi
parents: 2796
diff changeset
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
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
123 exit(0);
8671d43c1078 still sig11
arpi
parents: 2778
diff changeset
124 //return 0;
2501
alex
parents:
diff changeset
125 }