aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-08-11 21:22:25 +0200
committermarha <marha@users.sourceforge.net>2014-08-11 21:22:25 +0200
commit8e27619ab489dece35cc4bec86950ee7729cd309 (patch)
treeab59dbc661e00c12ed4777cf9d0d37393c4163aa /xorg-server/Xext
parentffc99ce2402fe5c9a6eb8fcf193e8e9472fd993b (diff)
parentfdbedba4d50e1b28b0249c83ba11c029f096e400 (diff)
downloadvcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.gz
vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.bz2
vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.zip
Merge remote-tracking branch 'origin/released'
Conflicts: libxcb/src/c_client.py mesalib/include/GL/glext.h mesalib/include/GL/glxext.h mesalib/src/glsl/.gitignore mesalib/src/mesa/drivers/dri/common/xmlconfig.h mesalib/src/mesa/main/.gitignore xorg-server/Xext/xvmain.c xorg-server/dix/dispatch.c xorg-server/hw/xfree86/common/compiler.h
Diffstat (limited to 'xorg-server/Xext')
-rw-r--r--xorg-server/Xext/saver.c16
-rw-r--r--xorg-server/Xext/xvdisp.c98
-rw-r--r--xorg-server/Xext/xvdix.h31
-rwxr-xr-x[-rw-r--r--]xorg-server/Xext/xvmain.c144
4 files changed, 105 insertions, 184 deletions
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c
index 6afd79c34..43c110dac 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -472,9 +472,6 @@ CreateSaverWindow(ScreenPtr pScreen)
WindowPtr pWin;
int result;
unsigned long mask;
- Colormap *installedMaps;
- int numInstalled;
- int i;
Colormap wantMap;
ColormapPtr pCmap;
@@ -550,18 +547,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 9020b2497..607560efa 100644..100755
--- 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;
- if (pxvs->ddCloseScreen) (*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);
+}