5 int main(int argc
, char **argv
)
7 const unsigned int width
= 16, height
= 16;
8 const unsigned int mc_types
[2] = {XVMC_MOCOMP
| XVMC_MPEG_2
, XVMC_IDCT
| XVMC_MPEG_2
};
13 unsigned int is_overlay
, intra_unsigned
;
16 XvMCSurface surface
= {0};
18 display
= XOpenDisplay(NULL
);
25 XVMC_CHROMA_FORMAT_420
,
34 XCloseDisplay(display
);
35 error(1, 0, "Error, unable to find a good port.\n");
40 Atom xv_colorkey
= XInternAtom(display
, "XV_COLORKEY", 0);
41 XvGetPortAttribute(display
, port_num
, xv_colorkey
, &colorkey
);
44 assert(XvMCCreateContext(display
, port_num
, surface_type_id
, width
, height
, XVMC_DIRECT
, &context
) == Success
);
46 /* Test NULL context */
47 assert(XvMCCreateSurface(display
, NULL
, &surface
) == XvMCBadContext
);
48 /* Test NULL surface */
49 assert(XvMCCreateSurface(display
, &context
, NULL
) == XvMCBadSurface
);
50 /* Test valid params */
51 assert(XvMCCreateSurface(display
, &context
, &surface
) == Success
);
52 /* Test surface id assigned */
53 assert(surface
.surface_id
!= 0);
54 /* Test context id assigned and correct */
55 assert(surface
.context_id
== context
.context_id
);
56 /* Test surface type id assigned and correct */
57 assert(surface
.surface_type_id
== surface_type_id
);
58 /* Test width & height assigned and correct */
59 assert(surface
.width
== width
&& surface
.height
== height
);
60 /* Test valid params */
61 assert(XvMCDestroySurface(display
, &surface
) == Success
);
62 /* Test NULL surface */
63 assert(XvMCDestroySurface(display
, NULL
) == XvMCBadSurface
);
65 assert(XvMCDestroyContext(display
, &context
) == Success
);
67 XvUngrabPort(display
, port_num
, CurrentTime
);
68 XCloseDisplay(display
);