void xorg_xvmc_init(ScreenPtr pScreen, char *name) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XF86MCAdaptorPtr adaptorXvMC = xf86XvMCCreateAdaptorRec(); if (!adaptorXvMC) return; *adaptorXvMC = adaptor_template; adaptorXvMC->name = name; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Associated with %s.\n", name); if (!xf86XvMCScreenInit(pScreen, 1, &adaptorXvMC)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] Failed to initialize extension.\n"); else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Extension initialized.\n"); xf86XvMCDestroyAdaptorRec(adaptorXvMC); }
XF86MCAdaptorPtr vlCreateAdaptorXvMC(ScreenPtr pScreen, char *xv_adaptor_name) { XF86MCAdaptorPtr adaptor; ScrnInfoPtr pScrn; assert(pScreen); assert(xv_adaptor_name); pScrn = xf86Screens[pScreen->myNum]; adaptor = xf86XvMCCreateAdaptorRec(); if (!adaptor) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] Memory allocation failed.\n"); return NULL; } *adaptor = adaptor_template; adaptor->name = xv_adaptor_name; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Associated with %s.\n", xv_adaptor_name); return adaptor; }