summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-12-13 18:38:25 -0500
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-12-13 18:38:25 -0500
commitc8feb73f5841e7812d8dfdb91f1064e2033d028c (patch)
tree4f176f28ec27a4e5bfb9c671e569838741b6bfbd /Xext
parent9a7ce573636e349ee2967991c7cc1407e80ae524 (diff)
parenta125ce4a84f5fb5934fefebd7cfb22a83180874d (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: Xext/EVI.c Xext/bigreq.c Xext/cup.c Xext/dpms.c Xext/fontcache.c Xext/mitmisc.c Xext/xcmisc.c Xext/xf86bigfont.c Xext/xtest.c configure.ac dbe/dbe.c hw/darwin/darwin.h hw/darwin/darwinEvents.c hw/darwin/iokit/xfIOKit.h hw/darwin/iokit/xfIOKitCursor.c hw/darwin/quartz/fullscreen/fullscreen.c hw/darwin/quartz/fullscreen/quartzCursor.c hw/darwin/quartz/quartz.c hw/darwin/quartz/quartzCommon.h hw/darwin/quartz/quartzCursor.c hw/darwin/quartz/xpr/dri.c hw/darwin/quartz/xpr/dristruct.h hw/darwin/quartz/xpr/xprCursor.c hw/darwin/quartz/xpr/xprFrame.c hw/xfree86/modes/xf86RandR12.c include/cursor.h miext/rootless/rootlessCommon.h miext/rootless/rootlessScreen.c miext/rootless/rootlessWindow.c render/picturestr.h Trying to pick up the pieces from the darwin churn here...
Diffstat (limited to 'Xext')
-rw-r--r--Xext/EVI.c14
-rw-r--r--Xext/cup.c17
-rw-r--r--Xext/fontcache.c15
-rw-r--r--Xext/mbuf.c6
-rw-r--r--Xext/panoramiX.c7
-rw-r--r--Xext/panoramiXSwap.c8
-rw-r--r--Xext/panoramiXprocs.c10
-rw-r--r--Xext/saver.c6
-rw-r--r--Xext/shape.c6
-rw-r--r--Xext/xf86bigfont.c16
-rw-r--r--Xext/xprint.c19
-rw-r--r--Xext/xvdisp.c912
-rw-r--r--Xext/xvdisp.h1
-rw-r--r--Xext/xvmain.c4
14 files changed, 415 insertions, 626 deletions
diff --git a/Xext/EVI.c b/Xext/EVI.c
index 6abd50824..4bd050ca7 100644
--- a/Xext/EVI.c
+++ b/Xext/EVI.c
@@ -179,13 +179,9 @@ EVIResetProc(ExtensionEntry *extEntry)
void
EVIExtensionInit(INITARGS)
{
- ExtensionEntry *extEntry;
-
- if (!(extEntry = AddExtension(EVINAME, 0, 0,
- ProcEVIDispatch,
- SProcEVIDispatch,
- EVIResetProc, StandardMinorOpcode)))
- return;
-
- eviPriv = eviDDXInit();
+ if (AddExtension(EVINAME, 0, 0,
+ ProcEVIDispatch, SProcEVIDispatch,
+ EVIResetProc, StandardMinorOpcode)) {
+ eviPriv = eviDDXInit();
+ }
}
diff --git a/Xext/cup.c b/Xext/cup.c
index 44c96643d..d0e820c41 100644
--- a/Xext/cup.c
+++ b/Xext/cup.c
@@ -123,16 +123,13 @@ static xColorItem citems[] = {
void
XcupExtensionInit (INITARGS)
{
- ExtensionEntry* extEntry;
-
- if (!(extEntry = AddExtension (XCUPNAME,
- 0,
- XcupNumberErrors,
- ProcDispatch,
- SProcDispatch,
- ResetProc,
- StandardMinorOpcode)))
- return;
+ (void) AddExtension (XCUPNAME,
+ 0,
+ XcupNumberErrors,
+ ProcDispatch,
+ SProcDispatch,
+ ResetProc,
+ StandardMinorOpcode);
/* PC servers initialize the desktop colors (citems) here! */
}
diff --git a/Xext/fontcache.c b/Xext/fontcache.c
index eca730965..0338d4a0f 100644
--- a/Xext/fontcache.c
+++ b/Xext/fontcache.c
@@ -70,9 +70,18 @@ static DISPATCH_PROC(SProcFontCacheChangeCacheSettings);
void
FontCacheExtensionInit(INITARGS)
{
- AddExtension(FONTCACHENAME, FontCacheNumberEvents, FontCacheNumberErrors,
- ProcFontCacheDispatch, SProcFontCacheDispatch,
- FontCacheResetProc, StandardMinorOpcode);
+ ExtensionEntry* extEntry;
+
+ if (
+ (extEntry = AddExtension(FONTCACHENAME,
+ FontCacheNumberEvents,
+ FontCacheNumberErrors,
+ ProcFontCacheDispatch,
+ SProcFontCacheDispatch,
+ FontCacheResetProc,
+ StandardMinorOpcode))) {
+ miscErrorBase = extEntry->errorBase;
+ }
}
/*ARGSUSED*/
diff --git a/Xext/mbuf.c b/Xext/mbuf.c
index 9f17c86e3..35c8c8988 100644
--- a/Xext/mbuf.c
+++ b/Xext/mbuf.c
@@ -59,9 +59,6 @@ in this Software without prior written authorization from The Open Group.
#define ValidEventMasks (ExposureMask|MultibufferClobberNotifyMask|MultibufferUpdateNotifyMask)
-#if 0
-static unsigned char MultibufferReqCode;
-#endif
static int MultibufferEventBase;
static int MultibufferErrorBase;
int MultibufferScreenIndex = -1;
@@ -247,9 +244,6 @@ MultibufferExtensionInit()
ProcMultibufferDispatch, SProcMultibufferDispatch,
MultibufferResetProc, StandardMinorOpcode)))
{
-#if 0
- MultibufferReqCode = (unsigned char)extEntry->base;
-#endif
MultibufferEventBase = extEntry->eventBase;
MultibufferErrorBase = extEntry->errorBase;
EventSwapVector[MultibufferEventBase + MultibufferClobberNotify] = (EventSwapPtr) SClobberNotifyEvent;
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 26c280990..311a8e716 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -65,9 +65,6 @@ extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
ScreenPtr pMatchScreen);
#endif
-#if 0
-static unsigned char PanoramiXReqCode = 0;
-#endif
/*
* PanoramiX data declarations
*/
@@ -471,10 +468,6 @@ void PanoramiXExtensionInit(int argc, char *argv[])
break;
}
-#if 0
- PanoramiXReqCode = (unsigned char)extEntry->base;
-#endif
-
/*
* First make sure all the basic allocations succeed. If not,
* run in non-PanoramiXeen mode.
diff --git a/Xext/panoramiXSwap.c b/Xext/panoramiXSwap.c
index da445ffe1..b13c286dd 100644
--- a/Xext/panoramiXSwap.c
+++ b/Xext/panoramiXSwap.c
@@ -41,10 +41,6 @@ Equipment Corporation.
#include "window.h"
#include "windowstr.h"
#include "pixmapstr.h"
-#if 0
-#include <sys/workstation.h>
-#include <X11/Xserver/ws.h>
-#endif
#include "panoramiX.h"
#include <X11/extensions/panoramiXproto.h>
#include "panoramiXsrv.h"
@@ -70,6 +66,7 @@ SProcPanoramiXGetState(ClientPtr client)
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ swapl (&stuff->window, n);
return ProcPanoramiXGetState(client);
}
@@ -81,6 +78,7 @@ SProcPanoramiXGetScreenCount(ClientPtr client)
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ swapl (&stuff->window, n);
return ProcPanoramiXGetScreenCount(client);
}
@@ -92,6 +90,8 @@ SProcPanoramiXGetScreenSize(ClientPtr client)
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ swapl (&stuff->window, n);
+ swapl (&stuff->screen, n);
return ProcPanoramiXGetScreenSize(client);
}
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 402662f9e..f9a579625 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -54,16 +54,6 @@ Equipment Corporation.
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
CWDontPropagate | CWOverrideRedirect | CWCursor )
-#if 0
-extern void (* EventSwapVector[128]) (fsError *, fsError *);
-
-extern void Swap32Write();
-extern void SLHostsExtend();
-extern void SQColorsExtend();
-WriteSConnectionInfo();
-extern void WriteSConnSetupPrefix();
-#endif
-
/* Various of the DIX function interfaces were not designed to allow
* the client->errorValue to be set on BadValue and other errors.
* Rather than changing interfaces and breaking untold code we introduce
diff --git a/Xext/saver.c b/Xext/saver.c
index 20dbc924d..9a6dd7757 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -62,9 +62,6 @@ in this Software without prior written authorization from the X Consortium.
#include "modinit.h"
-#if 0
-static unsigned char ScreenSaverReqCode = 0;
-#endif
static int ScreenSaverEventBase = 0;
static DISPATCH_PROC(ProcScreenSaverQueryInfo);
@@ -274,9 +271,6 @@ ScreenSaverExtensionInit(INITARGS)
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
ScreenSaverResetProc, StandardMinorOpcode)))
{
-#if 0
- ScreenSaverReqCode = (unsigned char)extEntry->base;
-#endif
ScreenSaverEventBase = extEntry->eventBase;
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
}
diff --git a/Xext/shape.c b/Xext/shape.c
index e84eb34da..2f1baf917 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -111,9 +111,6 @@ static DISPATCH_PROC(SProcShapeSelectInput);
#include "panoramiXsrv.h"
#endif
-#if 0
-static unsigned char ShapeReqCode = 0;
-#endif
static int ShapeEventBase = 0;
static RESTYPE ClientType, EventType; /* resource types for event masks */
@@ -154,9 +151,6 @@ ShapeExtensionInit(void)
ProcShapeDispatch, SProcShapeDispatch,
ShapeResetProc, StandardMinorOpcode)))
{
-#if 0
- ShapeReqCode = (unsigned char)extEntry->base;
-#endif
ShapeEventBase = extEntry->eventBase;
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
}
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index 33627421d..779f3b940 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -145,15 +145,13 @@ CheckForShmSyscall(void)
void
XFree86BigfontExtensionInit()
{
- ExtensionEntry* extEntry;
-
- if ((extEntry = AddExtension(XF86BIGFONTNAME,
- XF86BigfontNumberEvents,
- XF86BigfontNumberErrors,
- ProcXF86BigfontDispatch,
- SProcXF86BigfontDispatch,
- XF86BigfontResetProc,
- StandardMinorOpcode))) {
+ if (AddExtension(XF86BIGFONTNAME,
+ XF86BigfontNumberEvents,
+ XF86BigfontNumberErrors,
+ ProcXF86BigfontDispatch,
+ SProcXF86BigfontDispatch,
+ XF86BigfontResetProc,
+ StandardMinorOpcode)) {
#ifdef HAS_SHM
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
/*
diff --git a/Xext/xprint.c b/Xext/xprint.c
index ef5111837..dba7989cc 100644
--- a/Xext/xprint.c
+++ b/Xext/xprint.c
@@ -355,25 +355,6 @@ XpCloseScreen(int index, ScreenPtr pScreen)
return (*CloseScreen)(index, pScreen);
}
-#if 0 /* NOT USED */
-static void
-FreeScreenEntry(XpScreenPtr pScreenEntry)
-{
- XpDriverPtr pDriver;
-
- pDriver = pScreenEntry->drivers;
- while(pDriver != (XpDriverPtr)NULL)
- {
- XpDriverPtr tmp;
-
- tmp = pDriver->next;
- xfree(pDriver);
- pDriver = tmp;
- }
- xfree(pScreenEntry);
-}
-#endif
-
/*
* XpRegisterInitFunc tells the print extension which screens
* are printers as opposed to displays, and what drivers are
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index f6130dfe1..8096c8c14 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -19,33 +19,8 @@ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
-
******************************************************************/
-/*
-** File:
-**
-** xvdisp.c --- Xv server extension dispatch module.
-**
-** Author:
-**
-** David Carver (Digital Workstation Engineering/Project Athena)
-**
-** Revisions:
-**
-** 11.06.91 Carver
-** - changed SetPortControl to SetPortAttribute
-** - changed GetPortControl to GetPortAttribute
-** - changed QueryBestSize
-**
-** 15.05.91 Carver
-** - version 2.0 upgrade
-**
-** 24.01.91 Carver
-** - version 1.4 upgrade
-**
-*/
-
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -78,81 +53,246 @@ SOFTWARE.
#include "panoramiXsrv.h"
unsigned long XvXRTPort;
-
-#ifdef MITSHM
-static int XineramaXvShmPutImage(ClientPtr);
-#endif
-static int XineramaXvPutImage(ClientPtr);
-static int XineramaXvPutVideo(ClientPtr);
-static int XineramaXvPutStill(ClientPtr);
-static int XineramaXvSetPortAttribute(ClientPtr);
-static int XineramaXvStopVideo(ClientPtr);
#endif
-/* INTERNAL */
-
-static int ProcXvQueryExtension(ClientPtr);
-static int ProcXvQueryAdaptors(ClientPtr);
-static int ProcXvQueryEncodings(ClientPtr);
-static int ProcXvPutVideo(ClientPtr);
-static int ProcXvPutStill(ClientPtr);
-static int ProcXvGetVideo(ClientPtr);
-static int ProcXvGetStill(ClientPtr);
-static int ProcXvGrabPort(ClientPtr);
-static int ProcXvUngrabPort(ClientPtr);
-static int ProcXvSelectVideoNotify(ClientPtr);
-static int ProcXvSelectPortNotify(ClientPtr);
-static int ProcXvStopVideo(ClientPtr);
-static int ProcXvSetPortAttribute(ClientPtr);
-static int ProcXvGetPortAttribute(ClientPtr);
-static int ProcXvQueryBestSize(ClientPtr);
-static int ProcXvQueryPortAttributes(ClientPtr);
-static int ProcXvPutImage(ClientPtr);
-#ifdef MITSHM
-static int ProcXvShmPutImage(ClientPtr);
-#endif
-static int ProcXvQueryImageAttributes(ClientPtr);
-static int ProcXvListImageFormats(ClientPtr);
-
-static int SProcXvQueryExtension(ClientPtr);
-static int SProcXvQueryAdaptors(ClientPtr);
-static int SProcXvQueryEncodings(ClientPtr);
-static int SProcXvPutVideo(ClientPtr);
-static int SProcXvPutStill(ClientPtr);
-static int SProcXvGetVideo(ClientPtr);
-static int SProcXvGetStill(ClientPtr);
-static int SProcXvGrabPort(ClientPtr);
-static int SProcXvUngrabPort(ClientPtr);
-static int SProcXvSelectVideoNotify(ClientPtr);
-static int SProcXvSelectPortNotify(ClientPtr);
-static int SProcXvStopVideo(ClientPtr);
-static int SProcXvSetPortAttribute(ClientPtr);
-static int SProcXvGetPortAttribute(ClientPtr);
-static int SProcXvQueryBestSize(ClientPtr);
-static int SProcXvQueryPortAttributes(ClientPtr);
-static int SProcXvPutImage(ClientPtr);
-#ifdef MITSHM
-static int SProcXvShmPutImage(ClientPtr);
-#endif
-static int SProcXvQueryImageAttributes(ClientPtr);
-static int SProcXvListImageFormats(ClientPtr);
-
-static int SWriteQueryAdaptorsReply(ClientPtr, xvQueryAdaptorsReply *);
-static int SWriteQueryExtensionReply(ClientPtr, xvQueryExtensionReply *);
-static int SWriteQueryEncodingsReply(ClientPtr, xvQueryEncodingsReply *);
-static int SWriteAdaptorInfo(ClientPtr, xvAdaptorInfo *);
-static int SWriteEncodingInfo(ClientPtr, xvEncodingInfo *);
-static int SWriteFormat(ClientPtr, xvFormat *);
-static int SWriteAttributeInfo(ClientPtr, xvAttributeInfo *);
-static int SWriteGrabPortReply(ClientPtr, xvGrabPortReply *);
-static int SWriteGetPortAttributeReply(ClientPtr, xvGetPortAttributeReply *);
-static int SWriteQueryBestSizeReply(ClientPtr, xvQueryBestSizeReply *);
-static int SWriteQueryPortAttributesReply(
- ClientPtr, xvQueryPortAttributesReply *);
-static int SWriteQueryImageAttributesReply(
- ClientPtr, xvQueryImageAttributesReply*);
-static int SWriteListImageFormatsReply(ClientPtr, xvListImageFormatsReply*);
-static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*);
+static int
+SWriteQueryExtensionReply(
+ ClientPtr client,
+ xvQueryExtensionReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swaps(&rep->version, n);
+ swaps(&rep->revision, n);
+
+ (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteQueryAdaptorsReply(
+ ClientPtr client,
+ xvQueryAdaptorsReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swaps(&rep->num_adaptors, n);
+
+ (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteQueryEncodingsReply(
+ ClientPtr client,
+ xvQueryEncodingsReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swaps(&rep->num_encodings, n);
+
+ (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteAdaptorInfo(
+ ClientPtr client,
+ xvAdaptorInfo *pAdaptor
+){
+ char n;
+
+ swapl(&pAdaptor->base_id, n);
+ swaps(&pAdaptor->name_size, n);
+ swaps(&pAdaptor->num_ports, n);
+ swaps(&pAdaptor->num_formats, n);
+
+ (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor);
+
+ return Success;
+}
+
+static int
+SWriteEncodingInfo(
+ ClientPtr client,
+ xvEncodingInfo *pEncoding
+){
+ char n;
+
+ swapl(&pEncoding->encoding, n);
+ swaps(&pEncoding->name_size, n);
+ swaps(&pEncoding->width, n);
+ swaps(&pEncoding->height, n);
+ swapl(&pEncoding->rate.numerator, n);
+ swapl(&pEncoding->rate.denominator, n);
+ (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding);
+
+ return Success;
+}
+
+static int
+SWriteFormat(
+ ClientPtr client,
+ xvFormat *pFormat
+){
+ char n;
+
+ swapl(&pFormat->visual, n);
+ (void)WriteToClient(client, sz_xvFormat, (char *)pFormat);
+
+ return Success;
+}
+
+static int
+SWriteAttributeInfo(
+ ClientPtr client,
+ xvAttributeInfo *pAtt
+){
+ char n;
+
+ swapl(&pAtt->flags, n);
+ swapl(&pAtt->size, n);
+ swapl(&pAtt->min, n);
+ swapl(&pAtt->max, n);
+ (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt);
+
+ return Success;
+}
+
+static int
+SWriteImageFormatInfo(
+ ClientPtr client,
+ xvImageFormatInfo *pImage
+){
+ char n;
+
+ swapl(&pImage->id, n);
+ swapl(&pImage->red_mask, n);
+ swapl(&pImage->green_mask, n);
+ swapl(&pImage->blue_mask, n);
+ swapl(&pImage->y_sample_bits, n);
+ swapl(&pImage->u_sample_bits, n);
+ swapl(&pImage->v_sample_bits, n);
+ swapl(&pImage->horz_y_period, n);
+ swapl(&pImage->horz_u_period, n);
+ swapl(&pImage->horz_v_period, n);
+ swapl(&pImage->vert_y_period, n);
+ swapl(&pImage->vert_u_period, n);
+ swapl(&pImage->vert_v_period, n);
+
+ (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage);
+
+ return Success;
+}
+
+static int
+SWriteGrabPortReply(
+ ClientPtr client,
+ xvGrabPortReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+
+ (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteGetPortAttributeReply(
+ ClientPtr client,
+ xvGetPortAttributeReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swapl(&rep->value, n);
+
+ (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteQueryBestSizeReply(
+ ClientPtr client,
+ xvQueryBestSizeReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swaps(&rep->actual_width, n);
+ swaps(&rep->actual_height, n);
+
+ (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteQueryPortAttributesReply(
+ ClientPtr client,
+ xvQueryPortAttributesReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swapl(&rep->num_attributes, n);
+ swapl(&rep->text_size, n);
+
+ (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteQueryImageAttributesReply(
+ ClientPtr client,
+ xvQueryImageAttributesReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swapl(&rep->num_planes, n);
+ swapl(&rep->data_size, n);
+ swaps(&rep->width, n);
+ swaps(&rep->height, n);
+
+ (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep);
+
+ return Success;
+}
+
+static int
+SWriteListImageFormatsReply(
+ ClientPtr client,
+ xvListImageFormatsReply *rep
+){
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ swapl(&rep->num_formats, n);
+
+ (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep);
+
+ return Success;
+}
#define _WriteQueryAdaptorsReply(_c,_d) \
if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \
@@ -213,141 +353,6 @@ static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*);
#define _AllocatePort(_i,_p) \
((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success
-/*
-** ProcXvDispatch
-**
-**
-**
-*/
-
-int
-ProcXvDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- UpdateCurrentTime();
-
- switch (stuff->data)
- {
- case xv_QueryExtension: return(ProcXvQueryExtension(client));
- case xv_QueryAdaptors: return(ProcXvQueryAdaptors(client));
- case xv_QueryEncodings: return(ProcXvQueryEncodings(client));
- case xv_PutVideo:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvPutVideo(client));
- else
-#endif
- return(ProcXvPutVideo(client));
- case xv_PutStill:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvPutStill(client));
- else
-#endif
- return(ProcXvPutStill(client));
- case xv_GetVideo: return(ProcXvGetVideo(client));
- case xv_GetStill: return(ProcXvGetStill(client));
- case xv_GrabPort: return(ProcXvGrabPort(client));
- case xv_UngrabPort: return(ProcXvUngrabPort(client));
- case xv_SelectVideoNotify: return(ProcXvSelectVideoNotify(client));
- case xv_SelectPortNotify: return(ProcXvSelectPortNotify(client));
- case xv_StopVideo:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvStopVideo(client));
- else
-#endif
- return(ProcXvStopVideo(client));
- case xv_SetPortAttribute:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvSetPortAttribute(client));
- else
-#endif
- return(ProcXvSetPortAttribute(client));
- case xv_GetPortAttribute: return(ProcXvGetPortAttribute(client));
- case xv_QueryBestSize: return(ProcXvQueryBestSize(client));
- case xv_QueryPortAttributes: return(ProcXvQueryPortAttributes(client));
- case xv_PutImage:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvPutImage(client));
- else
-#endif
- return(ProcXvPutImage(client));
-#ifdef MITSHM
- case xv_ShmPutImage:
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return(XineramaXvShmPutImage(client));
- else
-#endif
- return(ProcXvShmPutImage(client));
-#endif
- case xv_QueryImageAttributes: return(ProcXvQueryImageAttributes(client));
- case xv_ListImageFormats: return(ProcXvListImageFormats(client));
- default:
- if (stuff->data < xvNumRequests)
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0,
- BadImplementation);
- return(BadImplementation);
- }
- else
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
- return(BadRequest);
- }
- }
-}
-
-int
-SProcXvDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- UpdateCurrentTime();
-
- switch (stuff->data)
- {
- case xv_QueryExtension: return(SProcXvQueryExtension(client));
- case xv_QueryAdaptors: return(SProcXvQueryAdaptors(client));
- case xv_QueryEncodings: return(SProcXvQueryEncodings(client));
- case xv_PutVideo: return(SProcXvPutVideo(client));
- case xv_PutStill: return(SProcXvPutStill(client));
- case xv_GetVideo: return(SProcXvGetVideo(client));
- case xv_GetStill: return(SProcXvGetStill(client));
- case xv_GrabPort: return(SProcXvGrabPort(client));
- case xv_UngrabPort: return(SProcXvUngrabPort(client));
- case xv_SelectVideoNotify: return(SProcXvSelectVideoNotify(client));
- case xv_SelectPortNotify: return(SProcXvSelectPortNotify(client));
- case xv_StopVideo: return(SProcXvStopVideo(client));
- case xv_SetPortAttribute: return(SProcXvSetPortAttribute(client));
- case xv_GetPortAttribute: return(SProcXvGetPortAttribute(client));
- case xv_QueryBestSize: return(SProcXvQueryBestSize(client));
- case xv_QueryPortAttributes: return(SProcXvQueryPortAttributes(client));
- case xv_PutImage: return(SProcXvPutImage(client));
-#ifdef MITSHM
- case xv_ShmPutImage: return(SProcXvShmPutImage(client));
-#endif
- case xv_QueryImageAttributes: return(SProcXvQueryImageAttributes(client));
- case xv_ListImageFormats: return(SProcXvListImageFormats(client));
- default:
- if (stuff->data < xvNumRequests)
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0,
- BadImplementation);
- return(BadImplementation);
- }
- else
- {
- SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
- return(BadRequest);
- }
- }
-}
-
static int
ProcXvQueryExtension(ClientPtr client)
{
@@ -364,7 +369,6 @@ ProcXvQueryExtension(ClientPtr client)
_WriteQueryExtensionReply(client, &rep);
return Success;
-
}
static int
@@ -457,7 +461,6 @@ ProcXvQueryAdaptors(ClientPtr client)
}
return (client->noClientException);
-
}
static int
@@ -521,7 +524,6 @@ ProcXvQueryEncodings(ClientPtr client)
}
return (client->noClientException);
-
}
static int
@@ -567,7 +569,6 @@ ProcXvPutVideo(ClientPtr client)
stuff->vid_w, stuff->vid_h,
stuff->drw_x, stuff->drw_y,
stuff->drw_w, stuff->drw_h);
-
}
static int
@@ -613,10 +614,8 @@ ProcXvPutStill(ClientPtr client)
stuff->vid_w, stuff->vid_h,
stuff->drw_x, stuff->drw_y,
stuff->drw_w, stuff->drw_h);
-
}
-
static int
ProcXvGetVideo(ClientPtr client)
{
@@ -660,10 +659,8 @@ ProcXvGetVideo(ClientPtr client)
stuff->vid_w, stuff->vid_h,
stuff->drw_x, stuff->drw_y,
stuff->drw_w, stuff->drw_h);
-
}
-
static int
ProcXvGetStill(ClientPtr client)
{
@@ -707,7 +704,6 @@ ProcXvGetStill(ClientPtr client)
stuff->vid_w, stuff->vid_h,
stuff->drw_x, stuff->drw_y,
stuff->drw_w, stuff->drw_h);
-
}
static int
@@ -723,7 +719,6 @@ ProcXvSelectVideoNotify(ClientPtr client)
return rc;
return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff);
-
}
static int
@@ -747,7 +742,6 @@ ProcXvSelectPortNotify(ClientPtr client)
}
return XVCALL(diSelectPortNotify)(client, pPort, stuff->onoff);
-
}
static int
@@ -786,7 +780,6 @@ ProcXvGrabPort(ClientPtr client)
_WriteGrabPortReply(client, &rep);
return Success;
-
}
static int
@@ -810,10 +803,8 @@ ProcXvUngrabPort(ClientPtr client)
}
return XVCALL(diUngrabPort)(client, pPort, stuff->time);
-
}
-
static int
ProcXvStopVideo(ClientPtr client)
{
@@ -840,7 +831,6 @@ ProcXvStopVideo(ClientPtr client)
return rc;
return XVCALL(diStopVideo)(client, pPort, pDraw);
-
}
static int
@@ -1021,8 +1011,6 @@ ProcXvQueryPortAttributes(ClientPtr client)
return Success;
}
-
-
static int
ProcXvPutImage(ClientPtr client)
{
@@ -1200,6 +1188,13 @@ ProcXvShmPutImage(ClientPtr client)
return status;
}
+#else /* !MITSHM */
+static int
+ProcXvShmPutImage(ClientPtr client)
+{
+ SendErrorToClient(client, XvReqCode, xv_ShmPutImage, 0, BadImplementation);
+ return(BadImplementation);
+}
#endif
#ifdef XvMCExtension
@@ -1327,65 +1322,101 @@ ProcXvListImageFormats(ClientPtr client)
return Success;
}
+static int (*XvProcVector[xvNumRequests])(ClientPtr) = {
+ ProcXvQueryExtension,
+ ProcXvQueryAdaptors,
+ ProcXvQueryEncodings,
+ ProcXvGrabPort,
+ ProcXvUngrabPort,
+ ProcXvPutVideo,
+ ProcXvPutStill,
+ ProcXvGetVideo,
+ ProcXvGetStill,
+ ProcXvStopVideo,
+ ProcXvSelectVideoNotify,
+ ProcXvSelectPortNotify,
+ ProcXvQueryBestSize,
+ ProcXvSetPortAttribute,
+ ProcXvGetPortAttribute,
+ ProcXvQueryPortAttributes,
+ ProcXvListImageFormats,
+ ProcXvQueryImageAttributes,
+ ProcXvPutImage,
+ ProcXvShmPutImage,
+};
+int
+ProcXvDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+
+ UpdateCurrentTime();
+
+ if (stuff->data > xvNumRequests) {
+ SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
+ return(BadRequest);
+ }
+
+ return XvProcVector[stuff->data](client);
+}
/* Swapped Procs */
static int
SProcXvQueryExtension(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvQueryExtensionReq);
swaps(&stuff->length, n);
- return ProcXvQueryExtension(client);
+ return XvProcVector[xv_QueryExtension](client);
}
static int
SProcXvQueryAdaptors(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvQueryAdaptorsReq);
swaps(&stuff->length, n);
swapl(&stuff->window, n);
- return ProcXvQueryAdaptors(client);
+ return XvProcVector[xv_QueryAdaptors](client);
}
static int
SProcXvQueryEncodings(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvQueryEncodingsReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
- return ProcXvQueryEncodings(client);
+ return XvProcVector[xv_QueryEncodings](client);
}
static int
SProcXvGrabPort(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvGrabPortReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->time, n);
- return ProcXvGrabPort(client);
+ return XvProcVector[xv_GrabPort](client);
}
static int
SProcXvUngrabPort(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvUngrabPortReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->time, n);
- return ProcXvUngrabPort(client);
+ return XvProcVector[xv_UngrabPort](client);
}
static int
SProcXvPutVideo(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvPutVideoReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
@@ -1399,13 +1430,13 @@ SProcXvPutVideo(ClientPtr client)
swaps(&stuff->drw_y, n);
swaps(&stuff->drw_w, n);
swaps(&stuff->drw_h, n);
- return ProcXvPutVideo(client);
+ return XvProcVector[xv_PutVideo](client);
}
static int
SProcXvPutStill(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvPutStillReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
@@ -1419,13 +1450,13 @@ SProcXvPutStill(ClientPtr client)
swaps(&stuff->drw_y, n);
swaps(&stuff->drw_w, n);
swaps(&stuff->drw_h, n);
- return ProcXvPutStill(client);
+ return XvProcVector[xv_PutStill](client);
}
static int
SProcXvGetVideo(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvGetVideoReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
@@ -1439,13 +1470,13 @@ SProcXvGetVideo(ClientPtr client)
swaps(&stuff->drw_y, n);
swaps(&stuff->drw_w, n);
swaps(&stuff->drw_h, n);
- return ProcXvGetVideo(client);
+ return XvProcVector[xv_GetVideo](client);
}
static int
SProcXvGetStill(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvGetStillReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
@@ -1459,13 +1490,13 @@ SProcXvGetStill(ClientPtr client)
swaps(&stuff->drw_y, n);
swaps(&stuff->drw_w, n);
swaps(&stuff->drw_h, n);
- return ProcXvGetStill(client);
+ return XvProcVector[xv_GetStill](client);
}
static int
SProcXvPutImage(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvPutImageReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
@@ -1482,14 +1513,14 @@ SProcXvPutImage(ClientPtr client)
swaps(&stuff->drw_h, n);
swaps(&stuff->width, n);
swaps(&stuff->height, n);
- return ProcXvPutImage(client);
+ return XvProcVector[xv_PutImage](client);
}
#ifdef MITSHM
static int
SProcXvShmPutImage(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvShmPutImageReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
@@ -1508,68 +1539,69 @@ SProcXvShmPutImage(ClientPtr client)
swaps(&stuff->offset, n);
swaps(&stuff->width, n);
swaps(&stuff->height, n);
- return ProcXvShmPutImage(client);
+ return XvProcVector[xv_ShmPutImage](client);
}
+#else /* MITSHM */
+#define SProcXvShmPutImage ProcXvShmPutImage
#endif
-
static int
SProcXvSelectVideoNotify(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvSelectVideoNotifyReq);
swaps(&stuff->length, n);
swapl(&stuff->drawable, n);
- return ProcXvSelectVideoNotify(client);
+ return XvProcVector[xv_SelectVideoNotify](client);
}
static int
SProcXvSelectPortNotify(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvSelectPortNotifyReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
- return ProcXvSelectPortNotify(client);
+ return XvProcVector[xv_SelectPortNotify](client);
}
static int
SProcXvStopVideo(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvStopVideoReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
- return ProcXvStopVideo(client);
+ return XvProcVector[xv_StopVideo](client);
}
static int
SProcXvSetPortAttribute(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvSetPortAttributeReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->attribute, n);
- return ProcXvSetPortAttribute(client);
+ return XvProcVector[xv_SetPortAttribute](client);
}
static int
SProcXvGetPortAttribute(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvGetPortAttributeReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->attribute, n);
- return ProcXvGetPortAttribute(client);
+ return XvProcVector[xv_GetPortAttribute](client);
}
static int
SProcXvQueryBestSize(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvQueryBestSizeReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
@@ -1577,290 +1609,80 @@ SProcXvQueryBestSize(ClientPtr client)
swaps(&stuff->vid_h, n);
swaps(&stuff->drw_w, n);
swaps(&stuff->drw_h, n);
- return ProcXvQueryBestSize(client);
+ return XvProcVector[xv_QueryBestSize](client);
}
static int
SProcXvQueryPortAttributes(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvQueryPortAttributesReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
- return ProcXvQueryPortAttributes(client);
+ return XvProcVector[xv_QueryPortAttributes](client);
}
static int
SProcXvQueryImageAttributes(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvQueryImageAttributesReq);
swaps(&stuff->length, n);
swapl(&stuff->id, n);
swaps(&stuff->width, n);
swaps(&stuff->width, n);
- return ProcXvQueryImageAttributes(client);
+ return XvProcVector[xv_QueryImageAttributes](client);
}
static int
SProcXvListImageFormats(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xvListImageFormatsReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
- return ProcXvListImageFormats(client);
-}
-
-
-static int
-SWriteQueryExtensionReply(
- ClientPtr client,
- xvQueryExtensionReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->version, n);
- swaps(&rep->revision, n);
-
- (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryAdaptorsReply(
- ClientPtr client,
- xvQueryAdaptorsReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_adaptors, n);
-
- (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryEncodingsReply(
- ClientPtr client,
- xvQueryEncodingsReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_encodings, n);
-
- (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteAdaptorInfo(
- ClientPtr client,
- xvAdaptorInfo *pAdaptor
-){
- register char n;
-
- swapl(&pAdaptor->base_id, n);
- swaps(&pAdaptor->name_size, n);
- swaps(&pAdaptor->num_ports, n);
- swaps(&pAdaptor->num_formats, n);
-
- (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor);
-
- return Success;
-}
-
-static int
-SWriteEncodingInfo(
- ClientPtr client,
- xvEncodingInfo *pEncoding
-){
- register char n;
-
- swapl(&pEncoding->encoding, n);
- swaps(&pEncoding->name_size, n);
- swaps(&pEncoding->width, n);
- swaps(&pEncoding->height, n);
- swapl(&pEncoding->rate.numerator, n);
- swapl(&pEncoding->rate.denominator, n);
- (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding);
-
- return Success;
-}
-
-static int
-SWriteFormat(
- ClientPtr client,
- xvFormat *pFormat
-){
- register char n;
-
- swapl(&pFormat->visual, n);
- (void)WriteToClient(client, sz_xvFormat, (char *)pFormat);
-
- return Success;
-}
-
-static int
-SWriteAttributeInfo(
- ClientPtr client,
- xvAttributeInfo *pAtt
-){
- register char n;
-
- swapl(&pAtt->flags, n);
- swapl(&pAtt->size, n);
- swapl(&pAtt->min, n);
- swapl(&pAtt->max, n);
- (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt);
-
- return Success;
-}
-
-static int
-SWriteImageFormatInfo(
- ClientPtr client,
- xvImageFormatInfo *pImage
-){
- register char n;
-
- swapl(&pImage->id, n);
- swapl(&pImage->red_mask, n);
- swapl(&pImage->green_mask, n);
- swapl(&pImage->blue_mask, n);
- swapl(&pImage->y_sample_bits, n);
- swapl(&pImage->u_sample_bits, n);
- swapl(&pImage->v_sample_bits, n);
- swapl(&pImage->horz_y_period, n);
- swapl(&pImage->horz_u_period, n);
- swapl(&pImage->horz_v_period, n);
- swapl(&pImage->vert_y_period, n);
- swapl(&pImage->vert_u_period, n);
- swapl(&pImage->vert_v_period, n);
-
- (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage);
-
- return Success;
-}
-
-
-
-static int
-SWriteGrabPortReply(
- ClientPtr client,
- xvGrabPortReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
-
- (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteGetPortAttributeReply(
- ClientPtr client,
- xvGetPortAttributeReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->value, n);
-
- (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryBestSizeReply(
- ClientPtr client,
- xvQueryBestSizeReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->actual_width, n);
- swaps(&rep->actual_height, n);
-
- (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep);
-
- return Success;
+ return XvProcVector[xv_ListImageFormats](client);
}
-static int
-SWriteQueryPortAttributesReply(
- ClientPtr client,
- xvQueryPortAttributesReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_attributes, n);
- swapl(&rep->text_size, n);
+static int (*SXvProcVector[xvNumRequests])(ClientPtr) = {
+ SProcXvQueryExtension,
+ SProcXvQueryAdaptors,
+ SProcXvQueryEncodings,
+ SProcXvGrabPort,
+ SProcXvUngrabPort,
+ SProcXvPutVideo,
+ SProcXvPutStill,
+ SProcXvGetVideo,
+ SProcXvGetStill,
+ SProcXvStopVideo,
+ SProcXvSelectVideoNotify,
+ SProcXvSelectPortNotify,
+ SProcXvQueryBestSize,
+ SProcXvSetPortAttribute,
+ SProcXvGetPortAttribute,
+ SProcXvQueryPortAttributes,
+ SProcXvListImageFormats,
+ SProcXvQueryImageAttributes,
+ SProcXvPutImage,
+ SProcXvShmPutImage,
+};
- (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep);
-
- return Success;
-}
-
-static int
-SWriteQueryImageAttributesReply(
- ClientPtr client,
- xvQueryImageAttributesReply *rep
-){
- register char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_planes, n);
- swapl(&rep->data_size, n);
- swaps(&rep->width, n);
- swaps(&rep->height, n);
-
- (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep);
-
- return Success;
-}
-
-
-static int
-SWriteListImageFormatsReply(
- ClientPtr client,
- xvListImageFormatsReply *rep
-){
- register char n;
+int
+SProcXvDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_formats, n);
+ UpdateCurrentTime();
- (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep);
+ if (stuff->data > xvNumRequests) {
+ SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
+ return(BadRequest);
+ }
- return Success;
+ return SXvProcVector[stuff->data](client);
}
-
#ifdef PANORAMIX
-
-
-
-
static int
XineramaXvStopVideo(ClientPtr client)
{
@@ -1910,7 +1732,6 @@ XineramaXvSetPortAttribute(ClientPtr client)
return result;
}
-
#ifdef MITSHM
static int
XineramaXvShmPutImage(ClientPtr client)
@@ -1958,6 +1779,8 @@ XineramaXvShmPutImage(ClientPtr client)
}
return result;
}
+#else
+#define XineramaXvShmPutImage ProcXvShmPutImage
#endif
static int
@@ -2095,7 +1918,6 @@ XineramaXvPutStill(ClientPtr client)
return result;
}
-
void XineramifyXv(void)
{
ScreenPtr pScreen, screen0 = screenInfo.screens[0];
@@ -2202,6 +2024,26 @@ void XineramifyXv(void)
}
}
}
+
+ /* munge the dispatch vector */
+ XvProcVector[xv_PutVideo] = XineramaXvPutVideo;
+ XvProcVector[xv_PutStill] = XineramaXvPutStill;
+ XvProcVector[xv_StopVideo] = XineramaXvStopVideo;
+ XvProcVector[xv_SetPortAttribute] = XineramaXvSetPortAttribute;
+ XvProcVector[xv_PutImage] = XineramaXvPutImage;
+ XvProcVector[xv_ShmPutImage] = XineramaXvShmPutImage;
}
+#endif /* PANORAMIX */
+void
+XvResetProcVector(void)
+{
+#ifdef PANORAMIX
+ XvProcVector[xv_PutVideo] = ProcXvPutVideo;
+ XvProcVector[xv_PutStill] = ProcXvPutStill;
+ XvProcVector[xv_StopVideo] = ProcXvStopVideo;
+ XvProcVector[xv_SetPortAttribute] = ProcXvSetPortAttribute;
+ XvProcVector[xv_PutImage] = ProcXvPutImage;
+ XvProcVector[xv_ShmPutImage] = ProcXvShmPutImage;
#endif
+}
diff --git a/Xext/xvdisp.h b/Xext/xvdisp.h
index 75cacddcc..298d39560 100644
--- a/Xext/xvdisp.h
+++ b/Xext/xvdisp.h
@@ -1 +1,2 @@
extern void XineramifyXv(void);
+extern void XvResetProcVector(void);
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index a2fc10802..9834fcfa0 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -102,8 +102,8 @@ SOFTWARE.
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
-#include "xvdisp.h"
#endif
+#include "xvdisp.h"
static DevPrivateKey XvScreenKey = &XvScreenKey;
unsigned long XvExtensionGeneration = 0;
@@ -314,12 +314,12 @@ XvCloseScreen(
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
return (*pScreen->CloseScreen)(ii, pScreen);
-
}
static void
XvResetProc(ExtensionEntry* extEntry)
{
+ XvResetProcVector();
}
_X_EXPORT DevPrivateKey