bin_PROGRAMS = h264encode avcenc
-INCLUDES = -I$(top_srcdir)
+libva_helpers = \
+ $(top_builddir)/test/common/libva-display.la \
+ $(NULL)
-TEST_LIBS = $(top_builddir)/va/$(libvabackendlib) $(top_builddir)/va/$(libvacorelib) -lpthread -lX11
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/test/common \
+ $(NULL)
+
+TEST_LIBS = \
+ $(top_builddir)/va/$(libvabackendlib) \
+ $(top_builddir)/va/$(libvacorelib) \
+ $(libva_helpers) \
+ $(NULL)
h264encode_LDADD = $(TEST_LIBS)
h264encode_SOURCES = h264encode_x11.c
-avcenc_LDADD= $(TEST_LIBS)
-avcenc_SOURCES= avcenc.c
+avcenc_LDADD = $(TEST_LIBS)
+avcenc_SOURCES = avcenc.c
+avcenc_DEPENDENCIES = $(libva_helpers)
EXTRA_DIST = h264encode_common.c
* ./avcenc <width> <height> <input file> <output file> [qp]
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
-#include <X11/Xlib.h>
-
#include <unistd.h>
#include <sys/types.h>
#include <time.h>
#include <va/va.h>
-#include <va/va_x11.h>
+#include "va_display.h"
#define NAL_REF_IDC_NONE 0
#define NAL_REF_IDC_LOW 1
exit(1); \
}
-static Display *x11_display;
static VADisplay va_dpy;
static VAContextID context_id;
static VAConfigID config_id;
int major_ver, minor_ver;
VAStatus va_status;
- x11_display = XOpenDisplay(":0.0");
- assert(x11_display);
-
- va_dpy = vaGetDisplay(x11_display);
+ va_dpy = va_open_display();
va_status = vaInitialize(va_dpy, &major_ver, &minor_ver);
CHECK_VASTATUS(va_status, "vaInitialize");
vaDestroyContext(va_dpy,context_id);
vaDestroyConfig(va_dpy,config_id);
vaTerminate(va_dpy);
- XCloseDisplay(x11_display);
+ va_close_display(va_dpy);
}
/***************************************************