gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r12191: add patches to vaapi support


From: rsavoye
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12191: add patches to vaapi support.
Date: Wed, 19 May 2010 13:02:36 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12191
author: Gwenole Beauchesne <address@hidden>
committer: rsavoye <address@hidden>
branch nick: trunk
timestamp: Wed 2010-05-19 13:02:36 -0500
message:
  add patches to vaapi support.
modified:
  configure.ac
  gui/Makefile.am
  gui/gtk.cpp
  gui/gtk_canvas.cpp
  libvaapi/VaapiContext.cpp
  macros/ffmpeg.m4
=== modified file 'configure.ac'
--- a/configure.ac      2010-05-07 14:20:44 +0000
+++ b/configure.ac      2010-05-19 18:02:36 +0000
@@ -2030,8 +2030,8 @@
 
 AM_CONDITIONAL(HAVE_GLIB, [ test x"${has_glib}" = xyes ])
 
-if test x$build_gtk = xno -o x$build_kde4 = xno; then
-  if test x$npapi = xyes; then
+if test x$npapi = xyes; then
+  if ! test x$build_gtk = xyes -o x$build_kde4 = xyes; then
     AC_MSG_WARN(["Enabled NPAPI plugin, but it's not supported by the selected 
GUI"])
   fi
 fi

=== modified file 'gui/Makefile.am'
--- a/gui/Makefile.am   2010-05-04 13:50:10 +0000
+++ b/gui/Makefile.am   2010-05-19 18:02:36 +0000
@@ -102,8 +102,8 @@
        $(JPEG_LIBS) \
        $(PNG_LIBS) \
        $(LIRC_LIBS) \
+       $(MYSQL_LIBS) \
        $(INTLLIB) \
-       $(MYSQL_LIBS) \
        $(BOOST_LIBS) \
        $(PTHREAD_LIBS) \
        $(NULL)

=== modified file 'gui/gtk.cpp'
--- a/gui/gtk.cpp       2010-05-04 15:22:59 +0000
+++ b/gui/gtk.cpp       2010-05-19 18:02:36 +0000
@@ -37,14 +37,13 @@
 #include "gnash.h" // Quality
 
 #include <iostream>
+
 #ifdef HAVE_VA_VA_H
-#include "va/va.h"
-#include "va/va_backend.h"
+#include <va/va.h>
 #include "vaapi_utils.h"
 #endif
-
 #ifdef HAVE_VA_VA_X11_H
-#include "va/va_x11.h"
+#include <va/va_x11.h>
 #endif
 
 #ifdef HAVE_X11
@@ -259,23 +258,6 @@
         }
     }
 
-#ifdef HAVE_VA_VA_X11_H
-    if (hwaccel == "vaapi") {
-        char *driver_name;
-        struct VADisplayContext *pDisplayContext = (struct VADisplayContext 
*)vaGetDisplay(GDK_DISPLAY());
-        
-        if (pDisplayContext->vaGetDriverName(pDisplayContext, &driver_name) == 
0) {
-            if ((strcmp(driver_name, "nvidia" ) == 0) || (strcmp(driver_name, 
"vdpau" ) == 0) || (strcmp(driver_name, "s3g" ) == 0)) {
-                log_debug("Found supported vaapi driver for %s", driver_name);
-            } else {
-                log_error("No vaapi driver found for %s!", driver_name);
-            }
-        } else {
-            log_error("Couldn't get the VAAPI driver name!");
-        }
-    }
-#endif
-
 #ifdef BUILD_CANVAS
     _canvas = gnash_canvas_new();
     gnash_canvas_setup(GNASH_CANVAS(_canvas), hwaccel, renderer, argc, argv);

=== modified file 'gui/gtk_canvas.cpp'
--- a/gui/gtk_canvas.cpp        2010-04-04 22:55:35 +0000
+++ b/gui/gtk_canvas.cpp        2010-05-19 18:02:36 +0000
@@ -271,7 +271,7 @@
                 // Set the hardware acclerator to the next one to try
                 // if initializing fails.
                 next_hwaccel = "xv";
-            }
+            } else
 #endif
 #ifdef RENDERER_AGG
 #ifdef HAVE_XV

=== modified file 'libvaapi/VaapiContext.cpp'
--- a/libvaapi/VaapiContext.cpp 2010-05-04 14:21:15 +0000
+++ b/libvaapi/VaapiContext.cpp 2010-05-19 18:02:36 +0000
@@ -33,6 +33,21 @@
 static VaapiCodec get_codec(VAProfile profile)
 {
     GNASH_REPORT_FUNCTION;
+    const char *debug[] = {
+        "VAProfileMPEG2Simple",
+        "VAProfileMPEG2Main"
+        "VAProfileMPEG4Simple",
+        "VAProfileMPEG4AdvancedSimple",
+        "VAProfileMPEG4Main",
+        "VAProfileH264Baseline",
+        "VAProfileH264Main",
+        "VAProfileH264High",
+        "VAProfileVC1Simple",
+        "VAProfileVC1Main",
+        "VAProfileVC1Advanced",
+        "VAProfileUnknown"
+    };
+    log_debug("Video contains %s codec.", debug[profile]);
 
     switch (profile) {
     case VAProfileMPEG2Simple:

=== modified file 'macros/ffmpeg.m4'
--- a/macros/ffmpeg.m4  2010-05-04 20:37:38 +0000
+++ b/macros/ffmpeg.m4  2010-05-19 18:02:36 +0000
@@ -22,7 +22,6 @@
   backupCFLAGS="$CFLAGS"
   avcodec_h=""
   ffmpeg_top_incl=""
-  have_ffmpeg_vaapi="no"
 
   dnl If the user specify an path to include headers from, we assume it's the 
full
   dnl path to the header file, and not the top level path without the 'ffmpeg' 
node
@@ -222,20 +221,10 @@
 
 dnl   AC_EGREP_HEADER(avcodec_decode_audio2, ${avcodec_h}, [avfound=yes], 
[avfound=no])
   
-    dnl This makes sure the version of ffmpeg is new enough to contain
-    dnl the libva support.
-    if test x"${enable_vaapi}" = x"yes"; then
-      if test -z "$ffmpeg_num_version" -o "$ffmpeg_num_version" -lt 52480; then
-        AC_MSG_WARN([Wrong ffmpeg/libavcodec version! 52.48.0 or greater 
required to use libVA, $ffmpeg_version detected.])
-      else
-        ffmpeg_version_check=ok
-      fi
+    if test -z "$ffmpeg_num_version" -o "$ffmpeg_num_version" -lt 511100; then
+      AC_MSG_WARN([Wrong ffmpeg/libavcodec version! 51.11.0 or greater 
required, $ffmpeg_version detected.])
     else
-      if test -z "$ffmpeg_num_version" -o "$ffmpeg_num_version" -lt 511100; 
then
-        AC_MSG_WARN([Wrong ffmpeg/libavcodec version! 51.11.0 or greater 
required, $ffmpeg_version detected.])
-      else
-        ffmpeg_version_check=ok
-      fi
+      ffmpeg_version_check=ok
     fi
 
     if test ! -z "$ffmpeg_num_version" -a "$ffmpeg_num_version" -gt 512800; 
then
@@ -263,17 +252,6 @@
     else
       AC_DEFINE(FFMPEG_NELLYMOSER, 1, [Define if ffmpeg can decode NELLYMOSER 
audio])
     fi
-    if test -z "$ffmpeg_num_version" -o "$ffmpeg_num_version" -gt 524800; then
-      dnl 52.48.0 (r21285) or higher required for VAAPI support
-      have_ffmpeg_vaapi=yes
-      AC_DEFINE(FFMPEG_VAAPI, 1, [Define if ffmpeg supports VAAPI])
-    else
-      have_ffmpeg_vaapi=no
-    fi
-    if test -z "$ffmpeg_num_version" -o "$ffmpeg_num_version" -gt 52450; then
-      dnl 52.45.0 (r20957) or higher required for VAAPI support
-      AC_DEFINE(FFMPEG_VAAPI, 1, [Define if ffmpeg supports VAAPI.])
-    fi
   else
     AC_MSG_WARN([Could not check ffmpeg version (can't find avcodec.h file)])
     # ffmpeg_version_check=ok # this is NOT ok, why would it be ?! 
@@ -311,6 +289,18 @@
      ffmpeg_version_check=
   fi
 
+  AC_MSG_CHECKING([for libavcodec/vaapi.h])
+  have_ffmpeg_vaapi="no"
+  if test -f "${ffmpeg_top_incl}/ffmpeg/vaapi.h"; then
+    have_ffmpeg_vaapi="yes"
+    AC_DEFINE(HAVE_FFMPEG_VAAPI_H, 1, [Defined if ffmpeg/vaapi.h is found])
+  fi
+  if test -f "${ffmpeg_top_incl}/libavcodec/vaapi.h"; then
+    have_ffmpeg_vaapi="yes"
+    AC_DEFINE(HAVE_LIBAVCODEC_VAAPI_H, 1, [Defined if libavcodec/vaapi.h is 
found])
+  fi
+  AC_MSG_RESULT($have_ffmpeg_vaapi)
+
   dnl ---------------------------------
   dnl
   dnl FFMPEG libs checking


reply via email to

[Prev in Thread] Current Thread [Next in Thread]