17ec681f3Smrg/**************************************************************************
27ec681f3Smrg *
37ec681f3Smrg * Copyright 2009 Younes Manton.
47ec681f3Smrg * All Rights Reserved.
57ec681f3Smrg *
67ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a
77ec681f3Smrg * copy of this software and associated documentation files (the
87ec681f3Smrg * "Software"), to deal in the Software without restriction, including
97ec681f3Smrg * without limitation the rights to use, copy, modify, merge, publish,
107ec681f3Smrg * distribute, sub license, and/or sell copies of the Software, and to
117ec681f3Smrg * permit persons to whom the Software is furnished to do so, subject to
127ec681f3Smrg * the following conditions:
137ec681f3Smrg *
147ec681f3Smrg * The above copyright notice and this permission notice (including the
157ec681f3Smrg * next paragraph) shall be included in all copies or substantial portions
167ec681f3Smrg * of the Software.
177ec681f3Smrg *
187ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
197ec681f3Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
207ec681f3Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
217ec681f3Smrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
227ec681f3Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
237ec681f3Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
247ec681f3Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
257ec681f3Smrg *
267ec681f3Smrg **************************************************************************/
277ec681f3Smrg
287ec681f3Smrg#ifndef testlib_h
297ec681f3Smrg#define testlib_h
307ec681f3Smrg
317ec681f3Smrg/*
327ec681f3Smrg#define TEST(pred, doc)	test(pred, #pred, doc, __FILE__, __LINE__)
337ec681f3Smrg
347ec681f3Smrgvoid test(int pred, const char *pred_string, const char *doc_string, const char *file, unsigned int line);
357ec681f3Smrg*/
367ec681f3Smrg
377ec681f3Smrg#include <sys/time.h>
387ec681f3Smrg#include <X11/Xlib.h>
397ec681f3Smrg#include <X11/extensions/XvMClib.h>
407ec681f3Smrg
417ec681f3Smrg/*
427ec681f3Smrg * display: IN			A valid X display
437ec681f3Smrg * width, height: IN		Surface size that the port must display
447ec681f3Smrg * chroma_format: IN		Chroma format that the port must display
457ec681f3Smrg * mc_types, num_mc_types: IN	List of MC types that the port must support, first port that matches the first mc_type will be returned
467ec681f3Smrg * port_id: OUT			Your port's ID
477ec681f3Smrg * surface_type_id: OUT		Your port's surface ID
487ec681f3Smrg * is_overlay: OUT		If 1, port uses overlay surfaces, you need to set a colorkey
497ec681f3Smrg * intra_unsigned: OUT		If 1, port uses unsigned values for intra-coded blocks
507ec681f3Smrg */
517ec681f3Smrgint GetPort
527ec681f3Smrg(
537ec681f3Smrg	Display *display,
547ec681f3Smrg	unsigned int width,
557ec681f3Smrg	unsigned int height,
567ec681f3Smrg	unsigned int chroma_format,
577ec681f3Smrg	const unsigned int *mc_types,
587ec681f3Smrg	unsigned int num_mc_types,
597ec681f3Smrg	XvPortID *port_id,
607ec681f3Smrg	int *surface_type_id,
617ec681f3Smrg	unsigned int *is_overlay,
627ec681f3Smrg	unsigned int *intra_unsigned
637ec681f3Smrg);
647ec681f3Smrg
657ec681f3Smrgunsigned int align(unsigned int value, unsigned int alignment);
667ec681f3Smrg
677ec681f3Smrgint timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y);
687ec681f3Smrg
697ec681f3Smrg#endif
70