f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Copyright (c) 2001 by The XFree86 Project, Inc.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * copy of this software and associated documentation files (the "Software"),
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * to deal in the Software without restriction, including without limitation
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * and/or sell copies of the Software, and to permit persons to whom the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Software is furnished to do so, subject to the following conditions:
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The above copyright notice and this permission notice shall be included in
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * all copies or substantial portions of the Software.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * OTHER DEALINGS IN THE SOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Except as contained in this notice, the name of the copyright holder(s)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * and author(s) shall not be used in advertising or otherwise to promote
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the sale, use or other dealings in this Software without prior written
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * authorization from the copyright holder(s) and author(s).
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifndef _XF86XVMC_H
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define _XF86XVMC_H
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "xvmcext.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "xf86xv.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int num_xvimages;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *xvimage_ids; /* reference the subpictures in the XF86MCAdaptorRec */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} XF86MCImageIDList;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int surface_type_id; /* Driver generated. Must be unique on the port */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int chroma_format;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int color_description; /* no longer used */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short max_width;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short max_height;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short subpicture_max_width;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short subpicture_max_height;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int mc_type;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int flags;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XF86MCImageIDList *compatible_subpictures; /* can be null, if none */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} XF86MCSurfaceInfoRec, *XF86MCSurfaceInfoPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateContextProc
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DIX will fill everything out in the context except the driver_priv.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync The port_priv holds the private data specified for the port when
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Xv was initialized by the driver.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync The driver may store whatever it wants in driver_priv and edit
f78b12e570284aa8291f4ca1add24937fd107403vboxsync the width, height and flags. If the driver wants to return something
f78b12e570284aa8291f4ca1add24937fd107403vboxsync to the client it can allocate space in priv and specify the number
f78b12e570284aa8291f4ca1add24937fd107403vboxsync of 32 bit words in num_priv. This must be dynamically allocated
f78b12e570284aa8291f4ca1add24937fd107403vboxsync space because DIX will free it after it passes it to the client.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*xf86XvMCCreateContextProcPtr) (
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScrnInfoPtr pScrn,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XvMCContextPtr context,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *num_priv,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 **priv
f78b12e570284aa8291f4ca1add24937fd107403vboxsync);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*xf86XvMCDestroyContextProcPtr) (
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScrnInfoPtr pScrn,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XvMCContextPtr context
f78b12e570284aa8291f4ca1add24937fd107403vboxsync);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateSurfaceProc
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DIX will fill everything out in the surface except the driver_priv.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync The driver may store whatever it wants in driver_priv. The driver
f78b12e570284aa8291f4ca1add24937fd107403vboxsync may pass data back to the client in the same manner as the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateContextProc.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*xf86XvMCCreateSurfaceProcPtr) (
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScrnInfoPtr pScrn,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XvMCSurfacePtr surface,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *num_priv,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 **priv
f78b12e570284aa8291f4ca1add24937fd107403vboxsync);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*xf86XvMCDestroySurfaceProcPtr) (
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScrnInfoPtr pScrn,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XvMCSurfacePtr surface
f78b12e570284aa8291f4ca1add24937fd107403vboxsync);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateSubpictureProc
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DIX will fill everything out in the subpicture except the driver_priv,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync num_palette_entries, entry_bytes and component_order. The driver may
f78b12e570284aa8291f4ca1add24937fd107403vboxsync store whatever it wants in driver_priv and edit the width and height.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync If it is a paletted subpicture the driver needs to fill out the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync num_palette_entries, entry_bytes and component_order. These are
f78b12e570284aa8291f4ca1add24937fd107403vboxsync not communicated to the client until the time the surface is
f78b12e570284aa8291f4ca1add24937fd107403vboxsync created.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync The driver may pass data back to the client in the same manner as the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateContextProc.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*xf86XvMCCreateSubpictureProcPtr) (
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScrnInfoPtr pScrn,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XvMCSubpicturePtr subpicture,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *num_priv,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 **priv
f78b12e570284aa8291f4ca1add24937fd107403vboxsync);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*xf86XvMCDestroySubpictureProcPtr) (
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScrnInfoPtr pScrn,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XvMCSubpicturePtr subpicture
f78b12e570284aa8291f4ca1add24937fd107403vboxsync);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync char *name;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int num_surfaces;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XF86MCSurfaceInfoPtr *surfaces;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int num_subpictures;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XF86ImagePtr *subpictures;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateContextProcPtr CreateContext;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCDestroyContextProcPtr DestroyContext;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateSurfaceProcPtr CreateSurface;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCDestroySurfaceProcPtr DestroySurface;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCCreateSubpictureProcPtr CreateSubpicture;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCDestroySubpictureProcPtr DestroySubpicture;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} XF86MCAdaptorRec, *XF86MCAdaptorPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xf86XvMCScreenInit
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Unlike Xv, the adaptor data is not copied from this structure.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync This structure's data is used so it must stick around for the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync life of the server. Note that it's an array of pointers not
f78b12e570284aa8291f4ca1add24937fd107403vboxsync an array of structures.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool xf86XvMCScreenInit(
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScreenPtr pScreen,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int num_adaptors,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XF86MCAdaptorPtr *adaptors
f78b12e570284aa8291f4ca1add24937fd107403vboxsync);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*XvMCScreenInitProcPtr)(ScreenPtr, int, XvMCAdaptorPtr);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT XvMCScreenInitProcPtr XvMCScreenInitProc;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* _XF86XVMC_H */