diff src/video/x11/SDL_x11yuv.c @ 292:eadc0746dfaf

Added SDL_LockRect() and SDL_UnlockRect() Incorporated XFree86 extension libraries into the source
author Sam Lantinga <slouken@libsdl.org>
date Tue, 05 Mar 2002 19:55:32 +0000
parents e8157fcb3114
children f6ffac90895c
line wrap: on
line diff
--- a/src/video/x11/SDL_x11yuv.c	Sat Mar 02 16:50:35 2002 +0000
+++ b/src/video/x11/SDL_x11yuv.c	Tue Mar 05 19:55:32 2002 +0000
@@ -35,7 +35,7 @@
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <X11/extensions/XShm.h>
-#include <X11/extensions/Xvlib.h>
+#include <XFree86/extensions/Xvlib.h>
 
 #include "SDL_error.h"
 #include "SDL_video.h"
@@ -64,7 +64,7 @@
 struct private_yuvhwdata {
 	int port;
 	XShmSegmentInfo yuvshm;
-	XvImage *image;
+	SDL_NAME(XvImage) *image;
 };
 
 
@@ -75,13 +75,13 @@
 	int xv_port;
 	int i, j, k;
 	int adaptors;
-	XvAdaptorInfo *ainfo;
+	SDL_NAME(XvAdaptorInfo) *ainfo;
 	XShmSegmentInfo *yuvshm;
 
 	/* Look for the XVideo extension with a valid port for this format */
 	xv_port = -1;
-	if ( (Success == XvQueryExtension(GFX_Display, &j, &j, &j, &j, &j)) &&
-	     (Success == XvQueryAdaptors(GFX_Display,
+	if ( (Success == SDL_NAME(XvQueryExtension)(GFX_Display, &j, &j, &j, &j, &j)) &&
+	     (Success == SDL_NAME(XvQueryAdaptors)(GFX_Display,
 	                                 RootWindow(GFX_Display, SDL_Screen),
 	                                 &adaptors, &ainfo)) ) {
 #ifdef USE_LAST_ADAPTOR
@@ -106,8 +106,8 @@
 			if ( (ainfo[i].type & XvInputMask) &&
 			     (ainfo[i].type & XvImageMask) ) {
 				int num_formats;
-				XvImageFormatValues *formats;
-				formats = XvListImageFormats(GFX_Display,
+				SDL_NAME(XvImageFormatValues) *formats;
+				formats = SDL_NAME(XvListImageFormats)(GFX_Display,
 				              ainfo[i].base_id, &num_formats);
 #ifdef USE_LAST_ADAPTOR
 				for ( j=0; j < num_formats; ++j ) {
@@ -116,7 +116,7 @@
 #endif /* USE_LAST_ADAPTOR */
 					if ( (Uint32)formats[j].id == format ) {
 						for ( k=0; k < ainfo[i].num_ports; ++k ) {
-							if ( Success == XvGrabPort(GFX_Display, ainfo[i].base_id+k, CurrentTime) ) {
+							if ( Success == SDL_NAME(XvGrabPort)(GFX_Display, ainfo[i].base_id+k, CurrentTime) ) {
 								xv_port = ainfo[i].base_id+k;
 								break;
 							}
@@ -134,7 +134,7 @@
 	/* Create the overlay structure */
 	overlay = (SDL_Overlay *)malloc(sizeof *overlay);
 	if ( overlay == NULL ) {
-		XvUngrabPort(GFX_Display, xv_port, CurrentTime);
+		SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
 		SDL_OutOfMemory();
 		return(NULL);
 	}
@@ -153,7 +153,7 @@
 	hwdata = (struct private_yuvhwdata *)malloc(sizeof *hwdata);
 	overlay->hwdata = hwdata;
 	if ( hwdata == NULL ) {
-		XvUngrabPort(GFX_Display, xv_port, CurrentTime);
+		SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
 		SDL_OutOfMemory();
 		SDL_FreeYUVOverlay(overlay);
 		return(NULL);
@@ -161,7 +161,7 @@
 	yuvshm = &hwdata->yuvshm;
 	memset(yuvshm, 0, sizeof(*yuvshm));
 	hwdata->port = xv_port;
-	hwdata->image = XvShmCreateImage(GFX_Display, xv_port, format,
+	hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
 	                                 0, width, height, yuvshm);
 
 #ifdef PITCH_WORKAROUND
@@ -184,7 +184,7 @@
 	  }
 	  
 	  XFree(hwdata->image);
-	  hwdata->image = XvShmCreateImage(GFX_Display, xv_port, format,
+	  hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
 					   0, width, height, yuvshm);
 	}
 #endif
@@ -252,7 +252,7 @@
 	struct private_yuvhwdata *hwdata;
 
 	hwdata = overlay->hwdata;
-	XvShmPutImage(GFX_Display, hwdata->port, SDL_Window, SDL_GC,
+	SDL_NAME(XvShmPutImage)(GFX_Display, hwdata->port, SDL_Window, SDL_GC,
 	              hwdata->image, 0, 0, overlay->w, overlay->h,
 	              dstrect->x, dstrect->y, dstrect->w, dstrect->h, False);
 	XSync(GFX_Display, False);
@@ -265,7 +265,7 @@
 
 	hwdata = overlay->hwdata;
 	if ( hwdata ) {
-		XvUngrabPort(GFX_Display, hwdata->port, CurrentTime);
+		SDL_NAME(XvUngrabPort)(GFX_Display, hwdata->port, CurrentTime);
 		if ( hwdata->yuvshm.shmaddr ) {
 			XShmDetach(GFX_Display, &hwdata->yuvshm);
 			shmdt(hwdata->yuvshm.shmaddr);