diff options
author | marha <marha@users.sourceforge.net> | 2014-08-11 21:14:48 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-08-11 21:14:48 +0200 |
commit | fdbedba4d50e1b28b0249c83ba11c029f096e400 (patch) | |
tree | a80ccb6275fd99644c79c67856e9c1bf1b323d62 /xorg-server/Xext | |
parent | b33b8d8ae86876b50df96881b96074b3fe177cce (diff) | |
download | vcxsrv-fdbedba4d50e1b28b0249c83ba11c029f096e400.tar.gz vcxsrv-fdbedba4d50e1b28b0249c83ba11c029f096e400.tar.bz2 vcxsrv-fdbedba4d50e1b28b0249c83ba11c029f096e400.zip |
fontconfig libX11 libxcb libxcb/xcb-proto mesa xserver xkeyboard-config git update 11 Aug 2014
xserver commit 3714f5401690b288045090c4bcd9cb01c6e4860e
libxcb commit 966fba6ba4838949d0727dfa45eeb9392d1f85d9
libxcb/xcb-proto commit 4b384d2a015c50d0e93dcacda4b8260a3fd37640
xkeyboard-config commit 651a00ab656a1754b9183a383970a735209bbb50
libX11 commit 368a6401c6a3275d3497fec38a3dcbc38cd9df60
libXdmcp commit fe8eab93e9bcdbe8bb8052434bb5e676e3a0ee8f
libXext commit efdcbb7634501e1117d422636a0a75d7ea84b16b
libfontenc commit 0037a42107b952c9d903719615747e760e4e7247
libXinerama commit edd95182b26eb5d576d4878c559e0f17dddaa909
libXau commit 1e4635be11154dd8262f37b379511bd627defa2a
xkbcomp commit d4e02a09258063c6d024c3ccd42d6b22212e6e18
pixman commit 6d2cf40166d81bfc63108504c8022dc4fec37ff5
xextproto commit 66afec3f49e8eb0d4c2e9af7088fc3116d4bafd7
randrproto commit a4a6694c059d74247c16527eef4a0ec9f56bbef6
glproto commit f84853d97d5749308992412a215fa518b6536eb3
mkfontscale commit 47908fd7a0d061fdcd21e3498da4e223ca9136d9
xwininfo commit 017b3736489985999d8dcf4d9e473e1fd6dd3647
libXft commit 214f9b5306d833e2787c75fe41dfdc9228fcb738
libXmu commit 22d9c590901e121936f50dee97dc60c4f7defb63
libxtrans commit a57a7f62242e1ea972b81414741729bf3dbae0a4
fontconfig commit 841753a93f0e5698663b7931b8456e7b96259f54
mesa commit f24be7340162c6a831b392d46d6637e9656e7a8a
Diffstat (limited to 'xorg-server/Xext')
-rw-r--r-- | xorg-server/Xext/saver.c | 16 | ||||
-rw-r--r-- | xorg-server/Xext/xvdisp.c | 98 | ||||
-rw-r--r-- | xorg-server/Xext/xvdix.h | 31 | ||||
-rw-r--r-- | xorg-server/Xext/xvmain.c | 144 |
4 files changed, 105 insertions, 184 deletions
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c index 8e92fdf2f..2c14ea00e 100644 --- a/xorg-server/Xext/saver.c +++ b/xorg-server/Xext/saver.c @@ -467,9 +467,6 @@ CreateSaverWindow(ScreenPtr pScreen) WindowPtr pWin; int result; unsigned long mask; - Colormap *installedMaps; - int numInstalled; - int i; Colormap wantMap; ColormapPtr pCmap; @@ -545,18 +542,7 @@ CreateSaverWindow(ScreenPtr pScreen) /* check and install our own colormap if it isn't installed now */ wantMap = wColormap(pWin); - if (wantMap == None) - return TRUE; - installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof(Colormap)); - numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pScreen, installedMaps); - for (i = 0; i < numInstalled; i++) - if (installedMaps[i] == wantMap) - break; - - free((char *) installedMaps); - - if (i < numInstalled) + if (wantMap == None || IsMapInstalled(wantMap, pWin)) return TRUE; result = dixLookupResourceByType((void **) &pCmap, wantMap, RT_COLORMAP, diff --git a/xorg-server/Xext/xvdisp.c b/xorg-server/Xext/xvdisp.c index f2d49a2b8..0bdfed370 100644 --- a/xorg-server/Xext/xvdisp.c +++ b/xorg-server/Xext/xvdisp.c @@ -297,9 +297,6 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep) if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ else WriteToClient(_c, sz_xvImageFormatInfo, _d) -#define _AllocatePort(_i,_p) \ - ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success - static int ProcXvQueryExtension(ClientPtr client) { @@ -356,8 +353,6 @@ ProcXvQueryAdaptors(ClientPtr client) return Success; } - (*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors); - rep = (xvQueryAdaptorsReply) { .type = X_Reply, .sequenceNumber = client->sequence, @@ -422,18 +417,12 @@ ProcXvQueryEncodings(ClientPtr client) XvPortPtr pPort; int ne; XvEncodingPtr pe; - int status; REQUEST(xvQueryEncodingsReq); REQUEST_SIZE_MATCH(xvQueryEncodingsReq); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - rep = (xvQueryEncodingsReply) { .type = X_Reply, .sequenceNumber = client->sequence, @@ -485,11 +474,6 @@ ProcXvPutVideo(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvInputMask) || !(pPort->pAdaptor->type & XvVideoMask)) { client->errorValue = stuff->port; @@ -520,11 +504,6 @@ ProcXvPutStill(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvInputMask) || !(pPort->pAdaptor->type & XvStillMask)) { client->errorValue = stuff->port; @@ -555,11 +534,6 @@ ProcXvGetVideo(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvOutputMask) || !(pPort->pAdaptor->type & XvVideoMask)) { client->errorValue = stuff->port; @@ -590,11 +564,6 @@ ProcXvGetStill(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvOutputMask) || !(pPort->pAdaptor->type & XvStillMask)) { client->errorValue = stuff->port; @@ -631,7 +600,6 @@ ProcXvSelectVideoNotify(ClientPtr client) static int ProcXvSelectPortNotify(ClientPtr client) { - int status; XvPortPtr pPort; REQUEST(xvSelectPortNotifyReq); @@ -639,11 +607,6 @@ ProcXvSelectPortNotify(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - return XvdiSelectPortNotify(client, pPort, stuff->onoff); } @@ -659,11 +622,6 @@ ProcXvGrabPort(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - status = XvdiGrabPort(client, pPort, stuff->time, &result); if (status != Success) { @@ -684,7 +642,6 @@ ProcXvGrabPort(ClientPtr client) static int ProcXvUngrabPort(ClientPtr client) { - int status; XvPortPtr pPort; REQUEST(xvGrabPortReq); @@ -692,18 +649,13 @@ ProcXvUngrabPort(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - return XvdiUngrabPort(client, pPort, stuff->time); } static int ProcXvStopVideo(ClientPtr client) { - int status, ret; + int ret; DrawablePtr pDraw; XvPortPtr pPort; @@ -712,11 +664,6 @@ ProcXvStopVideo(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); if (ret != Success) return ret; @@ -735,11 +682,6 @@ ProcXvSetPortAttribute(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!ValidAtom(stuff->attribute)) { client->errorValue = stuff->attribute; return BadAtom; @@ -769,11 +711,6 @@ ProcXvGetPortAttribute(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!ValidAtom(stuff->attribute)) { client->errorValue = stuff->attribute; return BadAtom; @@ -800,7 +737,6 @@ ProcXvGetPortAttribute(ClientPtr client) static int ProcXvQueryBestSize(ClientPtr client) { - int status; unsigned int actual_width, actual_height; XvPortPtr pPort; xvQueryBestSizeReply rep; @@ -810,12 +746,7 @@ ProcXvQueryBestSize(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - - (*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion, + (*pPort->pAdaptor->ddQueryBestSize) (pPort, stuff->motion, stuff->vid_w, stuff->vid_h, stuff->drw_w, stuff->drw_h, &actual_width, &actual_height); @@ -836,7 +767,7 @@ ProcXvQueryBestSize(ClientPtr client) static int ProcXvQueryPortAttributes(ClientPtr client) { - int status, size, i; + int size, i; XvPortPtr pPort; XvAttributePtr pAtt; xvQueryPortAttributesReply rep; @@ -847,11 +778,6 @@ ProcXvQueryPortAttributes(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - rep = (xvQueryPortAttributesReply) { .type = X_Reply, .sequenceNumber = client->sequence, @@ -902,11 +828,6 @@ ProcXvPutImage(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvImageMask) || !(pPort->pAdaptor->type & XvInputMask)) { client->errorValue = stuff->port; @@ -930,8 +851,7 @@ ProcXvPutImage(ClientPtr client) width = stuff->width; height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes) (client, - pPort, pImage, &width, + size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); size += sizeof(xvPutImageReq); size = bytes_to_int32(size); @@ -968,11 +888,6 @@ ProcXvShmPutImage(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - if ((status = _AllocatePort(stuff->port, pPort)) != Success) { - client->errorValue = stuff->port; - return status; - } - if (!(pPort->pAdaptor->type & XvImageMask) || !(pPort->pAdaptor->type & XvInputMask)) { client->errorValue = stuff->port; @@ -1001,8 +916,7 @@ ProcXvShmPutImage(ClientPtr client) width = stuff->width; height = stuff->height; - size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (client, - pPort, pImage, + size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); if ((size_needed + stuff->offset) > shmdesc->size) @@ -1086,7 +1000,7 @@ ProcXvQueryImageAttributes(ClientPtr client) width = stuff->width; height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes) (client, pPort, pImage, + size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, offsets, pitches); diff --git a/xorg-server/Xext/xvdix.h b/xorg-server/Xext/xvdix.h index bb08cf4c7..e67a3c766 100644 --- a/xorg-server/Xext/xvdix.h +++ b/xorg-server/Xext/xvdix.h @@ -157,32 +157,29 @@ typedef struct { int nPorts; struct _XvPortRec *pPorts; ScreenPtr pScreen; - int (*ddAllocatePort) (unsigned long, struct _XvPortRec *, - struct _XvPortRec **); - int (*ddFreePort) (struct _XvPortRec *); - int (*ddPutVideo) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddPutVideo) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddPutStill) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddPutStill) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddGetVideo) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddGetVideo) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddGetStill) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddGetStill) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); - int (*ddStopVideo) (ClientPtr, struct _XvPortRec *, DrawablePtr); - int (*ddSetPortAttribute) (ClientPtr, struct _XvPortRec *, Atom, INT32); - int (*ddGetPortAttribute) (ClientPtr, struct _XvPortRec *, Atom, INT32 *); - int (*ddQueryBestSize) (ClientPtr, struct _XvPortRec *, CARD8, + int (*ddStopVideo) (struct _XvPortRec *, DrawablePtr); + int (*ddSetPortAttribute) (struct _XvPortRec *, Atom, INT32); + int (*ddGetPortAttribute) (struct _XvPortRec *, Atom, INT32 *); + int (*ddQueryBestSize) (struct _XvPortRec *, CARD8, CARD16, CARD16, CARD16, CARD16, unsigned int *, unsigned int *); - int (*ddPutImage) (ClientPtr, DrawablePtr, struct _XvPortRec *, GCPtr, + int (*ddPutImage) (DrawablePtr, struct _XvPortRec *, GCPtr, INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char *, Bool, CARD16, CARD16); - int (*ddQueryImageAttributes) (ClientPtr, struct _XvPortRec *, XvImagePtr, + int (*ddQueryImageAttributes) (struct _XvPortRec *, XvImagePtr, CARD16 *, CARD16 *, int *, int *); DevUnion devPriv; } XvAdaptorRec, *XvAdaptorPtr; @@ -213,9 +210,6 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; DestroyPixmapProcPtr DestroyPixmap; CloseScreenProcPtr CloseScreen; - Bool (*ddCloseScreen) (ScreenPtr); - int (*ddQueryAdaptors) (ScreenPtr, XvAdaptorPtr *, int *); - DevUnion devPriv; } XvScreenRec, *XvScreenPtr; #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \ @@ -235,8 +229,10 @@ extern _X_EXPORT int SProcXvDispatch(ClientPtr); extern _X_EXPORT int XvScreenInit(ScreenPtr); extern _X_EXPORT DevPrivateKey XvGetScreenKey(void); extern _X_EXPORT unsigned long XvGetRTPort(void); +extern _X_EXPORT void XvFreeAdaptor(XvAdaptorPtr pAdaptor); +extern void _X_EXPORT XvFillColorKey(DrawablePtr pDraw, CARD32 key, + RegionPtr region); extern _X_EXPORT int XvdiSendPortNotify(XvPortPtr, Atom, INT32); -extern _X_EXPORT int XvdiVideoStopped(XvPortPtr, int); extern _X_EXPORT int XvdiPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, INT16, INT16, CARD16, CARD16, @@ -260,7 +256,6 @@ extern _X_EXPORT int XvdiSelectPortNotify(ClientPtr, XvPortPtr, BOOL); extern _X_EXPORT int XvdiSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32); extern _X_EXPORT int XvdiGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *); extern _X_EXPORT int XvdiStopVideo(ClientPtr, XvPortPtr, DrawablePtr); -extern _X_EXPORT int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr); extern _X_EXPORT int XvdiMatchPort(XvPortPtr, DrawablePtr); extern _X_EXPORT int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *); extern _X_EXPORT int XvdiUngrabPort(ClientPtr, XvPortPtr, Time); diff --git a/xorg-server/Xext/xvmain.c b/xorg-server/Xext/xvmain.c index 00b5179bd..bc176c852 100644 --- a/xorg-server/Xext/xvmain.c +++ b/xorg-server/Xext/xvmain.c @@ -302,8 +302,6 @@ XvCloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = pxvs->DestroyWindow; pScreen->CloseScreen = pxvs->CloseScreen; - (*pxvs->ddCloseScreen) (pScreen); - free(pxvs); dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL); @@ -358,7 +356,7 @@ XvDestroyPixmap(PixmapPtr pPix) if (pp->pDraw == (DrawablePtr) pPix) { XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted); - (void) (*pp->pAdaptor->ddStopVideo) (NULL, pp, pp->pDraw); + (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw); pp->pDraw = NULL; pp->client = NULL; @@ -406,7 +404,7 @@ XvDestroyWindow(WindowPtr pWin) if (pp->pDraw == (DrawablePtr) pWin) { XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted); - (void) (*pp->pAdaptor->ddStopVideo) (NULL, pp, pp->pDraw); + (void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw); pp->pDraw = NULL; pp->client = NULL; @@ -425,34 +423,10 @@ XvDestroyWindow(WindowPtr pWin) } -/* The XvdiVideoStopped procedure is a hook for the device dependent layer. - It provides a way for the dd layer to inform the di layer that video has - stopped in a port for reasons that the di layer had no control over; note - that it doesn't call back into the dd layer */ - -int -XvdiVideoStopped(XvPortPtr pPort, int reason) -{ - - /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */ - - if (!pPort->pDraw) - return Success; - - XvdiSendVideoNotify(pPort, pPort->pDraw, reason); - - pPort->pDraw = NULL; - pPort->client = NULL; - pPort->time = currentTime; - - return Success; - -} - static int XvdiDestroyPort(void *pPort, XID id) { - return (*((XvPortPtr) pPort)->pAdaptor->ddFreePort) (pPort); + return Success; } static int @@ -592,7 +566,7 @@ XvdiPutVideo(ClientPtr client, XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } - (void) (*pPort->pAdaptor->ddPutVideo) (client, pDraw, pPort, pGC, + (void) (*pPort->pAdaptor->ddPutVideo) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -634,7 +608,7 @@ XvdiPutStill(ClientPtr client, pPort->time = currentTime; - status = (*pPort->pAdaptor->ddPutStill) (client, pDraw, pPort, pGC, + status = (*pPort->pAdaptor->ddPutStill) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -670,7 +644,7 @@ XvdiPutImage(ClientPtr client, pPort->time = currentTime; - return (*pPort->pAdaptor->ddPutImage) (client, pDraw, pPort, pGC, + return (*pPort->pAdaptor->ddPutImage) (pDraw, pPort, pGC, src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h, image, data, sync, width, height); @@ -709,7 +683,7 @@ XvdiGetVideo(ClientPtr client, XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); } - (void) (*pPort->pAdaptor->ddGetVideo) (client, pDraw, pPort, pGC, + (void) (*pPort->pAdaptor->ddGetVideo) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -749,7 +723,7 @@ XvdiGetStill(ClientPtr client, return Success; } - status = (*pPort->pAdaptor->ddGetStill) (client, pDraw, pPort, pGC, + status = (*pPort->pAdaptor->ddGetStill) (pDraw, pPort, pGC, vid_x, vid_y, vid_w, vid_h, drw_x, drw_y, drw_w, drw_h); @@ -981,29 +955,7 @@ XvdiStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) XvdiSendVideoNotify(pPort, pDraw, XvStopped); - status = (*pPort->pAdaptor->ddStopVideo) (client, pPort, pDraw); - - pPort->pDraw = NULL; - pPort->client = (ClientPtr) client; - pPort->time = currentTime; - - return status; - -} - -int -XvdiPreemptVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw) -{ - int status; - - /* IF PORT ISN'T ACTIVE THEN WE'RE DONE */ - - if (!pPort->pDraw || (pPort->pDraw != pDraw)) - return Success; - - XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted); - - status = (*pPort->pAdaptor->ddStopVideo) (client, pPort, pPort->pDraw); + status = (*pPort->pAdaptor->ddStopVideo) (pPort, pDraw); pPort->pDraw = NULL; pPort->client = (ClientPtr) client; @@ -1046,7 +998,7 @@ XvdiSetPortAttribute(ClientPtr client, int status; status = - (*pPort->pAdaptor->ddSetPortAttribute) (client, pPort, attribute, + (*pPort->pAdaptor->ddSetPortAttribute) (pPort, attribute, value); if (status == Success) XvdiSendPortNotify(pPort, attribute, value); @@ -1060,7 +1012,7 @@ XvdiGetPortAttribute(ClientPtr client, { return - (*pPort->pAdaptor->ddGetPortAttribute) (client, pPort, attribute, + (*pPort->pAdaptor->ddGetPortAttribute) (pPort, attribute, p_value); } @@ -1091,3 +1043,77 @@ WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to) cpswapl(from->u.portNotify.value, to->u.portNotify.value); } + +void +XvFreeAdaptor(XvAdaptorPtr pAdaptor) +{ + int i; + + free(pAdaptor->name); + pAdaptor->name = NULL; + + if (pAdaptor->pEncodings) { + XvEncodingPtr pEncode = pAdaptor->pEncodings; + + for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++) + free(pEncode->name); + free(pAdaptor->pEncodings); + pAdaptor->pEncodings = NULL; + } + + free(pAdaptor->pFormats); + pAdaptor->pFormats = NULL; + + free(pAdaptor->pPorts); + pAdaptor->pPorts = NULL; + + if (pAdaptor->pAttributes) { + XvAttributePtr pAttribute = pAdaptor->pAttributes; + + for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) + free(pAttribute->name); + free(pAdaptor->pAttributes); + pAdaptor->pAttributes = NULL; + } + + free(pAdaptor->pImages); + pAdaptor->pImages = NULL; + + free(pAdaptor->devPriv.ptr); + pAdaptor->devPriv.ptr = NULL; +} + +void +XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region) +{ + ScreenPtr pScreen = pDraw->pScreen; + ChangeGCVal pval[2]; + BoxPtr pbox = RegionRects(region); + int i, nbox = RegionNumRects(region); + xRectangle *rects; + GCPtr gc; + + gc = GetScratchGC(pDraw->depth, pScreen); + if (!gc) + return; + + pval[0].val = key; + pval[1].val = IncludeInferiors; + (void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval); + ValidateGC(pDraw, gc); + + rects = malloc(nbox * sizeof(xRectangle)); + if (rects) { + for (i = 0; i < nbox; i++, pbox++) { + rects[i].x = pbox->x1 - pDraw->x; + rects[i].y = pbox->y1 - pDraw->y; + rects[i].width = pbox->x2 - pbox->x1; + rects[i].height = pbox->y2 - pbox->y1; + } + + (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); + + free(rects); + } + FreeScratchGC(gc); +} |