105b261ecSmrg
205b261ecSmrg#ifndef _XVMC_H
305b261ecSmrg#define _XVMC_H
405b261ecSmrg#include <X11/extensions/Xv.h>
505b261ecSmrg#include "xvdix.h"
605b261ecSmrg
705b261ecSmrgtypedef struct {
835c4bbdfSmrg    int num_xvimages;
935c4bbdfSmrg    int *xvimage_ids;
1005b261ecSmrg} XvMCImageIDList;
1105b261ecSmrg
1205b261ecSmrgtypedef struct {
1335c4bbdfSmrg    int surface_type_id;
1435c4bbdfSmrg    int chroma_format;
1535c4bbdfSmrg    int color_description;
1635c4bbdfSmrg    unsigned short max_width;
1735c4bbdfSmrg    unsigned short max_height;
1835c4bbdfSmrg    unsigned short subpicture_max_width;
1935c4bbdfSmrg    unsigned short subpicture_max_height;
2035c4bbdfSmrg    int mc_type;
2135c4bbdfSmrg    int flags;
2235c4bbdfSmrg    XvMCImageIDList *compatible_subpictures;
2305b261ecSmrg} XvMCSurfaceInfoRec, *XvMCSurfaceInfoPtr;
2405b261ecSmrg
2505b261ecSmrgtypedef struct {
2635c4bbdfSmrg    XID context_id;
2735c4bbdfSmrg    ScreenPtr pScreen;
2835c4bbdfSmrg    int adapt_num;
2935c4bbdfSmrg    int surface_type_id;
3035c4bbdfSmrg    unsigned short width;
3135c4bbdfSmrg    unsigned short height;
3235c4bbdfSmrg    CARD32 flags;
3335c4bbdfSmrg    int refcnt;
3435c4bbdfSmrg    void *port_priv;
3535c4bbdfSmrg    void *driver_priv;
3605b261ecSmrg} XvMCContextRec, *XvMCContextPtr;
3705b261ecSmrg
3805b261ecSmrgtypedef struct {
3935c4bbdfSmrg    XID surface_id;
4035c4bbdfSmrg    int surface_type_id;
4135c4bbdfSmrg    XvMCContextPtr context;
4235c4bbdfSmrg    void *driver_priv;
4305b261ecSmrg} XvMCSurfaceRec, *XvMCSurfacePtr;
4405b261ecSmrg
4505b261ecSmrgtypedef struct {
4635c4bbdfSmrg    XID subpicture_id;
4735c4bbdfSmrg    int xvimage_id;
4835c4bbdfSmrg    unsigned short width;
4935c4bbdfSmrg    unsigned short height;
5035c4bbdfSmrg    int num_palette_entries;
5135c4bbdfSmrg    int entry_bytes;
5235c4bbdfSmrg    char component_order[4];
5335c4bbdfSmrg    XvMCContextPtr context;
5435c4bbdfSmrg    void *driver_priv;
5505b261ecSmrg} XvMCSubpictureRec, *XvMCSubpicturePtr;
5605b261ecSmrg
5735c4bbdfSmrgtypedef int (*XvMCCreateContextProcPtr) (XvPortPtr port,
5835c4bbdfSmrg                                         XvMCContextPtr context,
5935c4bbdfSmrg                                         int *num_priv, CARD32 **priv);
6005b261ecSmrg
6135c4bbdfSmrgtypedef void (*XvMCDestroyContextProcPtr) (XvMCContextPtr context);
6205b261ecSmrg
6335c4bbdfSmrgtypedef int (*XvMCCreateSurfaceProcPtr) (XvMCSurfacePtr surface,
6435c4bbdfSmrg                                         int *num_priv, CARD32 **priv);
6505b261ecSmrg
6635c4bbdfSmrgtypedef void (*XvMCDestroySurfaceProcPtr) (XvMCSurfacePtr surface);
6705b261ecSmrg
6835c4bbdfSmrgtypedef int (*XvMCCreateSubpictureProcPtr) (XvMCSubpicturePtr subpicture,
6935c4bbdfSmrg                                            int *num_priv, CARD32 **priv);
7005b261ecSmrg
7135c4bbdfSmrgtypedef void (*XvMCDestroySubpictureProcPtr) (XvMCSubpicturePtr subpicture);
7205b261ecSmrg
7305b261ecSmrgtypedef struct {
7435c4bbdfSmrg    XvAdaptorPtr xv_adaptor;
7535c4bbdfSmrg    int num_surfaces;
7635c4bbdfSmrg    XvMCSurfaceInfoPtr *surfaces;
7735c4bbdfSmrg    int num_subpictures;
7835c4bbdfSmrg    XvImagePtr *subpictures;
7935c4bbdfSmrg    XvMCCreateContextProcPtr CreateContext;
8035c4bbdfSmrg    XvMCDestroyContextProcPtr DestroyContext;
8135c4bbdfSmrg    XvMCCreateSurfaceProcPtr CreateSurface;
8235c4bbdfSmrg    XvMCDestroySurfaceProcPtr DestroySurface;
8335c4bbdfSmrg    XvMCCreateSubpictureProcPtr CreateSubpicture;
8435c4bbdfSmrg    XvMCDestroySubpictureProcPtr DestroySubpicture;
8505b261ecSmrg} XvMCAdaptorRec, *XvMCAdaptorPtr;
8605b261ecSmrg
8735c4bbdfSmrgextern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
8805b261ecSmrg
896747b715Smrgextern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
9035c4bbdfSmrg                                    int num, XvMCAdaptorPtr adapt);
9105b261ecSmrg
926747b715Smrgextern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
9305b261ecSmrg
9435c4bbdfSmrgextern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name,
9535c4bbdfSmrg                                            const char *busID, int major, int minor,
9635c4bbdfSmrg                                            int patchLevel);
9705b261ecSmrg
9835c4bbdfSmrg#endif                          /* _XVMC_H */
99