comparison src/video/cybergfx/SDL_cgxyuv.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents c9b51268668f
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
87 SDL_SetError("No available video ports for requested format"); 87 SDL_SetError("No available video ports for requested format");
88 return(NULL); 88 return(NULL);
89 } 89 }
90 90
91 /* Create the overlay structure */ 91 /* Create the overlay structure */
92 overlay = (SDL_Overlay *)malloc(sizeof *overlay); 92 overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
93 if ( overlay == NULL ) { 93 if ( overlay == NULL ) {
94 SDL_OutOfMemory(); 94 SDL_OutOfMemory();
95 return(NULL); 95 return(NULL);
96 } 96 }
97 memset(overlay, 0, (sizeof *overlay)); 97 SDL_memset(overlay, 0, (sizeof *overlay));
98 98
99 /* Fill in the basic members */ 99 /* Fill in the basic members */
100 overlay->format = format; 100 overlay->format = format;
101 overlay->w = width; 101 overlay->w = width;
102 overlay->h = height; 102 overlay->h = height;
103 103
104 /* Set up the YUV surface function structure */ 104 /* Set up the YUV surface function structure */
105 overlay->hwfuncs = &x11_yuvfuncs; 105 overlay->hwfuncs = &x11_yuvfuncs;
106 106
107 /* Create the pixel data and lookup tables */ 107 /* Create the pixel data and lookup tables */
108 hwdata = (struct private_yuvhwdata *)malloc(sizeof *hwdata); 108 hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
109 overlay->hwdata = hwdata; 109 overlay->hwdata = hwdata;
110 if ( hwdata == NULL ) { 110 if ( hwdata == NULL ) {
111 SDL_OutOfMemory(); 111 SDL_OutOfMemory();
112 SDL_FreeYUVOverlay(overlay); 112 SDL_FreeYUVOverlay(overlay);
113 return(NULL); 113 return(NULL);
114 } 114 }
115 yuvshm = &hwdata->yuvshm; 115 yuvshm = &hwdata->yuvshm;
116 memset(yuvshm, 0, sizeof(*yuvshm)); 116 SDL_memset(yuvshm, 0, sizeof(*yuvshm));
117 hwdata->port = xv_port; 117 hwdata->port = xv_port;
118 hwdata->image = XvShmCreateImage(GFX_Display, xv_port, format, 118 hwdata->image = XvShmCreateImage(GFX_Display, xv_port, format,
119 0, width, height, yuvshm); 119 0, width, height, yuvshm);
120 if ( hwdata->image == NULL ) { 120 if ( hwdata->image == NULL ) {
121 SDL_OutOfMemory(); 121 SDL_OutOfMemory();
177 shmdt(hwdata->yuvshm.shmaddr); 177 shmdt(hwdata->yuvshm.shmaddr);
178 } 178 }
179 if ( hwdata->image ) { 179 if ( hwdata->image ) {
180 XFree(hwdata->image); 180 XFree(hwdata->image);
181 } 181 }
182 free(hwdata); 182 SDL_free(hwdata);
183 } 183 }
184 } 184 }
185 185
186 #endif /* XFREE86_XV */ 186 #endif /* XFREE86_XV */