Mercurial > mplayer.hg
annotate TOOLS/realcodecs/cook.c @ 17108:f9a03e3c8e23
1000l, reverting 2 more unrelated changes with last commit
author | ods15 |
---|---|
date | Tue, 06 Dec 2005 08:47:32 +0000 |
parents | 6a0cf0ee0828 |
children | 3b80b74b6813 |
rev | line source |
---|---|
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
1 /* |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
2 GPL v2 blah blah |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
3 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
4 This is a small dll that works as a wrapper for the actual cook.so.6.0 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
5 dll from real player 8.0. |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
6 */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
7 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
8 /* |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
9 Assuming that RACloseCodec is the last call. |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
10 */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
11 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
12 #include <stddef.h> |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
13 #include <stdio.h> |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
14 #include <dlfcn.h> |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
15 #include <sys/time.h> |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
16 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
17 typedef unsigned long ulong; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
18 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
19 ulong (*raCloseCodec)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
20 ulong (*raDecode)(ulong,ulong,ulong,ulong,ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
21 ulong (*raEncode)(ulong,ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
22 ulong (*raFlush)(ulong,ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
23 ulong (*raFreeDecoder)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
24 ulong (*raFreeEncoder)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
25 ulong (*raGetFlavorProperty)(ulong,ulong,ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
26 ulong (*raGetNumberOfFlavors)(void); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
27 ulong (*raGetNumberOfFlavors2)(void); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
28 ulong (*raInitDecoder)(ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
29 ulong (*raInitEncoder)(ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
30 ulong (*raOpenCodec)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
31 ulong (*raOpenCodec2)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
32 ulong (*raSetFlavor)(ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
33 void (*raSetDLLAccessPath)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
34 /* the following symbol will be _dlsym()ed by rarender.so, |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
35 but at least doesn't exist in cook.so |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
36 ulong (raSetPwd*)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
37 */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
38 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
39 int b_dlOpened=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
40 void *handle=NULL; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
41 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
42 /* exits program when failure */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
43 void loadSyms() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
44 fputs("loadSyms()\n", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
45 if (!b_dlOpened) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
46 char *error; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
47 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
48 // fputs("opening dll...\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
49 handle = dlopen ("/usr/local/RealPlayer8/Codecs/realcook.so.6.0", RTLD_LAZY); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
50 if (!handle) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
51 fputs (dlerror(), stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
52 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
53 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
54 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
55 raCloseCodec = dlsym(handle, "RACloseCodec"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
56 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
57 fprintf (stderr, "dlsym(RACloseCodec): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
58 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
59 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
60 raDecode = dlsym(handle, "RADecode"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
61 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
62 fprintf (stderr, "dlsym(RADecode): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
63 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
64 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
65 raEncode = dlsym(handle, "RAEncode"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
66 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
67 fprintf (stderr, "dlsym(RAEncode): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
68 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
69 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
70 raFlush = dlsym(handle, "RAFlush"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
71 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
72 fprintf (stderr, "dlsym(RAFlush): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
73 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
74 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
75 raFreeDecoder = dlsym(handle, "RAFreeDecoder"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
76 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
77 fprintf (stderr, "dlsym(RAFreeDecoder): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
78 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
79 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
80 raFreeEncoder = dlsym(handle, "RAFreeEncoder"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
81 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
82 fprintf (stderr, "dlsym(RAFreeEncoder): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
83 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
84 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
85 raGetFlavorProperty = dlsym(handle, "RAGetFlavorProperty"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
86 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
87 fprintf (stderr, "dlsym(RAGetFlavorProperty): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
88 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
89 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
90 raGetNumberOfFlavors = dlsym(handle, "RAGetNumberOfFlavors"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
91 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
92 fprintf (stderr, "dlsym(RAGetNumberOfFlavors): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
93 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
94 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
95 raGetNumberOfFlavors2 = dlsym(handle, "RAGetNumberOfFlavors2"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
96 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
97 fprintf (stderr, "dlsym(RAGetNumberOfFlavors2): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
98 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
99 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
100 raInitDecoder = dlsym(handle, "RAInitDecoder"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
101 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
102 fprintf (stderr, "dlsym(RAInitDecoder): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
103 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
104 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
105 raInitEncoder = dlsym(handle, "RAInitEncoder"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
106 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
107 fprintf (stderr, "dlsym(RAInitEncoder): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
108 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
109 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
110 raOpenCodec = dlsym(handle, "RAOpenCodec"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
111 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
112 fprintf (stderr, "dlsym(RAOpenCodec): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
113 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
114 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
115 raOpenCodec2 = dlsym(handle, "RAOpenCodec2"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
116 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
117 fprintf (stderr, "dlsym(RAOpenCodec2): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
118 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
119 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
120 raSetFlavor = dlsym(handle, "RASetFlavor"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
121 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
122 fprintf (stderr, "dlsym(RASetFlavor): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
123 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
124 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
125 raSetDLLAccessPath = dlsym(handle, "SetDLLAccessPath"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
126 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
127 fprintf (stderr, "dlsym(SetDLLAccessPath): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
128 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
129 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
130 b_dlOpened=1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
131 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
132 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
133 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
134 void closeDll() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
135 if (handle) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
136 b_dlOpened=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
137 dlclose(handle); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
138 handle=NULL; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
139 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
140 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
141 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
142 void _init(void) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
143 loadSyms(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
144 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
145 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
146 struct timezone tz; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
147 struct timeval tv1, tv2; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
148 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
149 void tic() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
150 gettimeofday(&tv1, &tz); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
151 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
152 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
153 void toc() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
154 long secs, usecs; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
155 gettimeofday(&tv2, &tz); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
156 secs=tv2.tv_sec-tv1.tv_sec; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
157 usecs=tv2.tv_usec-tv1.tv_usec; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
158 if (usecs<0) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
159 usecs+=1000000; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
160 --secs; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
161 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
162 fprintf(stderr, "Duration: %d.%0.6ds\n", secs, usecs); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
163 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
164 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
165 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
166 void hexdump(void *pos, int len) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
167 unsigned char *cpos=pos, *cpos1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
168 int lines=(len+15)>>4; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
169 while(lines--) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
170 int len1=len, i; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
171 fprintf(stderr, "%0x ", cpos); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
172 cpos1=cpos; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
173 for (i=0;i<16;i++) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
174 if (len1>0) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
175 fprintf(stderr, "%02x ", *(cpos++)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
176 } else { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
177 fprintf(stderr, " "); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
178 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
179 len1--; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
180 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
181 fputs(" ", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
182 cpos=cpos1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
183 for (i=0;i<16;i++) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
184 if (len>0) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
185 unsigned char ch=(*(cpos++)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
186 if ((ch<32)||(ch>127)) ch='.'; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
187 fputc(ch, stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
188 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
189 len--; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
190 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
191 fputs("\n", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
192 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
193 fputc('\n', stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
194 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
195 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
196 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
197 ulong RACloseCodec(ulong p1) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
198 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
199 fprintf(stderr, "RACloseCodec(ulong p1=0x%0x(%d))\n", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
200 result=(*raCloseCodec)(p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
201 // closeDll(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
202 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
203 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
204 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
205 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
206 static int pkno=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
207 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
208 ulong RADecode(ulong p1,ulong p2,ulong p3,ulong p4,ulong* p5,ulong p6) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
209 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
210 int x,y; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
211 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
212 fprintf(stderr, "RADecode(ulong ctx=0x%0x, ", p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
213 fprintf(stderr, "ulong src=0x%0x,\n", p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
214 fprintf(stderr, "ulong len=0x%0x,", p3); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
215 fprintf(stderr, "ulong dst=0x%0x,\n", p4); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
216 fprintf(stderr, "ulong dstcnt=0x%0x, ",p5); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
217 fprintf(stderr, "ulong p6=%d)\n", p6); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
218 // hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
219 // hexdump((void*)p2, p3); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
220 // hexdump((void*)p4, 80); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
221 // hexdump((void*)p5, 16); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
222 // tic(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
223 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
224 fprintf(stderr,"\n#CRC[%3d]",pkno++); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
225 for(y=0;y<10;y++){ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
226 unsigned short crc=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
227 unsigned char* p=p2; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
228 p+=60*y; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
229 for(x=0;x<60;x++){ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
230 crc+=p[x]<<(x&7); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
231 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
232 fprintf(stderr," %04X",crc); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
233 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
234 fprintf(stderr,"\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
235 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
236 result=(*raDecode)(p1,p2,p3,p4,p5,p6); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
237 // toc(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
238 // hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
239 // hexdump((void*)p4, 80); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
240 // hexdump((void*)p5, 16); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
241 fprintf(stderr, "--> 0x%0x(%d) decoded: %d \n\n\n", result, result, p5[0]); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
242 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
243 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
244 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
245 ulong RAEncode(ulong p1,ulong p2,ulong p3) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
246 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
247 fprintf(stderr, "RAEncode(ulong p1=0x%0x(%d), ", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
248 fprintf(stderr, "ulong p2=0x%0x(%d),\n", p2, p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
249 fprintf(stderr, "ulong p3=0x%0x(%d))\n", p3, p3); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
250 result=(*raEncode)(p1,p2,p3); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
251 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
252 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
253 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
254 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
255 ulong RAFlush(ulong p1,ulong p2,ulong p3) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
256 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
257 fprintf(stderr, "RAFlush(ulong p1=0x%0x(%d), ", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
258 fprintf(stderr, "ulong p2=0x%0x(%d),\n", p2, p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
259 fprintf(stderr, "ulong p3=0x%0x(%d))\n", p3, p3); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
260 result=(*raFlush)(p1,p2,p3); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
261 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
262 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
263 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
264 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
265 ulong RAFreeDecoder(ulong p1) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
266 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
267 fprintf(stderr, "RAFreeDecoder(ulong p1=0x%0x(%d))\n", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
268 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
269 result=(*raFreeDecoder)(p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
270 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
271 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
272 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
273 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
274 ulong RAFreeEncoder(ulong p1) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
275 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
276 fprintf(stderr, "RAFreeEncoder(ulong p1=0x%0x(%d))\n", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
277 result=(*raFreeEncoder)(p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
278 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
279 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
280 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
281 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
282 ulong RAGetFlavorProperty(ulong p1,ulong p2,ulong p3, ulong p4) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
283 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
284 fprintf(stderr, "RAGetFlavorProperty(ulong p1=0x%0x(%d), ", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
285 fprintf(stderr, "ulong p2=0x%0x(%d),\n", p2, p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
286 fprintf(stderr, "ulong p3=0x%0x(%d), ", p3, p3); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
287 fprintf(stderr, "ulong p4=0x%0x(%d))\n", p4, p4); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
288 hexdump((void*)p4/*(void*)(*((void**)p4))*/,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
289 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
290 tic(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
291 result=(*raGetFlavorProperty)(p1,p2,p3,p4); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
292 toc(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
293 fprintf(stderr, "*p4=0x%0x\n", *((ulong*)p4)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
294 hexdump((void*)p4/*(void*)(*((void**)p4))*/,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
295 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
296 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
297 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
298 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
299 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
300 ulong RAGetNumberOfFlavors(void) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
301 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
302 fprintf(stderr, "RAGetNumberOfFlavors(void)\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
303 result=(*raGetNumberOfFlavors)(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
304 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
305 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
306 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
307 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
308 ulong RAGetNumberOfFlavors2(void) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
309 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
310 fprintf(stderr, "RAGetNumberOfFlavors2(void)\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
311 result=(*raGetNumberOfFlavors2)(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
312 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
313 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
314 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
315 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
316 ulong RAInitDecoder(ulong p1,ulong p2) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
317 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
318 int temp[256]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
319 unsigned char temp2[256]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
320 fprintf(stderr, "RAInitDecoder(ulong p1=0x%0x(%d), ", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
321 fprintf(stderr, "ulong p2=0x%0x(%d))\n", p2, p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
322 hexdump((void*)p2, 4*7); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
323 // hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
324 memset(temp,0x77,256*4); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
325 memcpy(temp,p2,4*7); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
326 hexdump((void*)temp[6], 32); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
327 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
328 memset(temp2,0x77,256); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
329 memcpy(temp2,temp[6],16); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
330 temp[6]=temp2; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
331 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
332 result=(*raInitDecoder)(p1,temp); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
333 hexdump((void*)temp[6], 32); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
334 // memcpy(p2,temp,4*11); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
335 // hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
336 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
337 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
338 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
339 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
340 ulong RAInitEncoder(ulong p1,ulong p2) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
341 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
342 fprintf(stderr, "RAInitEncoder(ulong p1=0x%0x(%d), ", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
343 fprintf(stderr, "ulong p2=0x%0x(%d))\n", p2, p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
344 result=(*raInitEncoder)(p1,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
345 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
346 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
347 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
348 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
349 ulong RAOpenCodec(ulong p1) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
350 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
351 // loadSyms(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
352 fprintf(stderr, "RAOpenCodec(ulong p1=0x%0x(%d))\n", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
353 result=(*raOpenCodec)(p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
354 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
355 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
356 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
357 |
9550 | 358 ulong RAOpenCodec2(ulong p1,ulong p2) { |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
359 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
360 // loadSyms(); |
9550 | 361 fprintf(stderr, "RAOpenCodec2(ulong p1=0x%0x(%d), p2=%p)\n", p1, p1, p2); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
362 hexdump((void*)p1, 44); |
9550 | 363 hexdump((void*)p2, 44); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
364 result=(*raOpenCodec2)(p1); |
9550 | 365 hexdump((void*)p2, 44); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
366 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
367 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
368 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
369 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
370 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
371 ulong RASetFlavor(ulong p1,ulong p2) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
372 ulong result, numprop=0, result1=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
373 ulong numflavors, flavor; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
374 unsigned short property; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
375 fprintf(stderr, "RASetFlavor(ulong p1=0x%0x(%d), ", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
376 fprintf(stderr, "ulong p2=0x%0x(%d))\n", p2, p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
377 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
378 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
379 result=(*raSetFlavor)(p1,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
380 fprintf(stderr, "--> 0x%0x(%d)\n\n\n", result, result); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
381 |
9550 | 382 #if 1 |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
383 fputs("######################## FLAVOR PROPERTIES ###################\n\n", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
384 numflavors=raGetNumberOfFlavors2(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
385 flavor=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
386 while (flavor<numflavors) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
387 fprintf(stderr, "************ Flavor %d *************\n\n", flavor); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
388 numprop=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
389 while (numprop<32) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
390 result1=raGetFlavorProperty(p1, flavor, numprop, (ulong)&property); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
391 fprintf(stderr, "property %d=%d, result=0x%0x\n\n", |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
392 numprop, property, result1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
393 hexdump((void*)result1, property); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
394 numprop++; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
395 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
396 flavor++; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
397 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
398 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
399 fputs("######################## FLAVOR PROPERTIES ###################\n\n", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
400 #endif |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
401 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
402 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
403 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
404 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
405 void SetDLLAccessPath(ulong p1) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
406 // loadSyms(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
407 fprintf(stderr, "SetDLLAccessPath(ulong p1=0x%0x(%d))\n", p1, p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
408 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
409 (*raSetDLLAccessPath)(p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
410 hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
411 fprintf(stderr, "--> void\n\n\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
412 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
413 |