Xext: xv: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping much easier. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
757f6ab8bc
commit
2892b49d26
489
Xext/xvdisp.c
489
Xext/xvdisp.c
|
@ -31,6 +31,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/Xvproto.h>
|
#include <X11/extensions/Xvproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "Xext/xvdix_priv.h"
|
#include "Xext/xvdix_priv.h"
|
||||||
#include "Xext/panoramiX.h"
|
#include "Xext/panoramiX.h"
|
||||||
#include "Xext/panoramiXsrv.h"
|
#include "Xext/panoramiXsrv.h"
|
||||||
|
@ -57,6 +58,8 @@ unsigned long XvXRTPort;
|
||||||
static int
|
static int
|
||||||
ProcXvQueryExtension(ClientPtr client)
|
ProcXvQueryExtension(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvQueryExtensionReq);
|
||||||
|
|
||||||
xvQueryExtensionReply rep = {
|
xvQueryExtensionReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -65,9 +68,6 @@ ProcXvQueryExtension(ClientPtr client)
|
||||||
.revision = XvRevision
|
.revision = XvRevision
|
||||||
};
|
};
|
||||||
|
|
||||||
/* REQUEST(xvQueryExtensionReq); */
|
|
||||||
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -90,8 +90,8 @@ ProcXvQueryAdaptors(ClientPtr client)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
XvScreenPtr pxvs;
|
XvScreenPtr pxvs;
|
||||||
|
|
||||||
REQUEST(xvQueryAdaptorsReq);
|
REQUEST_HEAD_STRUCT(xvQueryAdaptorsReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
@ -189,8 +189,8 @@ ProcXvQueryEncodings(ClientPtr client)
|
||||||
int ne;
|
int ne;
|
||||||
XvEncodingPtr pe;
|
XvEncodingPtr pe;
|
||||||
|
|
||||||
REQUEST(xvQueryEncodingsReq);
|
REQUEST_HEAD_STRUCT(xvQueryEncodingsReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -265,8 +265,7 @@ SingleXvPutVideo(ClientPtr client)
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
REQUEST(xvPutVideoReq);
|
REQUEST_HEAD_STRUCT(xvPutVideoReq);
|
||||||
REQUEST_SIZE_MATCH(xvPutVideoReq);
|
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
@ -292,6 +291,19 @@ static int XineramaXvPutVideo(ClientPtr client);
|
||||||
static int
|
static int
|
||||||
ProcXvPutVideo(ClientPtr client)
|
ProcXvPutVideo(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvPutVideoReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(gc);
|
||||||
|
REQUEST_FIELD_CARD16(vid_x);
|
||||||
|
REQUEST_FIELD_CARD16(vid_y);
|
||||||
|
REQUEST_FIELD_CARD16(vid_w);
|
||||||
|
REQUEST_FIELD_CARD16(vid_h);
|
||||||
|
REQUEST_FIELD_CARD16(drw_x);
|
||||||
|
REQUEST_FIELD_CARD16(drw_y);
|
||||||
|
REQUEST_FIELD_CARD16(drw_w);
|
||||||
|
REQUEST_FIELD_CARD16(drw_h);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (xvUseXinerama)
|
if (xvUseXinerama)
|
||||||
return XineramaXvPutVideo(client);
|
return XineramaXvPutVideo(client);
|
||||||
|
@ -307,8 +319,7 @@ SingleXvPutStill(ClientPtr client)
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
REQUEST(xvPutStillReq);
|
REQUEST_HEAD_STRUCT(xvPutStillReq);
|
||||||
REQUEST_SIZE_MATCH(xvPutStillReq);
|
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
@ -334,6 +345,19 @@ static int XineramaXvPutStill(ClientPtr client);
|
||||||
static int
|
static int
|
||||||
ProcXvPutStill(ClientPtr client)
|
ProcXvPutStill(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvPutStillReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(gc);
|
||||||
|
REQUEST_FIELD_CARD16(vid_x);
|
||||||
|
REQUEST_FIELD_CARD16(vid_y);
|
||||||
|
REQUEST_FIELD_CARD16(vid_w);
|
||||||
|
REQUEST_FIELD_CARD16(vid_h);
|
||||||
|
REQUEST_FIELD_CARD16(drw_x);
|
||||||
|
REQUEST_FIELD_CARD16(drw_y);
|
||||||
|
REQUEST_FIELD_CARD16(drw_w);
|
||||||
|
REQUEST_FIELD_CARD16(drw_h);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (xvUseXinerama)
|
if (xvUseXinerama)
|
||||||
return XineramaXvPutStill(client);
|
return XineramaXvPutStill(client);
|
||||||
|
@ -349,8 +373,18 @@ ProcXvGetVideo(ClientPtr client)
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
REQUEST(xvGetVideoReq);
|
REQUEST_HEAD_STRUCT(xvGetVideoReq);
|
||||||
REQUEST_SIZE_MATCH(xvGetVideoReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(gc);
|
||||||
|
REQUEST_FIELD_CARD16(vid_x);
|
||||||
|
REQUEST_FIELD_CARD16(vid_y);
|
||||||
|
REQUEST_FIELD_CARD16(vid_w);
|
||||||
|
REQUEST_FIELD_CARD16(vid_h);
|
||||||
|
REQUEST_FIELD_CARD16(drw_x);
|
||||||
|
REQUEST_FIELD_CARD16(drw_y);
|
||||||
|
REQUEST_FIELD_CARD16(drw_w);
|
||||||
|
REQUEST_FIELD_CARD16(drw_h);
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
@ -379,8 +413,18 @@ ProcXvGetStill(ClientPtr client)
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
REQUEST(xvGetStillReq);
|
REQUEST_HEAD_STRUCT(xvGetStillReq);
|
||||||
REQUEST_SIZE_MATCH(xvGetStillReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(gc);
|
||||||
|
REQUEST_FIELD_CARD16(vid_x);
|
||||||
|
REQUEST_FIELD_CARD16(vid_y);
|
||||||
|
REQUEST_FIELD_CARD16(vid_w);
|
||||||
|
REQUEST_FIELD_CARD16(vid_h);
|
||||||
|
REQUEST_FIELD_CARD16(drw_x);
|
||||||
|
REQUEST_FIELD_CARD16(drw_y);
|
||||||
|
REQUEST_FIELD_CARD16(drw_w);
|
||||||
|
REQUEST_FIELD_CARD16(drw_h);
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
@ -407,8 +451,8 @@ ProcXvSelectVideoNotify(ClientPtr client)
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xvSelectVideoNotifyReq);
|
REQUEST_HEAD_STRUCT(xvSelectVideoNotifyReq);
|
||||||
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixReceiveAccess);
|
DixReceiveAccess);
|
||||||
|
@ -423,8 +467,8 @@ ProcXvSelectPortNotify(ClientPtr client)
|
||||||
{
|
{
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvSelectPortNotifyReq);
|
REQUEST_HEAD_STRUCT(xvSelectPortNotifyReq);
|
||||||
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -437,8 +481,9 @@ ProcXvGrabPort(ClientPtr client)
|
||||||
int result, status;
|
int result, status;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvGrabPortReq);
|
REQUEST_HEAD_STRUCT(xvGrabPortReq);
|
||||||
REQUEST_SIZE_MATCH(xvGrabPortReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -467,8 +512,9 @@ ProcXvUngrabPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvGrabPortReq);
|
REQUEST_HEAD_STRUCT(xvGrabPortReq);
|
||||||
REQUEST_SIZE_MATCH(xvGrabPortReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -482,8 +528,9 @@ SingleXvStopVideo(ClientPtr client)
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvStopVideoReq);
|
REQUEST_HEAD_STRUCT(xvStopVideoReq);
|
||||||
REQUEST_SIZE_MATCH(xvStopVideoReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -512,8 +559,10 @@ SingleXvSetPortAttribute(ClientPtr client)
|
||||||
int status;
|
int status;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvSetPortAttributeReq);
|
REQUEST_HEAD_STRUCT(xvSetPortAttributeReq);
|
||||||
REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(attribute);
|
||||||
|
REQUEST_FIELD_CARD32(value);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess);
|
||||||
|
|
||||||
|
@ -552,8 +601,9 @@ ProcXvGetPortAttribute(ClientPtr client)
|
||||||
int status;
|
int status;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvGetPortAttributeReq);
|
REQUEST_HEAD_STRUCT(xvGetPortAttributeReq);
|
||||||
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(attribute);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
||||||
|
|
||||||
|
@ -590,8 +640,12 @@ ProcXvQueryBestSize(ClientPtr client)
|
||||||
unsigned int actual_width, actual_height;
|
unsigned int actual_width, actual_height;
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
|
|
||||||
REQUEST(xvQueryBestSizeReq);
|
REQUEST_HEAD_STRUCT(xvQueryBestSizeReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD16(vid_w);
|
||||||
|
REQUEST_FIELD_CARD16(vid_h);
|
||||||
|
REQUEST_FIELD_CARD16(drw_w);
|
||||||
|
REQUEST_FIELD_CARD16(drw_h);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -625,8 +679,8 @@ ProcXvQueryPortAttributes(ClientPtr client)
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
XvAttributePtr pAtt;
|
XvAttributePtr pAtt;
|
||||||
|
|
||||||
REQUEST(xvQueryPortAttributesReq);
|
REQUEST_HEAD_STRUCT(xvQueryPortAttributesReq);
|
||||||
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
|
||||||
|
|
||||||
|
@ -697,8 +751,7 @@ SingleXvPutImage(ClientPtr client)
|
||||||
int status, i, size;
|
int status, i, size;
|
||||||
CARD16 width, height;
|
CARD16 width, height;
|
||||||
|
|
||||||
REQUEST(xvPutImageReq);
|
REQUEST_HEAD_AT_LEAST(xvPutImageReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
|
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
@ -750,6 +803,22 @@ XineramaXvPutImage(ClientPtr client);
|
||||||
static int
|
static int
|
||||||
ProcXvPutImage(ClientPtr client)
|
ProcXvPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_AT_LEAST(xvPutImageReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(gc);
|
||||||
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
REQUEST_FIELD_CARD16(src_x);
|
||||||
|
REQUEST_FIELD_CARD16(src_y);
|
||||||
|
REQUEST_FIELD_CARD16(src_w);
|
||||||
|
REQUEST_FIELD_CARD16(src_h);
|
||||||
|
REQUEST_FIELD_CARD16(drw_x);
|
||||||
|
REQUEST_FIELD_CARD16(drw_y);
|
||||||
|
REQUEST_FIELD_CARD16(drw_w);
|
||||||
|
REQUEST_FIELD_CARD16(drw_h);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (xvUseXinerama)
|
if (xvUseXinerama)
|
||||||
return XineramaXvPutImage(client);
|
return XineramaXvPutImage(client);
|
||||||
|
@ -770,8 +839,7 @@ SingleXvShmPutImage(ClientPtr client)
|
||||||
int status, size_needed, i;
|
int status, size_needed, i;
|
||||||
CARD16 width, height;
|
CARD16 width, height;
|
||||||
|
|
||||||
REQUEST(xvShmPutImageReq);
|
REQUEST_HEAD_STRUCT(xvShmPutImageReq);
|
||||||
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
@ -835,13 +903,30 @@ SingleXvShmPutImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int XineramaXvShmPutImage(ClientPtr client);
|
static int XineramaXvShmPutImage(ClientPtr client);
|
||||||
|
|
||||||
#endif /* MITSHM */
|
#endif /* MITSHM */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXvShmPutImage(ClientPtr client)
|
ProcXvShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
#ifdef MITSHM
|
#ifdef MITSHM
|
||||||
|
REQUEST_HEAD_STRUCT(xvShmPutImageReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(gc);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
REQUEST_FIELD_CARD32(offset);
|
||||||
|
REQUEST_FIELD_CARD16(src_x);
|
||||||
|
REQUEST_FIELD_CARD16(src_y);
|
||||||
|
REQUEST_FIELD_CARD16(src_w);
|
||||||
|
REQUEST_FIELD_CARD16(src_h);
|
||||||
|
REQUEST_FIELD_CARD16(drw_x);
|
||||||
|
REQUEST_FIELD_CARD16(drw_y);
|
||||||
|
REQUEST_FIELD_CARD16(drw_w);
|
||||||
|
REQUEST_FIELD_CARD16(drw_h);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (xvUseXinerama)
|
if (xvUseXinerama)
|
||||||
return XineramaXvShmPutImage(client);
|
return XineramaXvShmPutImage(client);
|
||||||
|
@ -867,9 +952,11 @@ ProcXvQueryImageAttributes(ClientPtr client)
|
||||||
int32_t *offsets;
|
int32_t *offsets;
|
||||||
int32_t *pitches;
|
int32_t *pitches;
|
||||||
|
|
||||||
REQUEST(xvQueryImageAttributesReq);
|
REQUEST_HEAD_STRUCT(xvQueryImageAttributesReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -936,9 +1023,8 @@ ProcXvListImageFormats(ClientPtr client)
|
||||||
XvImagePtr pImage;
|
XvImagePtr pImage;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
REQUEST(xvListImageFormatsReq);
|
REQUEST_HEAD_STRUCT(xvListImageFormatsReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
|
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
@ -1064,317 +1150,6 @@ ProcXvDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Swapped Procs */
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvQueryAdaptors(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvQueryAdaptorsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return ProcXvQueryAdaptors(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvQueryEncodings(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvQueryEncodingsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
return ProcXvQueryEncodings(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvGrabPort(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvGrabPortReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvGrabPortReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
return ProcXvGrabPort(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvUngrabPort(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvUngrabPortReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvUngrabPortReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
return ProcXvUngrabPort(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvPutVideo(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvPutVideoReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvPutVideoReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->gc);
|
|
||||||
swaps(&stuff->vid_x);
|
|
||||||
swaps(&stuff->vid_y);
|
|
||||||
swaps(&stuff->vid_w);
|
|
||||||
swaps(&stuff->vid_h);
|
|
||||||
swaps(&stuff->drw_x);
|
|
||||||
swaps(&stuff->drw_y);
|
|
||||||
swaps(&stuff->drw_w);
|
|
||||||
swaps(&stuff->drw_h);
|
|
||||||
return ProcXvPutVideo(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvPutStill(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvPutStillReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvPutStillReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->gc);
|
|
||||||
swaps(&stuff->vid_x);
|
|
||||||
swaps(&stuff->vid_y);
|
|
||||||
swaps(&stuff->vid_w);
|
|
||||||
swaps(&stuff->vid_h);
|
|
||||||
swaps(&stuff->drw_x);
|
|
||||||
swaps(&stuff->drw_y);
|
|
||||||
swaps(&stuff->drw_w);
|
|
||||||
swaps(&stuff->drw_h);
|
|
||||||
return ProcXvPutStill(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvGetVideo(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvGetVideoReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvGetVideoReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->gc);
|
|
||||||
swaps(&stuff->vid_x);
|
|
||||||
swaps(&stuff->vid_y);
|
|
||||||
swaps(&stuff->vid_w);
|
|
||||||
swaps(&stuff->vid_h);
|
|
||||||
swaps(&stuff->drw_x);
|
|
||||||
swaps(&stuff->drw_y);
|
|
||||||
swaps(&stuff->drw_w);
|
|
||||||
swaps(&stuff->drw_h);
|
|
||||||
return ProcXvGetVideo(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvGetStill(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvGetStillReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvGetStillReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->gc);
|
|
||||||
swaps(&stuff->vid_x);
|
|
||||||
swaps(&stuff->vid_y);
|
|
||||||
swaps(&stuff->vid_w);
|
|
||||||
swaps(&stuff->vid_h);
|
|
||||||
swaps(&stuff->drw_x);
|
|
||||||
swaps(&stuff->drw_y);
|
|
||||||
swaps(&stuff->drw_w);
|
|
||||||
swaps(&stuff->drw_h);
|
|
||||||
return ProcXvGetStill(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvPutImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvPutImageReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->gc);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
swaps(&stuff->src_x);
|
|
||||||
swaps(&stuff->src_y);
|
|
||||||
swaps(&stuff->src_w);
|
|
||||||
swaps(&stuff->src_h);
|
|
||||||
swaps(&stuff->drw_x);
|
|
||||||
swaps(&stuff->drw_y);
|
|
||||||
swaps(&stuff->drw_w);
|
|
||||||
swaps(&stuff->drw_h);
|
|
||||||
swaps(&stuff->width);
|
|
||||||
swaps(&stuff->height);
|
|
||||||
return ProcXvPutImage(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MITSHM
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvShmPutImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvShmPutImageReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->gc);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
swapl(&stuff->offset);
|
|
||||||
swaps(&stuff->src_x);
|
|
||||||
swaps(&stuff->src_y);
|
|
||||||
swaps(&stuff->src_w);
|
|
||||||
swaps(&stuff->src_h);
|
|
||||||
swaps(&stuff->drw_x);
|
|
||||||
swaps(&stuff->drw_y);
|
|
||||||
swaps(&stuff->drw_w);
|
|
||||||
swaps(&stuff->drw_h);
|
|
||||||
swaps(&stuff->width);
|
|
||||||
swaps(&stuff->height);
|
|
||||||
return ProcXvShmPutImage(client);
|
|
||||||
}
|
|
||||||
#else /* MITSHM */
|
|
||||||
#define SProcXvShmPutImage ProcXvShmPutImage
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvSelectVideoNotify(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvSelectVideoNotifyReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
return ProcXvSelectVideoNotify(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvSelectPortNotify(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvSelectPortNotifyReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
return ProcXvSelectPortNotify(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvStopVideo(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvStopVideoReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvStopVideoReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
return ProcXvStopVideo(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvSetPortAttribute(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvSetPortAttributeReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->attribute);
|
|
||||||
swapl(&stuff->value);
|
|
||||||
return ProcXvSetPortAttribute(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvGetPortAttribute(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvGetPortAttributeReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->attribute);
|
|
||||||
return ProcXvGetPortAttribute(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvQueryBestSize(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvQueryBestSizeReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swaps(&stuff->vid_w);
|
|
||||||
swaps(&stuff->vid_h);
|
|
||||||
swaps(&stuff->drw_w);
|
|
||||||
swaps(&stuff->drw_h);
|
|
||||||
return ProcXvQueryBestSize(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvQueryPortAttributes(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvQueryPortAttributesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
return ProcXvQueryPortAttributes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvQueryImageAttributes(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvQueryImageAttributesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
swaps(&stuff->width);
|
|
||||||
swaps(&stuff->height);
|
|
||||||
return ProcXvQueryImageAttributes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXvListImageFormats(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xvListImageFormatsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
|
|
||||||
swapl(&stuff->port);
|
|
||||||
return ProcXvListImageFormats(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXvDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
UpdateCurrentTime();
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case xv_QueryExtension:
|
|
||||||
return ProcXvQueryExtension(client);
|
|
||||||
case xv_QueryAdaptors:
|
|
||||||
return SProcXvQueryAdaptors(client);
|
|
||||||
case xv_QueryEncodings:
|
|
||||||
return SProcXvQueryEncodings(client);
|
|
||||||
case xv_GrabPort:
|
|
||||||
return SProcXvGrabPort(client);
|
|
||||||
case xv_UngrabPort:
|
|
||||||
return SProcXvUngrabPort(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_StopVideo:
|
|
||||||
return SProcXvStopVideo(client);
|
|
||||||
case xv_SelectVideoNotify:
|
|
||||||
return SProcXvSelectVideoNotify(client);
|
|
||||||
case xv_SelectPortNotify:
|
|
||||||
return SProcXvSelectPortNotify(client);
|
|
||||||
case xv_QueryBestSize:
|
|
||||||
return SProcXvQueryBestSize(client);
|
|
||||||
case xv_SetPortAttribute:
|
|
||||||
return SProcXvSetPortAttribute(client);
|
|
||||||
case xv_GetPortAttribute:
|
|
||||||
return SProcXvGetPortAttribute(client);
|
|
||||||
case xv_QueryPortAttributes:
|
|
||||||
return SProcXvQueryPortAttributes(client);
|
|
||||||
case xv_ListImageFormats:
|
|
||||||
return SProcXvListImageFormats(client);
|
|
||||||
case xv_QueryImageAttributes:
|
|
||||||
return SProcXvQueryImageAttributes(client);
|
|
||||||
case xv_PutImage:
|
|
||||||
return SProcXvPutImage(client);
|
|
||||||
case xv_ShmPutImage:
|
|
||||||
return SProcXvShmPutImage(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
static int
|
static int
|
||||||
XineramaXvStopVideo(ClientPtr client)
|
XineramaXvStopVideo(ClientPtr client)
|
||||||
|
@ -1481,9 +1256,7 @@ XineramaXvShmPutImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
#define XineramaXvShmPutImage ProcXvShmPutImage
|
|
||||||
#endif /* MITSHM */
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
XineramaXvPutImage(ClientPtr client)
|
XineramaXvPutImage(ClientPtr client)
|
||||||
|
|
|
@ -183,7 +183,7 @@ XvExtensionInit(void)
|
||||||
XvExtensionGeneration = serverGeneration;
|
XvExtensionGeneration = serverGeneration;
|
||||||
|
|
||||||
extEntry = AddExtension(XvName, XvNumEvents, XvNumErrors,
|
extEntry = AddExtension(XvName, XvNumEvents, XvNumErrors,
|
||||||
ProcXvDispatch, SProcXvDispatch,
|
ProcXvDispatch, ProcXvDispatch,
|
||||||
XvResetProc, StandardMinorOpcode);
|
XvResetProc, StandardMinorOpcode);
|
||||||
if (!extEntry) {
|
if (!extEntry) {
|
||||||
FatalError("XvExtensionInit: AddExtensions failed\n");
|
FatalError("XvExtensionInit: AddExtensions failed\n");
|
||||||
|
|
Loading…
Reference in New Issue