[openjfx] 01/01: Initial packaging

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Wed Jun 25 13:16:12 UTC 2014


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository openjfx.

commit d06df188629232c70560843cc6e97446f9389753
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Wed Jun 25 15:11:25 2014 +0200

    Initial packaging
---
 debian/README.source                         |    5 +
 debian/TODO                                  |    1 +
 debian/changelog                             |    5 +
 debian/compat                                |    1 +
 debian/control                               |   90 +++
 debian/copyright                             |  155 ++++
 debian/gradle.properties                     |    4 +
 debian/libopenjfx-java-doc.doc-base          |    9 +
 debian/libopenjfx-java-doc.install           |    2 +
 debian/orig-tar.sh                           |   25 +
 debian/patches/01-skip-verify-java.patch     |   14 +
 debian/patches/02-use-system-libraries.patch |  121 +++
 debian/patches/03-buildflags.patch           |   24 +
 debian/patches/04-libav-compatibility.patch  | 1056 ++++++++++++++++++++++++++
 debian/patches/series                        |    4 +
 debian/rules                                 |   54 ++
 debian/source/format                         |    1 +
 debian/watch                                 |    2 +
 18 files changed, 1573 insertions(+)

diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..bd9e692
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,5 @@
+OpenJFX for Debian
+------------------
+
+The build of OpenJFX has been modified to use the system libraries instead
+of downloading them from the Maven Central Repository.
diff --git a/debian/TODO b/debian/TODO
new file mode 100644
index 0000000..a01d0eb
--- /dev/null
+++ b/debian/TODO
@@ -0,0 +1 @@
+- Enable hardening for libjfxwebkit.so and libglass.so
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..c5f8afa
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+openjfx (8u5-b13-1) unstable; urgency=low
+
+  * Initial release (Closes: #748413)
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Wed, 25 Jun 2014 15:05:20 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..2125964
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,90 @@
+Source: openjfx
+Section: java
+Priority: optional
+Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
+Uploaders: Emmanuel Bourg <ebourg at apache.org>
+Build-Depends: antlr3,
+               bison,
+               debhelper (>= 9),
+               flex,
+               gperf,
+               gradle,
+               junit4,
+               ksh,
+               libasound2-dev,
+               libavcodec-dev,
+               libgl1-mesa-dev,
+               libgstreamer-plugins-base0.10-dev,
+               libgstreamer0.10-dev,
+               libgtk2.0-dev,
+               libjpeg-dev,
+               libpng-dev,
+               libsqlite3-dev,
+               libswt-gtk-3-java,
+               libudev-dev,
+               libwerken.xpath-java,
+               libx11-dev,
+               libxml2-dev,
+               libxslt1-dev,
+               libxt-dev,
+               libxtst-dev,
+               libxxf86vm-dev,
+               openjdk-8-jdk,
+               pkg-config,
+               qt4-qmake,
+               x11proto-core-dev,
+               x11proto-xf86vidmode-dev
+Standards-Version: 3.9.5
+Vcs-Git: git://anonscm.debian.org/pkg-java/openjfx.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-java/openjfx.git
+Homepage: http://openjdk.java.net/projects/openjfx/
+
+Package: openjfx
+Architecture: any
+Depends: libopenjfx-java, openjdk-8-jre, ${misc:Depends}
+Description: JavaFX/OpenJFX 8 - Rich client application platform for Java
+ JavaFX/OpenJFX is a set of graphics and media APIs that enables Java developers
+ to design, create, test, debug, and deploy rich client applications that
+ operate consistently across diverse platforms.
+
+Package: libopenjfx-java
+Architecture: all
+Depends: libopenjfx-jni, ${misc:Depends}
+Description: JavaFX/OpenJFX 8 - Rich client application platform for Java (Java libraries)
+ JavaFX/OpenJFX is a set of graphics and media APIs that enables Java developers
+ to design, create, test, debug, and deploy rich client applications that
+ operate consistently across diverse platforms.
+ .
+ This package contains the Java libraries.
+
+Package: libopenjfx-jni
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: JavaFX/OpenJFX 8 - Rich client application platform for Java (native libraries)
+ JavaFX/OpenJFX is a set of graphics and media APIs that enables Java developers
+ to design, create, test, debug, and deploy rich client applications that
+ operate consistently across diverse platforms.
+ .
+ This package contains the native libraries for libopenjfx-java.
+
+Package: libopenjfx-java-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends}
+Suggests: libopenjfx-java
+Description: JavaFX/OpenJFX 8 - Rich client application platform for Java (Javadoc)
+ JavaFX/OpenJFX is a set of graphics and media APIs that enables Java developers
+ to design, create, test, debug, and deploy rich client applications that
+ operate consistently across diverse platforms.
+ .
+ This package contains the API documentation for libopenjfx-java.
+
+Package: openjfx-source
+Architecture: all
+Depends: ${misc:Depends}
+Description: JavaFX/OpenJFX 8 - Rich client application platform for Java (sources)
+ JavaFX/OpenJFX is a set of graphics and media APIs that enables Java developers
+ to design, create, test, debug, and deploy rich client applications that
+ operate consistently across diverse platforms.
+ .
+ This package contains the source archive to be used with an IDE.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..0c39d1d
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,155 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: OpenJFX
+Source: http://hg.openjdk.java.net/openjfx/8u-dev/rt/
+
+Files: *
+Copyright: 2014, Oracle Inc.
+License: GPL-2 with Classpath exception
+
+Files: apps/experiments/3DViewer/*
+       apps/experiments/ConferenceScheduleApp/*
+       apps/experiments/Modena/*
+       apps/performance/GraphicsPerformance/*
+       apps/scenebuilder/*
+       tests/golden-image-suite/*
+Copyright: 2008-2014, Oracle Inc.
+License: BSD 3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+  - Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+  - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the distribution.
+  - Neither the name of Oracle Corporation nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: modules/media/src/main/native/gstreamer/gstreamer-lite/*
+Copyright: 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+           1995-1998, 2000-2002 Free Software Foundation, Inc
+           1999-2003 Erik Walthinsen <omega at cse.ogi.edu>
+           2000-2011 Wim Taymans <wim.taymans at gmail.com>
+           2001-2005 Andy Wingo <wingo at pobox.com>
+           2001-2004 Ronald Bultje <rbultje at ronald.bitfreak.net>
+           2001 Thomas Nyberg <thomas at codefactory.se>
+           2001 RidgeRun (http://www.ridgerun.com/)
+           2003-2004, Mark Borgerding
+           2003-2007 David Schleef <ds at schleef.org>
+           2003-2004 Benjamin Otte <otte at gnome.org>
+           2003-2007 Julien Moutte <julien at moutte.net>
+           2003 Leif Johnson <leif at ambient.2y.net>
+           2004-2006 Zaheer Abbas Merali <zaheerabbas at merali.org>
+           2004-2005 Thomas Vander Stichele <thomas at apestaart.org>
+           2005-20011 Tim-Philipp Müller <tim at centricular.net>
+           2005-2009 Jan Schmidt <thaytan at noraisin.net>
+           2005 Ross Burton <ross at burtonini.com>
+           2005 Sebastien Moutte <sebastien at moutte.net>
+           2005-2010 Stefan Kost <ensonic at sonicpulse.de>
+           2010 Brandon Lewis <brandon.lewis at collabora.co.uk>
+           2006-2010 Edward Hervey <edward.hervey at collabora.co.uk>
+           2006 Edgard Lima <edgard.lima at indt.org.br>
+           2006 Josep Torra <josep at fluendo.com>
+           2006 Mathieu Garcia <matthieu at fluendo.com>
+           2006-2010 Nokia Corporation
+           2006 Ryan Lortie <desrt at desrt.ca>
+           2006-2010 Sebastian Droege <sebastian.droege at collabora.co.uk>
+           2007-2009 Pioneers of the Inevitable <songbird at songbirdnest.com>
+           2007 Peter Kjellerstedt <pkj at axis.com>
+           2008-2011 Thiago Santos <thiago.sousa.santos at collabora.co.uk>
+           2008-2010 Mark Nauwelaerts <mnauw at users.sf.net>
+           2008 Ole Andre Vadla Ravnas <ole.andre.ravnas at tandberg.com>
+           2009 Axis Communications <dev-gstreamer at axis.com>
+           2009 STEricsson <benjamin.gaignard at stericsson.com>
+           2009 Texas Instruments, Inc
+           2010-2011 Alexey Chernov <4ernov at gmail.com>
+           2010 Arun Raghavan <arun.raghavan at collabora.co.uk>
+           2010 Collabora Multimedia
+           2010 Fluendo S.A. <support at fluendo.com>
+           2011-2013, Oracle
+License: LGPL-2 or later
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ .
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Library General Public License for more details.
+ .
+ On Debian systems, the full text of the LGPL-2 license
+ can be found in the file '/usr/share/common-licenses/LGPL-2'
+
+Files: modules/web/src/main/native/*
+Copyright: 1995-2013, various contributors
+License: LGPL-2 or later, BSD-2-clause and BSD-3-clause
+ This is an embedded copy of the WebKit rendering engine, please see
+ the debian/copyright file of the webkitgtk or qtwebkit packages for a detailed
+ list of the copyright holders and the applicable licenses.
+
+Files: debian/*
+Copyright: 2014 Emmanuel Bourg <ebourg at apache.org>
+License: Apache-2.0
+ On Debian systems, the full text of the Apache-2.0 license
+ can be found in the file '/usr/share/common-licenses/Apache-2.0'
+
+License: GPL-2 with Classpath exception
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Oracle designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Oracle in the LICENSE file that accompanied this code.
+ .
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+ .
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ .
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+ .
+ On Debian systems, the complete text of the GNU General Public License
+ can be found in `/usr/share/common-licenses/GPL-2'.
+ .
+ "CLASSPATH" EXCEPTION TO THE GPL VERSION 2
+ .
+ Certain source files distributed by Oracle, Inc. are subject
+ to the following clarification and special exception to the GPL, but
+ only where Oracle has expressly included in the particular source file's
+ header the words "Oracle designates this particular file as subject to
+ the "Classpath" exception as provided by Oracle in the LICENSE file that
+ accompanied this code."
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole combination.
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent modules,
+ and to copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent module,
+ the terms and conditions of the license of that module. An independent
+ module is a module which is not derived from or based on this library.
+ If you modify this library, you may extend this exception to your version
+ of the library, but you are not obligated to do so. If you do not wish
+ to do so, delete this exception statement from your version.
diff --git a/debian/gradle.properties b/debian/gradle.properties
new file mode 100644
index 0000000..c9d6798
--- /dev/null
+++ b/debian/gradle.properties
@@ -0,0 +1,4 @@
+COMPILE_WEBKIT = true
+COMPILE_MEDIA = true
+BUILD_JAVADOC = true
+BUILD_SRC_ZIP = true
diff --git a/debian/libopenjfx-java-doc.doc-base b/debian/libopenjfx-java-doc.doc-base
new file mode 100644
index 0000000..87cd3fb
--- /dev/null
+++ b/debian/libopenjfx-java-doc.doc-base
@@ -0,0 +1,9 @@
+Document: libopenjfx-java-doc
+Title: API Javadoc for OpenJFX 8
+Author: Oracle Inc
+Abstract: This is the API Javadoc provided for the libopenjfx-java library.
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/libopenjfx-java/api/index.html
+Files: /usr/share/doc/libopenjfx-java/api/*
diff --git a/debian/libopenjfx-java-doc.install b/debian/libopenjfx-java-doc.install
new file mode 100644
index 0000000..b476e4e
--- /dev/null
+++ b/debian/libopenjfx-java-doc.install
@@ -0,0 +1,2 @@
+
+build/javadoc/* usr/share/doc/libopenjfx-java/api
diff --git a/debian/orig-tar.sh b/debian/orig-tar.sh
new file mode 100755
index 0000000..450f286
--- /dev/null
+++ b/debian/orig-tar.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+VERSION=$2
+TAR=../openjfx_$VERSION.orig.tar.xz
+DIR=rt-$VERSION
+
+rm $3
+
+wget http://hg.openjdk.java.net/openjfx/8u-dev/rt/archive/$VERSION.tar.gz
+
+tar -xf $VERSION.tar.gz
+rm $VERSION.tar.gz
+
+XZ_OPT=--best tar -c -v -J -f $TAR \
+                  --exclude '.hg*' \
+                  --exclude '.classpath' \
+                  --exclude '.project' \
+                  --exclude '.idea' \
+                  --exclude 'apps/samples' \
+                  --exclude 'modules/graphics/src/main/native-iio/libjpeg*' \
+                  --exclude 'modules/media/src/main/native/gstreamer/3rd_party/glib/*' \
+                  --exclude 'modules/web/src/main/native/Tools/TestResultServer/static-dashboards/dygraph-combined.js' \
+                  $DIR
+
+rm -Rf $DIR
diff --git a/debian/patches/01-skip-verify-java.patch b/debian/patches/01-skip-verify-java.patch
new file mode 100644
index 0000000..3cb1489
--- /dev/null
+++ b/debian/patches/01-skip-verify-java.patch
@@ -0,0 +1,14 @@
+Description: Skip the verification of Java to build with more recent versions of the JDK
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/build.gradle
++++ b/build.gradle
+@@ -904,7 +904,7 @@
+         def buildNum = Integer.parseInt(jdkBuildNumber)
+         def minBuildNum = Integer.parseInt(jfxBuildJdkBuildnumMin)
+         if (buildNum < minBuildNum) {
+-            fail("java build number ($buildNum) < minimum build number ($minBuildNum)")
++            //fail("java build number ($buildNum) < minimum build number ($minBuildNum)")
+         }
+     }
+ }
diff --git a/debian/patches/02-use-system-libraries.patch b/debian/patches/02-use-system-libraries.patch
new file mode 100644
index 0000000..dbfb5f8
--- /dev/null
+++ b/debian/patches/02-use-system-libraries.patch
@@ -0,0 +1,121 @@
+Description: Changes the dependency management to use the system jars when building
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/build.gradle
++++ b/build.gradle
+@@ -998,12 +998,8 @@
+     // closed gradle file instead.
+     if (!BUILD_CLOSED) {
+         repositories {
+-            mavenCentral()
+-            ivy {
+-                url "http://download.eclipse.org/eclipse/updates/3.7/R-3.7.2-201202080800/plugins/"
+-                layout "pattern", {
+-                    artifact "[artifact].[ext]"
+-                }
++            maven {
++                url "file:/usr/share/maven-repo"
+             }
+         }
+     }
+@@ -1011,7 +1007,7 @@
+     // By default all of our projects require junit for testing so we can just
+     // setup this dependency here.
+     dependencies {
+-        testCompile group: "junit", name: "junit", version: "4.8.2"
++        testCompile group: "junit", name: "junit", version: "4.x"
+         if (BUILD_CLOSED && DO_JCOV)  {
+             testCompile name: "jcov"
+         }
+@@ -1124,12 +1120,12 @@
+ 
+     dependencies {
+         compile project(":base"), BUILD_SRC
+-        compile name: SWT_FILE_NAME
+-        stubCompile group: "junit", name: "junit", version: "4.8.2",
++        compile files("/usr/share/java/swt-gtk-3.8.jar")
++        stubCompile group: "junit", name: "junit", version: "4.x",
+         project(":base").sourceSets.test.output, sourceSets.main.output
+-        antlr3 group: "org.antlr", name: "antlr", version: "3.1.3"
+-        antlr3 group: "org.antlr", name: "antlr-runtime",  version: "3.1.3"
+-        antlr3 group: "org.antlr", name: "stringtemplate", version: "3.2"
++        antlr3 group: "org.antlr", name: "antlr", version: "3.x"
++        antlr3 group: "org.antlr", name: "antlr-runtime",  version: "3.x"
++        antlr3 group: "org.antlr", name: "stringtemplate", version: "3.x"
+     }
+ 
+     // Create a single "native" task which will depend on all the individual native tasks for graphics
+@@ -1400,9 +1396,9 @@
+             copy {
+                 into libsDir
+                 from f.getParentFile()
+-                include "**/antlr-3.1.3.jar"
+-                include "**/stringtemplate-3.2.jar"
+-                include "**/antlr-runtime-3.1.3.jar"
++                include "**/antlr-3.x.jar"
++                include "**/stringtemplate-3.x.jar"
++                include "**/antlr-runtime-3.x.jar"
+                 includeEmptyDirs = false
+             }
+             // Have to rename the swt jar because it is some platform specific name but
+@@ -1481,7 +1477,7 @@
+     }
+     dependencies {
+         compile BUILD_SRC, project(":base"), project(":graphics")
+-        compile name: SWT_FILE_NAME
++        compile files("/usr/share/java/swt-gtk-3.8.jar")
+     }
+ }
+ 
+@@ -1581,7 +1577,7 @@
+     }
+ 
+     dependencies {
+-        compile group: "org.apache.ant", name: "ant", version: "1.8.2"
++        compile group: "org.apache.ant", name: "ant", version: "debian"
+     }
+ 
+     // When producing the jar, we need to relocate a few class files
+@@ -1754,13 +1750,13 @@
+     classes << {
+         // Copy all of the download libraries to libs directory for the sake of the IDEs
+         File libsDir = rootProject.file("build/libs");
+-        File antLib = new File(libsDir, "ant-1.8.2.jar")
++        File antLib = new File(libsDir, "ant-debian.jar")
+         libsDir.mkdirs();
+         for (File f : configurations.compile.files) {
+             copy {
+                 into libsDir
+                 from f.getParentFile()
+-                include "**/ant-1.8.2.jar"
++                include "**/ant-debian.jar"
+                 includeEmptyDirs = false
+             }
+         }
+@@ -2084,10 +2080,12 @@
+     compileTargets { t ->
+         def classifier = (t.name != "linux" && t.name != "win") ? t.name :
+                           IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
++/*
+         dependencies {
+             webkit group: "com.sun.webkit", name: "webview-deps",
+                    version: "1.2", classifier: "$classifier", ext: "zip"
+         }
++*/
+ 
+         def webkitOutputDir = "$buildDir/${t.name}"
+         def webkitConfig = IS_DEBUG_NATIVE ? "Debug" : "Release"
+@@ -2095,11 +2093,13 @@
+         def compileNativeTask = task("compileNative${t.capital}", dependsOn: generateHeaders) << {
+             println "Building Webkit configuration /$webkitConfig/ into $webkitOutputDir"
+             
++/*
+             def dependencyFile = configurations.webkit.filter(
+                     { File f -> f.getName().contains(classifier) }
+                 ).getSingleFile()
+             ant.unzip(src:  dependencyFile,
+                       dest: webkitOutputDir)
++*/
+ 
+             exec {
+                 workingDir("$projectDir/src/main/native")
diff --git a/debian/patches/03-buildflags.patch b/debian/patches/03-buildflags.patch
new file mode 100644
index 0000000..bb279ad
--- /dev/null
+++ b/debian/patches/03-buildflags.patch
@@ -0,0 +1,24 @@
+Description: Adjusts the compiler flags to enable the hardening and link to the system libraries
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/buildSrc/linux.gradle
++++ b/buildSrc/linux.gradle
+@@ -79,7 +79,9 @@
+         commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c",
+         IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : "-O2"].flatten()
+ //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
++ccFlags.addAll(["-fstack-protector", "--param=ssp-buffer-size=4", "-Wformat", "-Werror=format-security", "-D_FORTIFY_SOURCE=2"])
+ def linkFlags = ["-shared", commonFlags].flatten()
++linkFlags.addAll(["-Wl,-z,relro"])
+ 
+ // Create $buildDir/linux_tools.properties file and load props from it
+ setupTools("linux_tools",
+@@ -209,7 +211,7 @@
+ LINUX.iio.compiler = compiler
+ LINUX.iio.ccFlags = [ccFlags].flatten()
+ LINUX.iio.linker = linker
+-LINUX.iio.linkFlags = [linkFlags].flatten()
++LINUX.iio.linkFlags = [linkFlags, "-ljpeg"].flatten()
+ LINUX.iio.lib = "javafx_iio"
+ 
+ LINUX.prismES2 = [:]
diff --git a/debian/patches/04-libav-compatibility.patch b/debian/patches/04-libav-compatibility.patch
new file mode 100644
index 0000000..18210d5
--- /dev/null
+++ b/debian/patches/04-libav-compatibility.patch
@@ -0,0 +1,1056 @@
+Description: Resolves compile time errors for libav54 and libav55 and makes sound workable on these two versions of libav
+Author: Kirill Kirichenko <kirill.kirichenko at oracle.com>
+Bug: https://javafx-jira.kenai.com/browse/RT-37256
+--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gstregistry.c
++++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gstregistry.c
+@@ -162,7 +162,7 @@
+ #include <link.h>
+ #include <dlfcn.h>
+ 
+-static const int AVCODEC_EXPLICIT_VERSIONS[] = { 53 };
++static const int AVCODEC_EXPLICIT_VERSIONS[] = { 53, 54, 55 };
+ 
+ typedef unsigned (*avcodec_version_proto)();
+ 
+@@ -1150,6 +1150,7 @@
+   return changed;
+ }
+ 
++#ifndef GSTREAMER_LITE
+ static gboolean
+ is_blacklisted_hidden_directory (const gchar * dirent)
+ {
+@@ -1168,6 +1169,7 @@
+ 
+   return FALSE;
+ }
++#endif
+ 
+ static gboolean
+ gst_registry_scan_path_level (GstRegistryScanContext * context,
+@@ -1249,7 +1251,7 @@
+   {
+       filename_partial = g_build_filename (path, gstlite_plugins_list[gstlite_plugins_list_index], NULL);
+ #ifdef LINUX
+-      if (g_str_has_suffix(filename_partial, "libavplugin") != NULL) // Check libavc version and load correspondent module.
++      if (g_str_has_suffix(filename_partial, "libavplugin")) // Check libav version and load correspondent module.
+       {
+           int vi;
+           for (vi = 0, avcHandle = NULL; 
+--- a/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.c
++++ b/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.c
+@@ -36,6 +36,7 @@
+ 
+ #include "audiodecoder.h"
+ #include <libavformat/avformat.h>
++#include <libavutil/samplefmt.h>
+ 
+ GST_DEBUG_CATEGORY_STATIC(audiodecoder_debug);
+ #define GST_CAT_DEFAULT audiodecoder_debug
+@@ -131,7 +132,10 @@
+ static gboolean audiodecoder_src_query(GstPad * pad, GstQuery* query);
+ static const GstQueryType * audiodecoder_get_src_query_types(GstPad * pad);
+ static gboolean audiodecoder_init_state(AudioDecoder *decoder);
+-static void audiodecoder_init_context(BaseDecoder *decoder);
++
++#if DECODE_AUDIO4
++static gboolean audiodecoder_is_oformat_supported(int format);
++#endif
+ 
+ /* --- GObject vmethod implementations --- */
+ 
+@@ -160,7 +164,6 @@
+ static void audiodecoder_class_init(AudioDecoderClass * klass)
+ {
+      GST_ELEMENT_CLASS(klass)->change_state = audiodecoder_change_state;
+-     BASEDECODER_CLASS(klass)->init_context = audiodecoder_init_context;
+ }
+ /*
+  * Initialize the new element.
+@@ -194,16 +197,18 @@
+  */
+ static gboolean audiodecoder_init_state(AudioDecoder *decoder)
+ {
+-    decoder->samples = av_mallocz(AVCODEC_MAX_AUDIO_FRAME_SIZE);
++#if NEW_CODEC_ID
++    decoder->codec_id = AV_CODEC_ID_NONE;
++#else
++    decoder->codec_id = CODEC_ID_NONE;
++#endif
++    
++#if !DECODE_AUDIO4
++    decoder->samples = av_mallocz(AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+     if (!decoder->samples)
+         return FALSE;
+-
+-#if ! LIBAVCODEC_NEW
+-    decoder->packet = NULL;
+-    decoder->packet_size = 0;
+-#endif // LIBAVCODEC_NEW
+-
+-    decoder->codec_id = CODEC_ID_NONE;
++#endif
++    
+     decoder->total_samples = 0;
+     decoder->initial_offset = GST_BUFFER_OFFSET_NONE;
+     decoder->duration = GST_CLOCK_TIME_NONE;
+@@ -217,17 +222,6 @@
+     return TRUE;
+ }
+ 
+-static void audiodecoder_init_context(BaseDecoder *base)
+-{
+-    AudioDecoder *decoder = AUDIODECODER(base);
+-
+-    base->context->channels = decoder->num_channels;
+-    base->context->sample_rate = decoder->sample_rate;
+-    base->context->bit_rate = decoder->bit_rate;
+-
+-    BASEDECODER_CLASS(parent_class)->init_context(base);
+-}
+-
+ /**
+  * Reset the state of the AudioDecoder structure. This should happen before
+  * decoding a new segment.
+@@ -244,22 +238,14 @@
+ 
+ static void audiodecoder_close_decoder(AudioDecoder *decoder)
+ {
++#if !DECODE_AUDIO4
+     if (decoder->samples)
+     {
+         av_free(decoder->samples);
+         decoder->samples = NULL;
+     }
+-
+-#if ! LIBAVCODEC_NEW
+-    if (decoder->packet)
+-    {
+-        av_free(decoder->packet);
+-
+-        decoder->packet = NULL;
+-        decoder->packet_size = 0;
+-    }
+ #endif
+-
++    
+     basedecoder_close_decoder(BASEDECODER(decoder));
+ }
+ 
+@@ -507,7 +493,11 @@
+ 
+             if (4 == mpeg_version)
+             {
++#if NEW_CODEC_ID
++                decoder->codec_id = AV_CODEC_ID_AAC;
++#else
+                 decoder->codec_id = CODEC_ID_AAC;
++#endif
+                 if (base->codec_data) // codec_data is optional for AAC
+                 {
+                     //
+@@ -546,8 +536,11 @@
+             }
+             else
+             {
++#if NEW_CODEC_ID
++                decoder->codec_id = AV_CODEC_ID_MP3;
++#else
+                 decoder->codec_id = CODEC_ID_MP3;
+-
++#endif
+                 if (!gst_structure_get_int(caps_struct, "layer", &mpeg_layer))
+                     mpeg_layer = 3;
+ 
+@@ -580,9 +573,6 @@
+         }
+         else
+             return FALSE; // Type is not "audio/mpeg"
+-
+-        decoder->bytes_per_sample = (AUDIODECODER_BITS_PER_SAMPLE/8)*AUDIODECODER_OUT_NUM_CHANNELS;
+-        decoder->initial_offset = GST_BUFFER_OFFSET_IS_VALID(buffer) ?  GST_BUFFER_OFFSET(buffer) : 0;
+     }
+ 
+     if (!base->codec && !basedecoder_open_decoder(base, decoder->codec_id))
+@@ -604,6 +594,9 @@
+                                "signed", G_TYPE_BOOLEAN, TRUE,
+                                NULL);
+ 
++    decoder->bytes_per_sample = (AUDIODECODER_BITS_PER_SAMPLE/8)*AUDIODECODER_OUT_NUM_CHANNELS;
++    decoder->initial_offset = GST_BUFFER_OFFSET_IS_VALID(buffer) ?  GST_BUFFER_OFFSET(buffer) : 0;
++
+     // Set the source caps.
+     base->is_initialized = gst_pad_set_caps(base->srcpad, caps);
+ 
+@@ -612,6 +605,12 @@
+     return base->is_initialized;
+ }
+ 
++static inline int16_t float_to_int(float sample)
++{
++    int value = (int)(sample * INT16_MAX);
++    return value > INT16_MAX ? INT16_MAX : value < INT16_MIN ? INT16_MIN : (int16_t)value;
++}
++
+ /*
+  * Processes a buffer of MPEG audio data pushed to the sink pad.
+  */
+@@ -620,19 +619,23 @@
+     AudioDecoder *decoder = AUDIODECODER(GST_OBJECT_PARENT(pad));
+     BaseDecoder  *base = BASEDECODER(decoder);
+     GstFlowReturn ret = GST_FLOW_OK;
+-    gint          outbuf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+     int           num_dec = NO_DATA_USED;
+ 
+-
++#if DECODE_AUDIO4
++    gint          got_frame = 0;
++    int           sample, ci;
++ #else
++    gint          outbuf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
++#endif
++    
+ #ifdef VERBOSE_DEBUG
+     g_print("audiodecoder: incoming size=%d, ts=%.4f, duration=%.4f ", GST_BUFFER_SIZE(buf),
+             GST_BUFFER_TIMESTAMP_IS_VALID(buf) ? (double)GST_BUFFER_TIMESTAMP(buf)/GST_SECOND : -1.0,
+             GST_BUFFER_DURATION_IS_VALID(buf) ? (double)GST_BUFFER_DURATION(buf)/GST_SECOND : -1.0);
+ #endif
+-
++   
+     // If we have incoming buffers with PTS, then use them.
+-    if (GST_BUFFER_TIMESTAMP_IS_VALID(buf))
+-        decoder->generate_pts = FALSE;
++    decoder->generate_pts = !GST_BUFFER_TIMESTAMP_IS_VALID(buf);
+ 
+     // If between FLUSH_START and FLUSH_STOP, reject new buffers.
+     if (base->is_flushing)
+@@ -665,67 +668,44 @@
+         decoder->is_synced = TRUE;
+     }
+ 
+-#if LIBAVCODEC_NEW
+-    if (!base->is_hls)
+-    {
+-        if (av_new_packet(&decoder->packet, GST_BUFFER_SIZE(buf)) == 0)
+-        {
+-            memcpy(decoder->packet.data, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf));
+-            num_dec = avcodec_decode_audio3(base->context, (int16_t*)decoder->samples, &outbuf_size, &decoder->packet);
+-            av_free_packet(&decoder->packet);
+-        }
+-        else
+-        {
+-            ret = GST_FLOW_ERROR;
+-            goto _exit;
+-        }
+-    }
+-    else
+-    {
+-        av_init_packet(&decoder->packet);
+-        decoder->packet.data = GST_BUFFER_DATA(buf);
+-        decoder->packet.size = GST_BUFFER_SIZE(buf);
+-        num_dec = avcodec_decode_audio3(base->context, (int16_t*)decoder->samples, &outbuf_size, &decoder->packet);
+-    }
+-#else // ! LIBAVCODEC_NEW
+-    if (!base->is_hls)
+-    {
+-        if (decoder->packet_size < GST_BUFFER_SIZE(buf))
+-        {
+-            decoder->packet = av_realloc(decoder->packet, GST_BUFFER_SIZE(buf));
+-            decoder->packet_size = decoder->packet ? GST_BUFFER_SIZE(buf) : 0;
+-        }
+-
+-        if (decoder->packet)
+-        {
+-            memcpy(decoder->packet, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf));
+-            num_dec = avcodec_decode_audio2(base->context, (int16_t*)decoder->samples, &outbuf_size, decoder->packet, GST_BUFFER_SIZE(buf));
+-        }
+-        else
+-        {
+-            ret = GST_FLOW_ERROR;
+-            goto _exit;
+-        }
+-    }
+-    else
+-        num_dec = avcodec_decode_audio2(base->context, (int16_t*)decoder->samples,
+-                                        &outbuf_size, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf));
+-
+-#endif // LIBAVCODEC_NEW
++    av_init_packet(&decoder->packet);
++    decoder->packet.data = GST_BUFFER_DATA(buf);
++    decoder->packet.size = GST_BUFFER_SIZE(buf);
++
++#if DECODE_AUDIO4
++    num_dec = avcodec_decode_audio4(base->context, base->frame, &got_frame, &decoder->packet);
++#else
++    num_dec = avcodec_decode_audio3(base->context, (int16_t*)decoder->samples, &outbuf_size, &decoder->packet);
++#endif
+ 
+-    if (num_dec < 0)
++    
++#if DECODE_AUDIO4
++    if (num_dec < 0 || !got_frame)
++#else
++    if (num_dec < 0 || outbuf_size == 0)
++#endif
+     {
+-        //        avcodec_flush_buffers(base->context);
+ #ifdef DEBUG_OUTPUT
+         g_print("audiodecoder_chain error: %s\n", avelement_error_to_string(AVELEMENT(decoder), num_dec));
+ #endif
+         goto _exit;
+     }
+ 
+-    if (outbuf_size == 0)
++    GstBuffer *outbuf = NULL;
++#if DECODE_AUDIO4
++    if (!audiodecoder_is_oformat_supported(base->frame->format))
++    {
++        gst_element_message_full(GST_ELEMENT(decoder), GST_MESSAGE_ERROR, GST_CORE_ERROR, GST_CORE_ERROR_NOT_IMPLEMENTED,
++                                 g_strdup("Unsupported decoded audio format"), NULL, ("audiodecoder.c"), ("audiodecoder_chain"), 0);
+         goto _exit;
++    }
++    
++    int outbuf_size = av_samples_get_buffer_size(NULL, base->context->channels, base->frame->nb_samples, AV_SAMPLE_FMT_S16, 1);
++    if (outbuf_size < 0) {
++        goto _exit;
++    }
++#endif
+ 
+-    GstBuffer *outbuf = NULL;
+     ret = gst_pad_alloc_buffer_and_set_caps(base->srcpad, GST_BUFFER_OFFSET_NONE,
+                                             outbuf_size, GST_PAD_CAPS(base->srcpad), &outbuf);
+ 
+@@ -734,14 +714,39 @@
+     {
+         if (ret != GST_FLOW_WRONG_STATE)
+         {
+-            gst_element_message_full(GST_ELEMENT(decoder), GST_MESSAGE_ERROR, GST_CORE_ERROR, GST_CORE_ERROR_SEEK,
++            gst_element_message_full(GST_ELEMENT(decoder), GST_MESSAGE_ERROR, GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_NO_SPACE_LEFT,
+                                      g_strdup("Decoded audio buffer allocation failed"), NULL, ("audiodecoder.c"), ("audiodecoder_chain"), 0);
+         }
+         goto _exit;
+     }
+ 
++#if DECODE_AUDIO4
++    if (base->frame->format == AV_SAMPLE_FMT_S16P)
++    {
++        // Reformat the output frame into single buffer.
++        int16_t *buffer = (int16_t*)GST_BUFFER_DATA(outbuf);
++        for (sample = 0; sample < base->frame->nb_samples; sample++)
++        {
++            for (ci = 0; ci < base->context->channels && ci < AV_NUM_DATA_POINTERS; ci++)
++                buffer[2*sample + ci] = ((int16_t*)base->frame->data[ci])[sample];
++        }
++    } 
++    else if (base->frame->format == AV_SAMPLE_FMT_FLTP)
++    {
++        // Reformat the output frame into single buffer and convert float [-1.0;1.0] to int16
++        int16_t *buffer = (int16_t*)GST_BUFFER_DATA(outbuf);
++        for (sample = 0; sample < base->frame->nb_samples; sample++)
++        {
++            for (ci = 0; ci < base->context->channels && ci < AV_NUM_DATA_POINTERS; ci++)
++                buffer[2*sample + ci] = float_to_int(((float*)base->frame->data[ci])[sample]);
++        }
++    }
++    else if (base->frame->format == AV_SAMPLE_FMT_S16)
++        memcpy(GST_BUFFER_DATA(outbuf), base->frame->data[0], GST_BUFFER_SIZE(outbuf));
++#else
+     memcpy(GST_BUFFER_DATA(outbuf), decoder->samples, GST_BUFFER_SIZE(outbuf));
+-
++#endif
++    
+     // Set output buffer properties.
+     if (decoder->generate_pts)
+     {
+@@ -776,18 +781,30 @@
+         goto _exit;
+     }
+ 
++#ifdef VERBOSE_DEBUG
++    g_print("ret=%s, num_dec=%d, Buffer: size=%d, ts=%.4f, duration=%.4f, offset=%ld, offset_end=%ld\n", 
++            gst_flow_get_name(ret), num_dec, outbuf_size,
++            (double)GST_BUFFER_TIMESTAMP(outbuf)/GST_SECOND, (double)GST_BUFFER_DURATION(outbuf)/GST_SECOND,
++            GST_BUFFER_OFFSET(outbuf), GST_BUFFER_OFFSET_END(outbuf));
++#endif
++    
+     ret = gst_pad_push(base->srcpad, outbuf);
+ 
+- _exit:
++_exit:
+ 
+-#ifdef VERBOSE_DEBUG
+-    g_print("ret=%s, num_dec=%d\n", gst_flow_get_name(ret), num_dec);
+-#endif
+ // INLINE - gst_buffer_unref()
+     gst_buffer_unref(buf);
+     return ret;
+ }
+ 
++#if DECODE_AUDIO4
++static gboolean audiodecoder_is_oformat_supported(int format) 
++{
++    return (format == AV_SAMPLE_FMT_S16P || format == AV_SAMPLE_FMT_FLTP ||
++            format == AV_SAMPLE_FMT_S16);
++}
++#endif
++
+ // --------------------------------------------------------------------------
+ gboolean audiodecoder_plugin_init(GstPlugin * audiodecoder) {
+     GST_DEBUG_CATEGORY_INIT(audiodecoder_debug, AV_AUDIO_DECODER_PLUGIN_NAME,
+--- a/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.h
++++ b/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.h
+@@ -53,13 +53,15 @@
+ struct _AudioDecoder {
+     BaseDecoder  parent;
+ 
++#if !DECODE_AUDIO4
+     guint8       *samples;          // temporary output buffer
+-
++#endif
++    
+     gboolean     is_synced;         // whether the first audio frame has been found
+     gboolean     is_discont;        // whether the next frame is a discontinuity
+ 
+-    enum CodecID codec_id;          // the libavcodec codec ID
+-
++    CodecIDType  codec_id;
++    
+     gint         num_channels;      // channels / stream
+     guint        bytes_per_sample;  // bytes / sample
+     gint         sample_rate;       // samples / second
+@@ -72,12 +74,7 @@
+     guint64      total_samples;     // sample offset from zero at current time
+     gboolean     generate_pts;
+ 
+-#if LIBAVCODEC_NEW
+-    AVPacket       packet;
+-#else // ! LIBAVCODEC_NEW
+-    uint8_t        *packet;
+-    int            packet_size;
+-#endif // LIBAVCODEC_NEW
++    AVPacket     packet;
+ };
+ 
+ struct _AudioDecoderClass
+--- a/modules/media/src/main/native/gstreamer/plugins/av/avelement.c
++++ b/modules/media/src/main/native/gstreamer/plugins/av/avelement.c
+@@ -89,42 +89,8 @@
+  ***********************************************************************************/
+ const char* avelement_error_to_string(AVElement *element, int ret)
+ {
+-#if LIBAVCODEC_NEW
+     if (av_strerror(ret, element->error_string, ERROR_STRING_SIZE) < 0)
+         g_strlcpy(element->error_string, "Unknown", ERROR_STRING_SIZE);
+ 
+     return element->error_string;
+-#else
+-    switch(ret)
+-    {
+-    case AVERROR_IO:
+-        return "I/O error";
+-    case AVERROR_NUMEXPECTED:
+-        return "Number syntax expected in filename";
+-
+-    case AVERROR_INVALIDDATA:
+-        return "invalid data found";
+-
+-    case AVERROR_NOMEM:
+-        return "not enough memory";
+-
+-    case AVERROR_NOFMT:
+-        return "unknown format";
+-
+-    case AVERROR_NOTSUPP:
+-        return "Operation not supported";
+-
+-    case AVERROR_NOENT:
+-        return "No such file or directory";
+-
+-    case AVERROR_EOF:
+-        return "End of file";
+-
+-    case AVERROR_PATCHWELCOME:
+-        return "Patches welcome";
+-
+-    default:
+-        return "Unknown";
+-    }
+-#endif
+ }
+--- a/modules/media/src/main/native/gstreamer/plugins/av/avelement.h
++++ b/modules/media/src/main/native/gstreamer/plugins/av/avelement.h
+@@ -28,13 +28,10 @@
+ 
+ #include <gst/gst.h>
+ #include <libavcodec/avcodec.h>
++#include "avdefines.h"
+ 
+ G_BEGIN_DECLS
+ 
+-// According to ffmpeg Git they introduced
+-// _decode_video2 and _decode_audio3  in version 52.25.0
+-#define LIBAVCODEC_NEW (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,1))
+-
+ // Maximum size of the buffer for string representation of errors
+ #define ERROR_STRING_SIZE 256
+ 
+@@ -52,9 +49,7 @@
+ {
+     GstElement element;
+ 
+-#if LIBAVCODEC_NEW
+     char error_string[ERROR_STRING_SIZE];
+-#endif // LIBAVCODEC_NEW
+ };
+ 
+ struct _AVElementClass
+@@ -66,6 +61,13 @@
+ 
+ const char* avelement_error_to_string(AVElement *avelement, int ret);
+ 
++#if NEW_CODEC_ID
++typedef enum AVCodecID CodecIDType;
++#else
++typedef enum CodecID CodecIDType;
++#endif
++
++
+ G_END_DECLS
+ 
+ #endif // __AV_ELEMENT_H__
+--- a/modules/media/src/main/native/gstreamer/plugins/av/decoder.c
++++ b/modules/media/src/main/native/gstreamer/plugins/av/decoder.c
+@@ -24,6 +24,11 @@
+  */
+ 
+ #include "decoder.h"
++#include <libavutil/mem.h>
++
++#if NEW_ALLOC_FRAME
++#include <libavutil/frame.h>
++#endif
+ 
+ /***********************************************************************************
+  * Static AVCodec library lock. One for all instances. Necessary for avcodec_open
+@@ -79,6 +84,7 @@
+     decoder->codec_data = NULL;
+     decoder->codec_data_size = 0;
+ 
++    decoder->frame = NULL;
+     decoder->context = NULL;
+     decoder->codec = NULL;
+ 
+@@ -87,32 +93,32 @@
+     decoder->is_hls = FALSE;
+ }
+ 
+-gboolean basedecoder_open_decoder(BaseDecoder *decoder, enum CodecID id)
++gboolean basedecoder_open_decoder(BaseDecoder *decoder, CodecIDType id)
+ {
+     gboolean result = TRUE;
+ 
++#if NEW_ALLOC_FRAME
++    decoder->frame = av_frame_alloc();
++#else
++    decoder->frame = avcodec_alloc_frame();
++#endif
++    if (!decoder->frame)
++        return FALSE; // Can't create frame
++
+     g_static_mutex_lock(&avlib_lock);
+ 
+     decoder->codec = avcodec_find_decoder(id);
+     result = (decoder->codec != NULL);
+     if (result)
+     {
+-#if LIBAVCODEC_NEW
+         decoder->context = avcodec_alloc_context3(decoder->codec);
+-#else
+-        decoder->context = avcodec_alloc_context();
+-#endif
+         result = (decoder->context != NULL);
+ 
+         if (result)
+         {
+             basedecoder_init_context(decoder);
+ 
+-#if LIBAVCODEC_NEW
+             int ret = avcodec_open2(decoder->context, decoder->codec, NULL);
+-#else
+-            int ret = avcodec_open(decoder->context, decoder->codec);
+-#endif
+             if (ret < 0) // Can't open codec
+             {
+                 av_free(decoder->context);
+@@ -160,10 +166,7 @@
+ void basedecoder_flush(BaseDecoder *decoder)
+ {
+     if (decoder->context)
+-    {
+         avcodec_flush_buffers(decoder->context);
+-        avcodec_default_free_buffers(decoder->context);
+-    }
+ }
+ 
+ void basedecoder_close_decoder(BaseDecoder *decoder)
+@@ -180,4 +183,14 @@
+         g_free(decoder->codec_data);
+         decoder->codec_data = NULL;
+     }
++
++    if (decoder->frame)
++    {
++#if NEW_ALLOC_FRAME
++        av_frame_free(&decoder->frame);
++#else
++        av_free(decoder->frame);
++        decoder->frame = NULL;
++#endif
++    }
+ }
+--- a/modules/media/src/main/native/gstreamer/plugins/av/decoder.h
++++ b/modules/media/src/main/native/gstreamer/plugins/av/decoder.h
+@@ -59,6 +59,8 @@
+     guint8        *codec_data;       // codec-specific data
+     gint          codec_data_size;   // number of bytes of codec-specific data
+ 
++    AVFrame        *frame;
++
+     AVCodec        *codec;           // the libavcodec decoder reference
+     AVCodecContext *context;         // the libavcodec context
+ };
+@@ -74,7 +76,7 @@
+ 
+ void      basedecoder_init_state(BaseDecoder *decoder);
+ 
+-gboolean  basedecoder_open_decoder(BaseDecoder *decoder, enum CodecID id);
++gboolean  basedecoder_open_decoder(BaseDecoder *decoder, CodecIDType id);
+ 
+ void      basedecoder_set_codec_data(BaseDecoder *decoder, GstStructure *s);
+ 
+--- a/modules/media/src/main/native/gstreamer/plugins/av/mpegtsdemuxer.c
++++ b/modules/media/src/main/native/gstreamer/plugins/av/mpegtsdemuxer.c
+@@ -49,7 +49,7 @@
+     GstClockTime      offset_time;
+ 
+     int               stream_index;
+-    enum CodecID      codec_id;
++    CodecIDType       codec_id;
+ } Stream;
+ 
+ typedef enum
+@@ -533,16 +533,16 @@
+     {
+         switch (demuxer->context->streams[i]->codec->codec_type)
+         {
+-#if LIBAVCODEC_NEW
+             case AVMEDIA_TYPE_VIDEO:
+-#else
+-            case CODEC_TYPE_VIDEO:
+-#endif // LIBAVCODEC_NEW
+ 
+                 if (demuxer->video.stream_index < 0)
+                 {
+                     AVStream *stream = demuxer->context->streams[i];
++#if NEW_CODEC_ID
++                    if (stream->codec->codec_id == AV_CODEC_ID_H264)
++#else
+                     if (stream->codec->codec_id == CODEC_ID_H264)
++#endif
+                     {
+                         demuxer->video.stream_index = i;
+                         demuxer->video.codec_id = stream->codec->codec_id;
+@@ -565,15 +565,15 @@
+                 }
+                 break;
+ 
+-#if LIBAVCODEC_NEW
+             case AVMEDIA_TYPE_AUDIO:
+-#else
+-            case CODEC_TYPE_AUDIO:
+-#endif // LIBAVCODEC_NEW
+                 if (demuxer->audio.stream_index < 0)
+                 {
+                     AVStream *stream = demuxer->context->streams[i];
++#if NEW_CODEC_ID
++                    if (stream->codec->codec_id == AV_CODEC_ID_AAC)
++#else
+                     if (stream->codec->codec_id == CODEC_ID_AAC)
++#endif
+                     {
+                         demuxer->audio.stream_index = i;
+                         demuxer->audio.codec_id = stream->codec->codec_id;
+@@ -875,20 +875,6 @@
+             result = PA_STOP;
+             break;
+ 
+-#if !LIBAVCODEC_NEW
+-        case AVERROR_IO: // Workaround for older version. It returns AVERROR_IO at the end.
+-#ifdef DEBUG_OUTPUT
+-            g_print("MpegTS process: AVERROR_IO %s\n", demuxer->is_eos ? "generating EOS" : "send error");
+-#endif
+-            if (demuxer->is_eos)
+-                mpegts_demuxer_push_to_sources(demuxer, gst_event_new_eos());
+-            else
+-                post_error(demuxer, "LibAV stream parse error", ret, GST_STREAM_ERROR_DEMUX);
+-
+-            result = PA_STOP;
+-            break;
+-#endif //!LIBAVCODEC_NEW
+-
+         default:
+             post_error(demuxer, "LibAV stream parse error", ret, GST_STREAM_ERROR_DEMUX);
+             result = PA_STOP;
+@@ -938,7 +924,6 @@
+                     return NULL;
+                 }
+ 
+-#if LIBAVCODEC_NEW
+                 AVIOContext *io_context = avio_alloc_context(io_buffer,            // buffer
+                                                              BUFFER_SIZE,          // buffer size
+                                                              0,                    // read only
+@@ -946,15 +931,6 @@
+                                                              mpegts_demuxer_read_packet, // read callback
+                                                              NULL,                 // write callback
+                                                              mpegts_demuxer_seek); // seek callback
+-#else
+-                ByteIOContext *io_context = av_alloc_put_byte(io_buffer,          // buffer
+-                                                              BUFFER_SIZE,        // buffer size
+-                                                              0,                  // read only
+-                                                              demuxer,            // opaque reference
+-                                                              mpegts_demuxer_read_packet, // read callback
+-                                                              NULL,               // write callback
+-                                                              mpegts_demuxer_seek); // seek callback
+-#endif // LIBAVCODEC_NEW
+ 
+                 if (!io_context)
+                 {
+@@ -970,20 +946,12 @@
+ 
+                 AVInputFormat* iformat = av_find_input_format("mpegts");
+ 
+-#if LIBAVCODEC_NEW
+                 action = get_init_action(demuxer, avformat_open_input(&demuxer->context, "", iformat, NULL));
+-#else
+-                action = get_init_action(demuxer, av_open_input_stream(&demuxer->context, io_context, "", iformat, NULL));
+-#endif
+ 
+                 if (action != PA_READ_FRAME)
+                     break;
+ 
+-#if LIBAVCODEC_NEW
+                 action = get_init_action(demuxer, avformat_find_stream_info(demuxer->context, NULL));
+-#else
+-                action = get_init_action(demuxer, av_find_stream_info(demuxer->context));
+-#endif
+ 
+                 g_mutex_lock(demuxer->lock);
+                 gint available = gst_adapter_available(demuxer->sink_adapter);
+@@ -1013,11 +981,7 @@
+             {
+                 av_free(demuxer->context->pb->buffer);
+                 av_free(demuxer->context->pb);
+-#if LIBAVCODEC_NEW
+                 avformat_free_context(demuxer->context);
+-#else
+-                av_free(demuxer->context);
+-#endif
+                 demuxer->context = NULL;
+             }
+             break;
+@@ -1078,14 +1042,7 @@
+         }
+     }
+     else
+-    {
+-#if LIBAVCODEC_NEW
+         result = AVERROR_EXIT;
+-#else
+-        result = AVERROR_IO;
+-#endif // LIBAVCODEC_NEW
+-
+-    }
+ 
+     g_mutex_unlock(demuxer->lock);
+ 
+@@ -1268,11 +1225,7 @@
+     {
+         av_free(demuxer->context->pb->buffer);
+         av_free(demuxer->context->pb);
+-#if LIBAVCODEC_NEW
+         avformat_free_context(demuxer->context);
+-#else
+-        av_free(demuxer->context);
+-#endif
+         demuxer->context = NULL;
+     }
+ 
+--- a/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.c
++++ b/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.c
+@@ -117,7 +117,7 @@
+ 
+     gst_element_class_set_details_simple(element_class,
+                 "Videodecoder",
+-        "Codec/Decoder/Video",
++                "Codec/Decoder/Video",
+                 "Decode video stream",
+                 "Oracle Corporation");
+ 
+@@ -135,7 +135,6 @@
+ static GstFlowReturn        videodecoder_chain(GstPad *pad, GstBuffer *buf);
+ 
+ static void                 videodecoder_init_state(VideoDecoder *decoder);
+-static void                 videodecoder_close_decoder(VideoDecoder *decoder);
+ static void                 videodecoder_state_reset(VideoDecoder *decoder);
+ 
+ static void videodecoder_class_init(VideoDecoderClass *klass)
+@@ -189,7 +188,7 @@
+     switch (transition)
+     {
+         case GST_STATE_CHANGE_PAUSED_TO_READY:
+-            videodecoder_close_decoder(decoder);
++            basedecoder_close_decoder(BASEDECODER(decoder));
+             break;
+         default:
+             break;
+@@ -249,8 +248,6 @@
+  ***********************************************************************************/
+ static void videodecoder_init_state(VideoDecoder *decoder)
+ {
+-    decoder->yuv_frame = NULL;
+-
+     decoder->width = decoder->height = 0;
+     decoder->u_offset = 0;
+     decoder->v_offset = 0;
+@@ -258,47 +255,9 @@
+     decoder->frame_size = 0;
+     decoder->discont = FALSE;
+ 
+-#if ! LIBAVCODEC_NEW
+-    decoder->packet = NULL;
+-    decoder->packet_size = 0;
+-#endif // LIBAVCODEC_NEW
+-
+     basedecoder_init_state(BASEDECODER(decoder));
+ }
+ 
+-static gboolean videodecoder_open_decoder(VideoDecoder *decoder)
+-{
+-    if (!basedecoder_open_decoder(BASEDECODER(decoder), CODEC_ID_H264))
+-        return FALSE;
+-
+-    decoder->yuv_frame = avcodec_alloc_frame();
+-    if (!decoder->yuv_frame)
+-        return FALSE; // Can't create frame
+-
+-    return TRUE;
+-}
+-
+-static void videodecoder_close_decoder(VideoDecoder *decoder)
+-{
+-    if (decoder->yuv_frame)
+-    {
+-        av_free(decoder->yuv_frame);
+-        decoder->yuv_frame = NULL;
+-    }
+-
+-#if ! LIBAVCODEC_NEW
+-    if (decoder->packet)
+-    {
+-        av_free(decoder->packet);
+-
+-        decoder->packet = NULL;
+-        decoder->packet_size = 0;
+-    }
+-#endif
+-
+-    basedecoder_close_decoder(BASEDECODER(decoder));
+-}
+-
+ static gboolean videodecoder_configure(VideoDecoder *decoder, GstCaps *sink_caps)
+ {
+     BaseDecoder *base = BASEDECODER(decoder);
+@@ -311,7 +270,11 @@
+     // Pass stencil context to init against if there is one.
+     basedecoder_set_codec_data(base, s);
+ 
+-    base->is_initialized = videodecoder_open_decoder(decoder);
++#if NEW_CODEC_ID
++    base->is_initialized = basedecoder_open_decoder(BASEDECODER(decoder), AV_CODEC_ID_H264);
++#else
++    base->is_initialized = basedecoder_open_decoder(BASEDECODER(decoder), CODEC_ID_H264);
++#endif    
+     return base->is_initialized;
+ }
+ 
+@@ -334,19 +297,19 @@
+ 
+         decoder->discont = (GST_PAD_CAPS(base->srcpad) != NULL);
+ 
+-        decoder->u_offset = decoder->yuv_frame->linesize[0] * decoder->height;
+-        decoder->uv_blocksize = decoder->yuv_frame->linesize[1] * decoder->height / 2;
++        decoder->u_offset = base->frame->linesize[0] * decoder->height;
++        decoder->uv_blocksize = base->frame->linesize[1] * decoder->height / 2;
+ 
+         decoder->v_offset = decoder->u_offset + decoder->uv_blocksize;
+-        decoder->frame_size = (decoder->yuv_frame->linesize[0] + decoder->yuv_frame->linesize[1]) * decoder->height;
++        decoder->frame_size = (base->frame->linesize[0] + base->frame->linesize[1]) * decoder->height;
+ 
+         GstCaps *src_caps = gst_caps_new_simple("video/x-raw-yuv",
+                                                 "format", GST_TYPE_FOURCC, GST_STR_FOURCC("YV12"),
+                                                 "width", G_TYPE_INT, decoder->width,
+                                                 "height", G_TYPE_INT, decoder->height,
+-                                                "stride-y", G_TYPE_INT, decoder->yuv_frame->linesize[0],
+-                                                "stride-u", G_TYPE_INT, decoder->yuv_frame->linesize[1],
+-                                                "stride-v", G_TYPE_INT, decoder->yuv_frame->linesize[2],
++                                                "stride-y", G_TYPE_INT, base->frame->linesize[0],
++                                                "stride-u", G_TYPE_INT, base->frame->linesize[1],
++                                                "stride-v", G_TYPE_INT, base->frame->linesize[2],
+                                                 "offset-y", G_TYPE_INT, 0,
+                                                 "offset-u", G_TYPE_INT, decoder->u_offset,
+                                                 "offset-v", G_TYPE_INT, decoder->v_offset,
+@@ -389,7 +352,6 @@
+         goto _exit;
+     }
+ 
+-#if LIBAVCODEC_NEW
+     if (!base->is_hls)
+     {
+         if (av_new_packet(&decoder->packet, GST_BUFFER_SIZE(buf)) == 0)
+@@ -399,7 +361,7 @@
+                 base->context->reordered_opaque = GST_BUFFER_TIMESTAMP(buf);
+             else
+                 base->context->reordered_opaque = AV_NOPTS_VALUE;
+-            num_dec = avcodec_decode_video2(base->context, decoder->yuv_frame, &decoder->frame_finished, &decoder->packet);
++            num_dec = avcodec_decode_video2(base->context, base->frame, &decoder->frame_finished, &decoder->packet);
+             av_free_packet(&decoder->packet);
+         }
+         else
+@@ -418,43 +380,8 @@
+         else
+             base->context->reordered_opaque = AV_NOPTS_VALUE;
+ 
+-        num_dec = avcodec_decode_video2(base->context, decoder->yuv_frame, &decoder->frame_finished, &decoder->packet);
+-    }
+-
+-#else // ! LIBAVCODEC_NEW
+-    if (!base->is_hls)
+-    {
+-        if (decoder->packet_size < GST_BUFFER_SIZE(buf))
+-        {
+-            decoder->packet = av_realloc(decoder->packet, GST_BUFFER_SIZE(buf));
+-            decoder->packet_size = decoder->packet ? GST_BUFFER_SIZE(buf) : 0;
+-        }
+-
+-        if (decoder->packet)
+-        {
+-            memcpy(decoder->packet, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf));
+-            if (GST_BUFFER_TIMESTAMP_IS_VALID(buf))
+-                base->context->reordered_opaque = GST_BUFFER_TIMESTAMP(buf);
+-            else
+-                base->context->reordered_opaque = AV_NOPTS_VALUE;
+-            num_dec = avcodec_decode_video(base->context, decoder->yuv_frame, &decoder->frame_finished, decoder->packet, GST_BUFFER_SIZE(buf));
+-        }
+-        else
+-        {
+-            result = GST_FLOW_ERROR;
+-            goto _exit;
+-        }
++        num_dec = avcodec_decode_video2(base->context, base->frame, &decoder->frame_finished, &decoder->packet);
+     }
+-    else
+-    {
+-        if (GST_BUFFER_TIMESTAMP_IS_VALID(buf))
+-            base->context->reordered_opaque = GST_BUFFER_TIMESTAMP(buf);
+-        else
+-            base->context->reordered_opaque = AV_NOPTS_VALUE;
+-        num_dec = avcodec_decode_video(base->context, decoder->yuv_frame, &decoder->frame_finished, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf));
+-    }
+-
+-#endif // LIBAVCODEC_NEW
+ 
+     if (num_dec < 0)
+     {
+@@ -486,17 +413,17 @@
+             }
+             else
+             {
+-                if (decoder->yuv_frame->reordered_opaque != AV_NOPTS_VALUE)
++                if (base->frame->reordered_opaque != AV_NOPTS_VALUE)
+                 {
+-                    GST_BUFFER_TIMESTAMP(outbuf) = decoder->yuv_frame->reordered_opaque;
++                    GST_BUFFER_TIMESTAMP(outbuf) = base->frame->reordered_opaque;
+                     GST_BUFFER_DURATION(outbuf) = GST_BUFFER_DURATION(buf); // Duration for video usually same
+                 }
+                 GST_BUFFER_SIZE(outbuf) = decoder->frame_size;
+ 
+                 // Copy image by parts from different arrays.
+-                memcpy(GST_BUFFER_DATA(outbuf),                     decoder->yuv_frame->data[0], decoder->u_offset);
+-                memcpy(GST_BUFFER_DATA(outbuf) + decoder->u_offset, decoder->yuv_frame->data[1], decoder->uv_blocksize);
+-                memcpy(GST_BUFFER_DATA(outbuf) + decoder->v_offset, decoder->yuv_frame->data[2], decoder->uv_blocksize);
++                memcpy(GST_BUFFER_DATA(outbuf),                     base->frame->data[0], decoder->u_offset);
++                memcpy(GST_BUFFER_DATA(outbuf) + decoder->u_offset, base->frame->data[1], decoder->uv_blocksize);
++                memcpy(GST_BUFFER_DATA(outbuf) + decoder->v_offset, base->frame->data[2], decoder->uv_blocksize);
+ 
+                 GST_BUFFER_OFFSET_END(outbuf) = GST_BUFFER_OFFSET_NONE;
+ 
+--- a/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.h
++++ b/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.h
+@@ -58,14 +58,8 @@
+     int         u_offset;
+     int         v_offset;
+     int         uv_blocksize;
+-    AVFrame     *yuv_frame;
+ 
+-#if LIBAVCODEC_NEW
+     AVPacket       packet;
+-#else // ! LIBAVCODEC_NEW
+-    uint8_t        *packet;
+-    int            packet_size;
+-#endif // LIBAVCODEC_NEW
+ };
+ 
+ struct _VideoDecoderClass
+--- /dev/null
++++ b/modules/media/src/main/native/gstreamer/plugins/av/avdefines.h
+@@ -0,0 +1,40 @@
++/*
++ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++#ifndef AVDEFINES_H
++#define	AVDEFINES_H
++
++// According to ffmpeg Git they introduced
++// _decode_audio4  in version 53.25.0
++#define DECODE_AUDIO4   (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0))
++
++// New AVCodecID was introduced in 54.25.0
++#define NEW_CODEC_ID    (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0))
++
++// New Frame alloc functions were introduced in 55.28.0
++#define NEW_ALLOC_FRAME (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,0))
++
++#endif	/* AVDEFINES_H */
++
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..4e43f59
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+01-skip-verify-java.patch
+02-use-system-libraries.patch
+03-buildflags.patch
+04-libav-compatibility.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..4aeaeb1
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,54 @@
+#!/usr/bin/make -f
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
+export JAVA_HOME  = /usr/lib/jvm/java-8-openjdk-$(DEB_HOST_ARCH)
+
+%:
+	dh $@ 
+
+override_dh_auto_build:
+	dh_auto_build
+	cp debian/gradle.properties .
+	gradle --offline --stacktrace
+
+override_dh_install:
+	dh_install -i
+
+	gzip -r -v --best build/linux-sdk/man/
+	dh_install -popenjfx build/linux-sdk/bin/* $(JAVA_HOME)/bin
+	dh_install -popenjfx build/linux-sdk/man   $(JAVA_HOME)
+	dh_link -popenjfx $(JAVA_HOME)/bin/javafxpackager           /usr/bin/javafxpackager
+	dh_link -popenjfx $(JAVA_HOME)/man/man1/javafxpackager.1.gz /usr/share/man/man1/javafxpackager.1.gz
+
+	dh_install -plibopenjfx-java build/linux-sdk/lib                 $(JAVA_HOME)
+	dh_install -plibopenjfx-java build/linux-sdk/rt/lib/*.jar        $(JAVA_HOME)/jre/lib
+	dh_install -plibopenjfx-java build/linux-sdk/rt/lib/*.properties $(JAVA_HOME)/jre/lib
+	dh_install -plibopenjfx-java build/linux-sdk/rt/lib/ext          $(JAVA_HOME)/jre/lib
+
+	dh_install -plibopenjfx-jni build/linux-sdk/rt/lib/$(DEB_HOST_ARCH) $(JAVA_HOME)/jre/lib
+
+	dh_install -popenjfx-source build/javafx-src.zip $(JAVA_HOME)
+
+override_dh_auto_clean:
+	dh_auto_clean
+	rm -f gradle.properties
+	rm -Rf build .gradle buildSrc/.gradle/ buildSrc/build/
+	rm -Rf modules/base/build/
+	rm -Rf modules/graphics/build/
+	rm -Rf modules/controls/build/
+	rm -Rf modules/designTime/build/
+	rm -Rf modules/swing/build/
+	rm -Rf modules/builders/build/
+	rm -Rf modules/extensions/build/
+	rm -Rf modules/fxml/build/
+	rm -Rf modules/fxpackager/build/
+	rm -Rf modules/media/build/
+	rm -Rf modules/swt/build/
+	rm -Rf modules/web/build/
+	rm -Rf modules/jmx/build/
+	rm -Rf tests/system/build/
+	rm -f modules/web/src/main/native/Source/WebCore/inspector/CodeGeneratorInspectorStrings.pyc
+
+get-orig-source:
+	uscan --download-current-version --force-download --rename
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..7be9c90
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://87.98.165.193/checkjdk.php .*/jdk(\d(?:u\d+)-b\d+).tar.gz debian debian/orig-tar.sh

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/openjfx.git



More information about the pkg-java-commits mailing list