1 #include "xorg_tracker.h"
6 #include <X11/extensions/Xv.h>
7 #include <X11/extensions/XvMC.h>
10 #define FOURCC_RGB 0x0000003
17 'R', 'G', 'B', 0x00, \
18 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 \
23 24, 0x00FF0000, 0x0000FF00, 0x000000FF, \
29 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
34 static int subpicture_index_list
[] = {
40 static XF86MCImageIDList subpicture_list
=
42 sizeof(subpicture_index_list
)/sizeof(*subpicture_index_list
),
46 static XF86MCSurfaceInfoRec yv12_mpeg2_surface
=
49 XVMC_CHROMA_FORMAT_420
,
51 2048, 2048, 2048, 2048,
52 XVMC_IDCT
| XVMC_MPEG_2
,
53 XVMC_SUBPICTURE_INDEPENDENT_SCALING
| XVMC_BACKEND_SUBPICTURE
,
57 static const XF86MCSurfaceInfoRec uyvy_mpeg2_surface
=
60 XVMC_CHROMA_FORMAT_422
,
62 2048, 2048, 2048, 2048,
63 XVMC_IDCT
| XVMC_MPEG_2
,
64 XVMC_SUBPICTURE_INDEPENDENT_SCALING
| XVMC_BACKEND_SUBPICTURE
,
68 static XF86MCSurfaceInfoPtr surfaces
[] =
70 (XF86MCSurfaceInfoPtr
)&yv12_mpeg2_surface
,
71 (XF86MCSurfaceInfoPtr
)&uyvy_mpeg2_surface
74 static const XF86ImageRec rgb_subpicture
= XVIMAGE_RGB
;
75 static const XF86ImageRec ia44_subpicture
= XVIMAGE_IA44
;
76 static const XF86ImageRec ai44_subpicture
= XVIMAGE_AI44
;
78 static XF86ImagePtr subpictures
[] =
80 (XF86ImagePtr
)&rgb_subpicture
,
81 (XF86ImagePtr
)&ia44_subpicture
,
82 (XF86ImagePtr
)&ai44_subpicture
85 static const XF86MCAdaptorRec adaptor_template
=
88 sizeof(surfaces
)/sizeof(*surfaces
),
90 sizeof(subpictures
)/sizeof(*subpictures
),
92 (xf86XvMCCreateContextProcPtr
)NULL
,
93 (xf86XvMCDestroyContextProcPtr
)NULL
,
94 (xf86XvMCCreateSurfaceProcPtr
)NULL
,
95 (xf86XvMCDestroySurfaceProcPtr
)NULL
,
96 (xf86XvMCCreateSubpictureProcPtr
)NULL
,
97 (xf86XvMCDestroySubpictureProcPtr
)NULL
101 xorg_xvmc_init(ScreenPtr pScreen
, char *name
)
103 ScrnInfoPtr pScrn
= xf86Screens
[pScreen
->myNum
];
104 XF86MCAdaptorPtr adaptorXvMC
= xf86XvMCCreateAdaptorRec();
108 *adaptorXvMC
= adaptor_template
;
109 adaptorXvMC
->name
= name
;
110 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
111 "[XvMC] Associated with %s.\n", name
);
112 if (!xf86XvMCScreenInit(pScreen
, 1, &adaptorXvMC
))
113 xf86DrvMsg(pScrn
->scrnIndex
, X_ERROR
,
114 "[XvMC] Failed to initialize extension.\n");
116 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
117 "[XvMC] Extension initialized.\n");
118 xf86XvMCDestroyAdaptorRec(adaptorXvMC
);