(!1714) Xext: xv: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new pixmap destroy notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
5ec097d808
commit
2f7c911730
|
@ -173,7 +173,6 @@ typedef struct {
|
||||||
int version, revision;
|
int version, revision;
|
||||||
int nAdaptors;
|
int nAdaptors;
|
||||||
XvAdaptorPtr pAdaptors;
|
XvAdaptorPtr pAdaptors;
|
||||||
DestroyPixmapProcPtr DestroyPixmap;
|
|
||||||
} XvScreenRec, *XvScreenPtr;
|
} XvScreenRec, *XvScreenPtr;
|
||||||
|
|
||||||
extern _X_EXPORT int XvScreenInit(ScreenPtr);
|
extern _X_EXPORT int XvScreenInit(ScreenPtr);
|
||||||
|
|
|
@ -142,7 +142,6 @@ static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
|
||||||
static Bool CreateResourceTypes(void);
|
static Bool CreateResourceTypes(void);
|
||||||
|
|
||||||
static void XvScreenClose(ScreenPtr, void *arg);
|
static void XvScreenClose(ScreenPtr, void *arg);
|
||||||
static Bool XvDestroyPixmap(PixmapPtr);
|
|
||||||
static void XvResetProc(ExtensionEntry *);
|
static void XvResetProc(ExtensionEntry *);
|
||||||
static int XvdiDestroyGrab(void *, XID);
|
static int XvdiDestroyGrab(void *, XID);
|
||||||
static int XvdiDestroyEncoding(void *, XID);
|
static int XvdiDestroyEncoding(void *, XID);
|
||||||
|
@ -262,6 +261,11 @@ static void XvWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg)
|
||||||
XvStopAdaptors(&pWin->drawable);
|
XvStopAdaptors(&pWin->drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void XvPixmapDestroy(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
|
||||||
|
{
|
||||||
|
XvStopAdaptors(&pPixmap->drawable);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
XvScreenInit(ScreenPtr pScreen)
|
XvScreenInit(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
@ -295,12 +299,9 @@ XvScreenInit(ScreenPtr pScreen)
|
||||||
|
|
||||||
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
|
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
|
||||||
|
|
||||||
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
|
|
||||||
|
|
||||||
dixScreenHookWindowDestroy(pScreen, XvWindowDestroy, NULL);
|
dixScreenHookWindowDestroy(pScreen, XvWindowDestroy, NULL);
|
||||||
dixScreenHookClose(pScreen, XvScreenClose, NULL);
|
dixScreenHookClose(pScreen, XvScreenClose, NULL);
|
||||||
|
dixScreenHookPixmapDestroy(pScreen, XvPixmapDestroy, NULL);
|
||||||
pScreen->DestroyPixmap = XvDestroyPixmap;
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -313,8 +314,7 @@ static void XvScreenClose(ScreenPtr pScreen, void *arg)
|
||||||
|
|
||||||
dixScreenUnhookWindowDestroy(pScreen, XvWindowDestroy, NULL);
|
dixScreenUnhookWindowDestroy(pScreen, XvWindowDestroy, NULL);
|
||||||
dixScreenUnhookClose(pScreen, XvScreenClose, NULL);
|
dixScreenUnhookClose(pScreen, XvScreenClose, NULL);
|
||||||
|
dixScreenUnhookPixmapDestroy(pScreen, XvPixmapDestroy, NULL);
|
||||||
pScreen->DestroyPixmap = pxvs->DestroyPixmap;
|
|
||||||
|
|
||||||
free(pxvs);
|
free(pxvs);
|
||||||
|
|
||||||
|
@ -368,25 +368,6 @@ XvStopAdaptors(DrawablePtr pDrawable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
|
||||||
XvDestroyPixmap(PixmapPtr pPix)
|
|
||||||
{
|
|
||||||
ScreenPtr pScreen = pPix->drawable.pScreen;
|
|
||||||
Bool status = TRUE;
|
|
||||||
|
|
||||||
if (pPix->refcnt == 1)
|
|
||||||
XvStopAdaptors(&pPix->drawable);
|
|
||||||
|
|
||||||
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
|
||||||
if (pScreen->DestroyPixmap)
|
|
||||||
status = pScreen->DestroyPixmap(pPix);
|
|
||||||
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
|
|
||||||
|
|
||||||
return status;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
XvdiDestroyPort(void *pPort, XID id)
|
XvdiDestroyPort(void *pPort, XID id)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue