diff options
author | Younes Manton <[email protected]> | 2009-09-27 20:18:02 -0400 |
---|---|---|
committer | Younes Manton <[email protected]> | 2009-09-27 20:18:02 -0400 |
commit | e44c85637a3298918e292e9ddba812856cf92924 (patch) | |
tree | 25e881754374bebd8123fa51d889c070489a3320 /src/xvmc/tests | |
parent | f547472bfa0a797adacc2a7688b4c1ba65381a80 (diff) |
g3dvl: Implement XvMC using pipe_video_context.
Diffstat (limited to 'src/xvmc/tests')
-rw-r--r-- | src/xvmc/tests/Makefile | 23 | ||||
-rw-r--r-- | src/xvmc/tests/test_rendering.c | 3 | ||||
-rw-r--r-- | src/xvmc/tests/test_surface.c | 19 | ||||
-rw-r--r-- | src/xvmc/tests/xvmc_bench.c | 2 |
4 files changed, 26 insertions, 21 deletions
diff --git a/src/xvmc/tests/Makefile b/src/xvmc/tests/Makefile index de095161d29..11b2e1a812b 100644 --- a/src/xvmc/tests/Makefile +++ b/src/xvmc/tests/Makefile @@ -1,27 +1,28 @@ -CFLAGS += -g -Wall -LDFLAGS += -LIBS += -lXvMCW -lXvMC -lXv +TOP = ../../.. +include $(TOP)/configs/current + +LIBS = -lXvMCW -lXvMC -lXv -lX11 ############################################# -.PHONY = all clean +.PHONY: default clean -all: test_context test_surface test_blocks test_rendering xvmc_bench +default: test_context test_surface test_blocks test_rendering xvmc_bench test_context: test_context.o testlib.o - $(CC) ${LDFLAGS} -o $@ $^ ${LIBS} + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) test_surface: test_surface.o testlib.o - $(CC) ${LDFLAGS} -o $@ $^ ${LIBS} + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) test_blocks: test_blocks.o testlib.o - $(CC) ${LDFLAGS} -o $@ $^ ${LIBS} + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) test_rendering: test_rendering.o testlib.o - $(CC) ${LDFLAGS} -o $@ $^ ${LIBS} + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) xvmc_bench: xvmc_bench.o testlib.o - $(CC) ${LDFLAGS} -o $@ $^ ${LIBS} + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) clean: - rm -rf *.o test_context test_surface test_blocks test_rendering xvmc_bench + $(RM) -rf *.o test_context test_surface test_blocks test_rendering xvmc_bench diff --git a/src/xvmc/tests/test_rendering.c b/src/xvmc/tests/test_rendering.c index 1e7467a3aa6..6d720dfcdca 100644 --- a/src/xvmc/tests/test_rendering.c +++ b/src/xvmc/tests/test_rendering.c @@ -23,6 +23,9 @@ #define DEFAULT_OUTPUT_HEIGHT INPUT_HEIGHT #define DEFAULT_ACCEPTABLE_ERR 0.01 +void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *output_height, double *acceptable_error, int *prompt); +void Gradient(short *block, unsigned int start, unsigned int stop, int horizontal); + void ParseArgs(int argc, char **argv, unsigned int *output_width, unsigned int *output_height, double *acceptable_error, int *prompt) { int fail = 0; diff --git a/src/xvmc/tests/test_surface.c b/src/xvmc/tests/test_surface.c index 25ebdcc4fcf..06948201ac9 100644 --- a/src/xvmc/tests/test_surface.c +++ b/src/xvmc/tests/test_surface.c @@ -6,7 +6,7 @@ int main(int argc, char **argv) { const unsigned int width = 16, height = 16; const unsigned int mc_types[2] = {XVMC_MOCOMP | XVMC_MPEG_2, XVMC_IDCT | XVMC_MPEG_2}; - + Display *display; XvPortID port_num; int surface_type_id; @@ -14,9 +14,9 @@ int main(int argc, char **argv) int colorkey; XvMCContext context; XvMCSurface surface = {0}; - + display = XOpenDisplay(NULL); - + if (!GetPort ( display, @@ -34,15 +34,15 @@ int main(int argc, char **argv) XCloseDisplay(display); error(1, 0, "Error, unable to find a good port.\n"); } - + if (is_overlay) { Atom xv_colorkey = XInternAtom(display, "XV_COLORKEY", 0); XvGetPortAttribute(display, port_num, xv_colorkey, &colorkey); } - + assert(XvMCCreateContext(display, port_num, surface_type_id, width, height, XVMC_DIRECT, &context) == Success); - + /* Test NULL context */ assert(XvMCCreateSurface(display, NULL, &surface) == XvMCBadContext); /* Test NULL surface */ @@ -61,12 +61,11 @@ int main(int argc, char **argv) assert(XvMCDestroySurface(display, &surface) == Success); /* Test NULL surface */ assert(XvMCDestroySurface(display, NULL) == XvMCBadSurface); - + assert(XvMCDestroyContext(display, &context) == Success); - + XvUngrabPort(display, port_num, CurrentTime); XCloseDisplay(display); - + return 0; } - diff --git a/src/xvmc/tests/xvmc_bench.c b/src/xvmc/tests/xvmc_bench.c index d5a39ecf17d..97adcfc58a8 100644 --- a/src/xvmc/tests/xvmc_bench.c +++ b/src/xvmc/tests/xvmc_bench.c @@ -32,6 +32,8 @@ struct Config unsigned int reps; }; +void ParseArgs(int argc, char **argv, struct Config *config); + void ParseArgs(int argc, char **argv, struct Config *config) { int fail = 0; |