Enable encoders 2.0alpha-wayland accepted/2.0alpha-wayland/20130506.171502 submit/2.0alpha-wayland/20130506.082856
authorZhao Halley <halley.zhao@intel.com>
Mon, 6 May 2013 07:19:21 +0000 (15:19 +0800)
committerZhao Halley <halley.zhao@intel.com>
Mon, 6 May 2013 08:27:46 +0000 (16:27 +0800)
remove X dependency in encoder and refine its display creation

gst-libs/gst/vaapi/gstvaapibaseencoder.c
gst-libs/gst/vaapi/gstvaapiencoder.c
gst-libs/gst/vaapi/gstvaapiencoder_h264.c
gst/vaapi/gstvaapiencode.c
packaging/gstreamer-vaapi.spec

index 9ea0502..f117980 100644 (file)
 #include <glib.h>
 #include <glib-object.h>
 
-#include <X11/Xlib.h>
 
 #include <va/va.h>
-#include "va/va_x11.h"
 
 #include "gst/gstclock.h"
 #include "gst/gstvalue.h"
index af2dd76..daddb25 100644 (file)
  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  *  Boston, MA 02110-1301 USA
  */
-
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 #include "gstvaapiencoder.h"
 
 #include <string.h>
-
+#if USE_X11
 #include "gstvaapidisplay_x11.h"
+#elif USE_WAYLAND
+#include "gstvaapidisplay_wayland.h"
+#elif USE_GLX
+#include "gstvaapidisplay_glx.h"
+#elif USE_DRM
+#include "gstvaapidisplay_drm.h"
+#else
+#error("undefined display type")
+#endif
 #include "gstvaapiobject_priv.h"
 #include "gstvaapidisplay_priv.h"
 
@@ -100,7 +111,18 @@ gst_vaapi_encoder_initialize(GstVaapiEncoder* encoder)
 
   /* create va_dpy*/
   if (!priv->display) {
+#if USE_X11
     priv->display = gst_vaapi_display_x11_new(NULL);
+#elif USE_WAYLAND
+    priv->display = gst_vaapi_display_wayland_new(NULL);
+#elif USE_GLX
+    priv->display = gst_vaapi_display_glx_new(NULL);
+#elif USE_DRM
+    priv->display = gst_vaapi_display_drm_new(NULL);
+#else
+    // error here:
+    priv->display = NULL;
+#endif
     ENCODER_CHECK_STATUS(priv->display,
                          ENCODER_DISPLAY_ERR,
                          "gst_vaapi_display_x11_new failed.");
index 0ff96d7..bff2ec0 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 #include <va/va.h>
-#include <va/va_x11.h>
 #if !HAVE_OLD_H264_ENCODER
 #include <va/va_enc_h264.h>
 #endif
-#include <X11/Xlib.h>
 #include <glib.h>
 
 #include "gst/gstclock.h"
index ae72fe0..286386d 100644 (file)
@@ -23,7 +23,6 @@
 #include "gstvaapiencode.h"
 
 #include <string.h>
-#include <X11/Xlib.h>
 #include <gst/video/videocontext.h>
 #include "gst/vaapi/gstvaapibaseencoder.h"
 
index 3e77d65..66eb7c2 100755 (executable)
@@ -41,7 +41,7 @@ developing applications that use %{name}.
 %build
 cp %{SOURCE1001} .
 
-%autogen --disable-jpeg --disable-mpeg4
+%autogen --disable-jpeg --disable-mpeg4 --enable-encoders
 make %{?_smp_mflags}
 
 %install