indent
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403247
This commit is contained in:
parent
de690ebe5d
commit
a733eee1b8
10 changed files with 120 additions and 113 deletions
|
@ -1445,7 +1445,8 @@ SDL_CreateYUVOverlay(int w, int h, Uint32 format, SDL_Surface * display)
|
||||||
|
|
||||||
/* Create a supported RGB format texture for display */
|
/* Create a supported RGB format texture for display */
|
||||||
overlay->hwdata->textureID =
|
overlay->hwdata->textureID =
|
||||||
SDL_CreateTexture(SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, w, h);
|
SDL_CreateTexture(SDL_PIXELFORMAT_RGB888,
|
||||||
|
SDL_TEXTUREACCESS_STREAMING, w, h);
|
||||||
}
|
}
|
||||||
if (!overlay->hwdata->textureID) {
|
if (!overlay->hwdata->textureID) {
|
||||||
SDL_FreeYUVOverlay(overlay);
|
SDL_FreeYUVOverlay(overlay);
|
||||||
|
@ -1466,11 +1467,13 @@ SDL_LockYUVOverlay(SDL_Overlay * overlay)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (overlay->hwdata->sw) {
|
if (overlay->hwdata->sw) {
|
||||||
if (SDL_SW_QueryYUVTexturePixels(overlay->hwdata->sw, &pixels, &pitch) < 0) {
|
if (SDL_SW_QueryYUVTexturePixels(overlay->hwdata->sw, &pixels, &pitch)
|
||||||
|
< 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (SDL_LockTexture(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch)
|
if (SDL_LockTexture
|
||||||
|
(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch)
|
||||||
< 0) {
|
< 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1504,14 +1507,17 @@ SDL_UnlockYUVOverlay(SDL_Overlay * overlay)
|
||||||
if (overlay->hwdata->sw) {
|
if (overlay->hwdata->sw) {
|
||||||
void *pixels;
|
void *pixels;
|
||||||
int pitch;
|
int pitch;
|
||||||
if (SDL_LockTexture(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch) == 0) {
|
if (SDL_LockTexture
|
||||||
|
(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch) == 0) {
|
||||||
SDL_Rect srcrect;
|
SDL_Rect srcrect;
|
||||||
|
|
||||||
srcrect.x = 0;
|
srcrect.x = 0;
|
||||||
srcrect.y = 0;
|
srcrect.y = 0;
|
||||||
srcrect.w = overlay->w;
|
srcrect.w = overlay->w;
|
||||||
srcrect.h = overlay->h;
|
srcrect.h = overlay->h;
|
||||||
SDL_SW_CopyYUVToRGB(overlay->hwdata->sw, &srcrect, SDL_PIXELFORMAT_RGB888, overlay->w, overlay->h, pixels, pitch);
|
SDL_SW_CopyYUVToRGB(overlay->hwdata->sw, &srcrect,
|
||||||
|
SDL_PIXELFORMAT_RGB888, overlay->w,
|
||||||
|
overlay->h, pixels, pitch);
|
||||||
SDL_UnlockTexture(overlay->hwdata->textureID);
|
SDL_UnlockTexture(overlay->hwdata->textureID);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -361,7 +361,8 @@ static int
|
||||||
SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
{
|
{
|
||||||
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
||||||
texture->driverdata = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
texture->driverdata =
|
||||||
|
SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
||||||
} else {
|
} else {
|
||||||
int bpp;
|
int bpp;
|
||||||
Uint32 Rmask, Gmask, Bmask, Amask;
|
Uint32 Rmask, Gmask, Bmask, Amask;
|
||||||
|
|
|
@ -1110,10 +1110,8 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
|
||||||
swdata->pitches[1] = swdata->pitches[0] / 2;
|
swdata->pitches[1] = swdata->pitches[0] / 2;
|
||||||
swdata->pitches[2] = swdata->pitches[0] / 2;
|
swdata->pitches[2] = swdata->pitches[0] / 2;
|
||||||
swdata->planes[0] = swdata->pixels;
|
swdata->planes[0] = swdata->pixels;
|
||||||
swdata->planes[1] =
|
swdata->planes[1] = swdata->planes[0] + swdata->pitches[0] * h;
|
||||||
swdata->planes[0] + swdata->pitches[0] * h;
|
swdata->planes[2] = swdata->planes[1] + swdata->pitches[1] * h / 2;
|
||||||
swdata->planes[2] =
|
|
||||||
swdata->planes[1] + swdata->pitches[1] * h / 2;
|
|
||||||
break;
|
break;
|
||||||
case SDL_PIXELFORMAT_YUY2:
|
case SDL_PIXELFORMAT_YUY2:
|
||||||
case SDL_PIXELFORMAT_UYVY:
|
case SDL_PIXELFORMAT_UYVY:
|
||||||
|
|
|
@ -633,7 +633,8 @@ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
d3drect.top = rect->y;
|
d3drect.top = rect->y;
|
||||||
d3drect.bottom = rect->y + rect->h;
|
d3drect.bottom = rect->y + rect->h;
|
||||||
|
|
||||||
result = IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0);
|
result =
|
||||||
|
IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0);
|
||||||
if (FAILED(result)) {
|
if (FAILED(result)) {
|
||||||
D3D_SetError("LockRect()", result);
|
D3D_SetError("LockRect()", result);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -294,7 +294,8 @@ GDI_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
texture->driverdata = data;
|
texture->driverdata = data;
|
||||||
|
|
||||||
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
||||||
data->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
data->yuv =
|
||||||
|
SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
||||||
if (!data->yuv) {
|
if (!data->yuv) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue