📄 intel_xvmc.c
字号:
Status XvMCSyncSurface(Display *display, XvMCSurface *surface){ Status ret; int stat = 0; if (!display || !surface) return XvMCBadSurface; do { ret = XvMCGetSurfaceStatus(display, surface, &stat); } while (!ret && (stat & XVMC_RENDERING)); return ret;}/* * Function: XvMCFlushSurface * Description: * This function commits pending rendering requests to ensure that they * wll be completed in a finite amount of time. * Arguments: * display - Connection to X server * surface - Surface to flush * Returns: Status */Status XvMCFlushSurface(Display * display, XvMCSurface *surface){ if (!display || !surface) return XvMCBadSurface; return Success;}/* * Function: XvMCGetSurfaceStatus * Description: * Arguments: * display: connection to X server * surface: The surface to query * stat: One of the Following * XVMC_RENDERING - The last XvMCRenderSurface command has not * completed. * XVMC_DISPLAYING - The surface is currently being displayed or a * display is pending. */Status XvMCGetSurfaceStatus(Display *display, XvMCSurface *surface, int *stat){ Status ret; if (!display || !surface || !stat) return XvMCBadSurface; ret = (xvmc_driver->get_surface_status)(display, surface, stat); if (ret) { XVMC_ERR("get surface status fail\n"); return ret; } return Success;}/* * Function: XvMCHideSurface * Description: Stops the display of a surface. * Arguments: * display - Connection to the X server. * surface - surface to be hidden. * * Returns: Status */Status XvMCHideSurface(Display *display, XvMCSurface *surface){ int stat = 0; Status ret; if (!display || !surface) return XvMCBadSurface; XvMCSyncSurface(display, surface); /* Get the status of the surface, if it is not currently displayed we don't need to worry about it. */ if ((ret = XvMCGetSurfaceStatus(display, surface, &stat)) != Success) return ret; if (!(stat & XVMC_DISPLAYING)) return Success; /* FIXME: */ XVMC_ERR("XvMCHideSurface not implemented!\n"); return BadValue;}/* * Function: XvMCCreateSubpicture * Description: This creates a subpicture by filling out the XvMCSubpicture * structure passed to it and returning Success. * Arguments: * display - Connection to the X server. * context - The context to create the subpicture for. * subpicture - Pre-allocated XvMCSubpicture structure to be filled in. * width - of subpicture * height - of subpicture * xvimage_id - The id describing the XvImage format. * * Returns: Status */Status XvMCCreateSubpicture(Display *display, XvMCContext *context, XvMCSubpicture *subpicture, unsigned short width, unsigned short height, int xvimage_id){ XVMC_ERR("XvMCCreateSubpicture not implemented!\n"); return BadValue;}/* * Function: XvMCClearSubpicture * Description: Clear the area of the given subpicture to "color". * structure passed to it and returning Success. * Arguments: * display - Connection to the X server. * subpicture - Subpicture to clear. * x, y, width, height - rectangle in the subpicture to clear. * color - The data to file the rectangle with. * * Returns: Status */Status XvMCClearSubpicture(Display *display, XvMCSubpicture *subpicture, short x, short y, unsigned short width, unsigned short height, unsigned int color){ XVMC_ERR("XvMCClearSubpicture not implemented!"); return BadValue;}/* * Function: XvMCCompositeSubpicture * Description: Composite the XvImae on the subpicture. This composit uses * non-premultiplied alpha. Destination alpha is utilized * except for with indexed subpictures. Indexed subpictures * use a simple "replace". * Arguments: * display - Connection to the X server. * subpicture - Subpicture to clear. * image - the XvImage to be used as the source of the composite. * srcx, srcy, width, height - The rectangle from the image to be used. * dstx, dsty - location in the subpicture to composite the source. * * Returns: Status */Status XvMCCompositeSubpicture(Display *display, XvMCSubpicture *subpicture, XvImage *image, short srcx, short srcy, unsigned short width, unsigned short height, short dstx, short dsty){ XVMC_ERR("XvMCCompositeSubpicture not implemented!"); return BadValue;}/* * Function: XvMCDestroySubpicture * Description: Destroys the specified subpicture. * Arguments: * display - Connection to the X server. * subpicture - Subpicture to be destroyed. * * Returns: Status */Status XvMCDestroySubpicture(Display *display, XvMCSubpicture *subpicture){ XVMC_ERR("XvMCDestroySubpicture not implemented!"); return BadValue;}/* * Function: XvMCSetSubpicturePalette * Description: Set the subpictures palette * Arguments: * display - Connection to the X server. * subpicture - Subpiture to set palette for. * palette - A pointer to an array holding the palette data. The array * is num_palette_entries * entry_bytes in size. * Returns: Status */Status XvMCSetSubpicturePalette(Display *display, XvMCSubpicture *subpicture, unsigned char *palette){ XVMC_ERR("XvMCSetSubpicturePalette not implemented!"); return BadValue;}/* * Function: XvMCBlendSubpicture * Description: * The behavior of this function is different depending on whether * or not the XVMC_BACKEND_SUBPICTURE flag is set in the XvMCSurfaceInfo. * i915 only support frontend behavior. * * XVMC_BACKEND_SUBPICTURE not set ("frontend" behavior): * * XvMCBlendSubpicture is a no-op in this case. * * Arguments: * display - Connection to the X server. * subpicture - The subpicture to be blended into the video. * target_surface - The surface to be displayed with the blended subpic. * source_surface - Source surface prior to blending. * subx, suby, subw, subh - The rectangle from the subpicture to use. * surfx, surfy, surfw, surfh - The rectangle in the surface to blend * blend the subpicture rectangle into. Scaling can ocure if * XVMC_SUBPICTURE_INDEPENDENT_SCALING is set. * * Returns: Status */Status XvMCBlendSubpicture(Display *display, XvMCSurface *target_surface, XvMCSubpicture *subpicture, short subx, short suby, unsigned short subw, unsigned short subh, short surfx, short surfy, unsigned short surfw, unsigned short surfh){ XVMC_ERR("XvMCBlendSubpicture not implemented!"); return BadValue;}/* * Function: XvMCBlendSubpicture2 * Description: * The behavior of this function is different depending on whether * or not the XVMC_BACKEND_SUBPICTURE flag is set in the XvMCSurfaceInfo. * i915 only supports frontend blending. * * XVMC_BACKEND_SUBPICTURE not set ("frontend" behavior): * * XvMCBlendSubpicture2 blends the source_surface and subpicture and * puts it in the target_surface. This does not effect the status of * the source surface but will cause the target_surface to query * XVMC_RENDERING until the blend is completed. * * Arguments: * display - Connection to the X server. * subpicture - The subpicture to be blended into the video. * target_surface - The surface to be displayed with the blended subpic. * source_surface - Source surface prior to blending. * subx, suby, subw, subh - The rectangle from the subpicture to use. * surfx, surfy, surfw, surfh - The rectangle in the surface to blend * blend the subpicture rectangle into. Scaling can ocure if * XVMC_SUBPICTURE_INDEPENDENT_SCALING is set. * * Returns: Status */Status XvMCBlendSubpicture2(Display *display, XvMCSurface *source_surface, XvMCSurface *target_surface, XvMCSubpicture *subpicture, short subx, short suby, unsigned short subw, unsigned short subh, short surfx, short surfy, unsigned short surfw, unsigned short surfh){ XVMC_ERR("XvMCBlendSubpicture2 not implemented!"); return BadValue;}/* * Function: XvMCSyncSubpicture * Description: This function blocks until all composite/clear requests on * the subpicture have been complete. * Arguments: * display - Connection to the X server. * subpicture - The subpicture to synchronize * * Returns: Status */Status XvMCSyncSubpicture(Display *display, XvMCSubpicture *subpicture){ XVMC_ERR("XvMCSyncSubpicture not implemented!"); return BadValue;}/* * Function: XvMCFlushSubpicture * Description: This function commits pending composite/clear requests to * ensure that they will be completed in a finite amount of * time. * Arguments: * display - Connection to the X server. * subpicture - The subpicture whos compsiting should be flushed * * Returns: Status */Status XvMCFlushSubpicture(Display *display, XvMCSubpicture *subpicture){ XVMC_ERR("XvMCFlushSubpicture not implemented!"); return BadValue;}/* * Function: XvMCGetSubpictureStatus * Description: This function gets the current status of a subpicture * * Arguments: * display - Connection to the X server. * subpicture - The subpicture whos status is being queried * stat - The status of the subpicture. It can be any of the following * OR'd together: * XVMC_RENDERING - Last composite or clear request not completed * XVMC_DISPLAYING - Suppicture currently being displayed. * * Returns: Status */Status XvMCGetSubpictureStatus(Display *display, XvMCSubpicture *subpicture, int *stat){ XVMC_ERR("XvMCGetSubpictureStatus not implemented!"); return BadValue;}/* * Function: XvMCQueryAttributes * Description: An array of XvAttributes of size "number" is returned by * this function. If there are no attributes, NULL is returned and number * is set to 0. The array may be freed with xfree(). * * Arguments: * display - Connection to the X server. * context - The context whos attributes we are querying. * number - The returned number of recognized atoms * * Returns: * An array of XvAttributes. */XvAttribute *XvMCQueryAttributes(Display *display, XvMCContext *context, int *number){ /* now XvMC has no extra attribs than Xv */ *number = 0; return NULL;}/* * Function: XvMCSetAttribute * Description: This function sets a context-specific attribute. * * Arguments: * display - Connection to the X server. * context - The context whos attributes we are querying. * attribute - The X atom of the attribute to be changed. * value - The new value for the attribute. * * Returns: * Status */Status XvMCSetAttribute(Display *display, XvMCContext *context, Atom attribute, int value){ return Success;}/* * Function: XvMCGetAttribute * Description: This function queries a context-specific attribute and * returns the value. * * Arguments: * display - Connection to the X server. * context - The context whos attributes we are querying. * attribute - The X atom of the attribute to be queried * value - The returned attribute value * * Returns: * Status */Status XvMCGetAttribute(Display *display, XvMCContext *context, Atom attribute, int *value){ return Success;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -