1 diff -ruN MPlayer-1.0pre3/Makefile MPlayer-1.0pre3.custom/Makefile
2 --- MPlayer-1.0pre3.orig/Makefile Tue Dec 9 06:33:31 2003
3 +++ MPlayer-1.0pre3/Makefile Thu Dec 11 16:18:27 2003
6 # These subdirectories require installation due to binaries within them.
8 -SUBDIRS += libdha vidix
10 DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
17 -PARTS += libdha vidix
23 COMMON_DEPS += libfaad2/libfaad2.a
26 -COMMON_DEPS += libdha/libdha.so vidix/libvidix.a
27 +COMMON_DEPS += vidix/libvidix.a
30 COMMON_DEPS += libfame/libfame.a
31 diff -ruN MPlayer-1.0pre3.orig/configure MPlayer-1.0pre3/configure
32 --- MPlayer-1.0pre3.orig/configure Tue Dec 9 06:33:31 2003
33 +++ MPlayer-1.0pre3/configure Thu Dec 11 17:29:38 2003
35 #include <sys/types.h>
36 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
38 -cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
39 +cc_check && _wordsize="32" && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
48 + _ld_pthread='-lpthread'
49 elif ( cc_check && $TMPO ) ; then # QNX
51 elif ( cc_check -lpthread && $TMPO ) ; then
52 diff -ruN MPlayer-1.0pre3.orig/vidix/drivers/Makefile MPlayer-1.0pre3/vidix/drivers/Makefile
53 --- MPlayer-1.0pre3.orig/vidix/drivers/Makefile Thu Oct 23 01:45:33 2003
54 +++ MPlayer-1.0pre3/vidix/drivers/Makefile Thu Dec 11 17:13:01 2003
57 $(SIS_VID): $(SIS_OBJS)
58 $(CC) -shared $(SIS_OBJS) $(SIS_LIBS) -Wl,-soname,$(SIS_VID) -o $(SIS_VID)
60 +$(W100_OBJS): $(W100_SRCS)
61 + $(CC) -c $(W100_CFLAGS) -o $@ $<
63 +$(W100_VID): $(W100_OBJS)
64 + $(CC) -shared $(W100_OBJS) $(W100_LIBS) -Wl,-soname,$(W100_VID) -o $(W100_VID)
68 diff -ruN MPlayer-1.0pre3.orig/vidix/drivers/w100_vid.c MPlayer-1.0pre3/vidix/drivers/w100_vid.c
69 --- MPlayer-1.0pre3.orig/vidix/drivers/w100_vid.c Thu Jan 1 09:00:00 1970
70 +++ MPlayer-1.0pre3/vidix/drivers/w100_vid.c Thu Dec 11 16:24:01 2003
76 +#include <inttypes.h>
79 +#include "../vidix.h"
80 +#include "../fourcc.h"
81 +#include "../../config.h"
84 +#define UNUSED(v) ((void)(v))
86 +static uint16_t st_overlayHandle;
88 +static vidix_capability_t w100_cap =
91 + "AGAWA Koji <kaoru-K@self-core.org>",
93 + { 0, 0, 0, 0 }, /* reserved */
94 + 480, /* max width */
95 + 640, /* max height */
98 + -1, /* max framerate */
99 + FLAG_EQUALIZER, /* flags */
100 + 0x1002, /* VENDOR_ATI(libdha/pci_vendors.h) */
101 + -1, /* device id */
102 + { 0, 0, 0, 0 } /* reserved */
105 +unsigned int vixGetVersion(void)
107 + return VIDIX_VERSION;
110 +int vixProbe(int verbose, int force)
119 + if (AtiCore_ProcessAttach()) {
120 + if (AtiCore_AllocOverlay(&st_overlayHandle))
127 +void vixDestroy(void)
129 + AtiCore_SetOverlayOnOff(st_overlayHandle, 0);
130 + AtiCore_ReleaseOverlay(st_overlayHandle);
131 + AtiCore_ProcessDetach();
134 +int vixGetCapability(vidix_capability_t *to)
136 + memcpy(to, &w100_cap, sizeof(vidix_capability_t));
140 +static int is_supported_fourcc(uint32_t fourcc)
150 +int vixQueryFourcc(vidix_fourcc_t *to)
152 + if (is_supported_fourcc(to->fourcc)) {
153 + to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
154 + VID_DEPTH_4BPP | VID_DEPTH_8BPP |
155 + VID_DEPTH_12BPP| VID_DEPTH_15BPP|
156 + VID_DEPTH_16BPP| VID_DEPTH_24BPP|
158 + to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK;
159 +/* to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY; */
162 + to->depth = to->flags = 0;
167 +int vixGetGrKeys(vidix_grkey_t *grkey)
173 +int vixSetGrKeys(const vidix_grkey_t *grkey)
179 +static vidix_video_eq_t st_equal =
181 + VEQ_CAP_BRIGHTNESS,
182 + 0, 0, 0, 0, 0, 0, 0, 0
185 +int vixPlaybackGetEq(vidix_video_eq_t * eq)
187 + memcpy(eq, &st_equal, sizeof(st_equal));
191 +int vixPlaybackSetEq(const vidix_video_eq_t * eq)
195 + if (eq->cap & VEQ_CAP_BRIGHTNESS)
196 + st_equal.brightness = eq->brightness;
197 + if (eq->cap & VEQ_CAP_CONTRAST)
198 + st_equal.contrast = eq->contrast;
199 + if (eq->cap & VEQ_CAP_SATURATION)
200 + st_equal.saturation = eq->saturation;
201 + if (eq->cap & VEQ_CAP_HUE)
202 + st_equal.hue = eq->hue;
203 + if (eq->cap & VEQ_CAP_RGB_INTENSITY) {
204 + st_equal.red_intensity = eq->red_intensity;
205 + st_equal.green_intensity = eq->green_intensity;
206 + st_equal.blue_intensity = eq->blue_intensity;
208 + st_equal.flags = eq->flags;
210 + br = (st_equal.brightness + 1000) * 127 / 2000;
220 + AtiCore_SetDisplayBrightness(br);
225 +static uint32_t st_frameOffsets[VID_PLAY_MAXFRAMES];
226 +static vidix_playback_t st_playbackInfo;
227 +static ATI_OVERLAYPROP st_overlayProp;
229 +int vixConfigPlayback(vidix_playback_t *info)
233 + int y_pitch, uv_pitch;
234 + int i, ret, newNumFrames;
235 + ATI_CLIPRECT clipRect;
237 + uint32_t internalVramSize, internalVramAddr;
238 + uint32_t externalVramSize, externalVramAddr;
239 + int useExternalVram = 0;
241 + if (!is_supported_fourcc(info->fourcc))
244 + src_w = info->src.w;
245 + src_h = info->src.h;
246 + drw_w = info->dest.w;
247 + drw_h = info->dest.h;
249 + switch (info->fourcc) {
251 + y_pitch = (src_w + 15) & ~15;
252 + uv_pitch = ((src_w / 2) + 7) & ~7;
253 + info->offset.y = 0;
254 + info->offset.v = y_pitch * src_h;
255 + info->offset.u = info->offset.v + uv_pitch * (src_h / 2);
256 + info->frame_size = y_pitch * src_h + 2 * uv_pitch * (src_h / 2);
261 +/* fprintf(stderr, "w100_vid: num_frames:%d\n", info->num_frames); */
262 +/* fprintf(stderr, "w100_vid: y_pitch:%d\n", y_pitch); */
264 +/* fprintf(stderr, "w100_vid: struct info {\n"); */
265 +/* fprintf(stderr, "w100_vid: src.x:%d. src.y:%d. src.w:%d, src.h:%d,\n", */
266 +/* info->src.x, info->src.y, info->src.w, info->src.h); */
267 +/* fprintf(stderr, "w100_vid: dest.x:%d. dest.y:%d. dest.w:%d, dest.h:%d,\n", */
268 +/* info->dest.x, info->dest.y, info->dest.w, info->dest.h); */
269 +/* fprintf(stderr, "w100_vid: offset.y:%d, offset.v:%d offset.y:%d\n", */
270 +/* info->offset.y, info->offset.v, info->offset.u); */
271 +/* fprintf(stderr, "w100_vid: frame_size:%d,\n", info->frame_size); */
273 + GetAvailableVideoMem(&internalVramSize, &externalVramSize);
274 + AtiCore_SetupMemoryTransfer(0, &internalVramAddr);
275 + AtiCore_TerminateMemoryTransfer();
276 + AtiCore_SetupMemoryTransfer(0xF000000, &externalVramAddr);
277 + AtiCore_TerminateMemoryTransfer();
279 +/* info->num_frames = 1; */
280 + useExternalVram = (getenv("MPLAYER_W100_USEEXTVRAM") ? 1 : 0);
282 + if (useExternalVram) {
283 + /*
\e$B%U%l!<%`%P%C%U%!$H$7$FMxMQ$5$l$F$$$kItJ,$O;H$o$J$$
\e(B */
284 + base = 640 * 480 * 2;
285 + newNumFrames = (externalVramSize - (640 * 480 * 2))
286 + / info->frame_size;
288 + /* FIXME:
\e$B30It
\e(B VRAM
\e$B$K%*!<%P%l%$$r3NJ]$9$k$H!"
\e(BVGA/QVGA
\e$BLd$o$:
\e(B
289 +
\e$BI=<($,GH>u$KMp$l$k!#
\e(B @SL-C700/C750 */
291 + /*
\e$B%U%l!<%`%P%C%U%!It$b;H$o$J$$$H!"
\e(BVRAM
\e$BMFNL$,B-$j$J$$
\e(B */
292 +/* base = 320 * 240 * 2; */
293 + base = 320 * 4 * 2;
294 + memset((void *)internalVramAddr, 0x00, 320 * 4 * 2);
295 + newNumFrames = internalVramSize / info->frame_size;
298 + if (newNumFrames > info->num_frames)
299 + newNumFrames = info->num_frames;
300 + if (newNumFrames > VID_PLAY_MAXFRAMES)
301 + newNumFrames = VID_PLAY_MAXFRAMES;
302 + info->num_frames = newNumFrames;
305 + (void *)(useExternalVram ? externalVramAddr : internalVramAddr);
306 +/* fprintf(stderr, "w100_vid: num_frames:%d,\n", info->num_frames); */
308 + info->dest.pitch.y = 16;
309 + info->dest.pitch.u = 16;
310 + info->dest.pitch.v = 16;
312 +/* fprintf(stderr, "w100_vid: }\n"); */
313 +/* fprintf(stderr, "w100_vid: base:%d\n", base); */
315 + for (i = 0; i < info->num_frames; ++i) {
316 + info->offsets[i] = base + info->frame_size * i;
317 + st_frameOffsets[i] = info->offsets[i]
318 + + (useExternalVram ? 0xF000000 : 0);
321 + st_overlayProp.lpSrcBitmap = (void *)st_frameOffsets[0];
322 + st_overlayProp.XCoord = 0;
323 + st_overlayProp.YCoord = 0;
324 + st_overlayProp.SrcPitch = y_pitch;
325 + st_overlayProp.SrcHeight = src_h;
326 + st_overlayProp.OverlayWidth = y_pitch;
327 + st_overlayProp.OverlayHeight = src_h;
328 + st_overlayProp.lpOverlayKey = 0;
329 + st_overlayProp.OverlayFormat = OVLTYPE_YUV420;
331 + ret = AtiCore_SetupOverlay(st_overlayHandle, &st_overlayProp);
332 +/* printf("w100_vid: AtiCore_SetupOverlay: ret=%d\n", ret); */
334 + clipRect.X_Top_Left = 0;
335 + clipRect.Y_Top_Left = 0;
336 + clipRect.X_Bottom_Right = st_overlayProp.SrcPitch;
337 + clipRect.Y_Bottom_Right = st_overlayProp.SrcHeight;
338 + AtiCore_SetDstClippingRect(&clipRect);
339 + clipRect.X_Bottom_Right = info->src.w;
340 + clipRect.Y_Bottom_Right = info->src.h;
341 + AtiCore_SetSrcClippingRect(&clipRect);
343 +/* AtiCore_SetOverlayPos(st_overlayHandle, info->dest.x, info->dest.y); */
344 + AtiCore_SetOverlayPos(st_overlayHandle, 4, 0);
346 + AtiCore_SetRopOperation(ROP3_SRCCOPY);
347 + AtiCore_SetDstType(DSTTYPE_8BPP);
348 + AtiCore_SetSrcType(SRCTYPE_EQU_DST);
350 + vixPlaybackSetEq(&st_equal);
352 + memcpy(&st_playbackInfo, info, sizeof(*info));
354 +/* fprintf(stderr, "w100_vid: ---- vixConfigPlayback complete.\n"); */
359 +int vixPlaybackOn(void)
361 + AtiCore_SetOverlayOnOff(st_overlayHandle, 1);
366 +int vixPlaybackOff(void)
368 + AtiCore_SetOverlayOnOff(st_overlayHandle, 0);
373 +int vixPlaybackFrameSelect(unsigned int frame)
375 + st_overlayProp.lpSrcBitmap = (void *)st_frameOffsets[frame];
376 + AtiCore_SetupOverlay(st_overlayHandle, &st_overlayProp);
379 + ATI_STRETCH stretchOptions;
381 + ATI_RECT srcRect, dstRect;
384 +/* fprintf(stderr, "w100_vid: vixPlaybackFrameSelect(frame=%d)\n", frame); */
385 +/* fprintf(stderr, "w100_vid: dga_addr:0x%08x, offset:%d,\n", */
386 +/* st_playbackInfo.dga_addr, st_frameOffsets[frame]); */
388 + stretchOptions.Count = 1;
389 + stretchOptions.ScaleXFactor = 4;
390 + stretchOptions.ScaleYFactor = 4;
391 + stretchOptions.BlendOn = 0;
392 + stretchOptions.dummy1 = 0;
394 + dpPoint.XCoord = 0;
395 + dpPoint.YCoord = 0;
397 + srcRect.XCoord = st_playbackInfo.src.x;
398 + srcRect.YCoord = st_playbackInfo.src.y;
399 + srcRect.Width = st_playbackInfo.src.w;
400 + srcRect.Height = st_playbackInfo.src.h;
401 + fprintf(stderr, "%d, %d, %d, %d\n", srcRect.XCoord, srcRect.YCoord,
402 + srcRect.Width, srcRect.Height);
404 + dstRect.XCoord = 0;
405 + dstRect.YCoord = 0;
406 + dstRect.Width = 432;//st_playbackInfo.src.w;
407 + dstRect.Height = 592;//st_playbackInfo.src.h;
410 + while (AtiCore_WaitComplete(100) != 1)
413 + AtiCore_SetRopOperation( ROP3_SRCCOPY );
414 + AtiCore_SetDstType( DSTTYPE_8BPP );
415 + AtiCore_SetSrcType( SRCTYPE_EQU_DST );
417 + ret = AtiCore_SetSrcPitchOffset(st_playbackInfo.src.w,
418 + st_frameOffsets[frame]);
419 + fprintf(stderr, "AtiCore_SetSrcPitchOffset(%d, %x) %d\n",
420 + st_playbackInfo.src.w, st_frameOffsets[frame], ret);
421 + ret = AtiCore_SetDstPitchOffset(432, 0);
422 +/* printf("AtiCore_SetDstPitchOffset: ret=%d\n", ret); */
424 +/* ret = AtiCore_BitBltFilpRotate(0, &srcRect, &dstRect); */
425 + ret = AtiCore_StretchBlt(&stretchOptions, &dpPoint, &srcRect);
426 + fprintf(stderr, "AtiCore_StretchBlt: ret=%d\n", ret);
430 + int y, srcOffset = 0, dstOffset = 0;
431 + fprintf(stderr, "%d %d %d\n", st_playbackInfo.src.h,
432 + st_playbackInfo.src.w, 0);
433 + for (y = 0; y < st_playbackInfo.src.h; ++y) {
435 + 0xF1100000 + dstOffset,
436 + st_playbackInfo.dga_addr + st_playbackInfo.offsets[frame] + srcOffset,
437 + st_playbackInfo.src.w);
438 + srcOffset += st_playbackInfo.src.w;