Mercurial > sdl-ios-xcode
comparison src/video/photon/SDL_phyuv.c @ 1289:c07c6ef7c93e
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.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 29 Jan 2006 09:19:55 +0000 |
parents | 05c551e5bc64 |
children | c9b51268668f |
comparison
equal
deleted
inserted
replaced
1288:ea3888b472bf | 1289:c07c6ef7c93e |
---|---|
56 int planes = 0; | 56 int planes = 0; |
57 | 57 |
58 /* Buffers have moved; re-obtain the pointers */ | 58 /* Buffers have moved; re-obtain the pointers */ |
59 Frame0->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane1); | 59 Frame0->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane1); |
60 Frame1->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane2); | 60 Frame1->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane2); |
61 Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1); | 61 Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1); |
62 Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2); | 62 Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2); |
63 Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1); | 63 Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1); |
64 Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2); | 64 Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2); |
65 | 65 |
66 if (Frame0->Y) | 66 if (Frame0->Y) |
67 planes++; | 67 planes++; |
68 | 68 |
69 if (Frame0->U) | 69 if (Frame0->U) |
215 | 215 |
216 planes = grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1); | 216 planes = grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1); |
217 | 217 |
218 if(overlay->hwdata->channel->yplane1 != NULL) | 218 if(overlay->hwdata->channel->yplane1 != NULL) |
219 overlay->hwdata->YStride = overlay->hwdata->channel->yplane1->pitch; | 219 overlay->hwdata->YStride = overlay->hwdata->channel->yplane1->pitch; |
220 if(overlay->hwdata->channel->vplane1 != NULL) | |
221 overlay->hwdata->UStride = overlay->hwdata->channel->vplane1->pitch; | |
220 if(overlay->hwdata->channel->uplane1 != NULL) | 222 if(overlay->hwdata->channel->uplane1 != NULL) |
221 overlay->hwdata->UStride = overlay->hwdata->channel->uplane1->pitch; | 223 overlay->hwdata->VStride = overlay->hwdata->channel->uplane1->pitch; |
222 if(overlay->hwdata->channel->vplane1 != NULL) | |
223 overlay->hwdata->VStride = overlay->hwdata->channel->vplane1->pitch; | |
224 | 224 |
225 /* check for the validness of all planes */ | 225 /* check for the validness of all planes */ |
226 if ((overlay->hwdata->channel->yplane1 == NULL) && | 226 if ((overlay->hwdata->channel->yplane1 == NULL) && |
227 (overlay->hwdata->channel->uplane1 == NULL) && | 227 (overlay->hwdata->channel->uplane1 == NULL) && |
228 (overlay->hwdata->channel->vplane1 == NULL)) | 228 (overlay->hwdata->channel->vplane1 == NULL)) |
265 overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch; | 265 overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch; |
266 overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y; | 266 overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y; |
267 } | 267 } |
268 if (overlay->planes > 1) | 268 if (overlay->planes > 1) |
269 { | 269 { |
270 overlay->pitches[1] = overlay->hwdata->channel->uplane1->pitch; | 270 overlay->pitches[1] = overlay->hwdata->channel->vplane1->pitch; |
271 overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U; | 271 overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U; |
272 } | 272 } |
273 if (overlay->planes > 2) | 273 if (overlay->planes > 2) |
274 { | 274 { |
275 overlay->pitches[2] = overlay->hwdata->channel->vplane1->pitch; | 275 overlay->pitches[2] = overlay->hwdata->channel->uplane1->pitch; |
276 overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V; | 276 overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V; |
277 } | 277 } |
278 | 278 |
279 overlay->hwdata->State = OVERLAY_STATE_ACTIVE; | 279 overlay->hwdata->State = OVERLAY_STATE_ACTIVE; |
280 overlay->hwdata->scaler_on = 0; | 280 overlay->hwdata->scaler_on = 0; |