From b49e57abdfd7a8d50b07005ebde8abb9d08cc449 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 29 Jan 2006 09:19:55 +0000 Subject: [PATCH] Date: Fri, 18 Feb 2005 07:58:00 +0200 From: "Mike Gorchak" Subject: [SDL] [PATCH] QNX6 and not only QNX6 fixes 1) Update SDL.qpg.in for the QNX 6.3. 4) video/photon/SDL_phyuv.c - fixed bug with swapped U and V planes, using YV12 mode with radeon cards. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401292 --- SDL.qpg.in | 56 +++++++++++++++------------------ src/video/photon/SDL_ph_modes.c | 1 - src/video/photon/SDL_phyuv.c | 18 +++++------ 3 files changed, 35 insertions(+), 40 deletions(-) diff --git a/SDL.qpg.in b/SDL.qpg.in index da0e18455..8e1ff8da8 100644 --- a/SDL.qpg.in +++ b/SDL.qpg.in @@ -24,32 +24,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -59,14 +55,14 @@ SDL 1 http://qnx.org.ru/repository - 2.0 + 2.6 Simple DirectMedia Layer (SDL) SDL slouken@libsdl.org - public + Public public http://www.libsdl.org @@ -85,7 +81,7 @@ @VERSION@ - High + Medium Stable @@ -96,7 +92,7 @@ Software Development/Libraries and Extensions/C Libraries - SDL, audio, graphics, demos, games, emulators, direct, media, layer + SDL,audio,graphics,demos,games,emulators,direct,media,layer qnx6 none Photon diff --git a/src/video/photon/SDL_ph_modes.c b/src/video/photon/SDL_ph_modes.c index e46648a8b..343287874 100644 --- a/src/video/photon/SDL_ph_modes.c +++ b/src/video/photon/SDL_ph_modes.c @@ -28,7 +28,6 @@ static char rcsid = #include "SDL_error.h" #include "SDL_ph_modes_c.h" -static unsigned long key1, key2; static PgVideoModeInfo_t mode_info; static PgVideoModes_t mode_list; diff --git a/src/video/photon/SDL_phyuv.c b/src/video/photon/SDL_phyuv.c index a73b988ca..bbd6860ca 100644 --- a/src/video/photon/SDL_phyuv.c +++ b/src/video/photon/SDL_phyuv.c @@ -58,10 +58,10 @@ int grab_ptrs2(PgVideoChannel_t* channel, FRAMEDATA* Frame0, FRAMEDATA* Frame1) /* Buffers have moved; re-obtain the pointers */ Frame0->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane1); Frame1->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane2); - Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1); - Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2); - Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1); - Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2); + Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1); + Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2); + Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1); + Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2); if (Frame0->Y) planes++; @@ -217,10 +217,10 @@ SDL_Overlay* ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SD if(overlay->hwdata->channel->yplane1 != NULL) overlay->hwdata->YStride = overlay->hwdata->channel->yplane1->pitch; - if(overlay->hwdata->channel->uplane1 != NULL) - overlay->hwdata->UStride = overlay->hwdata->channel->uplane1->pitch; if(overlay->hwdata->channel->vplane1 != NULL) - overlay->hwdata->VStride = overlay->hwdata->channel->vplane1->pitch; + overlay->hwdata->UStride = overlay->hwdata->channel->vplane1->pitch; + if(overlay->hwdata->channel->uplane1 != NULL) + overlay->hwdata->VStride = overlay->hwdata->channel->uplane1->pitch; /* check for the validness of all planes */ if ((overlay->hwdata->channel->yplane1 == NULL) && @@ -267,12 +267,12 @@ SDL_Overlay* ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SD } if (overlay->planes > 1) { - overlay->pitches[1] = overlay->hwdata->channel->uplane1->pitch; + overlay->pitches[1] = overlay->hwdata->channel->vplane1->pitch; overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U; } if (overlay->planes > 2) { - overlay->pitches[2] = overlay->hwdata->channel->vplane1->pitch; + overlay->pitches[2] = overlay->hwdata->channel->uplane1->pitch; overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V; }