changeset 9279:d753d6865b89 9-b85

Automated merge with http://hg.openjdk.java.net/openjfx/9/rt
author kcr
date Tue, 06 Oct 2015 09:23:15 -0700
parents 64cd004c2f5b 1909f0a4308f
children 0837e0c3f9ff e16275cacd8b
files modules/controls/src/test/java/test/com/sun/javafx/scene/control/LabeledImplTestOther.java modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsasrc.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsasrc.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioamplify.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiochebband.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiochebband.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiocheblimit.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiocheblimit.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiodynamic.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiodynamic.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioecho.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioecho.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiofirfilter.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiofirfilter.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiofxbasefirfilter.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiofxbasefirfilter.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiofxbaseiirfilter.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiofxbaseiirfilter.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioiirfilter.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioiirfilter.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioinvert.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioinvert.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiokaraoke.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiokaraoke.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiowsincband.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiowsincband.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiowsinclimit.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiowsinclimit.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/gstscaletempo.c modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/gstscaletempo.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/math_compat.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/sys/osxvideo/cocoawindow.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/sys/osxvideo/cocoawindow.m modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/sys/osxvideo/osxvideosink.h modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/sys/osxvideo/osxvideosink.m tests/system/src/test/java/com/sun/prism/es2/ES2Helper.java tests/system/src/test/java/javafx/scene/PhongMaterialTest.java
diffstat 132 files changed, 3175 insertions(+), 13056 deletions(-) [+]
line wrap: on
line diff
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/controls/menu/MenuApp.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/controls/menu/MenuApp.java	Tue Oct 06 09:23:15 2015 -0700
@@ -112,7 +112,7 @@
 
             final CheckMenuItem useSystemMenuBarCB = new CheckMenuItem("Use System Menu Bar (works only when MenuApp is run outside of Ensemble)");
             useSystemMenuBarCB.setSelected(true);
-            menuBar.useSystemMenuBarProperty().bind(useSystemMenuBarCB.selectedProperty());
+            menuBar.useSystemMenuBarProperty().bindBidirectional(useSystemMenuBarCB.selectedProperty());
             systemMenuBarMenu.getItems().add(useSystemMenuBarCB);
 
             menuBar.getMenus().add(systemMenuBarMenu);
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/overlaymediaplayer/OverlayMediaPlayerApp.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/overlaymediaplayer/OverlayMediaPlayerApp.java	Tue Oct 06 09:23:15 2015 -0700
@@ -77,7 +77,8 @@
         if (status == MediaPlayer.Status.UNKNOWN || status == MediaPlayer.Status.HALTED) {
             return;
         }
-        if (status == MediaPlayer.Status.PAUSED || status == MediaPlayer.Status.STOPPED || status == MediaPlayer.Status.READY) {
+        if (status == MediaPlayer.Status.PAUSED || status == MediaPlayer.Status.STOPPED ||
+            status == MediaPlayer.Status.READY) {
             mediaPlayer.play();
         }
     }
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/overlaymediaplayer/PlayerPane.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/overlaymediaplayer/PlayerPane.java	Tue Oct 06 09:23:15 2015 -0700
@@ -50,6 +50,7 @@
 import javafx.scene.control.ToolBar;
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.HBox;
+import javafx.scene.layout.Priority;
 import javafx.scene.layout.Region;
 import javafx.scene.media.MediaPlayer;
 import javafx.scene.media.MediaView;
@@ -149,7 +150,8 @@
                 transition.play();
             });
 
-            mp.currentTimeProperty().addListener((ObservableValue<? extends Duration> observable, Duration oldValue, Duration newValue) -> {
+            mp.currentTimeProperty().addListener((ObservableValue<? extends Duration> observable,
+                                                  Duration oldValue, Duration newValue) -> {
                 updateValues();
             });
             mp.setOnPlaying(() -> {
@@ -182,14 +184,19 @@
             timeSlider.setId("media-slider");
             timeSlider.setMinWidth(200);
             timeSlider.setMaxWidth(Double.MAX_VALUE);
-            timeSlider.valueProperty().addListener((Observable ov) -> {
+            timeSlider.valueProperty().addListener((ObservableValue<? extends Number> observable,
+                                                    Number old, Number now) -> {
                 if (timeSlider.isValueChanging()) {
                     // multiply duration by percentage calculated by slider position
                     if (duration != null) {
                         mp.seek(duration.multiply(timeSlider.getValue() / 100.0));
                     }
                     updateValues();
-                    
+                } else if (Math.abs(now.doubleValue() - old.doubleValue()) > 1.5) {
+                    // multiply duration by percentage calculated by slider position
+                    if (duration != null) {
+                        mp.seek(duration.multiply(timeSlider.getValue() / 100.0));
+                    }
                 }
             });
             mediaTopBar.getChildren().add(timeSlider);
@@ -216,11 +223,15 @@
             volumeSlider.setMaxWidth(Region.USE_PREF_SIZE);
             volumeSlider.valueProperty().addListener((Observable ov) -> {
             });
-            volumeSlider.valueProperty().addListener((ObservableValue<? extends Number> observable, Number oldValue, Number newValue) -> {
+            volumeSlider.valueProperty().addListener((ObservableValue<? extends Number> observable,
+                                                      Number old, Number now) -> {
                 if (volumeSlider.isValueChanging()) {
                     mp.setVolume(volumeSlider.getValue() / 100.0);
+                } else {
+                    mp.setVolume(volumeSlider.getValue() / 100.0);
                 }
             });
+            HBox.setHgrow(volumeSlider, Priority.ALWAYS);
             mediaTopBar.getChildren().add(volumeSlider);
                         
             final EventHandler<ActionEvent> backAction = (ActionEvent e) -> {
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/streamingmediaplayer/PlayerPane.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/streamingmediaplayer/PlayerPane.java	Tue Oct 06 09:23:15 2015 -0700
@@ -131,7 +131,8 @@
         BorderPane.setAlignment(mediaTopBar, Pos.CENTER);
 
 
-        mp.currentTimeProperty().addListener((ObservableValue<? extends Duration> observable, Duration oldValue, Duration newValue) -> {
+        mp.currentTimeProperty().addListener((ObservableValue<? extends Duration> observable,
+                                              Duration oldValue, Duration newValue) -> {
             updateValues();
         });
         mp.setOnPlaying(() -> {
@@ -163,14 +164,19 @@
         timeSlider.setId("media-slider");
         timeSlider.setMinWidth(240);
         timeSlider.setMaxWidth(Double.MAX_VALUE);
-        timeSlider.valueProperty().addListener((Observable ov) -> {
+        timeSlider.valueProperty().addListener((ObservableValue<? extends Number> observable,
+                                                Number old, Number now) -> {
             if (timeSlider.isValueChanging()) {
                 // multiply duration by percentage calculated by slider position
                 if (duration != null) {
                     mp.seek(duration.multiply(timeSlider.getValue() / 100.0));
                 }
                 updateValues();
-                
+            } else if (Math.abs(now.doubleValue() - old.doubleValue()) > 1.5) {
+                // multiply duration by percentage calculated by slider position
+                if (duration != null) {
+                    mp.seek(duration.multiply(timeSlider.getValue() / 100.0));
+                }
             }
         });
         HBox.setHgrow(timeSlider, Priority.ALWAYS);
@@ -192,14 +198,20 @@
         volumeSlider = new Slider();
         volumeSlider.setId("media-slider");
         volumeSlider.setPrefWidth(120);
-        volumeSlider.setMaxWidth(Double.MAX_VALUE);
+        volumeSlider.setMinWidth(30);
+        volumeSlider.setMaxWidth(Region.USE_PREF_SIZE);
         volumeSlider.valueProperty().addListener((Observable ov) -> {
         });
-        volumeSlider.valueProperty().addListener((ObservableValue<? extends Number> observable, Number oldValue, Number newValue) -> {
+        volumeSlider.valueProperty().addListener((ObservableValue<? extends Number> observable,
+                                                  Number old, Number now) -> {
+            
             if (volumeSlider.isValueChanging()) {
                 mp.setVolume(volumeSlider.getValue() / 100.0);
+            } else {
+                mp.setVolume(volumeSlider.getValue() / 100.0);
             }
         });
+        
         HBox.setHgrow(volumeSlider, Priority.ALWAYS);
         mediaTopBar.getChildren().add(volumeSlider);
 
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/streamingmediaplayer/StreamingMediaPlayerApp.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/media/streamingmediaplayer/StreamingMediaPlayerApp.java	Tue Oct 06 09:23:15 2015 -0700
@@ -54,7 +54,7 @@
 public class StreamingMediaPlayerApp extends Application {
 
     private String streamingMediaPlayerCss = StreamingMediaPlayerApp.class.getResource("StreamingMediaPlayer.css").toExternalForm();
-    private static final String MEDIA_URL = "http://download.oracle.com/otndocs/products/javafx/JavaRap/prog_index.m3u8";
+    private static final String MEDIA_URL = "http://download.oracle.com/otndocs/javafx/JavaRap_ProRes_H264_768kbit_Widescreen.mp4";
     private MediaPlayer mediaPlayer;
 
     public Parent createContent() {
@@ -74,7 +74,8 @@
         if (status == MediaPlayer.Status.UNKNOWN || status == MediaPlayer.Status.HALTED) {
             return;
         }
-        if (status == MediaPlayer.Status.PAUSED || status == MediaPlayer.Status.STOPPED || status == MediaPlayer.Status.READY) {
+        if (status == MediaPlayer.Status.PAUSED || status == MediaPlayer.Status.STOPPED ||
+            status == MediaPlayer.Status.READY) {
             mediaPlayer.play();
         }
     }
--- a/apps/toys/Hello/src/main/java/hello/HelloMenu.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/apps/toys/Hello/src/main/java/hello/HelloMenu.java	Tue Oct 06 09:23:15 2015 -0700
@@ -179,7 +179,7 @@
 
             final CheckMenuItem useSystemMenuBarCB = new CheckMenuItem("Use _System Menu Bar");
             useSystemMenuBarCB.setSelected(true);
-            menuBar.useSystemMenuBarProperty().bind(useSystemMenuBarCB.selectedProperty());
+            menuBar.useSystemMenuBarProperty().bindBidirectional(useSystemMenuBarCB.selectedProperty());
             systemMenuBarMenu.getItems().add(useSystemMenuBarCB);
 
             menuBar.getMenus().add(systemMenuBarMenu);
--- a/modules/base/src/main/java/com/sun/javafx/binding/MapExpressionHelper.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/base/src/main/java/com/sun/javafx/binding/MapExpressionHelper.java	Tue Oct 06 09:23:15 2015 -0700
@@ -403,6 +403,8 @@
                             }
                             invalidationListeners = null;
                             invalidationSize = 0;
+                        } else if ((invalidationSize == 2) && (changeSize == 0) && (mapChangeSize == 0)) {
+                            return new SingleInvalidation<>(observable, invalidationListeners[1-index]);
                         } else {
                             final int numMoved = invalidationSize - index - 1;
                             final InvalidationListener[] oldListeners = invalidationListeners;
@@ -415,7 +417,7 @@
                             }
                             invalidationSize--;
                             if (!locked) {
-                                invalidationListeners[--invalidationSize] = null; // Let gc do its work
+                                invalidationListeners[invalidationSize] = null; // Let gc do its work
                             }
                         }
                         break;
@@ -463,6 +465,8 @@
                             }
                             changeListeners = null;
                             changeSize = 0;
+                        } else if ((changeSize == 2) && (invalidationSize == 0) && (mapChangeSize == 0)) {
+                            return new SingleChange<>(observable, changeListeners[1-index]);
                         } else {
                             final int numMoved = changeSize - index - 1;
                             final ChangeListener<? super ObservableMap<K, V>>[] oldListeners = changeListeners;
@@ -475,7 +479,7 @@
                             }
                             changeSize--;
                             if (!locked) {
-                                changeListeners[--changeSize] = null; // Let gc do its work
+                                changeListeners[changeSize] = null; // Let gc do its work
                             }
                         }
                         break;
@@ -523,6 +527,8 @@
                             }
                             mapChangeListeners = null;
                             mapChangeSize = 0;
+                        } else if ((mapChangeSize == 2) && (invalidationSize == 0) && (changeSize == 0)) {
+                            return new SingleMapChange<>(observable, mapChangeListeners[1-index]);
                         } else {
                             final int numMoved = mapChangeSize - index - 1;
                             final MapChangeListener<? super K, ? super V>[] oldListeners = mapChangeListeners;
@@ -535,7 +541,7 @@
                             }
                             mapChangeSize--;
                             if (!locked) {
-                                mapChangeListeners[--mapChangeSize] = null; // Let gc do its work
+                                mapChangeListeners[mapChangeSize] = null; // Let gc do its work
                             }
                         }
                         break;
--- a/modules/base/src/main/java/com/sun/javafx/binding/SetExpressionHelper.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/base/src/main/java/com/sun/javafx/binding/SetExpressionHelper.java	Tue Oct 06 09:23:15 2015 -0700
@@ -394,6 +394,8 @@
                             }
                             invalidationListeners = null;
                             invalidationSize = 0;
+                        } else if ((invalidationSize == 2) && (changeSize == 0) && (setChangeSize == 0)) {
+                            return new SingleInvalidation<>(observable, invalidationListeners[1-index]);
                         } else {
                             final int numMoved = invalidationSize - index - 1;
                             final InvalidationListener[] oldListeners = invalidationListeners;
@@ -406,7 +408,7 @@
                             }
                             invalidationSize--;
                             if (!locked) {
-                                invalidationListeners[--invalidationSize] = null; // Let gc do its work
+                                invalidationListeners[invalidationSize] = null; // Let gc do its work
                             }
                         }
                         break;
@@ -454,6 +456,8 @@
                             }
                             changeListeners = null;
                             changeSize = 0;
+                        } else if ((changeSize == 2) && (invalidationSize == 0) && (setChangeSize == 0)) {
+                            return new SingleChange<>(observable, changeListeners[1-index]);
                         } else {
                             final int numMoved = changeSize - index - 1;
                             final ChangeListener<? super ObservableSet<E>>[] oldListeners = changeListeners;
@@ -514,6 +518,8 @@
                             }
                             setChangeListeners = null;
                             setChangeSize = 0;
+                        } else if ((setChangeSize == 2) && (invalidationSize == 0) && (changeSize == 0)) {
+                            return new SingleSetChange<>(observable, setChangeListeners[1-index]);
                         } else {
                             final int numMoved = setChangeSize - index - 1;
                             final SetChangeListener<? super E>[] oldListeners = setChangeListeners;
--- a/modules/base/src/test/java/test/com/sun/javafx/binding/ListExpressionHelperTest.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/base/src/test/java/test/com/sun/javafx/binding/ListExpressionHelperTest.java	Tue Oct 06 09:23:15 2015 -0700
@@ -442,6 +442,22 @@
     }
 
     @Test
+    public void testRemoveInvalidation8136465() {
+        helper = ListExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+        helper = ListExpressionHelper.addListener(helper, observable, invalidationListener[1]);
+
+        ListExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(observable, 1);
+        invalidationListener[1].check(observable, 1);
+
+        helper = ListExpressionHelper.removeListener(helper, invalidationListener[0]);
+
+        ListExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(observable, 1);
+    }
+
+    @Test
     public void testAddInvalidationWhileLocked() {
         final ChangeListener<Object> addingListener = new ChangeListener() {
             int index = 0;
@@ -591,6 +607,24 @@
     }
 
     @Test
+    public void testRemoveChange8136465() {
+        helper = ListExpressionHelper.addListener(helper, observable, changeListener[0]);
+        helper = ListExpressionHelper.addListener(helper, observable, changeListener[1]);
+
+        observable.set(data2);
+        ListExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(observable, data1, data2, 1);
+        changeListener[1].check(observable, data1, data2, 1);
+
+        helper = ListExpressionHelper.removeListener(helper, changeListener[0]);
+
+        observable.set(data1);
+        ListExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(observable, data2, data1, 1);
+    }
+
+    @Test
     public void testAddChangeWhileLocked() {
         final InvalidationListener addingListener = new InvalidationListener() {
             int index = 0;
@@ -758,6 +792,27 @@
     }
 
     @Test
+    public void testRemoveListChange8136465() {
+        helper = ListExpressionHelper.addListener(helper, observable, listChangeListener[0]);
+        helper = ListExpressionHelper.addListener(helper, observable, listChangeListener[1]);
+
+        observable.set(data2);
+        ListExpressionHelper.fireValueChangedEvent(helper);
+        listChangeListener[0].check1AddRemove(observable, FXCollections.emptyObservableList(), 0, 1);
+        listChangeListener[0].clear();
+        listChangeListener[1].check1AddRemove(observable, FXCollections.emptyObservableList(), 0, 1);
+        listChangeListener[1].clear();
+
+        helper = ListExpressionHelper.removeListener(helper, listChangeListener[0]);
+
+        observable.set(data1);
+        ListExpressionHelper.fireValueChangedEvent(helper);
+        listChangeListener[0].check0();
+        listChangeListener[1].check1AddRemove(observable, FXCollections.singletonObservableList(listItem), 0, 0);
+        listChangeListener[1].clear();
+    }
+
+    @Test
     public void testAddListChangeWhileLocked() {
         final InvalidationListener addingListener = new InvalidationListener() {
             int index = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/base/src/test/java/test/com/sun/javafx/binding/MapExpressionHelperTest.java	Tue Oct 06 09:23:15 2015 -0700
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+package test.com.sun.javafx.binding;
+
+import com.sun.javafx.binding.MapExpressionHelper;
+import javafx.beans.property.MapProperty;
+import javafx.beans.property.SimpleMapProperty;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableMap;
+import org.junit.Before;
+import org.junit.Test;
+import test.javafx.beans.InvalidationListenerMock;
+import test.javafx.beans.value.ChangeListenerMock;
+import test.javafx.collections.MockMapObserver;
+
+public class MapExpressionHelperTest {
+    private static final ObservableMap<Object, Object> UNDEFINED = null;
+    private Object key;
+    private Object value;
+    private ObservableMap<Object, Object> data1;
+    private ObservableMap<Object, Object> data2;
+
+    private MapExpressionHelper helper;
+    private MapProperty<Object, Object> observable;
+
+    private InvalidationListenerMock[] invalidationListener;
+    private ChangeListenerMock<? super ObservableMap<Object, Object>>[] changeListener;
+    private MockMapObserver<Object, Object>[] mapChangeListener;
+
+    @Before
+    public void setUp() {
+        key = new Object();
+        value = new Object();
+        data1 = FXCollections.observableHashMap();
+        data2 = FXCollections.observableHashMap();
+        data2.put(key, value);
+
+        helper = null;
+        observable = new SimpleMapProperty<>(data1);
+
+        invalidationListener = new InvalidationListenerMock[]{
+            new InvalidationListenerMock(), new InvalidationListenerMock(), new InvalidationListenerMock()
+        };
+        changeListener = new ChangeListenerMock[]{
+            new ChangeListenerMock(UNDEFINED), new ChangeListenerMock(UNDEFINED), new ChangeListenerMock(UNDEFINED)
+        };
+        mapChangeListener = new MockMapObserver[]{
+            new MockMapObserver<>(), new MockMapObserver<>(), new MockMapObserver<>()
+        };
+    }
+
+    @Test
+    public void testRemoveInvalidation() {
+        helper = MapExpressionHelper.addListener(helper, observable, changeListener[0]);
+        helper = MapExpressionHelper.addListener(helper, observable, mapChangeListener[0]);
+
+        helper = MapExpressionHelper.removeListener(helper, invalidationListener[1]);
+
+        helper = MapExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+
+        helper = MapExpressionHelper.removeListener(helper, invalidationListener[1]);
+
+        helper = MapExpressionHelper.addListener(helper, observable, invalidationListener[2]);
+        helper = MapExpressionHelper.addListener(helper, observable, invalidationListener[1]);
+
+        helper = MapExpressionHelper.removeListener(helper, invalidationListener[0]);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(observable, 1);
+        invalidationListener[2].check(observable, 1);
+
+        helper = MapExpressionHelper.removeListener(helper, invalidationListener[1]);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(null, 0);
+        invalidationListener[2].check(observable, 1);
+
+        helper = MapExpressionHelper.removeListener(helper, invalidationListener[2]);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(null, 0);
+        invalidationListener[2].check(null, 0);
+    }
+
+    @Test
+    public void testRemoveInvalidation8136465() {
+        helper = MapExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+        helper = MapExpressionHelper.addListener(helper, observable, invalidationListener[1]);
+
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(observable, 1);
+        invalidationListener[1].check(observable, 1);
+
+        helper = MapExpressionHelper.removeListener(helper, invalidationListener[0]);
+
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(observable, 1);
+    }
+
+    @Test
+    public void testRemoveChange() {
+        helper = MapExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+        helper = MapExpressionHelper.addListener(helper, observable, mapChangeListener[0]);
+
+        helper = MapExpressionHelper.removeListener(helper, changeListener[1]);
+
+        helper = MapExpressionHelper.addListener(helper, observable, changeListener[0]);
+
+        helper = MapExpressionHelper.removeListener(helper, changeListener[1]);
+
+        helper = MapExpressionHelper.addListener(helper, observable, changeListener[2]);
+        helper = MapExpressionHelper.addListener(helper, observable, changeListener[1]);
+
+        helper = MapExpressionHelper.removeListener(helper, changeListener[0]);
+        observable.set(data2);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(observable, data1, data2, 1);
+        changeListener[2].check(observable, data1, data2, 1);
+
+        helper = MapExpressionHelper.removeListener(helper, changeListener[1]);
+        observable.set(data1);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[2].check(observable, data2, data1, 1);
+
+        helper = MapExpressionHelper.removeListener(helper, changeListener[2]);
+        observable.set(data2);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[2].check(null, UNDEFINED, UNDEFINED, 0);
+    }
+
+    @Test
+    public void testRemoveChange8136465() {
+        helper = MapExpressionHelper.addListener(helper, observable, changeListener[0]);
+        helper = MapExpressionHelper.addListener(helper, observable, changeListener[1]);
+
+        observable.set(data2);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(observable, data1, data2, 1);
+        changeListener[1].check(observable, data1, data2, 1);
+
+        helper = MapExpressionHelper.removeListener(helper, changeListener[0]);
+
+        observable.set(data1);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(observable, data2, data1, 1);
+    }
+
+    @Test
+    public void testRemoveMapChange() {
+        helper = MapExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+        helper = MapExpressionHelper.addListener(helper, observable, changeListener[0]);
+
+        helper = MapExpressionHelper.removeListener(helper, mapChangeListener[1]);
+
+        helper = MapExpressionHelper.addListener(helper, observable, mapChangeListener[0]);
+
+        helper = MapExpressionHelper.removeListener(helper, mapChangeListener[1]);
+
+        helper = MapExpressionHelper.addListener(helper, observable, mapChangeListener[2]);
+        helper = MapExpressionHelper.addListener(helper, observable, mapChangeListener[1]);
+
+        helper = MapExpressionHelper.removeListener(helper, mapChangeListener[0]);
+        observable.set(data2);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        mapChangeListener[0].check0();
+        mapChangeListener[1].assertAdded(MockMapObserver.Tuple.tup(key, value));
+        mapChangeListener[1].clear();
+        mapChangeListener[2].assertAdded(MockMapObserver.Tuple.tup(key, value));
+        mapChangeListener[2].clear();
+
+        helper = MapExpressionHelper.removeListener(helper, mapChangeListener[1]);
+        observable.set(data1);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        mapChangeListener[0].check0();
+        mapChangeListener[1].check0();
+        mapChangeListener[2].assertRemoved(MockMapObserver.Tuple.tup(key, value));
+        mapChangeListener[2].clear();
+
+        helper = MapExpressionHelper.removeListener(helper, mapChangeListener[2]);
+        observable.set(data2);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        mapChangeListener[0].check0();
+        mapChangeListener[1].check0();
+        mapChangeListener[2].check0();
+    }
+
+    @Test
+    public void testRemoveMapChange8136465() {
+        helper = MapExpressionHelper.addListener(helper, observable, mapChangeListener[0]);
+        helper = MapExpressionHelper.addListener(helper, observable, mapChangeListener[1]);
+
+        observable.set(data2);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        mapChangeListener[0].assertAdded(MockMapObserver.Tuple.tup(key, value));
+        mapChangeListener[0].clear();
+        mapChangeListener[1].assertAdded(MockMapObserver.Tuple.tup(key, value));
+        mapChangeListener[1].clear();
+
+        helper = MapExpressionHelper.removeListener(helper, mapChangeListener[0]);
+
+        observable.set(data1);
+        MapExpressionHelper.fireValueChangedEvent(helper);
+        mapChangeListener[0].check0();
+        mapChangeListener[1].assertRemoved(MockMapObserver.Tuple.tup(key, value));
+        mapChangeListener[1].clear();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/base/src/test/java/test/com/sun/javafx/binding/SetExpressionHelperTest.java	Tue Oct 06 09:23:15 2015 -0700
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+package test.com.sun.javafx.binding;
+
+import com.sun.javafx.binding.SetExpressionHelper;
+import javafx.beans.property.SetProperty;
+import javafx.beans.property.SimpleSetProperty;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableSet;
+import org.junit.Before;
+import org.junit.Test;
+import test.javafx.beans.InvalidationListenerMock;
+import test.javafx.beans.value.ChangeListenerMock;
+import test.javafx.collections.MockSetObserver;
+
+public class SetExpressionHelperTest {
+    private static final ObservableSet<Object> UNDEFINED = null;
+    private Object value;
+    private ObservableSet<Object> data1;
+    private ObservableSet<Object> data2;
+
+    private SetExpressionHelper helper;
+    private SetProperty<Object> observable;
+
+    private InvalidationListenerMock[] invalidationListener;
+    private ChangeListenerMock<? super ObservableSet<Object>>[] changeListener;
+    private MockSetObserver<Object>[] setChangeListener;
+
+    @Before
+    public void setUp() {
+        value = new Object();
+        data1 = FXCollections.observableSet();
+        data2 = FXCollections.observableSet(value);
+
+        helper = null;
+        observable = new SimpleSetProperty<>(data1);
+
+        invalidationListener = new InvalidationListenerMock[]{
+            new InvalidationListenerMock(), new InvalidationListenerMock(), new InvalidationListenerMock()
+        };
+        changeListener = new ChangeListenerMock[]{
+            new ChangeListenerMock(UNDEFINED), new ChangeListenerMock(UNDEFINED), new ChangeListenerMock(UNDEFINED)
+        };
+        setChangeListener = new MockSetObserver[]{
+            new MockSetObserver<>(), new MockSetObserver<>(), new MockSetObserver<>()
+        };
+    }
+
+    @Test
+    public void testRemoveInvalidation() {
+        helper = SetExpressionHelper.addListener(helper, observable, changeListener[0]);
+        helper = SetExpressionHelper.addListener(helper, observable, setChangeListener[0]);
+
+        helper = SetExpressionHelper.removeListener(helper, invalidationListener[1]);
+
+        helper = SetExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+
+        helper = SetExpressionHelper.removeListener(helper, invalidationListener[1]);
+
+        helper = SetExpressionHelper.addListener(helper, observable, invalidationListener[2]);
+        helper = SetExpressionHelper.addListener(helper, observable, invalidationListener[1]);
+
+        helper = SetExpressionHelper.removeListener(helper, invalidationListener[0]);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(observable, 1);
+        invalidationListener[2].check(observable, 1);
+
+        helper = SetExpressionHelper.removeListener(helper, invalidationListener[1]);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(null, 0);
+        invalidationListener[2].check(observable, 1);
+
+        helper = SetExpressionHelper.removeListener(helper, invalidationListener[2]);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(null, 0);
+        invalidationListener[2].check(null, 0);
+    }
+
+    @Test
+    public void testRemoveInvalidation8136465() {
+        helper = SetExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+        helper = SetExpressionHelper.addListener(helper, observable, invalidationListener[1]);
+
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(observable, 1);
+        invalidationListener[1].check(observable, 1);
+
+        helper = SetExpressionHelper.removeListener(helper, invalidationListener[0]);
+
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        invalidationListener[0].check(null, 0);
+        invalidationListener[1].check(observable, 1);
+    }
+
+    @Test
+    public void testRemoveChange() {
+        helper = SetExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+        helper = SetExpressionHelper.addListener(helper, observable, setChangeListener[0]);
+
+        helper = SetExpressionHelper.removeListener(helper, changeListener[1]);
+
+        helper = SetExpressionHelper.addListener(helper, observable, changeListener[0]);
+
+        helper = SetExpressionHelper.removeListener(helper, changeListener[1]);
+
+        helper = SetExpressionHelper.addListener(helper, observable, changeListener[2]);
+        helper = SetExpressionHelper.addListener(helper, observable, changeListener[1]);
+
+        helper = SetExpressionHelper.removeListener(helper, changeListener[0]);
+        observable.set(data2);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(observable, data1, data2, 1);
+        changeListener[2].check(observable, data1, data2, 1);
+
+        helper = SetExpressionHelper.removeListener(helper, changeListener[1]);
+        observable.set(data1);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[2].check(observable, data2, data1, 1);
+
+        helper = SetExpressionHelper.removeListener(helper, changeListener[2]);
+        observable.set(data2);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[2].check(null, UNDEFINED, UNDEFINED, 0);
+    }
+
+    @Test
+    public void testRemoveChange8136465() {
+        helper = SetExpressionHelper.addListener(helper, observable, changeListener[0]);
+        helper = SetExpressionHelper.addListener(helper, observable, changeListener[1]);
+
+        observable.set(data2);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(observable, data1, data2, 1);
+        changeListener[1].check(observable, data1, data2, 1);
+
+        helper = SetExpressionHelper.removeListener(helper, changeListener[0]);
+
+        observable.set(data1);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        changeListener[0].check(null, UNDEFINED, UNDEFINED, 0);
+        changeListener[1].check(observable, data2, data1, 1);
+    }
+
+    @Test
+    public void testRemoveMapChange() {
+        helper = SetExpressionHelper.addListener(helper, observable, invalidationListener[0]);
+        helper = SetExpressionHelper.addListener(helper, observable, changeListener[0]);
+
+        helper = SetExpressionHelper.removeListener(helper, setChangeListener[1]);
+
+        helper = SetExpressionHelper.addListener(helper, observable, setChangeListener[0]);
+
+        helper = SetExpressionHelper.removeListener(helper, setChangeListener[1]);
+
+        helper = SetExpressionHelper.addListener(helper, observable, setChangeListener[2]);
+        helper = SetExpressionHelper.addListener(helper, observable, setChangeListener[1]);
+
+        helper = SetExpressionHelper.removeListener(helper, setChangeListener[0]);
+        observable.set(data2);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        setChangeListener[0].check0();
+        setChangeListener[1].assertAdded(MockSetObserver.Tuple.tup(value));
+        setChangeListener[1].clear();
+        setChangeListener[2].assertAdded(MockSetObserver.Tuple.tup(value));
+        setChangeListener[2].clear();
+
+        helper = SetExpressionHelper.removeListener(helper, setChangeListener[1]);
+        observable.set(data1);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        setChangeListener[0].check0();
+        setChangeListener[1].check0();
+        setChangeListener[2].assertRemoved(MockSetObserver.Tuple.tup(value));
+        setChangeListener[2].clear();
+
+        helper = SetExpressionHelper.removeListener(helper, setChangeListener[2]);
+        observable.set(data2);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        setChangeListener[0].check0();
+        setChangeListener[1].check0();
+        setChangeListener[2].check0();
+    }
+
+    @Test
+    public void testRemoveSetChange8136465() {
+        helper = SetExpressionHelper.addListener(helper, observable, setChangeListener[0]);
+        helper = SetExpressionHelper.addListener(helper, observable, setChangeListener[1]);
+
+        observable.set(data2);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        setChangeListener[0].assertAdded(MockSetObserver.Tuple.tup(value));
+        setChangeListener[0].clear();
+        setChangeListener[1].assertAdded(MockSetObserver.Tuple.tup(value));
+        setChangeListener[1].clear();
+
+        helper = SetExpressionHelper.removeListener(helper, setChangeListener[0]);
+
+        observable.set(data1);
+        SetExpressionHelper.fireValueChangedEvent(helper);
+        setChangeListener[0].check0();
+        setChangeListener[1].assertRemoved(MockSetObserver.Tuple.tup(value));
+        setChangeListener[1].clear();
+    }
+}
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java	Tue Oct 06 09:23:15 2015 -0700
@@ -149,12 +149,10 @@
                 keyMapping(new KeyBinding(BACK_SPACE), e -> deletePreviousChar(), validWhenEditable),
                 keyMapping(new KeyBinding(BACK_SPACE).shift(), e -> deletePreviousChar(), validWhenEditable),
                 keyMapping(new KeyBinding(DELETE), e -> deleteNextChar(), validWhenEditable),
-                keyMapping(new KeyBinding(DELETE).shift(), e -> deleteNextChar(), validWhenEditable),
 
                 // cut (only applies when control is editable)
-                keyMapping(new KeyBinding(X).shortcut(), e -> c.cut(), validWhenEditable),
+                keyMapping(new KeyBinding(X).shortcut(), e -> cut(), validWhenEditable),
                 keyMapping(new KeyBinding(CUT), e -> cut(), validWhenEditable),
-                keyMapping(new KeyBinding(DELETE).shift(), e -> cut(), validWhenEditable),
 
                 // copy
                 keyMapping(new KeyBinding(C).shortcut(), e -> c.copy()),
@@ -162,7 +160,7 @@
                 keyMapping(COPY, e -> c.copy()),
 
                 // paste (only applies when control is editable)
-                keyMapping(new KeyBinding(V).shortcut(), e -> c.paste(), validWhenEditable),
+                keyMapping(new KeyBinding(V).shortcut(), e -> paste(), validWhenEditable),
                 keyMapping(new KeyBinding(PASTE), e -> paste(), validWhenEditable),
                 keyMapping(new KeyBinding(INSERT).shift(), e -> paste(), validWhenEditable),
 
@@ -173,8 +171,6 @@
                 keyMapping(new KeyBinding(DOWN).shift(), e -> selectEnd()),
                 keyMapping(new KeyBinding(HOME).shortcut().shift(), e -> selectHome()),
                 keyMapping(new KeyBinding(END).shortcut().shift(), e -> selectEnd()),
-                keyMapping(new KeyBinding(LEFT).shortcut().shift(), e -> selectHomeExtend()),
-                keyMapping(new KeyBinding(RIGHT).shortcut().shift(), e -> selectEndExtend()),
                 keyMapping(new KeyBinding(A).shortcut(), e -> c.selectAll()),
 
                 // Traversal Bindings
@@ -186,9 +182,7 @@
                 // The following keys are forwarded to the parent container
                 new KeyMapping(ESCAPE, this::cancelEdit),
 
-                // Linux specific mappings
-                keyMapping(new KeyBinding(Z).ctrl(), e -> undo(), validOnLinux),
-                keyMapping(new KeyBinding(Z).ctrl().shift(), e -> redo(), validOnLinux),
+                keyMapping(new KeyBinding(Z).shortcut(), e -> undo()),
 
                 // character input.
                 // Any other key press first goes to normal text input
@@ -238,8 +232,9 @@
             keyMapping(new KeyBinding(DELETE).alt(), e -> deleteNextWord()),
             keyMapping(new KeyBinding(BACK_SPACE).alt(), e -> deletePreviousWord()),
             keyMapping(new KeyBinding(BACK_SPACE).shortcut(), e -> deleteFromLineStart()),
-            keyMapping(new KeyBinding(Z).shortcut(), e -> undo()),
             keyMapping(new KeyBinding(Z).shortcut().shift(), e -> redo()),
+            keyMapping(new KeyBinding(LEFT).shortcut().shift(), e -> selectHomeExtend()),
+            keyMapping(new KeyBinding(RIGHT).shortcut().shift(), e -> selectEndExtend()),
 
             // Mac OS specific selection mappings
             keyMapping(new KeyBinding(LEFT).shift().alt(), e -> selectLeftWord()),
@@ -259,8 +254,10 @@
             keyMapping(new KeyBinding(DELETE).ctrl(), e -> deleteNextWord()),
             keyMapping(new KeyBinding(BACK_SPACE).ctrl(), e -> deletePreviousWord()),
             keyMapping(new KeyBinding(BACK_SLASH).ctrl(), e -> c.deselect()),
-            keyMapping(new KeyBinding(Z).ctrl(), e -> undo()),
-            keyMapping(new KeyBinding(Y).ctrl(), e -> redo())
+            keyMapping(new KeyBinding(Y).ctrl(), e -> redo(), validOnWindows),
+            keyMapping(new KeyBinding(Z).ctrl().shift(), e -> redo(), validOnLinux),
+            keyMapping(new KeyBinding(LEFT).ctrl().shift(), e -> selectLeftWord()),
+            keyMapping(new KeyBinding(RIGHT).ctrl().shift(), e -> selectRightWord())
         );
         addDefaultChildMap(inputMap, nonMacOsInputMap);
 
@@ -702,7 +699,7 @@
     private final MenuItem copyMI   = new ContextMenuItem("Copy", e -> getNode().copy());
     private final MenuItem pasteMI  = new ContextMenuItem("Paste", e -> paste());
     private final MenuItem deleteMI = new ContextMenuItem("DeleteSelection", e -> deleteSelection());
-    private final MenuItem selectWordMI = new ContextMenuItem("SelectWord", e -> selectNextWord());
+    private final MenuItem selectWordMI = new ContextMenuItem("SelectWord", e -> selectWord());
     private final MenuItem selectAllMI = new ContextMenuItem("SelectAll", e -> getNode().selectAll());
     private final MenuItem separatorMI = new SeparatorMenuItem();
 
--- a/modules/controls/src/main/java/javafx/scene/control/skin/ComboBoxPopupControl.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/ComboBoxPopupControl.java	Tue Oct 06 09:23:15 2015 -0700
@@ -34,7 +34,6 @@
 import com.sun.javafx.scene.traversal.TraversalContext;
 import javafx.beans.InvalidationListener;
 import javafx.beans.value.ObservableValue;
-import javafx.css.PseudoClass;
 import javafx.css.Styleable;
 import javafx.event.EventHandler;
 import javafx.geometry.Bounds;
@@ -137,6 +136,11 @@
             if (getEditor() != null) {
                 // Fix for the regression noted in a comment in RT-29885.
                 ((FakeFocusTextField)textField).setFakeFocus(hasFocus);
+
+                // JDK-8120120 (aka RT-21454) and JDK-8136838
+                if (!hasFocus) {
+                    setTextFromTextFieldIntoComboBoxValue();
+                }
             }
         });
 
@@ -581,6 +585,4 @@
      *                                                                         *
      **************************************************************************/
 
-    private static PseudoClass CONTAINS_FOCUS_PSEUDOCLASS_STATE = PseudoClass.getPseudoClass("contains-focus");
-
 }
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css	Tue Oct 06 09:23:15 2015 -0700
@@ -3186,8 +3186,8 @@
     -fx-background-insets: 0 0 -1 0, 0, 1 0 1 1;
 }
 
-.combo-box-base:editable:contains-focus,
-.date-picker:contains-focus {
+.combo-box-base:editable:focused,
+.date-picker:focused {
     -fx-background-color: -fx-focus-color, -fx-outer-border, -fx-control-inner-background;
     -fx-background-radius: 5.4, 3, 2;
     -fx-background-insets: -1.4, 0, 1;
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css	Tue Oct 06 09:23:15 2015 -0700
@@ -1767,8 +1767,8 @@
     -fx-background-insets: 1 0 1 1;
     -fx-background-radius: 2 0 0 2;
 }
-.combo-box-base:editable:contains-focus,
-.date-picker:contains-focus {
+.combo-box-base:editable:focused,
+.date-picker:focused {
     -fx-background-color: -fx-focus-color;
     -fx-background-insets: -0.2;
     -fx-background-radius: 3;
@@ -1784,8 +1784,8 @@
     -fx-background-insets: 1 0 1 1, 1 0 1 1, 3 2 3 3;
     -fx-background-radius: 2 0 0 2, 1 0 0 1, 0;
 }
-.combo-box-base:editable:contains-focus > .arrow-button,
-.date-picker:contains-focus > .arrow-button {
+.combo-box-base:editable:focused > .arrow-button,
+.date-picker:focused > .arrow-button {
     -fx-background-color: -fx-inner-border, -fx-body-color, -fx-faint-focus-color, -fx-body-color;
     -fx-background-insets: 1, 2, 1, 2.6;
     -fx-background-radius: 0 2 2 0, 0 1 1 0, 0 1 1 0, 0 1 1 0;
--- a/modules/controls/src/test/java/com/sun/javafx/scene/control/ContextMenuContentShim.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/test/java/com/sun/javafx/scene/control/ContextMenuContentShim.java	Tue Oct 06 09:23:15 2015 -0700
@@ -24,18 +24,15 @@
  */
 package com.sun.javafx.scene.control;
 
-import test.com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
-import test.com.sun.javafx.scene.control.infrastructure.MouseEventFirer;
 import javafx.collections.ObservableList;
 import javafx.scene.Node;
 import javafx.scene.control.ContextMenu;
-import javafx.scene.control.CustomMenuItem;
 import javafx.scene.control.Menu;
 import javafx.scene.control.MenuItem;
 import javafx.scene.control.skin.ContextMenuSkin;
-import javafx.scene.input.KeyCode;
 
 import java.util.Optional;
+import javafx.scene.layout.Region;
 
 public class ContextMenuContentShim {
 
@@ -43,6 +40,10 @@
         // no-op
     }
 
+    public static Region get_selectedBackground(ContextMenuContent menu) {
+        return menu.selectedBackground;
+    }
+
     public static Menu getOpenSubMenu(ContextMenu menu) {
         ContextMenuContent content = getMenuContent(menu);
         return content.getOpenSubMenu();
@@ -137,70 +138,4 @@
         return null;
     }
 
-    public static void pressDownKey(ContextMenu menu) {
-//        getShowingMenuContent(menu).ifPresent(content -> new KeyEventFirer(content).doDownArrowPress());
-        Optional<ContextMenuContent> showingMenuContent = getShowingMenuContent(menu);
-        if (showingMenuContent.isPresent()) {
-            ContextMenuContent content = showingMenuContent.get();
-            new KeyEventFirer(content).doDownArrowPress();
-        }
-    }
-
-    public static void pressUpKey(ContextMenu menu) {
-//        getShowingMenuContent(menu).ifPresent(content -> new KeyEventFirer(content).doUpArrowPress());
-        Optional<ContextMenuContent> showingMenuContent = getShowingMenuContent(menu);
-        if (showingMenuContent.isPresent()) {
-            ContextMenuContent content = showingMenuContent.get();
-            new KeyEventFirer(content).doUpArrowPress();
-        }
-    }
-
-    public static void pressLeftKey(ContextMenu menu) {
-//        getShowingMenuContent(menu).ifPresent(content -> new KeyEventFirer(content).doLeftArrowPress());
-        Optional<ContextMenuContent> showingMenuContent = getShowingMenuContent(menu);
-        if (showingMenuContent.isPresent()) {
-            ContextMenuContent content = showingMenuContent.get();
-            new KeyEventFirer(content).doLeftArrowPress();
-        }
-    }
-
-    public static void pressRightKey(ContextMenu menu) {
-//        getShowingMenuContent(menu).ifPresent(content -> new KeyEventFirer(content).doRightArrowPress());
-        Optional<ContextMenuContent> showingMenuContent = getShowingMenuContent(menu);
-        if (showingMenuContent.isPresent()) {
-            ContextMenuContent content = showingMenuContent.get();
-            new KeyEventFirer(content).doRightArrowPress();
-        }
-    }
-
-    public static void pressEnterKey(ContextMenu menu) {
-//        getShowingMenuContent(menu).ifPresent(content -> new KeyEventFirer(content).doKeyPress(KeyCode.ENTER));
-        Optional<ContextMenuContent> showingMenuContent = getShowingMenuContent(menu);
-        if (showingMenuContent.isPresent()) {
-            ContextMenuContent content = showingMenuContent.get();
-            new KeyEventFirer(content).doKeyPress(KeyCode.ENTER);
-        }
-    }
-
-    public static void pressMouseButton(ContextMenu menu) {
-        Optional<ContextMenuContent> showingMenuContent = getShowingMenuContent(menu);
-        if (showingMenuContent.isPresent()) {
-            ContextMenuContent.MenuItemContainer itemContainer =
-                    (ContextMenuContent.MenuItemContainer) showingMenuContent.get().selectedBackground;
-
-            MenuItem item = itemContainer.getItem();
-            if (item instanceof CustomMenuItem) {
-                // If the item is a CustomMenuItem, we fire the event on the
-                // content of that CustomMenuItem.
-                // Also, note that we firea mouse _clicked_ event, as opposed to
-                // a press and release. I'm not sure why this is what the
-                // ContextMenuContent code expects, but I didn't want to mess with
-                // it at this point.
-                Node customContent = ((CustomMenuItem)item).getContent();
-                new MouseEventFirer(customContent).fireMouseClicked();
-            } else {
-                new MouseEventFirer(itemContainer).fireMousePressAndRelease();
-            }
-        }
-    }
 }
--- a/modules/controls/src/test/java/javafx/scene/control/skin/TableColumnHeaderShim.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/test/java/javafx/scene/control/skin/TableColumnHeaderShim.java	Tue Oct 06 09:23:15 2015 -0700
@@ -24,24 +24,16 @@
  */
 package javafx.scene.control.skin;
 
-import test.com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
 import javafx.scene.control.TableColumn;
 import javafx.scene.control.TableColumnBase;
-import javafx.scene.control.skin.TableColumnHeader;
 
 public class TableColumnHeaderShim {
 
-    public static int getColumnIndex(TableColumn col) {
-        TableColumnHeader colHeader = VirtualFlowTestUtils.getTableColumnHeader(col.getTableView(), col);
-        return colHeader == null ? -1 : colHeader.columnIndex;
-    }
-
     public static int getColumnIndex(TableColumnHeader colHeader) {
         return colHeader == null ? -1 : colHeader.columnIndex;
     }
 
-    public static void moveColumn(TableColumn col, int newPos) {
-        TableColumnHeader colHeader = VirtualFlowTestUtils.getTableColumnHeader(col.getTableView(), col);
+    public static void moveColumn(TableColumn col, TableColumnHeader colHeader, int newPos) {
         colHeader.moveColumn(col, newPos);
     }
 
@@ -49,14 +41,19 @@
         return header.sortPos;
     }
 
-    public static void moveColumn(TableColumn col, int dragOffset, int x) {
-        TableColumnHeader colHeader = VirtualFlowTestUtils.getTableColumnHeader(col.getTableView(), col);
-        colHeader.columnReorderingStarted(dragOffset);
-        colHeader.columnReordering(x, 0);
-        colHeader.columnReorderingComplete();
+    public static TableColumnHeader getColumnHeaderFor(TableHeaderRow header, final TableColumnBase<?,?> col) {
+        return header.getColumnHeaderFor(col);
     }
 
-    public static TableColumnHeader getColumnHeaderFor(final TableHeaderRow header, final TableColumnBase<?,?> col) {
-        return header.getColumnHeaderFor(col);
+    public static void columnReorderingStarted(TableColumnHeader header, double dragOffset) {
+        header.columnReorderingStarted(dragOffset);
+    }
+
+    public static void columnReordering(TableColumnHeader header, double sceneX, double sceneY) {
+        header.columnReordering(sceneX, sceneY);
+    }
+
+    public static void columnReorderingComplete(TableColumnHeader header) {
+        header.columnReorderingComplete();
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/controls/src/test/java/test/com/sun/javafx/scene/control/LabeledImplOtherTest.java	Tue Oct 06 09:23:15 2015 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2012, 2013, 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.
+ */
+
+package test.com.sun.javafx.scene.control;
+
+import com.sun.javafx.scene.control.LabeledImpl;
+import com.sun.javafx.scene.control.skin.Utils;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.control.Labeled;
+import javafx.scene.control.MenuButton;
+import javafx.scene.control.skin.MenuButtonSkin;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.stage.Stage;
+import org.junit.Test;
+
+import java.net.URL;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class LabeledImplOtherTest {
+    
+    
+    @Test public void test_RT_21357() {
+        
+        final Labeled labeled = new Label("label");
+        final LabeledImpl labeledImpl = new LabeledImpl(labeled);
+        
+        URL url = LabeledImplOtherTest.class.getResource("/test/com/sun/javafx/scene/control/center-btn.png");
+        Image img = new Image(url.toExternalForm());
+        assertNotNull(img);
+        
+        ImageView iView = new ImageView(img);
+        labeled.setGraphic(iView);  
+        
+        assertEquals(labeled.getGraphic(), labeledImpl.getGraphic());
+        assertNotNull(labeled.getGraphic());
+    }
+
+    @Test public void test_RT_21617() {
+        
+        MenuButton mb = new MenuButton();
+        mb.setText("SomeText"); 
+        MenuButtonSkin mbs = new MenuButtonSkin(mb);
+        mb.setSkin(mbs);
+         
+        mb.setTranslateX(100);mb.setTranslateY(100); 
+        
+        Scene scene = new Scene(mb, 300, 300); 
+        scene.getStylesheets().add(LabeledImplOtherTest.class.getResource("skin/LabeledImplTest.css").toExternalForm());
+        Stage stage = new Stage();
+        stage.setScene(scene); 
+        stage.show(); 
+        
+        
+        LabeledImpl labeledImpl = (LabeledImpl)mb.lookup(".label");
+        assertNotNull(labeledImpl);
+        // LabeledImpl should not mirror the translateX/Y of the MenuButton
+        assertEquals(100, mb.getTranslateX(), 0.00001);
+        assertEquals(0, labeledImpl.getTranslateX(), 0.00001);
+        assertEquals(100, mb.getTranslateY(), 0.00001);
+        assertEquals(0, labeledImpl.getTranslateY(), 0.00001);
+        // opacity set to 50% in LabeledImplTest.css
+        assertEquals(1, mb.getOpacity(), 0.00001);
+        assertEquals(.5, labeledImpl.getOpacity(), 0.00001);
+    }
+    
+}
--- a/modules/controls/src/test/java/test/com/sun/javafx/scene/control/LabeledImplTest.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/test/java/test/com/sun/javafx/scene/control/LabeledImplTest.java	Tue Oct 06 09:23:15 2015 -0700
@@ -68,7 +68,7 @@
         final StubImageLoaderFactory imageLoaderFactory =
                 ((StubToolkit) Toolkit.getToolkit()).getImageLoaderFactory();
         imageLoaderFactory.reset();
-        imageLoaderFactory.registerImage(FXVK.class.getResource("caspian/center-btn.png").toExternalForm(),
+        imageLoaderFactory.registerImage(LabeledImplTest.class.getResource("/test/com/sun/javafx/scene/control/center-btn.png").toExternalForm(),
                 new StubPlatformImageInfo(32, 32));
     }
 
@@ -131,9 +131,7 @@
             } else if ("-fx-wrap-text".equals(prop)) {
                 value = Boolean.TRUE;
             } else if ("-fx-graphic".equals(prop)) {
-                // FXVK is used here as it is located within com.sun.javafx.scene.control.skin,
-                // which is useful when trying to load caspian / modena resources.
-                value = FXVK.class.getResource("caspian/center-btn.png").toExternalForm();
+                value = LabeledImplTest.class.getResource("/test/com/sun/javafx/scene/control/center-btn.png").toExternalForm();
             } else if ("-fx-underline".equals(prop)) {
                 value = Boolean.TRUE;
             } else if ("-fx-content-display".equals(prop)) {
--- a/modules/controls/src/test/java/test/com/sun/javafx/scene/control/LabeledImplTestOther.java	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, 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.
- */
-
-package test.com.sun.javafx.scene.control;
-
-import com.sun.javafx.scene.control.LabeledImpl;
-import com.sun.javafx.scene.control.skin.Utils;
-import javafx.scene.Scene;
-import javafx.scene.control.Label;
-import javafx.scene.control.Labeled;
-import javafx.scene.control.MenuButton;
-import javafx.scene.control.skin.MenuButtonSkin;
-import javafx.scene.image.Image;
-import javafx.scene.image.ImageView;
-import javafx.stage.Stage;
-import org.junit.Test;
-
-import java.net.URL;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class LabeledImplTestOther {
-    
-    
-    @Test public void test_RT_21357() {
-        
-        final Labeled labeled = new Label("label");
-        final LabeledImpl labeledImpl = new LabeledImpl(labeled);
-        
-        URL url = Utils.class.getResource("caspian/center-btn.png");
-        Image img = new Image(url.toExternalForm());
-        assertNotNull(img);
-        
-        ImageView iView = new ImageView(img);
-        labeled.setGraphic(iView);  
-        
-        assertEquals(labeled.getGraphic(), labeledImpl.getGraphic());
-        assertNotNull(labeled.getGraphic());
-    }
-
-    @Test public void test_RT_21617() {
-        
-        MenuButton mb = new MenuButton();
-        mb.setText("SomeText"); 
-        MenuButtonSkin mbs = new MenuButtonSkin(mb);
-        mb.setSkin(mbs);
-         
-        mb.setTranslateX(100);mb.setTranslateY(100); 
-        
-        Scene scene = new Scene(mb, 300, 300); 
-        scene.getStylesheets().add(LabeledImplTestOther.class.getResource("LabeledImplTest.css").toExternalForm());
-        Stage stage = new Stage();
-        stage.setScene(scene); 
-        stage.show(); 
-        
-        
-        LabeledImpl labeledImpl = (LabeledImpl)mb.lookup(".label");
-        assertNotNull(labeledImpl);
-        // LabeledImpl should not mirror the translateX/Y of the MenuButton
-        assertEquals(100, mb.getTranslateX(), 0.00001);
-        assertEquals(0, labeledImpl.getTranslateX(), 0.00001);
-        assertEquals(100, mb.getTranslateY(), 0.00001);
-        assertEquals(0, labeledImpl.getTranslateY(), 0.00001);
-        // opacity set to 50% in LabeledImplTest.css
-        assertEquals(1, mb.getOpacity(), 0.00001);
-        assertEquals(.5, labeledImpl.getOpacity(), 0.00001);
-    }
-    
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/controls/src/test/java/test/com/sun/javafx/scene/control/infrastructure/TableColumnHeaderUtil.java	Tue Oct 06 09:23:15 2015 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+package test.com.sun.javafx.scene.control.infrastructure;
+
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.skin.TableColumnHeader;
+import javafx.scene.control.skin.TableColumnHeaderShim;
+
+public class TableColumnHeaderUtil {
+
+    public static int getColumnIndex(TableColumn col) {
+        TableColumnHeader colHeader = VirtualFlowTestUtils.getTableColumnHeader(col.getTableView(), col);
+        return TableColumnHeaderShim.getColumnIndex(colHeader);
+    }
+
+    public static void moveColumn(TableColumn col, int newPos) {
+        TableColumnHeader colHeader = VirtualFlowTestUtils.getTableColumnHeader(col.getTableView(), col);
+        TableColumnHeaderShim.moveColumn(col, colHeader, newPos);
+    }
+
+    public static void moveColumn(TableColumn col, int dragOffset, int x) {
+        TableColumnHeader colHeader = VirtualFlowTestUtils.getTableColumnHeader(col.getTableView(), col);
+        TableColumnHeaderShim.columnReorderingStarted(colHeader, dragOffset);
+        TableColumnHeaderShim.columnReordering(colHeader, x, 0);
+        TableColumnHeaderShim.columnReorderingComplete(colHeader);
+    }
+    
+}
--- a/modules/controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java	Tue Oct 06 09:23:15 2015 -0700
@@ -25,6 +25,8 @@
 
 package test.javafx.scene.control;
 
+import com.sun.javafx.scene.control.ContextMenuContent;
+import com.sun.javafx.scene.control.ContextMenuContentShim;
 import test.com.sun.javafx.scene.control.infrastructure.StageLoader;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
@@ -42,8 +44,69 @@
 
 import static org.junit.Assert.*;
 import static com.sun.javafx.scene.control.ContextMenuContentShim.*;
+import java.util.Optional;
+import javafx.scene.Node;
+import javafx.scene.input.KeyCode;
+import test.com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
+import test.com.sun.javafx.scene.control.infrastructure.MouseEventFirer;
 
 public class ContextMenuTest {
+
+    public static void pressDownKey(ContextMenu menu) {
+        Optional<ContextMenuContent> showingMenuContent = ContextMenuContentShim.getShowingMenuContent(menu);
+        if (showingMenuContent.isPresent()) {
+            ContextMenuContent content = showingMenuContent.get();
+            new KeyEventFirer(content).doDownArrowPress();
+        }
+    }
+
+    public static void pressUpKey(ContextMenu menu) {
+        Optional<ContextMenuContent> showingMenuContent = ContextMenuContentShim.getShowingMenuContent(menu);
+        if (showingMenuContent.isPresent()) {
+            ContextMenuContent content = showingMenuContent.get();
+            new KeyEventFirer(content).doUpArrowPress();
+        }
+    }
+
+    public static void pressRightKey(ContextMenu menu) {
+        Optional<ContextMenuContent> showingMenuContent = ContextMenuContentShim.getShowingMenuContent(menu);
+        if (showingMenuContent.isPresent()) {
+            ContextMenuContent content = showingMenuContent.get();
+            new KeyEventFirer(content).doRightArrowPress();
+        }
+    }
+
+    public static void pressEnterKey(ContextMenu menu) {
+        Optional<ContextMenuContent> showingMenuContent = ContextMenuContentShim.getShowingMenuContent(menu);
+        if (showingMenuContent.isPresent()) {
+            ContextMenuContent content = showingMenuContent.get();
+            new KeyEventFirer(content).doKeyPress(KeyCode.ENTER);
+        }
+    }
+
+    public static void pressLeftKey(ContextMenu menu) {
+        Optional<ContextMenuContent> showingMenuContent = ContextMenuContentShim.getShowingMenuContent(menu);
+        if (showingMenuContent.isPresent()) {
+            ContextMenuContent content = showingMenuContent.get();
+            new KeyEventFirer(content).doLeftArrowPress();
+        }
+    }
+
+    public static void pressMouseButton(ContextMenu menu) {
+        Optional<ContextMenuContent> showingMenuContent = ContextMenuContentShim.getShowingMenuContent(menu);
+        if (showingMenuContent.isPresent()) {
+            ContextMenuContent.MenuItemContainer itemContainer =  (ContextMenuContent.MenuItemContainer)
+                    ContextMenuContentShim.get_selectedBackground(showingMenuContent.get());
+            MenuItem item = itemContainer.getItem();
+            if (item instanceof CustomMenuItem) {
+                Node customContent = ((CustomMenuItem) item).getContent();
+                new MouseEventFirer(customContent).fireMouseClicked();
+            } else {
+                new MouseEventFirer(itemContainer).fireMousePressAndRelease();
+            }
+        }
+    }
+
     private MenuItem menuItem0, menuItem1, menuItem2, menuItem3;
 
     private ContextMenu contextMenu;
--- a/modules/controls/src/test/java/test/javafx/scene/control/TableViewTest.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/controls/src/test/java/test/javafx/scene/control/TableViewTest.java	Tue Oct 06 09:23:15 2015 -0700
@@ -101,9 +101,9 @@
 import test.com.sun.javafx.scene.control.test.Person;
 import test.com.sun.javafx.scene.control.test.RT_22463_Person;
 
-import static javafx.scene.control.skin.TableColumnHeaderShim.*;
 import javafx.scene.control.skin.TableHeaderRowShim;
 import static org.junit.Assert.assertEquals;
+import test.com.sun.javafx.scene.control.infrastructure.TableColumnHeaderUtil;
 
 public class TableViewTest {
     private TableView<String> table;
@@ -2082,12 +2082,12 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-
-        moveColumn(col1, 1);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(0, getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+
+        TableColumnHeaderUtil.moveColumn(col1, 1);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col2));
 
         sl.dispose();
     }
@@ -2100,12 +2100,12 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-
-        moveColumn(col2, 0);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(0, getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+
+        TableColumnHeaderUtil.moveColumn(col2, 0);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col2));
 
         sl.dispose();
     }
@@ -2119,14 +2119,14 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-
-        moveColumn(col1, 1);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(0, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col1, 1);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2140,14 +2140,14 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-
-        moveColumn(col2, 0);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(0, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col2, 0);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2161,14 +2161,14 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-
-        moveColumn(col2, 2);
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(2, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col2, 2);
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2182,14 +2182,14 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-
-        moveColumn(col3, 1);
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(2, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col3, 1);
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2203,14 +2203,14 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-
-        moveColumn(col1, 2);
-        assertEquals(2, getColumnIndex(col1));
-        assertEquals(0, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col1, 2);
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2224,14 +2224,14 @@
 
         StageLoader sl = new StageLoader(table);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-
-        moveColumn(col3, 0);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(2, getColumnIndex(col2));
-        assertEquals(0, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col3, 0);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2247,14 +2247,14 @@
 
         col2.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-
-        moveColumn(col1, 1);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(0, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col1, 1);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2270,14 +2270,14 @@
 
         col2.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-
-        moveColumn(col1, 100);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(0, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col1, 100);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2293,14 +2293,14 @@
 
         col2.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-
-        moveColumn(col3, 0);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(0, getColumnIndex(col3));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+
+        TableColumnHeaderUtil.moveColumn(col3, 0);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col3));
 
         sl.dispose();
     }
@@ -2320,20 +2320,20 @@
         col2.setVisible(false);
         col4.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
-
-        moveColumn(col1, 1);    // 1 should represent the spot between col2 and col4
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(0, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
+
+        TableColumnHeaderUtil.moveColumn(col1, 1);    // 1 should represent the spot between col2 and col4
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
 
         sl.dispose();
     }
@@ -2353,20 +2353,20 @@
         col2.setVisible(false);
         col4.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
-
-        moveColumn(col1, 3);    // 3 should represent the end place
-        assertEquals(3, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(0, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(1, getColumnIndex(col5));
-        assertEquals(2, getColumnIndex(col6));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
+
+        TableColumnHeaderUtil.moveColumn(col1, 3);    // 3 should represent the end place
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col6));
 
         sl.dispose();
     }
@@ -2386,20 +2386,20 @@
         col2.setVisible(false);
         col4.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
-
-        moveColumn(col3, 0);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(0, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
+
+        TableColumnHeaderUtil.moveColumn(col3, 0);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
 
         sl.dispose();
     }
@@ -2419,20 +2419,20 @@
         col2.setVisible(false);
         col4.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
-
-        moveColumn(col3, 3);    // 3 should represent the end place
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(3, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(1, getColumnIndex(col5));
-        assertEquals(2, getColumnIndex(col6));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
+
+        TableColumnHeaderUtil.moveColumn(col3, 3);    // 3 should represent the end place
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col6));
 
         sl.dispose();
     }
@@ -2452,20 +2452,20 @@
         col2.setVisible(false);
         col4.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
-
-        moveColumn(col6, 0);
-        assertEquals(1, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(3, getColumnIndex(col5));
-        assertEquals(0, getColumnIndex(col6));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
+
+        TableColumnHeaderUtil.moveColumn(col6, 0);
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col6));
 
         sl.dispose();
     }
@@ -2485,20 +2485,20 @@
         col2.setVisible(false);
         col4.setVisible(false);
 
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(1, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(2, getColumnIndex(col5));
-        assertEquals(3, getColumnIndex(col6));
-
-        moveColumn(col6, 1);
-        assertEquals(0, getColumnIndex(col1));
-        assertEquals(-1, getColumnIndex(col2));
-        assertEquals(2, getColumnIndex(col3));
-        assertEquals(-1, getColumnIndex(col4));
-        assertEquals(3, getColumnIndex(col5));
-        assertEquals(1, getColumnIndex(col6));
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col6));
+
+        TableColumnHeaderUtil.moveColumn(col6, 1);
+        assertEquals(0, TableColumnHeaderUtil.getColumnIndex(col1));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col2));
+        assertEquals(2, TableColumnHeaderUtil.getColumnIndex(col3));
+        assertEquals(-1, TableColumnHeaderUtil.getColumnIndex(col4));
+        assertEquals(3, TableColumnHeaderUtil.getColumnIndex(col5));
+        assertEquals(1, TableColumnHeaderUtil.getColumnIndex(col6));
 
         sl.dispose();
     }
@@ -3302,28 +3302,28 @@
         // RT-37057).
 
         // Drag column 1 to slot 1. As expected, the column position doesn't change.
-        TableColumnHeaderShim.moveColumn(column1, 0);
+        TableColumnHeaderUtil.moveColumn(column1, 0);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 2. As expected, the column 1 and 2 swap positions.
-        TableColumnHeaderShim.moveColumn(column1, 1);
+        TableColumnHeaderUtil.moveColumn(column1, 1);
         assertEquals(column2, table.getVisibleLeafColumn(0));
         assertEquals(column1, table.getVisibleLeafColumn(1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 0. As expected, the column 1 and 2 swap positions.
-        TableColumnHeaderShim.moveColumn(column1, 0);
+        TableColumnHeaderUtil.moveColumn(column1, 0);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 1 again. What? Why did they swap positions this time?
-        TableColumnHeaderShim.moveColumn(column1, 0);
+        TableColumnHeaderUtil.moveColumn(column1, 0);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
@@ -3365,28 +3365,28 @@
         // in TableColumnHeader
 
         // Drag column 1 to slot 1. As expected, the column position doesn't change.
-        TableColumnHeaderShim.moveColumn(column1, 9, 61);
+        TableColumnHeaderUtil.moveColumn(column1, 9, 61);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 2. As expected, the column 1 and 2 swap positions.
-        TableColumnHeaderShim.moveColumn(column1, 12, 139);
+        TableColumnHeaderUtil.moveColumn(column1, 12, 139);
         assertEquals(column2, table.getVisibleLeafColumn(0));
         assertEquals(column1, table.getVisibleLeafColumn(1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 0. As expected, the column 1 and 2 swap positions.
-        TableColumnHeaderShim.moveColumn(column1, 45, 21);
+        TableColumnHeaderUtil.moveColumn(column1, 45, 21);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 1 again. What? Why did they swap positions this time?
-        TableColumnHeaderShim.moveColumn(column1, 19, 63);
+        TableColumnHeaderUtil.moveColumn(column1, 19, 63);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
@@ -3428,21 +3428,21 @@
         // RT-37057).
 
         // Drag column 1 to slot 2. As expected, the column 1 and 2 swap positions
-        TableColumnHeaderShim.moveColumn(column1, 1);
+        TableColumnHeaderUtil.moveColumn(column1, 1);
         assertEquals(column2, table.getVisibleLeafColumn(0));
         assertEquals(column1, table.getVisibleLeafColumn(1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 0. As expected, the column 1 and 2 swap positions.
-        TableColumnHeaderShim.moveColumn(column1, 0);
+        TableColumnHeaderUtil.moveColumn(column1, 0);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 4 to slot 1. What? It behaves like it was dragged to slot 0?!
-        TableColumnHeaderShim.moveColumn(column4, 1);
+        TableColumnHeaderUtil.moveColumn(column4, 1);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column4, table.getVisibleLeafColumn(1));
         assertEquals(column2, table.getVisibleLeafColumn(2));
@@ -3488,21 +3488,21 @@
         // in TableColumnHeader
 
         // Drag column 1 to slot 2. As expected, the column 1 and 2 swap positions
-        TableColumnHeaderShim.moveColumn(column1, 25, 136);
+        TableColumnHeaderUtil.moveColumn(column1, 25, 136);
         assertEquals(column2, table.getVisibleLeafColumn(0));
         assertEquals(column1, table.getVisibleLeafColumn(1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 1 to slot 0. As expected, the column 1 and 2 swap positions.
-        TableColumnHeaderShim.moveColumn(column1, 51, 23);
+        TableColumnHeaderUtil.moveColumn(column1, 51, 23);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column2, table.getVisibleLeafColumn(1));
         assertEquals(0, TableColumnHeaderShim.getColumnIndex(header1));
         assertEquals(1, TableColumnHeaderShim.getColumnIndex(header2));
 
         // Drag column 4 to slot 1. What? It behaves like it was dragged to slot 0?!
-        TableColumnHeaderShim.moveColumn(column4, 56, 103);
+        TableColumnHeaderUtil.moveColumn(column4, 56, 103);
         assertEquals(column1, table.getVisibleLeafColumn(0));
         assertEquals(column4, table.getVisibleLeafColumn(1));
         assertEquals(column2, table.getVisibleLeafColumn(2));
Binary file modules/controls/src/test/resources/test/com/sun/javafx/scene/control/center-btn.png has changed
--- a/modules/graphics/src/main/java/javafx/scene/Parent.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/Parent.java	Tue Oct 06 09:23:15 2015 -0700
@@ -497,7 +497,10 @@
                         old.setParent(null);
                         old.setScenes(null, null);
                     }
-                    if (!removedChildrenOptimizationDisabled) {
+                    // Do not add node with null scene to the removed list.
+                    // It will not be processed in the list and its memory
+                    // will not be freed.
+                    if (scene != null && !removedChildrenOptimizationDisabled) {
                         removed.add(old);
                     }
                 }
@@ -653,6 +656,11 @@
         if (oldScene != null && newScene == null) {
             // RT-34863 - clean up CSS cache when Parent is removed from scene-graph
             StyleManager.getInstance().forget(this);
+
+            // Clear removed list on parent who is no longer in a scene 
+            if (removed != null) {
+                removed.clear();
+            }
         }
 
         for (int i=0; i<children.size(); i++) {
--- a/modules/graphics/src/test/java/test/javafx/scene/Parent_structure_sync_Test.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/graphics/src/test/java/test/javafx/scene/Parent_structure_sync_Test.java	Tue Oct 06 09:23:15 2015 -0700
@@ -33,6 +33,7 @@
 import javafx.scene.Parent;
 import javafx.scene.ParentShim;
 import javafx.scene.Scene;
+import javafx.scene.layout.BorderPane;
 import javafx.scene.shape.Rectangle;
 import javafx.stage.Stage;
 import org.junit.Before;
@@ -338,4 +339,28 @@
         sync();
         assertTrue(ParentShim.test_getRemoved(parent2).isEmpty());
     }
+
+    @Test
+    public void validateParentsRemovedList2() {
+        BorderPane borderPane = new BorderPane(r1);
+        sync();
+        borderPane.setCenter(null);
+        assertNotNull(ParentShim.test_getRemoved(borderPane));
+        assertTrue(ParentShim.test_getRemoved(borderPane).isEmpty());
+        sync();
+        assertTrue(ParentShim.test_getRemoved(borderPane).isEmpty());        
+    }
+
+    @Test
+    public void validateParentsRemovedList3() {
+        BorderPane borderPane = new BorderPane(r1);
+        parent.getScene().setRoot(borderPane);
+        sync();
+        borderPane.getScene().setRoot(parent);
+        borderPane.setCenter(null);
+        assertNotNull(ParentShim.test_getRemoved(borderPane));
+        assertTrue(ParentShim.test_getRemoved(borderPane).isEmpty());
+        sync();
+        assertTrue(ParentShim.test_getRemoved(borderPane).isEmpty());
+    }
 }
--- a/modules/media/src/main/java/com/sun/media/jfxmedia/MediaManager.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmedia/MediaManager.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -57,11 +57,25 @@
      * @throws IllegalArgumentException if <code>contentType</code> is
      * <code>null</code>.
      */
-    public static boolean canPlayContentType (String contentType) {
+    public static boolean canPlayContentType(String contentType) {
         if (contentType == null) {
             throw new IllegalArgumentException("contentType == null!");
         }
-        return NativeMediaManager.getDefaultInstance().canPlayContentType (contentType);
+        return NativeMediaManager.getDefaultInstance().canPlayContentType(contentType);
+    }
+
+    /**
+     * Whether a media source having the indicated protocol may be
+     * played.
+     *
+     * @throws IllegalArgumentException if <code>contentType</code> is
+     * <code>null</code>.
+     */
+    public static boolean canPlayProtocol(String protocol) {
+        if (protocol == null) {
+            throw new IllegalArgumentException("protocol == null!");
+        }
+        return NativeMediaManager.getDefaultInstance().canPlayProtocol(protocol);
     }
 
 
--- a/modules/media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -256,7 +256,7 @@
 
         boolean needBuffer() {
             String scheme = uri.getScheme().toLowerCase();
-            return "http".equals(scheme);
+            return ("http".equals(scheme) || "https".equals(scheme));
         }
 
         boolean isSeekable() {
--- a/modules/media/src/main/java/com/sun/media/jfxmedia/locator/HLSConnectionHolder.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmedia/locator/HLSConnectionHolder.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -593,7 +593,7 @@
 
         private URI getPlaylistURI() throws URISyntaxException, MalformedURLException {
             String location = playlistsLocations.get(infoIndex);
-            if (location.startsWith("http://")) {
+            if (location.startsWith("http://") || location.startsWith("https://")) {
                 return new URI(location);
             } else {
                 return new URI(playlistURI.toURL().toString().substring(0, playlistURI.toURL().toString().lastIndexOf("/") + 1) + location);
@@ -899,7 +899,7 @@
         }
 
         private void setBaseURI(String playlistURI, String URI) {
-            if (!URI.startsWith("http://")) {
+            if (!URI.startsWith("http://") || !URI.startsWith("https://")) {
                 baseURI = playlistURI.substring(0, playlistURI.lastIndexOf("/") + 1);
             }
             needBaseURI = false;
--- a/modules/media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java	Tue Oct 06 09:23:15 2015 -0700
@@ -229,12 +229,12 @@
         }
 
         // Verify the protocol is supported.
-        if (!isIpod && !protocol.equals("file") && !protocol.equals("http")) {
+        if (!isIpod && !MediaManager.canPlayProtocol(protocol)) {
             throw new UnsupportedOperationException("Unsupported protocol \"" + protocol + "\"");
         }
 
         // Check if we can block
-        if (protocol.equals("http")) {
+        if (protocol.equals("http") || protocol.equals("https")) {
             canBlock = true;
         }
 
@@ -343,7 +343,7 @@
                 if (protocol.equals("file")) {
                     // Map file:/somepath to file:///somepath
                     uriString = uriString.replaceFirst("/", "///");
-                } else if (protocol.equals("http")) {
+                } else if (protocol.equals("http") || protocol.equals("https")) {
                     // Map http:/somepath to http://somepath
                     uriString = uriString.replaceFirst("/", "//");
                 }
@@ -386,7 +386,7 @@
                 for (int numConnectionAttempts = 0; numConnectionAttempts < MAX_CONNECTION_ATTEMPTS; numConnectionAttempts++) {
                     try {
                         // Verify existence.
-                        if (scheme.equals("http")) {
+                        if (scheme.equals("http") || scheme.equals("https")) {
                             // Check ability to connect, trying HEAD before GET.
                             LocatorConnection locatorConnection = getConnection(uri, "HEAD");
                             if (locatorConnection == null || locatorConnection.connection == null) {
--- a/modules/media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaManager.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaManager.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -67,6 +67,8 @@
     // should never change once we're initialized
     private final List<String> supportedContentTypes =
             new ArrayList();
+    private final List<String> supportedProtocols =
+            new ArrayList<>();
 
     /**
      * The NativeMediaManager singleton.
@@ -164,6 +166,28 @@
         }
     }
 
+    private synchronized void loadProtocols() {
+        if (!supportedProtocols.isEmpty()) {
+            // already populated, just return
+            return;
+        }
+
+        List<String> npt = PlatformManager.getManager().getSupportedProtocols();
+        if (null != npt && !npt.isEmpty()) {
+            supportedProtocols.addAll(npt);
+        }
+
+        if (Logger.canLog(Logger.DEBUG)) {
+            StringBuilder sb = new StringBuilder("JFXMedia supported protocols:\n");
+            for (String type : supportedProtocols) {
+                sb.append("    ");
+                sb.append(type);
+                sb.append("\n");
+            }
+            Logger.logMsg(Logger.DEBUG, sb.toString());
+        }
+    }
+
     /**
      * Whether a media source having the indicated content type may be played.
      *
@@ -195,11 +219,6 @@
         return false;
     }
 
-    /**
-     * Returns a copy of the array of supported content types.
-     *
-     * @return {@link String} array of supported content types.
-     */
     public String[] getSupportedContentTypes() {
         if (supportedContentTypes.isEmpty()) {
             loadContentTypes();
@@ -208,6 +227,37 @@
         return supportedContentTypes.toArray(new String[1]);
     }
 
+    /**
+     * Whether a media source having the indicated protocol may be played.
+     *
+     * @see MediaManager#canPlayProtocol(java.lang.String)
+     *
+     * @throws IllegalArgumentException if
+     * <code>protocol</code> is
+     * <code>null</code>.
+     */
+    public boolean canPlayProtocol(String protocol) {
+        if (protocol == null) {
+            throw new IllegalArgumentException("protocol == null!");
+        }
+
+        if (supportedProtocols.isEmpty()) {
+            loadProtocols();
+        }
+
+        /*
+         * Don't just use supportedProtocols.contains(protocol) as that
+         * is case sensitive, which we do not want
+         */
+        for (String type : supportedProtocols) {
+            if (protocol.equalsIgnoreCase(type)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
     public static MetadataParser getMetadataParser(Locator locator) {
         return PlatformManager.getManager().createMetadataParser(locator);
     }
--- a/modules/media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaPlayer.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaPlayer.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -750,7 +750,7 @@
             String contentType = media.getLocator().getContentType();
             String protocol = media.getLocator().getProtocol();
             if ((contentType != null && (contentType.equals(MediaUtils.CONTENT_TYPE_M3U) || contentType.equals(MediaUtils.CONTENT_TYPE_M3U8)))
-                    || (protocol != null && !protocol.equals("http"))) {
+                    || (protocol != null && !protocol.equals("http") && !protocol.equals("https"))) {
                 HandleBufferEvents(new BufferProgressEvent(getDuration(), 0, 1, 1));
             }
         }
--- a/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/Platform.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/Platform.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -59,14 +59,30 @@
         }
         return false;
     }
+    
+    public boolean canPlayProtocol(String protocol) {
+        String[] protocols = getSupportedProtocols();
+        if (protocols != null) {
+            for (String p : protocols) {
+                if (p.equalsIgnoreCase(protocol)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
 
     // NB: This method returns only content which can actually be PLAYED. It
     // does not account for metadata being able to be parsed without the media
     // being able to be played.
     public String[] getSupportedContentTypes() {
-        return null;
+        return new String[0];
     }
-
+    
+    public String[] getSupportedProtocols() {
+        return new String[0];
+    }
+    
     // XXX javadoc
     public MetadataParser createMetadataParser(Locator source) {
         return null;
--- a/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/PlatformManager.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/PlatformManager.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -166,6 +166,25 @@
         return outTypes;
     }
 
+    public List<String> getSupportedProtocols() {
+        ArrayList<String> outProtocols = new ArrayList<String>();
+
+        if (!platforms.isEmpty()) {
+            for (Platform platty : platforms) {
+                String[] npt = platty.getSupportedProtocols();
+                if (npt != null) {
+                    for (String p : npt) {
+                        if (!outProtocols.contains(p)) {
+                            outProtocols.add(p);
+                        }
+                    }
+                }
+            }
+        }
+
+        return outProtocols;
+    }
+
     public MetadataParser createMetadataParser(Locator source) {
         for (Platform platty : platforms) {
             MetadataParser parser = platty.createMetadataParser(source);
@@ -180,9 +199,10 @@
     // FIXME: Make Media non-platform specific, it doesn't need to be
     public Media createMedia(Locator source) {
         String mimeType = source.getContentType();
+        String protocol = source.getProtocol();
         // go down the list until we get one that can be created
         for (Platform platty : platforms) {
-            if (platty.canPlayContentType(mimeType)) {
+            if (platty.canPlayContentType(mimeType) && platty.canPlayProtocol(protocol)) {
                 Media outMedia = platty.createMedia(source);
                 if (null != outMedia) {
                     return outMedia;
@@ -195,9 +215,10 @@
 
     public MediaPlayer createMediaPlayer(Locator source) {
         String mimeType = source.getContentType();
+        String protocol = source.getProtocol();
         // go down the list until we get one that can be created
         for (Platform platty : platforms) {
-            if (platty.canPlayContentType(mimeType)) {
+            if (platty.canPlayContentType(mimeType) && platty.canPlayProtocol(protocol)) {
                 MediaPlayer outPlayer = platty.createMediaPlayer(source);
                 if (null != outPlayer) {
                     return outPlayer;
--- a/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/gstreamer/GSTPlatform.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/gstreamer/GSTPlatform.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -34,6 +34,7 @@
 import com.sun.media.jfxmediaimpl.HostUtils;
 import com.sun.media.jfxmediaimpl.MediaUtils;
 import com.sun.media.jfxmediaimpl.platform.Platform;
+import java.util.Arrays;
 
 /**
  * GStreamer platform implementation.
@@ -56,23 +57,18 @@
         "application/vnd.apple.mpegurl",
         "audio/mpegurl"
     };
+    
+    /**
+     * All supported protocols.
+     */
+    private static final String[] PROTOCOLS = {
+        "file",
+        "http",
+        "https"
+    };
 
     private static GSTPlatform globalInstance = null;
 
-    // HACK: move this back to native when we fix the jdeveloper crash
-    private static final String[] contentTypes;
-
-    static {
-        // HACK: remove this when we go back to polling native
-        if (!HostUtils.isMacOSX()) {
-            contentTypes = new String[CONTENT_TYPES.length];
-            System.arraycopy(CONTENT_TYPES, 0, contentTypes,
-                    0, CONTENT_TYPES.length);
-        } else {
-            contentTypes = CONTENT_TYPES;
-        }
-    }
-
     @Override
     public boolean loadPlatform() {
         // Initialize GStreamer JNI and supporting native classes.
@@ -104,9 +100,12 @@
 
     @Override
     public String[] getSupportedContentTypes() {
-        String[] contentTypesCopy = new String[contentTypes.length];
-        System.arraycopy(contentTypes, 0, contentTypesCopy, 0, contentTypes.length);
-        return contentTypesCopy;
+        return Arrays.copyOf(CONTENT_TYPES, CONTENT_TYPES.length);
+    }
+    
+    @Override
+    public String[] getSupportedProtocols() {
+        return Arrays.copyOf(PROTOCOLS, PROTOCOLS.length);
     }
 
     @Override
@@ -135,7 +134,8 @@
                 // Block until player transitions to READY or HALTED.
 
                 // Timeouts in milliseconds.
-                final long timeout = source.getURI().getScheme().equals("http") ?
+                String scheme = source.getURI().getScheme();
+                final long timeout = (scheme.equals("http") || scheme.equals("https")) ?
                         60000L : 5000L;
                 final long iterationTime = 50L;
                 long timeWaited = 0L;
--- a/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/ios/IOSPlatform.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/ios/IOSPlatform.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -31,6 +31,7 @@
 import com.sun.media.jfxmedia.logging.Logger;
 import com.sun.media.jfxmediaimpl.HostUtils;
 import com.sun.media.jfxmediaimpl.platform.Platform;
+import java.util.Arrays;
 
 /**
  * iOS Platform implementation.
@@ -53,6 +54,15 @@
         "video/x-quicktime",
         "audio/x-aiff"
     };
+    
+    /**
+     * All supported protocols.
+     */
+    private static final String[] PROTOCOLS = {
+        "http",
+        "https",
+        "ipod-library"
+    };
 
     private static final class IOSPlatformInitializer {
         private static final IOSPlatform globalInstance = new IOSPlatform();
@@ -88,9 +98,12 @@
 
     @Override
     public String[] getSupportedContentTypes() {
-        String[] contentTypesCopy = new String[CONTENT_TYPES.length];
-        System.arraycopy(CONTENT_TYPES, 0, contentTypesCopy, 0, CONTENT_TYPES.length);
-        return contentTypesCopy;
+        return Arrays.copyOf(CONTENT_TYPES, CONTENT_TYPES.length);
+    }
+    
+    @Override
+    public String[] getSupportedProtocols() {
+        return Arrays.copyOf(PROTOCOLS, PROTOCOLS.length);
     }
 
     @Override
--- a/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/osx/OSXPlatform.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/osx/OSXPlatform.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -34,11 +34,12 @@
 import com.sun.media.jfxmediaimpl.platform.Platform;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.Arrays;
 
 /**
  * Mac OS X Platform implementation. This class implements both the QTKit based
  * platform and the AVFoundation based platforms.
- * 
+ *
  * NOTE: The QTKit based platform is deprecated and will be removed in a future
  * release.
  */
@@ -57,6 +58,15 @@
         "audio/mpegurl"
     };
 
+    /**
+     * All supported protocols.
+     */
+    private static final String[] PROTOCOLS = {
+        "file",
+        "http",
+        "https"
+    };
+
     private static final class OSXPlatformInitializer {
         private static final OSXPlatform globalInstance;
         static {
@@ -121,9 +131,12 @@
 
     @Override
     public String[] getSupportedContentTypes() {
-        String[] contentTypesCopy = new String[CONTENT_TYPES.length];
-        System.arraycopy(CONTENT_TYPES, 0, contentTypesCopy, 0, CONTENT_TYPES.length);
-        return contentTypesCopy;
+        return Arrays.copyOf(CONTENT_TYPES, CONTENT_TYPES.length);
+    }
+
+    @Override
+    public String[] getSupportedProtocols() {
+        return Arrays.copyOf(PROTOCOLS, PROTOCOLS.length);
     }
 
     @Override
--- a/modules/media/src/main/java/javafx/scene/media/AudioClip.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/javafx/scene/media/AudioClip.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -70,7 +70,7 @@
      * Create an <code>AudioClip</code> loaded from the supplied source URL.
      *
      * @param source URL string from which to load the audio clip. This can be an
-     * HTTP, file or jar source.
+     * HTTP, HTTPS, FILE or JAR source.
      * @throws NullPointerException if the parameter is <code>null</code>.
      * @throws IllegalArgumentException if the parameter violates
      * <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>.
--- a/modules/media/src/main/java/javafx/scene/media/Media.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/javafx/scene/media/Media.java	Tue Oct 06 09:23:15 2015 -0700
@@ -87,7 +87,9 @@
     private ReadOnlyObjectWrapper<MediaException> error;
 
     private void setError(MediaException value) {
-        errorPropertyImpl().set(value);
+        if (getError() == null) {
+            errorPropertyImpl().set(value);
+        }
     }
 
     /**
@@ -335,7 +337,7 @@
     /**
      * Constructs a <code>Media</code> instance.  This is the only way to
      * specify the media source. The source must represent a valid <code>URI</code>
-     * and is immutable. Only HTTP, FILE, and JAR <code>URL</code>s are supported. If the
+     * and is immutable. Only HTTP, HTTPS, FILE, and JAR <code>URL</code>s are supported. If the
      * provided URL is invalid then an exception will be thrown.  If an
      * asynchronous error occurs, the {@link #errorProperty error} property will be set. Listen
      * to this property to be notified of any such errors.
@@ -352,7 +354,7 @@
      * <ul>
      * <li>The supplied URI must conform to RFC-2396 as required by
      * <A href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</A>.</li>
-     * <li>Only HTTP, FILE, and JAR URIs are supported.</li>
+     * <li>Only HTTP, HTTPS, FILE, and JAR URIs are supported.</li>
      * </ul>
      *
      * <p>See <A href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</A>
@@ -451,7 +453,7 @@
         }
         return null;
     }
-    
+
     // http://javafx-jira.kenai.com/browse/RT-24594
     // TODO: Remove this entire method (and associated stuff) when we switch to track parsing in MetadataParser
     void _updateMedia(com.sun.media.jfxmedia.Media _media) {
@@ -473,28 +475,28 @@
                         }
                         trackMetadata.put("encoding", trackElement.getEncodingType().toString());
                         trackMetadata.put("enabled", Boolean.valueOf(trackElement.isEnabled()));
-                        
+
                         if (trackElement instanceof com.sun.media.jfxmedia.track.VideoTrack) {
                             com.sun.media.jfxmedia.track.VideoTrack vt =
                                     (com.sun.media.jfxmedia.track.VideoTrack) trackElement;
 
                             int videoWidth = vt.getFrameSize().getWidth();
                             int videoHeight = vt.getFrameSize().getHeight();
-                            
+
                             // FIXME: this isn't valid when there are multiple video tracks...
                             setWidth(videoWidth);
                             setHeight(videoHeight);
 
                             trackMetadata.put("video width", Integer.valueOf(videoWidth));
                             trackMetadata.put("video height", Integer.valueOf(videoHeight));
-                            
+
                             newTrack = new VideoTrack(trackElement.getTrackID(), trackMetadata);
                         } else if (trackElement instanceof com.sun.media.jfxmedia.track.AudioTrack) {
                             newTrack = new AudioTrack(trackElement.getTrackID(), trackMetadata);
                         } else if (trackElement instanceof com.sun.media.jfxmedia.track.SubtitleTrack) {
                             newTrack = new SubtitleTrack(trackID, trackMetadata);
                         }
-                        
+
                         if (null != newTrack) {
                             tracksBacking.add(newTrack);
                         }
--- a/modules/media/src/main/java/javafx/scene/media/MediaPlayer.java	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/javafx/scene/media/MediaPlayer.java	Tue Oct 06 09:23:15 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -526,7 +526,12 @@
             } catch (com.sun.media.jfxmedia.MediaException e) {
                 handleError(MediaException.exceptionToMediaException(e));
             } catch (MediaException e) {
-                handleError(e);
+                // Check media object for error. If it is connection related, then Media object will have better error message
+                if (media.getError() != null) {
+                    handleError(media.getError());
+                } else {
+                    handleError(e);
+                }
             } catch (Exception e) {
                 handleError(new MediaException(MediaException.Type.UNKNOWN, e.getMessage()));
             }
--- a/modules/media/src/main/java/javafx/scene/media/package.html	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/java/javafx/scene/media/package.html	Tue Oct 06 09:23:15 2015 -0700
@@ -99,14 +99,19 @@
     <td>Hypertext transfer protocol for representation of remote files</td>
     <td><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</a></td>
 </tr>
+    <td>HTTPS</td>
+    <td>Hypertext transfer protocol secure for representation of remote files</td>
+    <td><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</a></td>
+</tr>
+<tr>
 <tr>
     <td>JAR</td>
-    <td>Representation of media entries in files accessible via the FILE or HTTP protocols</td>
+    <td>Representation of media entries in files accessible via the FILE, HTTP or HTTPS protocols</td>
     <td><a href="https://docs.oracle.com/javase/8/docs/api/java/net/JarURLConnection.html">java.net.JarURLConnection</a></td>
 </tr>
 <tr>
     <td>HTTP Live Streaming (HLS)</td>
-    <td>Playlist-based media streaming via HTTP</td>
+    <td>Playlist-based media streaming via HTTP or HTTPS</td>
     <td><a href="http://tools.ietf.org/html/draft-pantos-http-live-streaming">Internet-Draft: HTTP Live Streaming</a></td>
 </tr>
 </table>
@@ -114,7 +119,7 @@
 </p>
 <p>
 <h4>MPEG-4 Playback via HTTP</h4>
-It is recommended that MPEG-4 media to be played over HTTP be formatted such that the
+It is recommended that MPEG-4 media to be played over HTTP or HTTPS be formatted such that the
 headers required to decode the stream appear at the beginning of the file. Otherwise,
 playback might stall until the entire file is downloaded.
 </p>
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/build/win32/dirent/dirent.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/build/win32/dirent/dirent.c	Tue Oct 06 09:23:15 2015 -0700
@@ -1,341 +1,341 @@
-/*
- * dirent.c
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
- *
- * Derived from DIRLIB.C by Matt J. Weinstein
- * This note appears in the DIRLIB.H
- * DIRLIB.H by M. J. Weinstein   Released to public domain 1-Jan-89
- *
- * Updated by Jeremy Bettis <jeremy@hksys.com>
- * Significantly revised and rewinddir, seekdir and telldir added by Colin
- * Peters <colin@fu.is.saga-u.ac.jp>
- *	
- */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <io.h>
-#include <direct.h>
-
-#include "dirent.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h> /* for GetFileAttributes */
-
-#include <tchar.h>
-
-#ifdef _UNICODE
-#define _tdirent	_wdirent
-#define _TDIR 		_WDIR
-#define _topendir	_wopendir
-#define _tclosedir	_wclosedir
-#define _treaddir	_wreaddir
-#define _trewinddir	_wrewinddir
-#define _ttelldir	_wtelldir
-#define _tseekdir	_wseekdir
-#else
-#define _tdirent	dirent
-#define _TDIR 		DIR
-#define _topendir	opendir
-#define _tclosedir	closedir
-#define _treaddir	readdir
-#define _trewinddir	rewinddir
-#define _ttelldir	telldir
-#define _tseekdir	seekdir
-#endif
-
-#define SUFFIX	_T("*")
-#define	SLASH	_T("\\")
-
-
-/*
- * opendir
- *
- * Returns a pointer to a DIR structure appropriately filled in to begin
- * searching a directory.
- */
-_TDIR *
-_topendir (const _TCHAR *szPath)
-{
-  _TDIR *nd;
-  unsigned int rc;
-  _TCHAR szFullPath[MAX_PATH];
-	
-  errno = 0;
-
-  if (!szPath)
-    {
-      errno = EFAULT;
-      return (_TDIR *) 0;
-    }
-
-  if (szPath[0] == _T('\0'))
-    {
-      errno = ENOTDIR;
-      return (_TDIR *) 0;
-    }
-
-  /* Attempt to determine if the given path really is a directory. */
-  rc = GetFileAttributes (szPath);
-  if (rc == (unsigned int)-1)
-    {
-      /* call GetLastError for more error info */
-      errno = ENOENT;
-      return (_TDIR *) 0;
-    }
-  if (!(rc & FILE_ATTRIBUTE_DIRECTORY))
-    {
-      /* Error, entry exists but not a directory. */
-      errno = ENOTDIR;
-      return (_TDIR *) 0;
-    }
-
-  /* Make an absolute pathname.  */
-  _tfullpath (szFullPath, szPath, MAX_PATH);
-
-  /* Allocate enough space to store DIR structure and the complete
-   * directory path given. */
-  nd = (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen(szFullPath) + _tcslen (SLASH) +
-			 _tcslen(SUFFIX) + 1) * sizeof(_TCHAR));
-
-  if (!nd)
-    {
-      /* Error, out of memory. */
-      errno = ENOMEM;
-      return (_TDIR *) 0;
-    }
-
-  /* Create the search expression. */
-  _tcscpy (nd->dd_name, szFullPath);
-
-  /* Add on a slash if the path does not end with one. */
-  if (nd->dd_name[0] != _T('\0') &&
-      nd->dd_name[_tcslen (nd->dd_name) - 1] != _T('/') &&
-      nd->dd_name[_tcslen (nd->dd_name) - 1] != _T('\\'))
-    {
-      _tcscat (nd->dd_name, SLASH);
-    }
-
-  /* Add on the search pattern */
-  _tcscat (nd->dd_name, SUFFIX);
-
-  /* Initialize handle to -1 so that a premature closedir doesn't try
-   * to call _findclose on it. */
-  nd->dd_handle = -1;
-
-  /* Initialize the status. */
-  nd->dd_stat = 0;
-
-  /* Initialize the dirent structure. ino and reclen are invalid under
-   * Win32, and name simply points at the appropriate part of the
-   * findfirst_t structure. */
-  nd->dd_dir.d_ino = 0;
-  nd->dd_dir.d_reclen = 0;
-  nd->dd_dir.d_namlen = 0;
-  memset (nd->dd_dir.d_name, 0, FILENAME_MAX);
-
-  return nd;
-}
-
-
-/*
- * readdir
- *
- * Return a pointer to a dirent structure filled with the information on the
- * next entry in the directory.
- */
-struct _tdirent *
-_treaddir (_TDIR * dirp)
-{
-  errno = 0;
-
-  /* Check for valid DIR struct. */
-  if (!dirp)
-    {
-      errno = EFAULT;
-      return (struct _tdirent *) 0;
-    }
-
-  if (dirp->dd_stat < 0)
-    {
-      /* We have already returned all files in the directory
-       * (or the structure has an invalid dd_stat). */
-      return (struct _tdirent *) 0;
-    }
-  else if (dirp->dd_stat == 0)
-    {
-      /* We haven't started the search yet. */
-      /* Start the search */
-      dirp->dd_handle = _tfindfirst (dirp->dd_name, &(dirp->dd_dta));
-
-  	  if (dirp->dd_handle == -1)
-	{
-	  /* Whoops! Seems there are no files in that
-	   * directory. */
-	  dirp->dd_stat = -1;
-	}
-      else
-	{
-	  dirp->dd_stat = 1;
-	}
-    }
-  else
-    {
-      /* Get the next search entry. */
-      if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta)))
-	{
-	  /* We are off the end or otherwise error.	
-	     _findnext sets errno to ENOENT if no more file
-	     Undo this. */
-	  DWORD winerr = GetLastError();
-	  if (winerr == ERROR_NO_MORE_FILES)
-	    errno = 0;	
-	  _findclose (dirp->dd_handle);
-	  dirp->dd_handle = -1;
-	  dirp->dd_stat = -1;
-	}
-      else
-	{
-	  /* Update the status to indicate the correct
-	   * number. */
-	  dirp->dd_stat++;
-	}
-    }
-
-  if (dirp->dd_stat > 0)
-    {
-      /* Successfully got an entry. Everything about the file is
-       * already appropriately filled in except the length of the
-       * file name. */
-      dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dta.name);
-      _tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
-      return &dirp->dd_dir;
-    }
-
-  return (struct _tdirent *) 0;
-}
-
-
-/*
- * closedir
- *
- * Frees up resources allocated by opendir.
- */
-int
-_tclosedir (_TDIR * dirp)
-{
-  int rc;
-
-  errno = 0;
-  rc = 0;
-
-  if (!dirp)
-    {
-      errno = EFAULT;
-      return -1;
-    }
-
-  if (dirp->dd_handle != -1)
-    {
-      rc = _findclose (dirp->dd_handle);
-    }
-
-  /* Delete the dir structure. */
-  free (dirp);
-
-  return rc;
-}
-
-/*
- * rewinddir
- *
- * Return to the beginning of the directory "stream". We simply call findclose
- * and then reset things like an opendir.
- */
-void
-_trewinddir (_TDIR * dirp)
-{
-  errno = 0;
-
-  if (!dirp)
-    {
-      errno = EFAULT;
-      return;
-    }
-
-  if (dirp->dd_handle != -1)
-    {
-      _findclose (dirp->dd_handle);
-    }
-
-  dirp->dd_handle = -1;
-  dirp->dd_stat = 0;
-}
-
-/*
- * telldir
- *
- * Returns the "position" in the "directory stream" which can be used with
- * seekdir to go back to an old entry. We simply return the value in stat.
- */
-long
-_ttelldir (_TDIR * dirp)
-{
-  errno = 0;
-
-  if (!dirp)
-    {
-      errno = EFAULT;
-      return -1;
-    }
-  return dirp->dd_stat;
-}
-
-/*
- * seekdir
- *
- * Seek to an entry previously returned by telldir. We rewind the directory
- * and call readdir repeatedly until either dd_stat is the position number
- * or -1 (off the end). This is not perfect, in that the directory may
- * have changed while we weren't looking. But that is probably the case with
- * any such system.
- */
-void
-_tseekdir (_TDIR * dirp, long lPos)
-{
-  errno = 0;
-
-  if (!dirp)
-    {
-      errno = EFAULT;
-      return;
-    }
-
-  if (lPos < -1)
-    {
-      /* Seeking to an invalid position. */
-      errno = EINVAL;
-      return;
-    }
-  else if (lPos == -1)
-    {
-      /* Seek past end. */
-      if (dirp->dd_handle != -1)
-	{
-	  _findclose (dirp->dd_handle);
-	}
-      dirp->dd_handle = -1;
-      dirp->dd_stat = -1;
-    }
-  else
-    {
-      /* Rewind and read forward to the appropriate index. */
-      _trewinddir (dirp);
-
-      while ((dirp->dd_stat < lPos) && _treaddir (dirp))
-	;
-    }
-}
+/*
+ * dirent.c
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is a part of the mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within the package.
+ *
+ * Derived from DIRLIB.C by Matt J. Weinstein
+ * This note appears in the DIRLIB.H
+ * DIRLIB.H by M. J. Weinstein   Released to public domain 1-Jan-89
+ *
+ * Updated by Jeremy Bettis <jeremy@hksys.com>
+ * Significantly revised and rewinddir, seekdir and telldir added by Colin
+ * Peters <colin@fu.is.saga-u.ac.jp>
+ *	
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <io.h>
+#include <direct.h>
+
+#include "dirent.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h> /* for GetFileAttributes */
+
+#include <tchar.h>
+
+#ifdef _UNICODE
+#define _tdirent	_wdirent
+#define _TDIR 		_WDIR
+#define _topendir	_wopendir
+#define _tclosedir	_wclosedir
+#define _treaddir	_wreaddir
+#define _trewinddir	_wrewinddir
+#define _ttelldir	_wtelldir
+#define _tseekdir	_wseekdir
+#else
+#define _tdirent	dirent
+#define _TDIR 		DIR
+#define _topendir	opendir
+#define _tclosedir	closedir
+#define _treaddir	readdir
+#define _trewinddir	rewinddir
+#define _ttelldir	telldir
+#define _tseekdir	seekdir
+#endif
+
+#define SUFFIX	_T("*")
+#define	SLASH	_T("\\")
+
+
+/*
+ * opendir
+ *
+ * Returns a pointer to a DIR structure appropriately filled in to begin
+ * searching a directory.
+ */
+_TDIR *
+_topendir (const _TCHAR *szPath)
+{
+  _TDIR *nd;
+  unsigned int rc;
+  _TCHAR szFullPath[MAX_PATH];
+	
+  errno = 0;
+
+  if (!szPath)
+    {
+      errno = EFAULT;
+      return (_TDIR *) 0;
+    }
+
+  if (szPath[0] == _T('\0'))
+    {
+      errno = ENOTDIR;
+      return (_TDIR *) 0;
+    }
+
+  /* Attempt to determine if the given path really is a directory. */
+  rc = GetFileAttributes (szPath);
+  if (rc == (unsigned int)-1)
+    {
+      /* call GetLastError for more error info */
+      errno = ENOENT;
+      return (_TDIR *) 0;
+    }
+  if (!(rc & FILE_ATTRIBUTE_DIRECTORY))
+    {
+      /* Error, entry exists but not a directory. */
+      errno = ENOTDIR;
+      return (_TDIR *) 0;
+    }
+
+  /* Make an absolute pathname.  */
+  _tfullpath (szFullPath, szPath, MAX_PATH);
+
+  /* Allocate enough space to store DIR structure and the complete
+   * directory path given. */
+  nd = (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen(szFullPath) + _tcslen (SLASH) +
+			 _tcslen(SUFFIX) + 1) * sizeof(_TCHAR));
+
+  if (!nd)
+    {
+      /* Error, out of memory. */
+      errno = ENOMEM;
+      return (_TDIR *) 0;
+    }
+
+  /* Create the search expression. */
+  _tcscpy (nd->dd_name, szFullPath);
+
+  /* Add on a slash if the path does not end with one. */
+  if (nd->dd_name[0] != _T('\0') &&
+      nd->dd_name[_tcslen (nd->dd_name) - 1] != _T('/') &&
+      nd->dd_name[_tcslen (nd->dd_name) - 1] != _T('\\'))
+    {
+      _tcscat (nd->dd_name, SLASH);
+    }
+
+  /* Add on the search pattern */
+  _tcscat (nd->dd_name, SUFFIX);
+
+  /* Initialize handle to -1 so that a premature closedir doesn't try
+   * to call _findclose on it. */
+  nd->dd_handle = -1;
+
+  /* Initialize the status. */
+  nd->dd_stat = 0;
+
+  /* Initialize the dirent structure. ino and reclen are invalid under
+   * Win32, and name simply points at the appropriate part of the
+   * findfirst_t structure. */
+  nd->dd_dir.d_ino = 0;
+  nd->dd_dir.d_reclen = 0;
+  nd->dd_dir.d_namlen = 0;
+  memset (nd->dd_dir.d_name, 0, FILENAME_MAX);
+
+  return nd;
+}
+
+
+/*
+ * readdir
+ *
+ * Return a pointer to a dirent structure filled with the information on the
+ * next entry in the directory.
+ */
+struct _tdirent *
+_treaddir (_TDIR * dirp)
+{
+  errno = 0;
+
+  /* Check for valid DIR struct. */
+  if (!dirp)
+    {
+      errno = EFAULT;
+      return (struct _tdirent *) 0;
+    }
+
+  if (dirp->dd_stat < 0)
+    {
+      /* We have already returned all files in the directory
+       * (or the structure has an invalid dd_stat). */
+      return (struct _tdirent *) 0;
+    }
+  else if (dirp->dd_stat == 0)
+    {
+      /* We haven't started the search yet. */
+      /* Start the search */
+      dirp->dd_handle = _tfindfirst (dirp->dd_name, &(dirp->dd_dta));
+
+  	  if (dirp->dd_handle == -1)
+	{
+	  /* Whoops! Seems there are no files in that
+	   * directory. */
+	  dirp->dd_stat = -1;
+	}
+      else
+	{
+	  dirp->dd_stat = 1;
+	}
+    }
+  else
+    {
+      /* Get the next search entry. */
+      if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta)))
+	{
+	  /* We are off the end or otherwise error.	
+	     _findnext sets errno to ENOENT if no more file
+	     Undo this. */
+	  DWORD winerr = GetLastError();
+	  if (winerr == ERROR_NO_MORE_FILES)
+	    errno = 0;	
+	  _findclose (dirp->dd_handle);
+	  dirp->dd_handle = -1;
+	  dirp->dd_stat = -1;
+	}
+      else
+	{
+	  /* Update the status to indicate the correct
+	   * number. */
+	  dirp->dd_stat++;
+	}
+    }
+
+  if (dirp->dd_stat > 0)
+    {
+      /* Successfully got an entry. Everything about the file is
+       * already appropriately filled in except the length of the
+       * file name. */
+      dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dta.name);
+      _tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
+      return &dirp->dd_dir;
+    }
+
+  return (struct _tdirent *) 0;
+}
+
+
+/*
+ * closedir
+ *
+ * Frees up resources allocated by opendir.
+ */
+int
+_tclosedir (_TDIR * dirp)
+{
+  int rc;
+
+  errno = 0;
+  rc = 0;
+
+  if (!dirp)
+    {
+      errno = EFAULT;
+      return -1;
+    }
+
+  if (dirp->dd_handle != -1)
+    {
+      rc = _findclose (dirp->dd_handle);
+    }
+
+  /* Delete the dir structure. */
+  free (dirp);
+
+  return rc;
+}
+
+/*
+ * rewinddir
+ *
+ * Return to the beginning of the directory "stream". We simply call findclose
+ * and then reset things like an opendir.
+ */
+void
+_trewinddir (_TDIR * dirp)
+{
+  errno = 0;
+
+  if (!dirp)
+    {
+      errno = EFAULT;
+      return;
+    }
+
+  if (dirp->dd_handle != -1)
+    {
+      _findclose (dirp->dd_handle);
+    }
+
+  dirp->dd_handle = -1;
+  dirp->dd_stat = 0;
+}
+
+/*
+ * telldir
+ *
+ * Returns the "position" in the "directory stream" which can be used with
+ * seekdir to go back to an old entry. We simply return the value in stat.
+ */
+long
+_ttelldir (_TDIR * dirp)
+{
+  errno = 0;
+
+  if (!dirp)
+    {
+      errno = EFAULT;
+      return -1;
+    }
+  return dirp->dd_stat;
+}
+
+/*
+ * seekdir
+ *
+ * Seek to an entry previously returned by telldir. We rewind the directory
+ * and call readdir repeatedly until either dd_stat is the position number
+ * or -1 (off the end). This is not perfect, in that the directory may
+ * have changed while we weren't looking. But that is probably the case with
+ * any such system.
+ */
+void
+_tseekdir (_TDIR * dirp, long lPos)
+{
+  errno = 0;
+
+  if (!dirp)
+    {
+      errno = EFAULT;
+      return;
+    }
+
+  if (lPos < -1)
+    {
+      /* Seeking to an invalid position. */
+      errno = EINVAL;
+      return;
+    }
+  else if (lPos == -1)
+    {
+      /* Seek past end. */
+      if (dirp->dd_handle != -1)
+	{
+	  _findclose (dirp->dd_handle);
+	}
+      dirp->dd_handle = -1;
+      dirp->dd_stat = -1;
+    }
+  else
+    {
+      /* Rewind and read forward to the appropriate index. */
+      _trewinddir (dirp);
+
+      while ((dirp->dd_stat < lPos) && _treaddir (dirp))
+	;
+    }
+}
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/build/win32/dirent/dirent.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/build/win32/dirent/dirent.h	Tue Oct 06 09:23:15 2015 -0700
@@ -1,127 +1,127 @@
-/*
- * DIRENT.H (formerly DIRLIB.H)
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
- *
- */
-#ifndef _DIRENT_H_
-#define _DIRENT_H_
-
-#include <stdio.h>
-#include <io.h>
-
-#ifndef RC_INVOKED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct dirent
-{
-	long		d_ino;		/* Always zero. */
-	unsigned short	d_reclen;	/* Always zero. */
-	unsigned short	d_namlen;	/* Length of name in d_name. */
-	char		d_name[FILENAME_MAX]; /* File name. */
-};
-
-#ifdef _WIN64
-#define INTPTR __int64
-#else
-#define INTPTR long
-#endif
-
-/*
- * This is an internal data structure. Good programmers will not use it
- * except as an argument to one of the functions below.
- * dd_stat field is now int (was short in older versions).
- */
-typedef struct
-{
-	/* disk transfer area for this dir */
-	struct _finddata_t	dd_dta;
-
-	/* dirent struct to return from dir (NOTE: this makes this thread
-	 * safe as long as only one thread uses a particular DIR struct at
-	 * a time) */
-	struct dirent		dd_dir;
-
-	/* _findnext handle */
-	INTPTR			dd_handle;
-
-	/*
-         * Status of search:
-	 *   0 = not started yet (next entry to read is first entry)
-	 *  -1 = off the end
-	 *   positive = 0 based index of next entry
-	 */
-	int			dd_stat;
-
-	/* given path for dir with search pattern (struct is extended) */
-	char			dd_name[1];
-} DIR;
-
-DIR* __cdecl opendir (const char*);
-struct dirent* __cdecl readdir (DIR*);
-int __cdecl closedir (DIR*);
-void __cdecl rewinddir (DIR*);
-long __cdecl telldir (DIR*);
-void __cdecl seekdir (DIR*, long);
-
-
-/* wide char versions */
-
-struct _wdirent
-{
-	long		d_ino;		/* Always zero. */
-	unsigned short	d_reclen;	/* Always zero. */
-	unsigned short	d_namlen;	/* Length of name in d_name. */
-	wchar_t		d_name[FILENAME_MAX]; /* File name. */
-};
-
-/*
- * This is an internal data structure. Good programmers will not use it
- * except as an argument to one of the functions below.
- */
-typedef struct
-{
-	/* disk transfer area for this dir */
-	struct _wfinddata_t	dd_dta;
-
-	/* dirent struct to return from dir (NOTE: this makes this thread
-	 * safe as long as only one thread uses a particular DIR struct at
-	 * a time) */
-	struct _wdirent		dd_dir;
-
-	/* _findnext handle */
-	INTPTR			dd_handle;
-
-	/*
-         * Status of search:
-	 *   0 = not started yet (next entry to read is first entry)
-	 *  -1 = off the end
-	 *   positive = 0 based index of next entry
-	 */
-	int			dd_stat;
-
-	/* given path for dir with search pattern (struct is extended) */
-	wchar_t			dd_name[1];
-} _WDIR;
-
-
-
-_WDIR* __cdecl _wopendir (const wchar_t*);
-struct _wdirent*  __cdecl _wreaddir (_WDIR*);
-int __cdecl _wclosedir (_WDIR*);
-void __cdecl _wrewinddir (_WDIR*);
-long __cdecl _wtelldir (_WDIR*);
-void __cdecl _wseekdir (_WDIR*, long);
-
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* Not RC_INVOKED */
-
-#endif	/* Not _DIRENT_H_ */
+/*
+ * DIRENT.H (formerly DIRLIB.H)
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is a part of the mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within the package.
+ *
+ */
+#ifndef _DIRENT_H_
+#define _DIRENT_H_
+
+#include <stdio.h>
+#include <io.h>
+
+#ifndef RC_INVOKED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct dirent
+{
+	long		d_ino;		/* Always zero. */
+	unsigned short	d_reclen;	/* Always zero. */
+	unsigned short	d_namlen;	/* Length of name in d_name. */
+	char		d_name[FILENAME_MAX]; /* File name. */
+};
+
+#ifdef _WIN64
+#define INTPTR __int64
+#else
+#define INTPTR long
+#endif
+
+/*
+ * This is an internal data structure. Good programmers will not use it
+ * except as an argument to one of the functions below.
+ * dd_stat field is now int (was short in older versions).
+ */
+typedef struct
+{
+	/* disk transfer area for this dir */
+	struct _finddata_t	dd_dta;
+
+	/* dirent struct to return from dir (NOTE: this makes this thread
+	 * safe as long as only one thread uses a particular DIR struct at
+	 * a time) */
+	struct dirent		dd_dir;
+
+	/* _findnext handle */
+	INTPTR			dd_handle;
+
+	/*
+         * Status of search:
+	 *   0 = not started yet (next entry to read is first entry)
+	 *  -1 = off the end
+	 *   positive = 0 based index of next entry
+	 */
+	int			dd_stat;
+
+	/* given path for dir with search pattern (struct is extended) */
+	char			dd_name[1];
+} DIR;
+
+DIR* __cdecl opendir (const char*);
+struct dirent* __cdecl readdir (DIR*);
+int __cdecl closedir (DIR*);
+void __cdecl rewinddir (DIR*);
+long __cdecl telldir (DIR*);
+void __cdecl seekdir (DIR*, long);
+
+
+/* wide char versions */
+
+struct _wdirent
+{
+	long		d_ino;		/* Always zero. */
+	unsigned short	d_reclen;	/* Always zero. */
+	unsigned short	d_namlen;	/* Length of name in d_name. */
+	wchar_t		d_name[FILENAME_MAX]; /* File name. */
+};
+
+/*
+ * This is an internal data structure. Good programmers will not use it
+ * except as an argument to one of the functions below.
+ */
+typedef struct
+{
+	/* disk transfer area for this dir */
+	struct _wfinddata_t	dd_dta;
+
+	/* dirent struct to return from dir (NOTE: this makes this thread
+	 * safe as long as only one thread uses a particular DIR struct at
+	 * a time) */
+	struct _wdirent		dd_dir;
+
+	/* _findnext handle */
+	INTPTR			dd_handle;
+
+	/*
+         * Status of search:
+	 *   0 = not started yet (next entry to read is first entry)
+	 *  -1 = off the end
+	 *   positive = 0 based index of next entry
+	 */
+	int			dd_stat;
+
+	/* given path for dir with search pattern (struct is extended) */
+	wchar_t			dd_name[1];
+} _WDIR;
+
+
+
+_WDIR* __cdecl _wopendir (const wchar_t*);
+struct _wdirent*  __cdecl _wreaddir (_WDIR*);
+int __cdecl _wclosedir (_WDIR*);
+void __cdecl _wrewinddir (_WDIR*);
+long __cdecl _wtelldir (_WDIR*);
+void __cdecl _wseekdir (_WDIR*, long);
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* Not RC_INVOKED */
+
+#endif	/* Not _DIRENT_H_ */
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/build/win32/dirent/wdirent.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/build/win32/dirent/wdirent.c	Tue Oct 06 09:23:15 2015 -0700
@@ -1,3 +1,3 @@
-#define _UNICODE 1
-#define UNICODE 1
-#include "dirent.c"
+#define _UNICODE 1
+#define UNICODE 1
+#include "dirent.c"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/deprecated/gthread.h	Tue Oct 06 09:23:15 2015 -0700
@@ -0,0 +1,299 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GLib Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_DEPRECATED_THREAD_H__
+#define __G_DEPRECATED_THREAD_H__
+
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#include <glib/gthread.h>
+
+G_BEGIN_DECLS
+
+#ifndef G_DISABLE_DEPRECATED
+
+typedef enum
+{
+  G_THREAD_PRIORITY_LOW,
+  G_THREAD_PRIORITY_NORMAL,
+  G_THREAD_PRIORITY_HIGH,
+  G_THREAD_PRIORITY_URGENT
+} GThreadPriority;
+
+#endif
+
+struct  _GThread
+{
+  /*< private >*/
+  GThreadFunc func;
+  gpointer data;
+  gboolean joinable;
+#ifdef GSTREAMER_LITE
+#ifndef G_DISABLE_DEPRECATED
+  GThreadPriority priority;
+#endif // G_DISABLE_DEPRECATED
+#else // GSTREAMER_LITE
+  GThreadPriority priority;
+#endif // GSTREAMER_LITE
+};
+
+#ifndef G_DISABLE_DEPRECATED
+
+typedef struct _GThreadFunctions GThreadFunctions;
+struct _GThreadFunctions
+{
+  GMutex*  (*mutex_new)           (void);
+  void     (*mutex_lock)          (GMutex               *mutex);
+  gboolean (*mutex_trylock)       (GMutex               *mutex);
+  void     (*mutex_unlock)        (GMutex               *mutex);
+  void     (*mutex_free)          (GMutex               *mutex);
+  GCond*   (*cond_new)            (void);
+  void     (*cond_signal)         (GCond                *cond);
+  void     (*cond_broadcast)      (GCond                *cond);
+  void     (*cond_wait)           (GCond                *cond,
+                                   GMutex               *mutex);
+  gboolean (*cond_timed_wait)     (GCond                *cond,
+                                   GMutex               *mutex,
+                                   GTimeVal             *end_time);
+  void      (*cond_free)          (GCond                *cond);
+  GPrivate* (*private_new)        (GDestroyNotify        destructor);
+  gpointer  (*private_get)        (GPrivate             *private_key);
+  void      (*private_set)        (GPrivate             *private_key,
+                                   gpointer              data);
+  void      (*thread_create)      (GThreadFunc           func,
+                                   gpointer              data,
+                                   gulong                stack_size,
+                                   gboolean              joinable,
+                                   gboolean              bound,
+                                   GThreadPriority       priority,
+                                   gpointer              thread,
+                                   GError              **error);
+  void      (*thread_yield)       (void);
+  void      (*thread_join)        (gpointer              thread);
+  void      (*thread_exit)        (void);
+  void      (*thread_set_priority)(gpointer              thread,
+                                   GThreadPriority       priority);
+  void      (*thread_self)        (gpointer              thread);
+  gboolean  (*thread_equal)       (gpointer              thread1,
+                                   gpointer              thread2);
+};
+
+GLIB_VAR GThreadFunctions       g_thread_functions_for_glib_use;
+GLIB_VAR gboolean               g_thread_use_default_impl;
+
+GLIB_VAR guint64   (*g_thread_gettime) (void);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
+GThread *g_thread_create       (GThreadFunc       func,
+                                gpointer          data,
+                                gboolean          joinable,
+                                GError          **error);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
+GThread *g_thread_create_full  (GThreadFunc       func,
+                                gpointer          data,
+                                gulong            stack_size,
+                                gboolean          joinable,
+                                gboolean          bound,
+                                GThreadPriority   priority,
+                                GError          **error);
+
+GLIB_DEPRECATED_IN_2_32
+void     g_thread_set_priority (GThread          *thread,
+                                GThreadPriority   priority);
+
+GLIB_DEPRECATED_IN_2_32
+void     g_thread_foreach      (GFunc             thread_func,
+                                gpointer          user_data);
+
+#ifndef G_OS_WIN32
+#include <sys/types.h>
+#include <pthread.h>
+#endif
+
+#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl
+#define G_STATIC_MUTEX_INIT { NULL }
+typedef struct
+{
+  GMutex *mutex;
+#ifndef G_OS_WIN32
+  /* only for ABI compatibility reasons */
+  pthread_mutex_t unused;
+#endif
+} GStaticMutex;
+
+#define g_static_mutex_lock(mutex) \
+    g_mutex_lock (g_static_mutex_get_mutex (mutex))
+#define g_static_mutex_trylock(mutex) \
+    g_mutex_trylock (g_static_mutex_get_mutex (mutex))
+#define g_static_mutex_unlock(mutex) \
+    g_mutex_unlock (g_static_mutex_get_mutex (mutex))
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_init)
+void    g_static_mutex_init           (GStaticMutex *mutex);
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_clear)
+void    g_static_mutex_free           (GStaticMutex *mutex);
+GLIB_DEPRECATED_IN_2_32_FOR(GMutex)
+GMutex *g_static_mutex_get_mutex_impl (GStaticMutex *mutex);
+
+typedef struct _GStaticRecMutex GStaticRecMutex;
+struct _GStaticRecMutex
+{
+  /*< private >*/
+  GStaticMutex mutex;
+  guint depth;
+
+  /* ABI compat only */
+  union {
+#ifdef G_OS_WIN32
+    void *owner;
+#else
+    pthread_t owner;
+#endif
+    gdouble dummy;
+  } unused;
+};
+
+#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT }
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init)
+void     g_static_rec_mutex_init        (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_lock)
+void     g_static_rec_mutex_lock        (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_try_lock)
+gboolean g_static_rec_mutex_trylock     (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_unlock)
+void     g_static_rec_mutex_unlock      (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32
+void     g_static_rec_mutex_lock_full   (GStaticRecMutex *mutex,
+                                         guint            depth);
+
+GLIB_DEPRECATED_IN_2_32
+guint    g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_free)
+void     g_static_rec_mutex_free        (GStaticRecMutex *mutex);
+
+typedef struct _GStaticRWLock GStaticRWLock;
+struct _GStaticRWLock
+{
+  /*< private >*/
+  GStaticMutex mutex;
+  GCond *read_cond;
+  GCond *write_cond;
+  guint read_counter;
+  gboolean have_writer;
+  guint want_to_read;
+  guint want_to_write;
+};
+
+#define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 }
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_init)
+void      g_static_rw_lock_init           (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_lock)
+void      g_static_rw_lock_reader_lock    (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_trylock)
+gboolean  g_static_rw_lock_reader_trylock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_unlock)
+void      g_static_rw_lock_reader_unlock  (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_lock)
+void      g_static_rw_lock_writer_lock    (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_trylock)
+gboolean  g_static_rw_lock_writer_trylock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_unlock)
+void      g_static_rw_lock_writer_unlock  (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_free)
+void      g_static_rw_lock_free           (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32
+GPrivate *      g_private_new             (GDestroyNotify notify);
+
+typedef struct _GStaticPrivate  GStaticPrivate;
+struct _GStaticPrivate
+{
+  /*< private >*/
+  guint index;
+};
+
+#define G_STATIC_PRIVATE_INIT { 0 }
+GLIB_DEPRECATED_IN_2_32
+void     g_static_private_init           (GStaticPrivate *private_key);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_get)
+gpointer g_static_private_get            (GStaticPrivate *private_key);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_set)
+void     g_static_private_set            (GStaticPrivate *private_key,
+                                          gpointer        data,
+                                          GDestroyNotify  notify);
+
+GLIB_DEPRECATED_IN_2_32
+void     g_static_private_free           (GStaticPrivate *private_key);
+
+GLIB_DEPRECATED_IN_2_32
+gboolean g_once_init_enter_impl          (volatile gsize *location);
+
+GLIB_DEPRECATED_IN_2_32
+void     g_thread_init                   (gpointer vtable);
+GLIB_DEPRECATED_IN_2_32
+void    g_thread_init_with_errorcheck_mutexes (gpointer vtable);
+
+GLIB_DEPRECATED_IN_2_32
+gboolean g_thread_get_initialized        (void);
+
+GLIB_VAR gboolean g_threads_got_initialized;
+
+#define g_thread_supported()     (1)
+
+GLIB_DEPRECATED_IN_2_32
+GMutex *        g_mutex_new             (void);
+GLIB_DEPRECATED_IN_2_32
+void            g_mutex_free            (GMutex *mutex);
+GLIB_DEPRECATED_IN_2_32
+GCond *         g_cond_new              (void);
+GLIB_DEPRECATED_IN_2_32
+void            g_cond_free             (GCond  *cond);
+GLIB_DEPRECATED_IN_2_32
+gboolean        g_cond_timed_wait       (GCond          *cond,
+                                         GMutex         *mutex,
+                                         GTimeVal       *timeval);
+
+#endif
+
+G_END_DECLS
+
+#endif /* __G_DEPRECATED_THREAD_H__ */
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gbacktrace.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gbacktrace.c	Tue Oct 06 09:23:15 2015 -0700
@@ -251,12 +251,19 @@
 
   waitpid (pid, &status, 0);
 #else
-#ifdef G_ENABLE_DEBUG // GSTREAMER_LITE exception
+#ifdef GSTREAMER_LITE
+  #ifdef G_ENABLE_DEBUG
+    if (IsDebuggerPresent ())
+      G_BREAKPOINT ();
+    else
+  #endif // G_ENABLE_DEBUG
+    abort ();
+#else // GSTREAMER_LITE
   if (IsDebuggerPresent ())
     G_BREAKPOINT ();
   else
-#endif // GSTREAMER_LITE exception
     abort ();
+#endif // GSTREAMER_LITE
 #endif
 }
 
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gfileutils.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gfileutils.c	Tue Oct 06 09:23:15 2015 -0700
@@ -610,10 +610,15 @@
                       const gchar  *format_string,
                       int           saved_errno) G_GNUC_FORMAT(2);
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif // GSTREAMER_LITE
 
 static char *
 format_error_message (const gchar  *filename,
@@ -630,9 +635,13 @@
   return msg;
 }
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32
 #pragma GCC diagnostic pop
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic pop
+#endif // GSTREAMER_LITE
 
 /* format string must have two '%s':
  *
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/ggettext.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/ggettext.c	Tue Oct 06 09:23:15 2015 -0700
@@ -40,9 +40,13 @@
 
 #include <string.h>
 #include <locale.h>
+#ifdef GSTREAMER_LITE
 #ifdef ENABLE_NLS
 #include <libintl.h>
 #endif
+#else // GSTREAMER_LITE
+#include <libintl.h>
+#endif // GSTREAMER_LITE
 #ifdef G_OS_WIN32
 
 /**
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gmarkup.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gmarkup.c	Tue Oct 06 09:23:15 2015 -0700
@@ -2382,10 +2382,15 @@
  * Since: 2.4
  */
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif // GSTREAMER_LITE
 
 gchar *
 g_markup_vprintf_escaped (const gchar *format,
@@ -2513,9 +2518,13 @@
     return NULL;
 }
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32
 #pragma GCC diagnostic pop
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic pop
+#endif // GSTREAMER_LITE
 
 /**
  * g_markup_printf_escaped:
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gstrfuncs.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gstrfuncs.c	Tue Oct 06 09:23:15 2015 -0700
@@ -878,10 +878,15 @@
   return g_ascii_formatd (buffer, buf_len, "%.17g", d);
 }
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif // GSTREAMER_LITE
 
 /**
  * g_ascii_formatd:
@@ -991,9 +996,13 @@
 #endif
 }
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32
 #pragma GCC diagnostic pop
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic pop
+#endif // GSTREAMER_LITE
 
 #define ISSPACE(c)              ((c) == ' ' || (c) == '\f' || (c) == '\n' || \
                                  (c) == '\r' || (c) == '\t' || (c) == '\v')
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gtimezone.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gtimezone.c	Tue Oct 06 09:23:15 2015 -0700
@@ -761,7 +761,11 @@
   else /* M.W.D */
     {
       guint days;
+#ifdef GSTREAMER_LITE
       guint days_in_month = g_date_get_days_in_month (buffer->mon, buffer->year);
+#else // GSTREAMER_LITE
+      guint days_in_month = g_date_days_in_month (buffer->mon, buffer->year);
+#endif // GSTREAMER_LITE
       GDateWeekday first_wday;
 
       g_date_set_dmy (&date, 1, buffer->mon, buffer->year);
--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gutils.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.42.1/glib/gutils.c	Tue Oct 06 09:23:15 2015 -0700
@@ -181,7 +181,7 @@
  * Deprecated:2.40: Just use memmove().
  */
 
-#ifndef G_DISABLE_DEPRECATED
+#ifndef GSTREAMER_LITE
 
 #ifdef G_OS_WIN32
 #undef g_atexit
@@ -237,7 +237,7 @@
     }
 }
 
-#endif  /* G_DISABLE_DEPRECATED */
+#endif // GSTREAMER_LITE
 
 /* Based on execvp() from GNU Libc.
  * Some of this code is cut-and-pasted into gspawn.c
@@ -2090,10 +2090,15 @@
  * Flags to modify the format of the string returned by g_format_size_full().
  */
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif // GSTREAMER_LITE
 
 /**
  * g_format_size_full:
@@ -2228,9 +2233,13 @@
   return g_string_free (string, FALSE);
 }
 
+#ifdef GSTREAMER_LITE
 #ifndef G_OS_WIN32
 #pragma GCC diagnostic pop
 #endif // G_OS_WIN32
+#else // GSTREAMER_LITE
+#pragma GCC diagnostic pop
+#endif // GSTREAMER_LITE
 
 /**
  * g_format_size_for_display:
--- a/modules/media/src/main/native/gstreamer/3rd_party/libffi/src/x86/ffi.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/3rd_party/libffi/src/x86/ffi.c	Tue Oct 06 09:23:15 2015 -0700
@@ -99,13 +99,19 @@
        i != 0;
        i--, p_arg += dir, p_argv += dir)
     {
+#ifdef GSTREAMER_LITE
       size_t z = 0;
+#endif // GSTREAMER_LITE
       
       /* Align if necessary */
       if ((sizeof(void*) - 1) & (size_t) argp)
         argp = (char *) ALIGN(argp, sizeof(void*));
 
+#ifdef GSTREAMER_LITE
       z = (*p_arg)->size;
+#else // GSTREAMER_LITE
+      size_t z = (*p_arg)->size;
+#endif // GSTREAMER_LITE
 
 #ifdef X86_WIN64
       if (z > FFI_SIZEOF_ARG
@@ -204,7 +210,9 @@
      on top of stack, so that those can be moved to registers by call-handler.  */
   if (stack_args_count > 0)
     {
+#ifdef GSTREAMER_LITE
       int i;
+#endif // GSTREAMER_LITE
       if (dir < 0 && stack_args_count > 1)
         {
           /* Reverse order if iterating arguments backwards */
@@ -212,7 +220,10 @@
           *(ffi_arg*) p_stack_data[0] = *(ffi_arg*) p_stack_data[stack_args_count - 1];
           *(ffi_arg*) p_stack_data[stack_args_count - 1] = tmp;
         }
-      
+
+#ifndef GSTREAMER_LITE
+      int i;
+#endif // GSTREAMER_LITE
       for (i = 0; i < stack_args_count; i++)
         {
           if (p_stack_data[i] != argp2)
@@ -570,13 +581,19 @@
   for (i = 0, p_arg = cif->arg_types; 
        i < cif->nargs && passed_regs < max_stack_count;
        i++, p_arg++)
-    {
+  {
+#ifdef GSTREAMER_LITE
       size_t sz = 0;
+#endif // GSTREAMER_LITE
       if ((*p_arg)->type == FFI_TYPE_FLOAT
          || (*p_arg)->type == FFI_TYPE_STRUCT)
         continue;
 
+#ifdef GSTREAMER_LITE
       sz = (*p_arg)->size;
+#else // GSTREAMER_LITE
+      size_t sz = (*p_arg)->size;
+#endif // GSTREAMER_LITE
       if(sz == 0 || sz > FFI_SIZEOF_ARG)
         continue;
 
@@ -602,12 +619,18 @@
        i != 0;
        i--, p_arg += dir, p_argv += dir)
     {
+#ifdef GSTREAMER_LITE
       size_t z = 0;
+#endif // GSTREAMER_LITE
       /* Align if necessary */
       if ((sizeof(void*) - 1) & (size_t) argp)
         argp = (char *) ALIGN(argp, sizeof(void*));
 
+#ifdef GSTREAMER_LITE
       z = (*p_arg)->size;
+#else // GSTREAMER_LITE
+      size_t z = (*p_arg)->size;
+#endif // GSTREAMER_LITE
 
 #ifdef X86_WIN64
       if (z > FFI_SIZEOF_ARG
@@ -859,12 +882,18 @@
   
   for (i = 0; i < cif->nargs && passed_regs <= max_regs; i++)
     {
+#ifdef GSTREAMER_LITE
       size_t sz = 0;
+#endif // GSTREAMER_LITE
       if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
          || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
         continue;
 
+#ifdef GSTREAMER_LITE
       sz = cif->arg_types[i]->size;
+#else // GSTREAMER_LITE
+      size_t sz = cif->arg_types[i]->size;
+#endif // GSTREAMER_LITE
       if (sz == 0 || sz > FFI_SIZEOF_ARG)
         continue;
 
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-bad/COPYING	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-bad/COPYING	Tue Oct 06 09:23:15 2015 -0700
@@ -2,7 +2,7 @@
 		       Version 2, June 1991
 
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -305,7 +305,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 Also add information on how to contact you by electronic and paper mail.
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsaplugin.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsaplugin.c	Tue Oct 06 09:23:15 2015 -0700
@@ -24,7 +24,9 @@
 #endif
 
 #include "gstalsasink.h"
+#ifndef GSTREAMER_LITE
 #include "gstalsasrc.h"
+#endif // GSTREAMER_LITE
 
 #include <gst/gst-i18n-plugin.h>
 
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsasink.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsasink.h	Tue Oct 06 09:23:15 2015 -0700
@@ -1,7 +1,7 @@
 /* GStreamer
  * Copyright (C)  2005 Wim Taymans <wim@fluendo.com>
  *
- * gstalsasink.h:
+ * gstalsasink.h: 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsasrc.c	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,859 +0,0 @@
-/* GStreamer
- * Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
- *
- * gstalsasrc.c:
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/**
- * SECTION:element-alsasrc
- * @see_also: alsasink, alsamixer
- *
- * This element reads data from an audio card using the ALSA API.
- *
- * <refsect2>
- * <title>Example pipelines</title>
- * |[
- * gst-launch -v alsasrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=alsasrc.ogg
- * ]| Record from a sound card using ALSA and encode to Ogg/Vorbis.
- * </refsect2>
- *
- * Last reviewed on 2006-03-01 (0.10.4)
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <getopt.h>
-#include <alsa/asoundlib.h>
-
-#include "gstalsasrc.h"
-#include "gstalsadeviceprobe.h"
-
-#include <gst/gst-i18n-plugin.h>
-
-#define DEFAULT_PROP_DEVICE		"default"
-#define DEFAULT_PROP_DEVICE_NAME	""
-#define DEFAULT_PROP_CARD_NAME	        ""
-
-enum
-{
-  PROP_0,
-  PROP_DEVICE,
-  PROP_DEVICE_NAME,
-  PROP_CARD_NAME,
-  PROP_LAST
-};
-
-static void gst_alsasrc_init_interfaces (GType type);
-
-GST_BOILERPLATE_FULL (GstAlsaSrc, gst_alsasrc, GstAudioSrc,
-    GST_TYPE_AUDIO_SRC, gst_alsasrc_init_interfaces);
-
-GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaSrc, gst_alsasrc_mixer);
-
-static void gst_alsasrc_finalize (GObject * object);
-static void gst_alsasrc_set_property (GObject * object,
-    guint prop_id, const GValue * value, GParamSpec * pspec);
-static void gst_alsasrc_get_property (GObject * object,
-    guint prop_id, GValue * value, GParamSpec * pspec);
-
-static GstCaps *gst_alsasrc_getcaps (GstBaseSrc * bsrc);
-
-static gboolean gst_alsasrc_open (GstAudioSrc * asrc);
-static gboolean gst_alsasrc_prepare (GstAudioSrc * asrc,
-    GstRingBufferSpec * spec);
-static gboolean gst_alsasrc_unprepare (GstAudioSrc * asrc);
-static gboolean gst_alsasrc_close (GstAudioSrc * asrc);
-static guint gst_alsasrc_read (GstAudioSrc * asrc, gpointer data, guint length);
-static guint gst_alsasrc_delay (GstAudioSrc * asrc);
-static void gst_alsasrc_reset (GstAudioSrc * asrc);
-
-/* AlsaSrc signals and args */
-enum
-{
-  LAST_SIGNAL
-};
-
-#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
-# define ALSA_SRC_FACTORY_ENDIANNESS   "LITTLE_ENDIAN, BIG_ENDIAN"
-#else
-# define ALSA_SRC_FACTORY_ENDIANNESS   "BIG_ENDIAN, LITTLE_ENDIAN"
-#endif
-
-static GstStaticPadTemplate alsasrc_src_factory =
-    GST_STATIC_PAD_TEMPLATE ("src",
-    GST_PAD_SRC,
-    GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-raw-int, "
-        "endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, "
-        "signed = (boolean) { TRUE, FALSE }, "
-        "width = (int) 32, "
-        "depth = (int) 32, "
-        "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
-        "audio/x-raw-int, "
-        "endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, "
-        "signed = (boolean) { TRUE, FALSE }, "
-        "width = (int) 32, "
-        "depth = (int) 24, "
-        "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
-        "audio/x-raw-int, "
-        "endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, "
-        "signed = (boolean) { TRUE, FALSE }, "
-        "width = (int) 24, "
-        "depth = (int) 24, "
-        "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
-        "audio/x-raw-int, "
-        "endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, "
-        "signed = (boolean) { TRUE, FALSE }, "
-        "width = (int) 16, "
-        "depth = (int) 16, "
-        "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
-        "audio/x-raw-int, "
-        "signed = (boolean) { TRUE, FALSE }, "
-        "width = (int) 8, "
-        "depth = (int) 8, "
-        "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]")
-    );
-
-static void
-gst_alsasrc_finalize (GObject * object)
-{
-  GstAlsaSrc *src = GST_ALSA_SRC (object);
-
-  g_free (src->device);
-  g_mutex_free (src->alsa_lock);
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static gboolean
-gst_alsasrc_interface_supported (GstAlsaSrc * this, GType interface_type)
-{
-  /* only support this one interface (wrapped by GstImplementsInterface) */
-  g_assert (interface_type == GST_TYPE_MIXER);
-
-  return gst_alsasrc_mixer_supported (this, interface_type);
-}
-
-static void
-gst_implements_interface_init (GstImplementsInterfaceClass * klass)
-{
-  klass->supported = (gpointer) gst_alsasrc_interface_supported;
-}
-
-static void
-gst_alsasrc_init_interfaces (GType type)
-{
-  static const GInterfaceInfo implements_iface_info = {
-    (GInterfaceInitFunc) gst_implements_interface_init,
-    NULL,
-    NULL,
-  };
-  static const GInterfaceInfo mixer_iface_info = {
-    (GInterfaceInitFunc) gst_alsasrc_mixer_interface_init,
-    NULL,
-    NULL,
-  };
-
-  g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE,
-      &implements_iface_info);
-  g_type_add_interface_static (type, GST_TYPE_MIXER, &mixer_iface_info);
-
-  gst_alsa_type_add_device_property_probe_interface (type);
-}
-
-static void
-gst_alsasrc_base_init (gpointer g_class)
-{
-  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
-
-  gst_element_class_set_details_simple (element_class,
-      "Audio source (ALSA)", "Source/Audio",
-      "Read from a sound card via ALSA", "Wim Taymans <wim@fluendo.com>");
-
-  gst_element_class_add_pad_template (element_class,
-      gst_static_pad_template_get (&alsasrc_src_factory));
-}
-
-static void
-gst_alsasrc_class_init (GstAlsaSrcClass * klass)
-{
-  GObjectClass *gobject_class;
-  GstBaseSrcClass *gstbasesrc_class;
-  GstAudioSrcClass *gstaudiosrc_class;
-
-  gobject_class = (GObjectClass *) klass;
-  gstbasesrc_class = (GstBaseSrcClass *) klass;
-  gstaudiosrc_class = (GstAudioSrcClass *) klass;
-
-  gobject_class->finalize = gst_alsasrc_finalize;
-  gobject_class->get_property = gst_alsasrc_get_property;
-  gobject_class->set_property = gst_alsasrc_set_property;
-
-  gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_alsasrc_getcaps);
-
-  gstaudiosrc_class->open = GST_DEBUG_FUNCPTR (gst_alsasrc_open);
-  gstaudiosrc_class->prepare = GST_DEBUG_FUNCPTR (gst_alsasrc_prepare);
-  gstaudiosrc_class->unprepare = GST_DEBUG_FUNCPTR (gst_alsasrc_unprepare);
-  gstaudiosrc_class->close = GST_DEBUG_FUNCPTR (gst_alsasrc_close);
-  gstaudiosrc_class->read = GST_DEBUG_FUNCPTR (gst_alsasrc_read);
-  gstaudiosrc_class->delay = GST_DEBUG_FUNCPTR (gst_alsasrc_delay);
-  gstaudiosrc_class->reset = GST_DEBUG_FUNCPTR (gst_alsasrc_reset);
-
-  g_object_class_install_property (gobject_class, PROP_DEVICE,
-      g_param_spec_string ("device", "Device",
-          "ALSA device, as defined in an asound configuration file",
-          DEFAULT_PROP_DEVICE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_property (gobject_class, PROP_DEVICE_NAME,
-      g_param_spec_string ("device-name", "Device name",
-          "Human-readable name of the sound device",
-          DEFAULT_PROP_DEVICE_NAME, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_property (gobject_class, PROP_CARD_NAME,
-      g_param_spec_string ("card-name", "Card name",
-          "Human-readable name of the sound card",
-          DEFAULT_PROP_CARD_NAME, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-}
-
-static void
-gst_alsasrc_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec)
-{
-  GstAlsaSrc *src;
-
-  src = GST_ALSA_SRC (object);
-
-  switch (prop_id) {
-    case PROP_DEVICE:
-      g_free (src->device);
-      src->device = g_value_dup_string (value);
-      if (src->device == NULL) {
-        src->device = g_strdup (DEFAULT_PROP_DEVICE);
-      }
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-static void
-gst_alsasrc_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec)
-{
-  GstAlsaSrc *src;
-
-  src = GST_ALSA_SRC (object);
-
-  switch (prop_id) {
-    case PROP_DEVICE:
-      g_value_set_string (value, src->device);
-      break;
-    case PROP_DEVICE_NAME:
-      g_value_take_string (value,
-          gst_alsa_find_device_name (GST_OBJECT_CAST (src),
-              src->device, src->handle, SND_PCM_STREAM_CAPTURE));
-      break;
-    case PROP_CARD_NAME:
-      g_value_take_string (value,
-          gst_alsa_find_card_name (GST_OBJECT_CAST (src),
-              src->device, SND_PCM_STREAM_CAPTURE));
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-static void
-gst_alsasrc_init (GstAlsaSrc * alsasrc, GstAlsaSrcClass * g_class)
-{
-  GST_DEBUG_OBJECT (alsasrc, "initializing");
-
-  alsasrc->device = g_strdup (DEFAULT_PROP_DEVICE);
-  alsasrc->cached_caps = NULL;
-
-  alsasrc->alsa_lock = g_mutex_new ();
-}
-
-#define CHECK(call, error) \
-G_STMT_START {                  \
-if ((err = call) < 0)           \
-  goto error;                   \
-} G_STMT_END;
-
-
-static GstCaps *
-gst_alsasrc_getcaps (GstBaseSrc * bsrc)
-{
-  GstElementClass *element_class;
-  GstPadTemplate *pad_template;
-  GstAlsaSrc *src;
-  GstCaps *caps;
-
-  src = GST_ALSA_SRC (bsrc);
-
-  if (src->handle == NULL) {
-    GST_DEBUG_OBJECT (src, "device not open, using template caps");
-    return NULL;                /* base class will get template caps for us */
-  }
-
-  if (src->cached_caps) {
-    GST_LOG_OBJECT (src, "Returning cached caps");
-    return gst_caps_ref (src->cached_caps);
-  }
-
-  element_class = GST_ELEMENT_GET_CLASS (src);
-  pad_template = gst_element_class_get_pad_template (element_class, "src");
-  g_return_val_if_fail (pad_template != NULL, NULL);
-
-  caps = gst_alsa_probe_supported_formats (GST_OBJECT (src), src->handle,
-      gst_pad_template_get_caps (pad_template));
-
-  if (caps) {
-    src->cached_caps = gst_caps_ref (caps);
-  }
-
-  GST_INFO_OBJECT (src, "returning caps %" GST_PTR_FORMAT, caps);
-
-  return caps;
-}
-
-static int
-set_hwparams (GstAlsaSrc * alsa)
-{
-  guint rrate;
-  gint err;
-  snd_pcm_hw_params_t *params;
-
-  snd_pcm_hw_params_malloc (&params);
-
-  /* choose all parameters */
-  CHECK (snd_pcm_hw_params_any (alsa->handle, params), no_config);
-  /* set the interleaved read/write format */
-  CHECK (snd_pcm_hw_params_set_access (alsa->handle, params, alsa->access),
-      wrong_access);
-  /* set the sample format */
-  CHECK (snd_pcm_hw_params_set_format (alsa->handle, params, alsa->format),
-      no_sample_format);
-  /* set the count of channels */
-  CHECK (snd_pcm_hw_params_set_channels (alsa->handle, params, alsa->channels),
-      no_channels);
-  /* set the stream rate */
-  rrate = alsa->rate;
-  CHECK (snd_pcm_hw_params_set_rate_near (alsa->handle, params, &rrate, NULL),
-      no_rate);
-  if (rrate != alsa->rate)
-    goto rate_match;
-
-  if (alsa->buffer_time != -1) {
-    /* set the buffer time */
-    CHECK (snd_pcm_hw_params_set_buffer_time_near (alsa->handle, params,
-            &alsa->buffer_time, NULL), buffer_time);
-  }
-  if (alsa->period_time != -1) {
-    /* set the period time */
-    CHECK (snd_pcm_hw_params_set_period_time_near (alsa->handle, params,
-            &alsa->period_time, NULL), period_time);
-  }
-
-  /* write the parameters to device */
-  CHECK (snd_pcm_hw_params (alsa->handle, params), set_hw_params);
-
-  CHECK (snd_pcm_hw_params_get_buffer_size (params, &alsa->buffer_size),
-      buffer_size);
-
-  CHECK (snd_pcm_hw_params_get_period_size (params, &alsa->period_size, NULL),
-      period_size);
-
-  snd_pcm_hw_params_free (params);
-  return 0;
-
-  /* ERRORS */
-no_config:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Broken configuration for recording: no configurations available: %s",
-            snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-wrong_access:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Access type not available for recording: %s", snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-no_sample_format:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Sample format not available for recording: %s", snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-no_channels:
-  {
-    gchar *msg = NULL;
-
-    if ((alsa->channels) == 1)
-      msg = g_strdup (_("Could not open device for recording in mono mode."));
-    if ((alsa->channels) == 2)
-      msg = g_strdup (_("Could not open device for recording in stereo mode."));
-    if ((alsa->channels) > 2)
-      msg =
-          g_strdup_printf (_
-          ("Could not open device for recording in %d-channel mode"),
-          alsa->channels);
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, ("%s", msg),
-        ("%s", snd_strerror (err)));
-    g_free (msg);
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-no_rate:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Rate %iHz not available for recording: %s",
-            alsa->rate, snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-rate_match:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Rate doesn't match (requested %iHz, get %iHz)", alsa->rate, err));
-    snd_pcm_hw_params_free (params);
-    return -EINVAL;
-  }
-buffer_time:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to set buffer time %i for recording: %s",
-            alsa->buffer_time, snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-buffer_size:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to get buffer size for recording: %s", snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-period_time:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to set period time %i for recording: %s", alsa->period_time,
-            snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-period_size:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to get period size for recording: %s", snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-set_hw_params:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to set hw params for recording: %s", snd_strerror (err)));
-    snd_pcm_hw_params_free (params);
-    return err;
-  }
-}
-
-static int
-set_swparams (GstAlsaSrc * alsa)
-{
-  int err;
-  snd_pcm_sw_params_t *params;
-
-  snd_pcm_sw_params_malloc (&params);
-
-  /* get the current swparams */
-  CHECK (snd_pcm_sw_params_current (alsa->handle, params), no_config);
-  /* allow the transfer when at least period_size samples can be processed */
-  CHECK (snd_pcm_sw_params_set_avail_min (alsa->handle, params,
-          alsa->period_size), set_avail);
-  /* start the transfer on first read */
-  CHECK (snd_pcm_sw_params_set_start_threshold (alsa->handle, params,
-          0), start_threshold);
-
-#if GST_CHECK_ALSA_VERSION(1,0,16)
-  /* snd_pcm_sw_params_set_xfer_align() is deprecated, alignment is always 1 */
-#else
-  /* align all transfers to 1 sample */
-  CHECK (snd_pcm_sw_params_set_xfer_align (alsa->handle, params, 1), set_align);
-#endif
-
-  /* write the parameters to the recording device */
-  CHECK (snd_pcm_sw_params (alsa->handle, params), set_sw_params);
-
-  snd_pcm_sw_params_free (params);
-  return 0;
-
-  /* ERRORS */
-no_config:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to determine current swparams for playback: %s",
-            snd_strerror (err)));
-    snd_pcm_sw_params_free (params);
-    return err;
-  }
-start_threshold:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to set start threshold mode for playback: %s",
-            snd_strerror (err)));
-    snd_pcm_sw_params_free (params);
-    return err;
-  }
-set_avail:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to set avail min for playback: %s", snd_strerror (err)));
-    snd_pcm_sw_params_free (params);
-    return err;
-  }
-#if !GST_CHECK_ALSA_VERSION(1,0,16)
-set_align:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to set transfer align for playback: %s", snd_strerror (err)));
-    snd_pcm_sw_params_free (params);
-    return err;
-  }
-#endif
-set_sw_params:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Unable to set sw params for playback: %s", snd_strerror (err)));
-    snd_pcm_sw_params_free (params);
-    return err;
-  }
-}
-
-static gboolean
-alsasrc_parse_spec (GstAlsaSrc * alsa, GstRingBufferSpec * spec)
-{
-  switch (spec->type) {
-    case GST_BUFTYPE_LINEAR:
-      alsa->format = snd_pcm_build_linear_format (spec->depth, spec->width,
-          spec->sign ? 0 : 1, spec->bigend ? 1 : 0);
-      break;
-    case GST_BUFTYPE_FLOAT:
-      switch (spec->format) {
-        case GST_FLOAT32_LE:
-          alsa->format = SND_PCM_FORMAT_FLOAT_LE;
-          break;
-        case GST_FLOAT32_BE:
-          alsa->format = SND_PCM_FORMAT_FLOAT_BE;
-          break;
-        case GST_FLOAT64_LE:
-          alsa->format = SND_PCM_FORMAT_FLOAT64_LE;
-          break;
-        case GST_FLOAT64_BE:
-          alsa->format = SND_PCM_FORMAT_FLOAT64_BE;
-          break;
-        default:
-          goto error;
-      }
-      break;
-    case GST_BUFTYPE_A_LAW:
-      alsa->format = SND_PCM_FORMAT_A_LAW;
-      break;
-    case GST_BUFTYPE_MU_LAW:
-      alsa->format = SND_PCM_FORMAT_MU_LAW;
-      break;
-    default:
-      goto error;
-
-  }
-  alsa->rate = spec->rate;
-  alsa->channels = spec->channels;
-  alsa->buffer_time = spec->buffer_time;
-  alsa->period_time = spec->latency_time;
-  alsa->access = SND_PCM_ACCESS_RW_INTERLEAVED;
-
-  return TRUE;
-
-  /* ERRORS */
-error:
-  {
-    return FALSE;
-  }
-}
-
-static gboolean
-gst_alsasrc_open (GstAudioSrc * asrc)
-{
-  GstAlsaSrc *alsa;
-  gint err;
-
-  alsa = GST_ALSA_SRC (asrc);
-
-  CHECK (snd_pcm_open (&alsa->handle, alsa->device, SND_PCM_STREAM_CAPTURE,
-          SND_PCM_NONBLOCK), open_error);
-
-  if (!alsa->mixer)
-    alsa->mixer = gst_alsa_mixer_new (alsa->device, GST_ALSA_MIXER_CAPTURE);
-
-  return TRUE;
-
-  /* ERRORS */
-open_error:
-  {
-    if (err == -EBUSY) {
-      GST_ELEMENT_ERROR (alsa, RESOURCE, BUSY,
-          (_("Could not open audio device for recording. "
-                  "Device is being used by another application.")),
-          ("Device '%s' is busy", alsa->device));
-    } else {
-      GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_READ,
-          (_("Could not open audio device for recording.")),
-          ("Recording open error on device '%s': %s", alsa->device,
-              snd_strerror (err)));
-    }
-    return FALSE;
-  }
-}
-
-static gboolean
-gst_alsasrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
-{
-  GstAlsaSrc *alsa;
-  gint err;
-
-  alsa = GST_ALSA_SRC (asrc);
-
-  if (!alsasrc_parse_spec (alsa, spec))
-    goto spec_parse;
-
-  CHECK (snd_pcm_nonblock (alsa->handle, 0), non_block);
-
-  CHECK (set_hwparams (alsa), hw_params_failed);
-  CHECK (set_swparams (alsa), sw_params_failed);
-  CHECK (snd_pcm_prepare (alsa->handle), prepare_failed);
-
-  alsa->bytes_per_sample = spec->bytes_per_sample;
-  spec->segsize = alsa->period_size * spec->bytes_per_sample;
-  spec->segtotal = alsa->buffer_size / alsa->period_size;
-  spec->silence_sample[0] = 0;
-  spec->silence_sample[1] = 0;
-  spec->silence_sample[2] = 0;
-  spec->silence_sample[3] = 0;
-
-  return TRUE;
-
-  /* ERRORS */
-spec_parse:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Error parsing spec"));
-    return FALSE;
-  }
-non_block:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Could not set device to blocking: %s", snd_strerror (err)));
-    return FALSE;
-  }
-hw_params_failed:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Setting of hwparams failed: %s", snd_strerror (err)));
-    return FALSE;
-  }
-sw_params_failed:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Setting of swparams failed: %s", snd_strerror (err)));
-    return FALSE;
-  }
-prepare_failed:
-  {
-    GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
-        ("Prepare failed: %s", snd_strerror (err)));
-    return FALSE;
-  }
-}
-
-static gboolean
-gst_alsasrc_unprepare (GstAudioSrc * asrc)
-{
-  GstAlsaSrc *alsa;
-
-  alsa = GST_ALSA_SRC (asrc);
-
-  snd_pcm_drop (alsa->handle);
-  snd_pcm_hw_free (alsa->handle);
-  snd_pcm_nonblock (alsa->handle, 1);
-
-  return TRUE;
-}
-
-static gboolean
-gst_alsasrc_close (GstAudioSrc * asrc)
-{
-  GstAlsaSrc *alsa = GST_ALSA_SRC (asrc);
-
-  snd_pcm_close (alsa->handle);
-  alsa->handle = NULL;
-
-  if (alsa->mixer) {
-    gst_alsa_mixer_free (alsa->mixer);
-    alsa->mixer = NULL;
-  }
-
-  gst_caps_replace (&alsa->cached_caps, NULL);
-
-  return TRUE;
-}
-
-/*
- *   Underrun and suspend recovery
- */
-static gint
-xrun_recovery (GstAlsaSrc * alsa, snd_pcm_t * handle, gint err)
-{
-  GST_DEBUG_OBJECT (alsa, "xrun recovery %d", err);
-
-  if (err == -EPIPE) {          /* under-run */
-    err = snd_pcm_prepare (handle);
-    if (err < 0)
-      GST_WARNING_OBJECT (alsa,
-          "Can't recovery from underrun, prepare failed: %s",
-          snd_strerror (err));
-    return 0;
-  } else if (err == -ESTRPIPE) {
-    while ((err = snd_pcm_resume (handle)) == -EAGAIN)
-      g_usleep (100);           /* wait until the suspend flag is released */
-
-    if (err < 0) {
-      err = snd_pcm_prepare (handle);
-      if (err < 0)
-        GST_WARNING_OBJECT (alsa,
-            "Can't recovery from suspend, prepare failed: %s",
-            snd_strerror (err));
-    }
-    return 0;
-  }
-  return err;
-}
-
-static guint
-gst_alsasrc_read (GstAudioSrc * asrc, gpointer data, guint length)
-{
-  GstAlsaSrc *alsa;
-  gint err;
-  gint cptr;
-  gint16 *ptr;
-
-  alsa = GST_ALSA_SRC (asrc);
-
-  cptr = length / alsa->bytes_per_sample;
-  ptr = data;
-
-  GST_ALSA_SRC_LOCK (asrc);
-  while (cptr > 0) {
-    if ((err = snd_pcm_readi (alsa->handle, ptr, cptr)) < 0) {
-      if (err == -EAGAIN) {
-        GST_DEBUG_OBJECT (asrc, "Read error: %s", snd_strerror (err));
-        continue;
-      } else if (xrun_recovery (alsa, alsa->handle, err) < 0) {
-        goto read_error;
-      }
-      continue;
-    }
-
-    ptr += err * alsa->channels;
-    cptr -= err;
-  }
-  GST_ALSA_SRC_UNLOCK (asrc);
-
-  return length - (cptr * alsa->bytes_per_sample);
-
-read_error:
-  {
-    GST_ALSA_SRC_UNLOCK (asrc);
-    return length;              /* skip one period */
-  }
-}
-
-static guint
-gst_alsasrc_delay (GstAudioSrc * asrc)
-{
-  GstAlsaSrc *alsa;
-  snd_pcm_sframes_t delay;
-  int res;
-
-  alsa = GST_ALSA_SRC (asrc);
-
-  res = snd_pcm_delay (alsa->handle, &delay);
-  if (G_UNLIKELY (res < 0)) {
-    GST_DEBUG_OBJECT (alsa, "snd_pcm_delay returned %d", res);
-    delay = 0;
-  }
-
-  return CLAMP (delay, 0, alsa->buffer_size);
-}
-
-static void
-gst_alsasrc_reset (GstAudioSrc * asrc)
-{
-  GstAlsaSrc *alsa;
-  gint err;
-
-  alsa = GST_ALSA_SRC (asrc);
-
-  GST_ALSA_SRC_LOCK (asrc);
-  GST_DEBUG_OBJECT (alsa, "drop");
-  CHECK (snd_pcm_drop (alsa->handle), drop_error);
-  GST_DEBUG_OBJECT (alsa, "prepare");
-  CHECK (snd_pcm_prepare (alsa->handle), prepare_error);
-  GST_DEBUG_OBJECT (alsa, "reset done");
-  GST_ALSA_SRC_UNLOCK (asrc);
-
-  return;
-
-  /* ERRORS */
-drop_error:
-  {
-    GST_ERROR_OBJECT (alsa, "alsa-reset: pcm drop error: %s",
-        snd_strerror (err));
-    GST_ALSA_SRC_UNLOCK (asrc);
-    return;
-  }
-prepare_error:
-  {
-    GST_ERROR_OBJECT (alsa, "alsa-reset: pcm prepare error: %s",
-        snd_strerror (err));
-    GST_ALSA_SRC_UNLOCK (asrc);
-    return;
-  }
-}
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/alsa/gstalsasrc.h	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/* GStreamer
- * Copyright (C)  2005 Wim Taymans <wim@fluendo.com>
- *
- * gstalsasrc.h:
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-
-#ifndef __GST_ALSASRC_H__
-#define __GST_ALSASRC_H__
-
-#include <gst/audio/audio.h>
-#include "gstalsa.h"
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_ALSA_SRC            (gst_alsasrc_get_type())
-#define GST_ALSA_SRC(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_SRC,GstAlsaSrc))
-#define GST_ALSA_SRC_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_SRC,GstAlsaSrcClass))
-#define GST_IS_ALSA_SRC(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_SRC))
-#define GST_IS_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_SRC))
-#define GST_ALSA_SRC_CAST(obj)       ((GstAlsaSrc *)(obj))
-
-#define GST_ALSA_SRC_GET_LOCK(obj)  (&GST_ALSA_SRC_CAST (obj)->alsa_lock)
-#define GST_ALSA_SRC_LOCK(obj)      (g_mutex_lock (GST_ALSA_SRC_GET_LOCK (obj)))
-#define GST_ALSA_SRC_UNLOCK(obj)    (g_mutex_unlock (GST_ALSA_SRC_GET_LOCK (obj)))
-
-typedef struct _GstAlsaSrc GstAlsaSrc;
-typedef struct _GstAlsaSrcClass GstAlsaSrcClass;
-
-/**
- * GstAlsaSrc:
- *
- * Opaque data structure
- */
-struct _GstAlsaSrc {
-  GstAudioSrc           src;
-
-  gchar                 *device;
-
-  snd_pcm_t             *handle;
-  snd_pcm_hw_params_t   *hwparams;
-  snd_pcm_sw_params_t   *swparams;
-
-  GstCaps               *cached_caps;
-
-  snd_pcm_access_t      access;
-  snd_pcm_format_t      format;
-  guint                 rate;
-  guint                 channels;
-  gint                  bpf;
-  gboolean              driver_timestamps;
-
-  guint                 buffer_time;
-  guint                 period_time;
-  snd_pcm_uframes_t     buffer_size;
-  snd_pcm_uframes_t     period_size;
-
-  GMutex                alsa_lock;
-};
-
-struct _GstAlsaSrcClass {
-  GstAudioSrcClass parent_class;
-};
-
-GType gst_alsasrc_get_type(void);
-
-G_END_DECLS
-
-#endif /* __GST_ALSASRC_H__ */
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/audio/gstaudiobasesink.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/audio/gstaudiobasesink.c	Tue Oct 06 09:23:15 2015 -0700
@@ -322,7 +322,7 @@
     GST_OBJECT_FLAG_SET (basesink, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
   else
     GST_OBJECT_FLAG_UNSET (basesink, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
-      }
+}
 
 static void
 gst_audio_base_sink_dispose (GObject * object)
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/audio/gstaudioringbuffer.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/audio/gstaudioringbuffer.h	Tue Oct 06 09:23:15 2015 -0700
@@ -262,15 +262,15 @@
 /* callback stuff */
 void            gst_audio_ring_buffer_set_callback    (GstAudioRingBuffer *buf,
                                                        GstAudioRingBufferCallback cb,
-                                                 gpointer user_data);
+                                                       gpointer user_data);
 
 gboolean        gst_audio_ring_buffer_parse_caps      (GstAudioRingBufferSpec *spec, GstCaps *caps);
 void            gst_audio_ring_buffer_debug_spec_caps (GstAudioRingBufferSpec *spec);
 void            gst_audio_ring_buffer_debug_spec_buff (GstAudioRingBufferSpec *spec);
 
 gboolean        gst_audio_ring_buffer_convert         (GstAudioRingBuffer * buf, GstFormat src_fmt,
-                                                 gint64 src_val, GstFormat dest_fmt,
-						 gint64 * dest_val);
+                                                       gint64 src_val, GstFormat dest_fmt,
+                                                       gint64 * dest_val);
 
 /* device state */
 gboolean        gst_audio_ring_buffer_open_device     (GstAudioRingBuffer *buf);
@@ -312,14 +312,14 @@
 /* commit samples */
 guint           gst_audio_ring_buffer_commit          (GstAudioRingBuffer * buf, guint64 *sample,
                                                        guint8 * data, gint in_samples,
-						 gint out_samples, gint * accum);
+                                                       gint out_samples, gint * accum);
 
 /* read samples */
 guint           gst_audio_ring_buffer_read            (GstAudioRingBuffer *buf, guint64 sample,
                                                        guint8 *data, guint len, GstClockTime *timestamp);
 
 /* Set timestamp on buffer */
-void            gst_audio_ring_buffer_set_timestamp   (GstAudioRingBuffer * buf, gint readseg, GstClockTime
+void            gst_audio_ring_buffer_set_timestamp   (GstAudioRingBuffer * buf, gint readseg, GstClockTime 
                                                        timestamp);
 
 /* mostly protected */
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.h	Tue Oct 06 09:23:15 2015 -0700
@@ -202,7 +202,7 @@
 GstClockTime              gst_discoverer_info_get_duration(const GstDiscovererInfo* info);
 gboolean                  gst_discoverer_info_get_seekable(const GstDiscovererInfo* info);
 const GstStructure*       gst_discoverer_info_get_misc(const GstDiscovererInfo* info);
-const GstTagList*         gst_discoverer_info_get_tags(const GstDiscovererInfo* info);
+const GstTagList*         gst_discoverer_info_get_tags(const GstDiscovererInfo* info); 
 const GstToc*             gst_discoverer_info_get_toc(const GstDiscovererInfo* info);
 const gchar**             gst_discoverer_info_get_missing_elements_installer_details(const GstDiscovererInfo* info);
 
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/riff/riff-ids.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/riff/riff-ids.h	Tue Oct 06 09:23:15 2015 -0700
@@ -324,7 +324,7 @@
 #define GST_RIFF_WAVE_FORMAT_DOLBY_AC2      (0x0030)
 #define GST_RIFF_WAVE_FORMAT_GSM610         (0x0031)
 #define GST_RIFF_WAVE_FORMAT_MSN            (0x0032)
-#define GST_RIFF_WAVE_FORMAT_ANTEX_ADPCME   (0x0033
+#define GST_RIFF_WAVE_FORMAT_ANTEX_ADPCME   (0x0033 
 #define GST_RIFF_WAVE_FORMAT_CONTROL_RES_VQLPC (0x0034)
 #define GST_RIFF_WAVE_FORMAT_DIGIREAL       (0x0035)
 #define GST_RIFF_WAVE_FORMAT_DIGIADPCM      (0x0036)
@@ -466,7 +466,7 @@
 #endif
 } gst_riff_strf_auds;
 
-typedef struct _gst_riff_strf_iavs {
+typedef struct _gst_riff_strf_iavs {    
   guint32 DVAAuxSrc;
   guint32 DVAAuxCtl;
   guint32 DVAAuxSrc1;
@@ -477,7 +477,7 @@
   guint32 DVReserved2;
 } gst_riff_strf_iavs;
 
-typedef struct _gst_riff_index_entry {
+typedef struct _gst_riff_index_entry {  
   guint32 id;
   guint32 flags;
 #define GST_RIFF_IF_LIST                (0x00000001L)
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/tag/gsttagdemux.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/tag/gsttagdemux.c	Tue Oct 06 09:23:15 2015 -0700
@@ -947,7 +947,7 @@
 
 static gboolean
 gst_tag_demux_seek_push (GstTagDemux * tagdemux, GstEvent * event)
-    {
+{
   gboolean res = FALSE;
       gdouble rate;
       GstFormat format;
@@ -1589,7 +1589,7 @@
   if (!gst_pad_peer_query (sinkpad, query)) {
     gst_query_unref (query);
     goto activate_push;
-}
+  }
 
   pull_mode = gst_query_has_scheduling_mode_with_flags (query,
       GST_PAD_MODE_PULL, GST_SCHEDULING_FLAG_SEEKABLE);
@@ -1630,7 +1630,7 @@
     default:
       res = TRUE;
       break;
-}
+  }
   return res;
 }
 
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/tag/gsttageditingprivate.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/tag/gsttageditingprivate.h	Tue Oct 06 09:23:15 2015 -0700
@@ -24,7 +24,7 @@
 #include <gst/tag/tag.h>
 
 G_BEGIN_DECLS
-
+  
 
 typedef struct _GstTagEntryMatch GstTagEntryMatch;
 struct _GstTagEntryMatch {
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/video/gstvideosink.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/video/gstvideosink.h	Tue Oct 06 09:23:15 2015 -0700
@@ -105,7 +105,7 @@
  * @parent_class: the parent class structure
  * @show_frame: render a video frame. Maps to #GstBaseSinkClass.render() and
  *     #GstBaseSinkClass.preroll() vfuncs. Rendering during preroll will be
- *     suppressed if the #GstVideoSink:show-preroll-frame property is set to
+ *     suppressed if the #GstVideoSink:show-preroll-frame property is set to 
  *     %FALSE.
  *
  * The video sink class structure. Derived classes should override the
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/video/video.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst-libs/gst/video/video.c	Tue Oct 06 09:23:15 2015 -0700
@@ -99,7 +99,7 @@
 
   /* ERRORS */
 error_overflow:
-{
+  {
     GST_WARNING ("overflow in multiply");
     return FALSE;
   }
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/typefind/gsttypefindfunctions.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/typefind/gsttypefindfunctions.c	Tue Oct 06 09:23:15 2015 -0700
@@ -1912,7 +1912,7 @@
   if (data != NULL && memcmp (data, "wvpk", 4) == 0) {
     GST_DEBUG ("found second block sync");
     base_prob = GST_TYPE_FIND_LIKELY;
-}
+  }
 
   GST_DEBUG ("wvc=%d, wv=%d", count_wvc, count_wv);
 
@@ -2765,11 +2765,11 @@
 
       if (seen_sps && seen_pps && seen_irap && good >= 10 && bad < 4) {
         gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY, H265_VIDEO_CAPS);
-    return;
-  }
+        return;
+      }
 
       data_scan_ctx_advance (tf, &c, 5);
-}
+    }
     data_scan_ctx_advance (tf, &c, 1);
   }
 
@@ -3509,9 +3509,9 @@
         mod_type = "stm";
         probability = GST_TYPE_FIND_MAXIMUM;
         goto suggest_audio_mod_caps;
+      }
     }
   }
-}
   /* AMF */
   if ((data = gst_type_find_peek (tf, 0, 19)) != NULL) {
     if (memcmp (data, "ASYLUM Music Format", 19) == 0) {
@@ -4158,7 +4158,7 @@
         else
           ++info->other;
         break;
-}
+      }
       case MATROSKA_STEREO_MODE:
         ++info->video_stereo;
         break;
@@ -4210,7 +4210,7 @@
     GST_INFO ("=== done with chunk %08x", id);
     if (id == MATROSKA_SEGMENT)
       break;
-}
+  }
 
   GST_INFO ("audio=%u video=%u other=%u chunks=%u doctype=%d all_tracks=%d",
       info.audio, info.video, info.other, info.chunks, info.doctype,
@@ -4227,7 +4227,7 @@
     type_name = "video/x-matroska-3d";
   } else {
     type_name = (is_audio) ? "audio/x-matroska" : "video/x-matroska";
-}
+  }
 
   if (info.doctype == EBML_DOCTYPE_UNKNOWN)
     prob = GST_TYPE_FIND_LIKELY;
@@ -4399,8 +4399,8 @@
       if (memcmp (c.data, markers[i].marker, markers[i].marker_size) == 0) {
         ++hdr_count[markers[i].stream_type];
         break;
-  }
-}
+      }
+    }
 
     if (i == G_N_ELEMENTS (markers)) {
       GST_MEMDUMP ("unknown Ogg stream marker", c.data, size);
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolume.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolume.h	Tue Oct 06 09:23:15 2015 -0700
@@ -67,7 +67,7 @@
   gint   current_vol_i24; /* the _i(nt) values get synchronized with the */
   gint   current_vol_i16; /* the _i(nt) values get synchronized with the */
   gint   current_vol_i8;   /* the _i(nt) values get synchronized with the */
-
+  
   GList *tracklist;
   gboolean negotiated;
 
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolumeorc-dist.c	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolumeorc-dist.c	Tue Oct 06 09:23:15 2015 -0700
@@ -79,10 +79,24 @@
 #endif
 #endif
 
+#ifndef ORC_INTERNAL
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+#define ORC_INTERNAL __attribute__((visibility("hidden")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define ORC_INTERNAL __hidden
+#elif defined (__GNUC__)
+#define ORC_INTERNAL __attribute__((visibility("hidden")))
+#else
+#define ORC_INTERNAL
+#endif
+#endif
+
+
 #ifndef DISABLE_ORC
 #include <orc/orc.h>
 #endif
-void volume_orc_scalarmultiply_f64_ns (double *ORC_RESTRICT d1, double p1, int n);
+void volume_orc_scalarmultiply_f64_ns (double *ORC_RESTRICT d1, double p1,
+    int n);
 void volume_orc_scalarmultiply_f32_ns (float *ORC_RESTRICT d1, float p1, int n);
 void volume_orc_process_int32 (gint32 * ORC_RESTRICT d1, int p1, int n);
 void volume_orc_process_int32_clamp (gint32 * ORC_RESTRICT d1, int p1, int n);
@@ -110,8 +124,6 @@
 void volume_orc_process_controlled_int8_2ch (gint8 * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n);
 
-void gst_volume_orc_init (void);
-
 
 /* begin Orc C target preamble */
 #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
@@ -136,8 +148,8 @@
 #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)
 #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)
 #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)
-#define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8))
-#define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24))
+#define ORC_SWAP_W(x) ((((x)&0xffU)<<8) | (((x)&0xff00U)>>8))
+#define ORC_SWAP_L(x) ((((x)&0xffU)<<24) | (((x)&0xff00U)<<8) | (((x)&0xff0000U)>>8) | (((x)&0xff000000U)>>24))
 #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56))
 #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))
 #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff))
@@ -194,7 +206,7 @@
 
 #else
 static void
-_backup_orc_scalarmultiply_f64_ns (OrcExecutor * ORC_RESTRICT ex)
+_backup_volume_orc_scalarmultiply_f64_ns (OrcExecutor * ORC_RESTRICT ex)
 {
   int i;
   int n = ex->n;
@@ -229,15 +241,50 @@
 
 }
 
-static OrcProgram *_orc_program_orc_scalarmultiply_f64_ns;
 void
 volume_orc_scalarmultiply_f64_ns (double *ORC_RESTRICT d1, double p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_orc_scalarmultiply_f64_ns;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 32, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 115, 99,
+        97, 108, 97, 114, 109, 117, 108, 116, 105, 112, 108, 121, 95, 102, 54,
+            52,
+        95, 110, 115, 11, 8, 8, 18, 8, 214, 0, 0, 24, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_scalarmultiply_f64_ns);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_scalarmultiply_f64_ns");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_scalarmultiply_f64_ns);
+      orc_program_add_destination (p, 8, "d1");
+      orc_program_add_parameter_double (p, 8, "p1");
+
+      orc_program_append_2 (p, "muld", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
@@ -248,7 +295,7 @@
     ex->params[ORC_VAR_T1] = tmp.x2[1];
   }
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -291,7 +338,7 @@
 
 #else
 static void
-_backup_orc_scalarmultiply_f32_ns (OrcExecutor * ORC_RESTRICT ex)
+_backup_volume_orc_scalarmultiply_f32_ns (OrcExecutor * ORC_RESTRICT ex)
 {
   int i;
   int n = ex->n;
@@ -324,15 +371,50 @@
 
 }
 
-static OrcProgram *_orc_program_orc_scalarmultiply_f32_ns;
 void
 volume_orc_scalarmultiply_f32_ns (float *ORC_RESTRICT d1, float p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_orc_scalarmultiply_f32_ns;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 32, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 115, 99,
+        97, 108, 97, 114, 109, 117, 108, 116, 105, 112, 108, 121, 95, 102, 51,
+            50,
+        95, 110, 115, 11, 4, 4, 17, 4, 202, 0, 0, 24, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_scalarmultiply_f32_ns);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_scalarmultiply_f32_ns");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_scalarmultiply_f32_ns);
+      orc_program_add_destination (p, 4, "d1");
+      orc_program_add_parameter_float (p, 4, "p1");
+
+      orc_program_append_2 (p, "mulf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
@@ -342,7 +424,7 @@
     ex->params[ORC_VAR_P1] = tmp.i;
   }
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -414,21 +496,60 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_int32;
 void
 volume_orc_process_int32 (gint32 * ORC_RESTRICT d1, int p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_int32;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 24, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 105, 110, 116, 51, 50, 11, 4, 4, 14, 4,
+        27, 0, 0, 0, 16, 4, 20, 8, 178, 32, 0, 24, 147, 32, 32, 16,
+        169, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p, _backup_volume_orc_process_int32);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_int32");
+      orc_program_set_backup_function (p, _backup_volume_orc_process_int32);
+      orc_program_add_destination (p, 4, "d1");
+      orc_program_add_constant (p, 4, 0x0000001b, "c1");
+      orc_program_add_parameter (p, 4, "p1");
+      orc_program_add_temporary (p, 8, "t1");
+
+      orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convql", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->params[ORC_VAR_P1] = p1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -500,21 +621,62 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_int32_clamp;
 void
 volume_orc_process_int32_clamp (gint32 * ORC_RESTRICT d1, int p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_int32_clamp;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 30, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 105, 110, 116, 51, 50, 95, 99, 108, 97, 109,
+        112, 11, 4, 4, 14, 4, 27, 0, 0, 0, 16, 4, 20, 8, 178, 32,
+        0, 24, 147, 32, 32, 16, 170, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_int32_clamp);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_int32_clamp");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_int32_clamp);
+      orc_program_add_destination (p, 4, "d1");
+      orc_program_add_constant (p, 4, 0x0000001b, "c1");
+      orc_program_add_parameter (p, 4, "p1");
+      orc_program_add_temporary (p, 8, "t1");
+
+      orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convsssql", 0, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1, ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->params[ORC_VAR_P1] = p1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -544,7 +706,7 @@
     /* 2: mulswl */
     var36.i = var33.i * var34.i;
     /* 3: shrsl */
-    var37.i = var36.i >> 13;
+    var37.i = var36.i >> 11;
     /* 4: convlw */
     var35.i = var37.i;
     /* 5: storew */
@@ -577,7 +739,7 @@
     /* 2: mulswl */
     var36.i = var33.i * var34.i;
     /* 3: shrsl */
-    var37.i = var36.i >> 13;
+    var37.i = var36.i >> 11;
     /* 4: convlw */
     var35.i = var37.i;
     /* 5: storew */
@@ -586,21 +748,60 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_int16;
 void
 volume_orc_process_int16 (gint16 * ORC_RESTRICT d1, int p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_int16;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 24, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 105, 110, 116, 49, 54, 11, 2, 2, 14, 4,
+        11, 0, 0, 0, 16, 2, 20, 4, 176, 32, 0, 24, 125, 32, 32, 16,
+        163, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p, _backup_volume_orc_process_int16);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_int16");
+      orc_program_set_backup_function (p, _backup_volume_orc_process_int16);
+      orc_program_add_destination (p, 2, "d1");
+      orc_program_add_constant (p, 4, 0x0000000b, "c1");
+      orc_program_add_parameter (p, 2, "p1");
+      orc_program_add_temporary (p, 4, "t1");
+
+      orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convlw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->params[ORC_VAR_P1] = p1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -630,7 +831,7 @@
     /* 2: mulswl */
     var36.i = var33.i * var34.i;
     /* 3: shrsl */
-    var37.i = var36.i >> 13;
+    var37.i = var36.i >> 11;
     /* 4: convssslw */
     var35.i = ORC_CLAMP_SW (var37.i);
     /* 5: storew */
@@ -663,7 +864,7 @@
     /* 2: mulswl */
     var36.i = var33.i * var34.i;
     /* 3: shrsl */
-    var37.i = var36.i >> 13;
+    var37.i = var36.i >> 11;
     /* 4: convssslw */
     var35.i = ORC_CLAMP_SW (var37.i);
     /* 5: storew */
@@ -672,21 +873,62 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_int16_clamp;
 void
 volume_orc_process_int16_clamp (gint16 * ORC_RESTRICT d1, int p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_int16_clamp;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 30, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 105, 110, 116, 49, 54, 95, 99, 108, 97, 109,
+        112, 11, 2, 2, 14, 4, 11, 0, 0, 0, 16, 2, 20, 4, 176, 32,
+        0, 24, 125, 32, 32, 16, 165, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_int16_clamp);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_int16_clamp");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_int16_clamp);
+      orc_program_add_destination (p, 2, "d1");
+      orc_program_add_constant (p, 4, 0x0000000b, "c1");
+      orc_program_add_parameter (p, 2, "p1");
+      orc_program_add_temporary (p, 4, "t1");
+
+      orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convssslw", 0, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1, ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->params[ORC_VAR_P1] = p1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -716,7 +958,7 @@
     /* 2: mulsbw */
     var36.i = var33 * var34;
     /* 3: shrsw */
-    var37.i = var36.i >> 5;
+    var37.i = var36.i >> 3;
     /* 4: convwb */
     var35 = var37.i;
     /* 5: storeb */
@@ -749,7 +991,7 @@
     /* 2: mulsbw */
     var36.i = var33 * var34;
     /* 3: shrsw */
-    var37.i = var36.i >> 5;
+    var37.i = var36.i >> 3;
     /* 4: convwb */
     var35 = var37.i;
     /* 5: storeb */
@@ -758,21 +1000,60 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_int8;
 void
 volume_orc_process_int8 (gint8 * ORC_RESTRICT d1, int p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_int8;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 23, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 105, 110, 116, 56, 11, 1, 1, 14, 4, 3,
+        0, 0, 0, 16, 1, 20, 2, 174, 32, 0, 24, 94, 32, 32, 16, 157,
+        0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p, _backup_volume_orc_process_int8);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_int8");
+      orc_program_set_backup_function (p, _backup_volume_orc_process_int8);
+      orc_program_add_destination (p, 1, "d1");
+      orc_program_add_constant (p, 4, 0x00000003, "c1");
+      orc_program_add_parameter (p, 1, "p1");
+      orc_program_add_temporary (p, 2, "t1");
+
+      orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->params[ORC_VAR_P1] = p1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -802,7 +1083,7 @@
     /* 2: mulsbw */
     var36.i = var33 * var34;
     /* 3: shrsw */
-    var37.i = var36.i >> 5;
+    var37.i = var36.i >> 3;
     /* 4: convssswb */
     var35 = ORC_CLAMP_SB (var37.i);
     /* 5: storeb */
@@ -835,7 +1116,7 @@
     /* 2: mulsbw */
     var36.i = var33 * var34;
     /* 3: shrsw */
-    var37.i = var36.i >> 5;
+    var37.i = var36.i >> 3;
     /* 4: convssswb */
     var35 = ORC_CLAMP_SB (var37.i);
     /* 5: storeb */
@@ -844,21 +1125,63 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_int8_clamp;
 void
 volume_orc_process_int8_clamp (gint8 * ORC_RESTRICT d1, int p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_int8_clamp;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 29, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 105, 110, 116, 56, 95, 99, 108, 97, 109,
+            112,
+        11, 1, 1, 14, 4, 3, 0, 0, 0, 16, 1, 20, 2, 174, 32, 0,
+        24, 94, 32, 32, 16, 159, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_int8_clamp);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_int8_clamp");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_int8_clamp);
+      orc_program_add_destination (p, 1, "d1");
+      orc_program_add_constant (p, 4, 0x00000003, "c1");
+      orc_program_add_parameter (p, 1, "p1");
+      orc_program_add_temporary (p, 2, "t1");
+
+      orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convssswb", 0, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1, ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->params[ORC_VAR_P1] = p1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -890,7 +1213,7 @@
 
 #else
 static void
-_backup_orc_memset_f64 (OrcExecutor * ORC_RESTRICT ex)
+_backup_volume_orc_memset_f64 (OrcExecutor * ORC_RESTRICT ex)
 {
   int i;
   int n = ex->n;
@@ -914,15 +1237,47 @@
 
 }
 
-static OrcProgram *_orc_program_orc_memset_f64;
 void
 volume_orc_memset_f64 (gdouble * ORC_RESTRICT d1, double p1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_orc_memset_f64;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 21, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 109, 101,
+        109, 115, 101, 116, 95, 102, 54, 52, 11, 8, 8, 18, 8, 137, 0, 24,
+        2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p, _backup_volume_orc_memset_f64);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_memset_f64");
+      orc_program_set_backup_function (p, _backup_volume_orc_memset_f64);
+      orc_program_add_destination (p, 8, "d1");
+      orc_program_add_parameter_double (p, 8, "p1");
+
+      orc_program_append_2 (p, "copyq", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
@@ -933,7 +1288,7 @@
     ex->params[ORC_VAR_T1] = tmp.x2[1];
   }
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -949,7 +1304,11 @@
   orc_union64 *ORC_RESTRICT ptr0;
   const orc_union32 *ORC_RESTRICT ptr4;
   orc_union32 var33;
+#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
+  volatile orc_union64 var34;
+#else
   orc_union64 var34;
+#endif
   orc_union64 var35;
   orc_union64 var36;
   orc_union64 var37;
@@ -996,14 +1355,18 @@
 
 #else
 static void
-_backup_orc_prepare_volumes (OrcExecutor * ORC_RESTRICT ex)
+_backup_volume_orc_prepare_volumes (OrcExecutor * ORC_RESTRICT ex)
 {
   int i;
   int n = ex->n;
   orc_union64 *ORC_RESTRICT ptr0;
   const orc_union32 *ORC_RESTRICT ptr4;
   orc_union32 var33;
+#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
+  volatile orc_union64 var34;
+#else
   orc_union64 var34;
+#endif
   orc_union64 var35;
   orc_union64 var36;
   orc_union64 var37;
@@ -1048,22 +1411,61 @@
 
 }
 
-static OrcProgram *_orc_program_orc_prepare_volumes;
 void
 volume_orc_prepare_volumes (gdouble * ORC_RESTRICT d1,
     const gboolean * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_orc_prepare_volumes;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 26, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        101, 112, 97, 114, 101, 95, 118, 111, 108, 117, 109, 101, 115, 11, 8, 8,
+        12, 4, 4, 15, 8, 0, 0, 0, 0, 0, 0, 240, 63, 20, 8, 223,
+        32, 4, 213, 32, 16, 32, 214, 0, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p, _backup_volume_orc_prepare_volumes);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_prepare_volumes");
+      orc_program_set_backup_function (p, _backup_volume_orc_prepare_volumes);
+      orc_program_add_destination (p, 8, "d1");
+      orc_program_add_source (p, 4, "s1");
+      orc_program_add_constant_int64 (p, 8, 0x3ff0000000000000ULL, "c1");
+      orc_program_add_temporary (p, 8, "t1");
+
+      orc_program_append_2 (p, "convld", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "subd", 0, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_T1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "muld", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -1144,22 +1546,58 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_f64_1ch;
 void
 volume_orc_process_controlled_f64_1ch (gdouble * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_f64_1ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 37, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 102, 54, 52, 95, 49, 99, 104, 11, 8, 8, 12, 8, 8, 214, 0,
+        0, 4, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_f64_1ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_f64_1ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_f64_1ch);
+      orc_program_add_destination (p, 8, "d1");
+      orc_program_add_source (p, 8, "s1");
+
+      orc_program_append_2 (p, "muld", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -1258,22 +1696,61 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_f32_1ch;
 void
 volume_orc_process_controlled_f32_1ch (gfloat * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_f32_1ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 37, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 102, 51, 50, 95, 49, 99, 104, 11, 4, 4, 12, 8, 8, 20, 4,
+        225, 32, 4, 202, 0, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_f32_1ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_f32_1ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_f32_1ch);
+      orc_program_add_destination (p, 4, "d1");
+      orc_program_add_source (p, 8, "s1");
+      orc_program_add_temporary (p, 4, "t1");
+
+      orc_program_append_2 (p, "convdf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mulf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -1406,22 +1883,65 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_f32_2ch;
 void
 volume_orc_process_controlled_f32_2ch (gfloat * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_f32_2ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 37, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 102, 51, 50, 95, 50, 99, 104, 11, 8, 8, 12, 8, 8, 20, 4,
+        20, 8, 225, 32, 4, 194, 33, 32, 32, 21, 1, 202, 0, 0, 33, 2,
+        0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_f32_2ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_f32_2ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_f32_2ch);
+      orc_program_add_destination (p, 8, "d1");
+      orc_program_add_source (p, 8, "s1");
+      orc_program_add_temporary (p, 4, "t1");
+      orc_program_add_temporary (p, 8, "t2");
+
+      orc_program_append_2 (p, "convdf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mulf", 1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -1526,22 +2046,63 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_int32_1ch;
 void
 volume_orc_process_controlled_int32_1ch (gint32 * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_int32_1ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 39, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 105, 110, 116, 51, 50, 95, 49, 99, 104, 11, 4, 4, 12, 8, 8,
+        20, 8, 223, 32, 0, 214, 32, 32, 4, 222, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int32_1ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_int32_1ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int32_1ch);
+      orc_program_add_destination (p, 4, "d1");
+      orc_program_add_source (p, 8, "s1");
+      orc_program_add_temporary (p, 8, "t1");
+
+      orc_program_append_2 (p, "convld", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "muld", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convdl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -1676,22 +2237,71 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_int16_1ch;
 void
 volume_orc_process_controlled_int16_1ch (gint16 * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_int16_1ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 39, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 105, 110, 116, 49, 54, 95, 49, 99, 104, 11, 2, 2, 12, 8, 8,
+        20, 4, 20, 4, 153, 32, 0, 211, 32, 32, 225, 33, 4, 202, 32, 32,
+        33, 210, 32, 32, 165, 0, 32, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int16_1ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_int16_1ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int16_1ch);
+      orc_program_add_destination (p, 2, "d1");
+      orc_program_add_source (p, 8, "s1");
+      orc_program_add_temporary (p, 4, "t1");
+      orc_program_add_temporary (p, 4, "t2");
+
+      orc_program_append_2 (p, "convswl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convlf", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convdf", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mulf", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convfl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convssslw", 0, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1, ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -1880,22 +2490,75 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_int16_2ch;
 void
 volume_orc_process_controlled_int16_2ch (gint16 * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_int16_2ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 39, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 105, 110, 116, 49, 54, 95, 50, 99, 104, 11, 4, 4, 12, 8, 8,
+        20, 8, 20, 4, 20, 8, 21, 1, 153, 32, 0, 21, 1, 211, 32, 32,
+        225, 33, 4, 194, 34, 33, 33, 21, 1, 202, 34, 34, 32, 21, 1, 210,
+        34, 34, 21, 1, 165, 0, 34, 2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int16_2ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_int16_2ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int16_2ch);
+      orc_program_add_destination (p, 4, "d1");
+      orc_program_add_source (p, 8, "s1");
+      orc_program_add_temporary (p, 8, "t1");
+      orc_program_add_temporary (p, 4, "t2");
+      orc_program_add_temporary (p, 8, "t3");
+
+      orc_program_append_2 (p, "convswl", 1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convlf", 1, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convdf", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_T2,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mulf", 1, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convfl", 1, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convssslw", 1, ORC_VAR_D1, ORC_VAR_T3,
+          ORC_VAR_D1, ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -2042,22 +2705,77 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_int8_1ch;
 void
 volume_orc_process_controlled_int8_1ch (gint8 * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_int8_1ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 38, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 105, 110, 116, 56, 95, 49, 99, 104, 11, 1, 1, 12, 8, 8, 20,
+        2, 20, 4, 20, 4, 149, 32, 0, 153, 33, 32, 211, 33, 33, 225, 34,
+        4, 202, 33, 33, 34, 210, 33, 33, 163, 32, 33, 159, 0, 32, 2, 0,
+
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int8_1ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_int8_1ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int8_1ch);
+      orc_program_add_destination (p, 1, "d1");
+      orc_program_add_source (p, 8, "s1");
+      orc_program_add_temporary (p, 2, "t1");
+      orc_program_add_temporary (p, 4, "t2");
+      orc_program_add_temporary (p, 4, "t3");
+
+      orc_program_append_2 (p, "convsbw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convlf", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convdf", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mulf", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convfl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convssswb", 0, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1, ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
@@ -2262,460 +2980,80 @@
 
 }
 
-static OrcProgram *_orc_program_volume_orc_process_controlled_int8_2ch;
 void
 volume_orc_process_controlled_int8_2ch (gint8 * ORC_RESTRICT d1,
     const gdouble * ORC_RESTRICT s1, int n)
 {
   OrcExecutor _ex, *ex = &_ex;
-  OrcProgram *p = _orc_program_volume_orc_process_controlled_int8_2ch;
+  static volatile int p_inited = 0;
+  static OrcCode *c = 0;
   void (*func) (OrcExecutor *);
 
-  ex->program = p;
+  if (!p_inited) {
+    orc_once_mutex_lock ();
+    if (!p_inited) {
+      OrcProgram *p;
+
+#if 1
+      static const orc_uint8 bc[] = {
+        1, 9, 38, 118, 111, 108, 117, 109, 101, 95, 111, 114, 99, 95, 112, 114,
+        111, 99, 101, 115, 115, 95, 99, 111, 110, 116, 114, 111, 108, 108, 101,
+            100,
+        95, 105, 110, 116, 56, 95, 50, 99, 104, 11, 2, 2, 12, 8, 8, 20,
+        4, 20, 8, 20, 8, 21, 1, 149, 32, 0, 21, 1, 153, 33, 32, 21,
+        1, 211, 33, 33, 225, 32, 4, 194, 34, 32, 32, 21, 1, 202, 33, 33,
+        34, 21, 1, 210, 33, 33, 21, 1, 163, 32, 33, 21, 1, 159, 0, 32,
+        2, 0,
+      };
+      p = orc_program_new_from_static_bytecode (bc);
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int8_2ch);
+#else
+      p = orc_program_new ();
+      orc_program_set_name (p, "volume_orc_process_controlled_int8_2ch");
+      orc_program_set_backup_function (p,
+          _backup_volume_orc_process_controlled_int8_2ch);
+      orc_program_add_destination (p, 2, "d1");
+      orc_program_add_source (p, 8, "s1");
+      orc_program_add_temporary (p, 4, "t1");
+      orc_program_add_temporary (p, 8, "t2");
+      orc_program_add_temporary (p, 8, "t3");
+
+      orc_program_append_2 (p, "convsbw", 1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convswl", 1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convlf", 1, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convdf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_T1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "mulf", 1, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convfl", 1, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convlw", 1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1,
+          ORC_VAR_D1);
+      orc_program_append_2 (p, "convssswb", 1, ORC_VAR_D1, ORC_VAR_T1,
+          ORC_VAR_D1, ORC_VAR_D1);
+#endif
+
+      orc_program_compile (p);
+      c = orc_program_take_code (p);
+      orc_program_free (p);
+    }
+    p_inited = TRUE;
+    orc_once_mutex_unlock ();
+  }
+  ex->arrays[ORC_VAR_A2] = c;
+  ex->program = 0;
 
   ex->n = n;
   ex->arrays[ORC_VAR_D1] = d1;
   ex->arrays[ORC_VAR_S1] = (void *) s1;
 
-  func = p->code_exec;
+  func = c->exec;
   func (ex);
 }
 #endif
-
-
-void
-gst_volume_orc_init (void)
-{
-#ifndef DISABLE_ORC
-  {
-    /* volume_orc_scalarmultiply_f64_ns */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_scalarmultiply_f64_ns");
-    orc_program_set_backup_function (p, _backup_orc_scalarmultiply_f64_ns);
-    orc_program_add_destination (p, 8, "d1");
-    orc_program_add_parameter_double (p, 8, "p1");
-
-    orc_program_append_2 (p, "muld", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_orc_scalarmultiply_f64_ns = p;
-  }
-  {
-    /* volume_orc_scalarmultiply_f32_ns */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_scalarmultiply_f32_ns");
-    orc_program_set_backup_function (p, _backup_orc_scalarmultiply_f32_ns);
-    orc_program_add_destination (p, 4, "d1");
-    orc_program_add_parameter_float (p, 4, "p1");
-
-    orc_program_append_2 (p, "mulf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_orc_scalarmultiply_f32_ns = p;
-  }
-  {
-    /* volume_orc_process_int32 */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_int32");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_int32);
-    orc_program_add_destination (p, 4, "d1");
-    orc_program_add_constant (p, 4, 0x0000001b, "c1");
-    orc_program_add_parameter (p, 4, "p1");
-    orc_program_add_temporary (p, 8, "t1");
-
-    orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convql", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_int32 = p;
-  }
-  {
-    /* volume_orc_process_int32_clamp */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_int32_clamp");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_int32_clamp);
-    orc_program_add_destination (p, 4, "d1");
-    orc_program_add_constant (p, 4, 0x0000001b, "c1");
-    orc_program_add_parameter (p, 4, "p1");
-    orc_program_add_temporary (p, 8, "t1");
-
-    orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convsssql", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_int32_clamp = p;
-  }
-  {
-    /* volume_orc_process_int16 */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_int16");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_int16);
-    orc_program_add_destination (p, 2, "d1");
-    orc_program_add_constant (p, 4, 0x0000000d, "c1");
-    orc_program_add_parameter (p, 2, "p1");
-    orc_program_add_temporary (p, 4, "t1");
-
-    orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convlw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_int16 = p;
-  }
-  {
-    /* volume_orc_process_int16_clamp */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_int16_clamp");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_int16_clamp);
-    orc_program_add_destination (p, 2, "d1");
-    orc_program_add_constant (p, 4, 0x0000000d, "c1");
-    orc_program_add_parameter (p, 2, "p1");
-    orc_program_add_temporary (p, 4, "t1");
-
-    orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convssslw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_int16_clamp = p;
-  }
-  {
-    /* volume_orc_process_int8 */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_int8");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_int8);
-    orc_program_add_destination (p, 1, "d1");
-    orc_program_add_constant (p, 4, 0x00000005, "c1");
-    orc_program_add_parameter (p, 1, "p1");
-    orc_program_add_temporary (p, 2, "t1");
-
-    orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_int8 = p;
-  }
-  {
-    /* volume_orc_process_int8_clamp */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_int8_clamp");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_int8_clamp);
-    orc_program_add_destination (p, 1, "d1");
-    orc_program_add_constant (p, 4, 0x00000005, "c1");
-    orc_program_add_parameter (p, 1, "p1");
-    orc_program_add_temporary (p, 2, "t1");
-
-    orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convssswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_int8_clamp = p;
-  }
-  {
-    /* volume_orc_memset_f64 */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_memset_f64");
-    orc_program_set_backup_function (p, _backup_orc_memset_f64);
-    orc_program_add_destination (p, 8, "d1");
-    orc_program_add_parameter_double (p, 8, "p1");
-
-    orc_program_append_2 (p, "copyq", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_orc_memset_f64 = p;
-  }
-  {
-    /* volume_orc_prepare_volumes */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_prepare_volumes");
-    orc_program_set_backup_function (p, _backup_orc_prepare_volumes);
-    orc_program_add_destination (p, 8, "d1");
-    orc_program_add_source (p, 4, "s1");
-    orc_program_add_constant_int64 (p, 8, 0x3ff0000000000000ULL, "c1");
-    orc_program_add_temporary (p, 8, "t1");
-
-    orc_program_append_2 (p, "convld", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "subd", 0, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_T1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "muld", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_orc_prepare_volumes = p;
-  }
-  {
-    /* volume_orc_process_controlled_f64_1ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_f64_1ch");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_controlled_f64_1ch);
-    orc_program_add_destination (p, 8, "d1");
-    orc_program_add_source (p, 8, "s1");
-
-    orc_program_append_2 (p, "muld", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_f64_1ch = p;
-  }
-  {
-    /* volume_orc_process_controlled_f32_1ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_f32_1ch");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_controlled_f32_1ch);
-    orc_program_add_destination (p, 4, "d1");
-    orc_program_add_source (p, 8, "s1");
-    orc_program_add_temporary (p, 4, "t1");
-
-    orc_program_append_2 (p, "convdf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mulf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_f32_1ch = p;
-  }
-  {
-    /* volume_orc_process_controlled_f32_2ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_f32_2ch");
-    orc_program_set_backup_function (p, _backup_volume_orc_process_controlled_f32_2ch);
-    orc_program_add_destination (p, 8, "d1");
-    orc_program_add_source (p, 8, "s1");
-    orc_program_add_temporary (p, 4, "t1");
-    orc_program_add_temporary (p, 8, "t2");
-
-    orc_program_append_2 (p, "convdf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mulf", 1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_f32_2ch = p;
-  }
-  {
-    /* volume_orc_process_controlled_int32_1ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_int32_1ch");
-    orc_program_set_backup_function (p,
-        _backup_volume_orc_process_controlled_int32_1ch);
-    orc_program_add_destination (p, 4, "d1");
-    orc_program_add_source (p, 8, "s1");
-    orc_program_add_temporary (p, 8, "t1");
-
-    orc_program_append_2 (p, "convld", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "muld", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convdl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_int32_1ch = p;
-  }
-  {
-    /* volume_orc_process_controlled_int16_1ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_int16_1ch");
-    orc_program_set_backup_function (p,
-        _backup_volume_orc_process_controlled_int16_1ch);
-    orc_program_add_destination (p, 2, "d1");
-    orc_program_add_source (p, 8, "s1");
-    orc_program_add_temporary (p, 4, "t1");
-    orc_program_add_temporary (p, 4, "t2");
-
-    orc_program_append_2 (p, "convswl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convlf", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convdf", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mulf", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convfl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convssslw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_int16_1ch = p;
-  }
-  {
-    /* volume_orc_process_controlled_int16_2ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_int16_2ch");
-    orc_program_set_backup_function (p,
-        _backup_volume_orc_process_controlled_int16_2ch);
-    orc_program_add_destination (p, 4, "d1");
-    orc_program_add_source (p, 8, "s1");
-    orc_program_add_temporary (p, 8, "t1");
-    orc_program_add_temporary (p, 4, "t2");
-    orc_program_add_temporary (p, 8, "t3");
-
-    orc_program_append_2 (p, "convswl", 1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convlf", 1, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convdf", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_T2,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mulf", 1, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convfl", 1, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convssslw", 1, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_int16_2ch = p;
-  }
-  {
-    /* volume_orc_process_controlled_int8_1ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_int8_1ch");
-    orc_program_set_backup_function (p,
-        _backup_volume_orc_process_controlled_int8_1ch);
-    orc_program_add_destination (p, 1, "d1");
-    orc_program_add_source (p, 8, "s1");
-    orc_program_add_temporary (p, 2, "t1");
-    orc_program_add_temporary (p, 4, "t2");
-    orc_program_add_temporary (p, 4, "t3");
-
-    orc_program_append_2 (p, "convsbw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convlf", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convdf", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mulf", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convfl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convssswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_int8_1ch = p;
-  }
-  {
-    /* volume_orc_process_controlled_int8_2ch */
-    OrcProgram *p;
-
-    p = orc_program_new ();
-    orc_program_set_name (p, "volume_orc_process_controlled_int8_2ch");
-    orc_program_set_backup_function (p,
-        _backup_volume_orc_process_controlled_int8_2ch);
-    orc_program_add_destination (p, 2, "d1");
-    orc_program_add_source (p, 8, "s1");
-    orc_program_add_temporary (p, 4, "t1");
-    orc_program_add_temporary (p, 8, "t2");
-    orc_program_add_temporary (p, 8, "t3");
-
-    orc_program_append_2 (p, "convsbw", 1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convswl", 1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convlf", 1, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convdf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mergelq", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_T1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "mulf", 1, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convfl", 1, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convlw", 1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1,
-        ORC_VAR_D1);
-    orc_program_append_2 (p, "convssswb", 1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
-        ORC_VAR_D1);
-
-    orc_program_compile (p);
-
-    _orc_program_volume_orc_process_controlled_int8_2ch = p;
-  }
-#endif
-}
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolumeorc-dist.h	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolumeorc-dist.h	Tue Oct 06 09:23:15 2015 -0700
@@ -10,8 +10,6 @@
 extern "C" {
 #endif
 
-void gst_volume_orc_init (void);
-
 
 
 #ifndef _ORC_INTEGER_TYPEDEFS_
@@ -69,6 +67,19 @@
 #define ORC_RESTRICT
 #endif
 #endif
+
+#ifndef ORC_INTERNAL
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+#define ORC_INTERNAL __attribute__((visibility("hidden")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define ORC_INTERNAL __hidden
+#elif defined (__GNUC__)
+#define ORC_INTERNAL __attribute__((visibility("hidden")))
+#else
+#define ORC_INTERNAL
+#endif
+#endif
+
 void volume_orc_scalarmultiply_f64_ns (double * ORC_RESTRICT d1, double p1, int n);
 void volume_orc_scalarmultiply_f32_ns (float * ORC_RESTRICT d1, float p1, int n);
 void volume_orc_process_int32 (gint32 * ORC_RESTRICT d1, int p1, int n);
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolumeorc.orc	Tue Oct 06 09:17:24 2015 -0700
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/gst/volume/gstvolumeorc.orc	Tue Oct 06 09:23:15 2015 -0700
@@ -1,19 +1,17 @@
 
-.init gst_volume_orc_init
-
-.function orc_scalarmultiply_f64_ns
+.function volume_orc_scalarmultiply_f64_ns
 .dest 8 d1 double
 .doubleparam 8 p1
 
 muld d1, d1, p1
 
-.function orc_scalarmultiply_f32_ns
+.function volume_orc_scalarmultiply_f32_ns
 .dest 4 d1 float
 .floatparam 4 p1
 
 mulf d1, d1, p1
 
-.function orc_process_int32
+.function volume_orc_process_int32
 .dest 4 d1 gint32
 .param 4 p1
 .temp 8 t1
@@ -22,7 +20,7 @@
 shrsq t1, t1, 27
 convql d1, t1
 
-.function orc_process_int32_clamp
+.function volume_orc_process_int32_clamp
 .dest 4 d1 gint32
 .param 4 p1
 .temp 8 t1
@@ -31,51 +29,51 @@
 shrsq t1, t1, 27
 convsssql d1, t1
 
-.function orc_process_int16
+.function volume_orc_process_int16
 .dest 2 d1 gint16
 .param 2 p1
 .temp 4 t1
 
 mulswl t1, d1, p1
-shrsl t1, t1, 13
+shrsl t1, t1, 11
 convlw d1, t1
 
 
-.function orc_process_int16_clamp
+.function volume_orc_process_int16_clamp
 .dest 2 d1 gint16
 .param 2 p1
 .temp 4 t1
 
 mulswl t1, d1, p1
-shrsl t1, t1, 13
+shrsl t1, t1, 11
 convssslw d1, t1
 
-.function orc_process_int8
+.function volume_orc_process_int8
 .dest 1 d1 gint8
 .param 1 p1
 .temp 2 t1
 
 mulsbw t1, d1, p1
-shrsw t1, t1, 5
+shrsw t1, t1, 3
 convwb d1, t1
 
 
-.function orc_process_int8_clamp
+.function volume_orc_process_int8_clamp
 .dest 1 d1 gint8
 .param 1 p1
 .temp 2 t1
 
 mulsbw t1, d1, p1
-shrsw t1, t1, 5
+shrsw t1, t1, 3
 convssswb d1, t1
 
-.function orc_memset_f64
+.function volume_orc_memset_f64
 .dest 8 d1 gdouble
 .doubleparam 8 p1
 
 copyq d1, p1
 
-.function orc_prepare_volumes
+.function volume_orc_prepare_volumes
 .dest 8 d1 gdouble
 .source 4 s1 gboolean
 .temp 8 t1
@@ -84,13 +82,13 @@
 subd t1, 0x3FF0000000000000L, t1
 muld d1, d1, t1
 
-.function orc_process_controlled_f64_1ch
+.function volume_orc_process_controlled_f64_1ch
 .dest 8 d1 gdouble
 .source 8 s1 gdouble
 
 muld d1, d1, s1
 
-.function orc_process_controlled_f32_1ch
+.function volume_orc_process_controlled_f32_1ch
 .dest 4 d1 gfloat
 .source 8 s1 gdouble
 .temp 4 t1
@@ -98,7 +96,7 @@
 convdf t1, s1
 mulf d1, d1, t1
 
-.function orc_process_controlled_f32_2ch
+.function volume_orc_process_controlled_f32_2ch
 .dest 8 d1 gfloat
 .source 8 s1 gdouble
 .temp 4 t1
@@ -108,7 +106,7 @@
 mergelq t2, t1, t1
 x2 mulf d1, d1, t2
 
-.function orc_process_controlled_int32_1ch
+.function volume_orc_process_controlled_int32_1ch
 .dest 4 d1 gint32
 .source 8 s1 gdouble
 .temp 8 t1
@@ -117,7 +115,7 @@
 muld t1, t1, s1
 convdl d1, t1
 
-.function orc_process_controlled_int16_1ch
+.function volume_orc_process_controlled_int16_1ch
 .dest 2 d1 gint16
 .source 8 s1 gdouble
 .temp 4 t1
@@ -130,7 +128,7 @@
 convfl t1, t1
 convssslw d1, t1
 
-.function orc_process_controlled_int16_2ch
+.function volume_orc_process_controlled_int16_2ch
 .dest 4 d1 gint16
 .source 8 s1 gdouble
 .temp 8 t1
@@ -145,7 +143,7 @@
 x2 convfl t3, t3
 x2 convssslw d1, t3
 
-.function orc_process_controlled_int8_1ch
+.function volume_orc_process_controlled_int8_1ch
 .dest 1 d1 gint8
 .source 8 s1 gdouble
 .temp 2 t1
@@ -161,7 +159,7 @@
 convlw t1, t2
 convssswb d1, t1
 
-.function orc_process_controlled_int8_2ch
+.function volume_orc_process_controlled_int8_2ch
 .dest 2 d1 gint8
 .source 8 s1 gdouble
 .temp 4 t1
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audioamplify.c	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,476 +0,0 @@
-/* 
- * GStreamer
- * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
- * Copyright (C) 2006 Stefan Kost <ensonic@users.sf.net>
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/**
- * SECTION:element-audioamplify
- *
- * Amplifies an audio stream by a given factor and allows the selection of different clipping modes.
- * The difference between the clipping modes is best evaluated by testing.
- *
- * <refsect2>
- * <title>Example launch line</title>
- * |[
- * gst-launch-1.0 audiotestsrc wave=saw ! audioamplify amplification=1.5 ! alsasink
- * gst-launch-1.0 filesrc location="melo1.ogg" ! oggdemux ! vorbisdec ! audioconvert ! audioamplify amplification=1.5 method=wrap-negative ! alsasink
- * gst-launch-1.0 audiotestsrc wave=saw ! audioconvert ! audioamplify amplification=1.5 method=wrap-positive ! audioconvert ! alsasink
- * ]|
- * </refsect2>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gst/gst.h>
-#include <gst/base/gstbasetransform.h>
-#include <gst/audio/audio.h>
-#include <gst/audio/gstaudiofilter.h>
-
-#include "audioamplify.h"
-
-#define GST_CAT_DEFAULT gst_audio_amplify_debug
-GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
-
-/* Filter signals and args */
-enum
-{
-  /* FILL ME */
-  LAST_SIGNAL
-};
-
-enum
-{
-  PROP_0,
-  PROP_AMPLIFICATION,
-  PROP_CLIPPING_METHOD
-};
-
-enum
-{
-  METHOD_CLIP = 0,
-  METHOD_WRAP_NEGATIVE,
-  METHOD_WRAP_POSITIVE,
-  METHOD_NOCLIP,
-  NUM_METHODS
-};
-
-#define GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD (gst_audio_amplify_clipping_method_get_type ())
-static GType
-gst_audio_amplify_clipping_method_get_type (void)
-{
-  static GType gtype = 0;
-
-  if (gtype == 0) {
-    static const GEnumValue values[] = {
-      {METHOD_CLIP, "Normal clipping (default)", "clip"},
-      {METHOD_WRAP_NEGATIVE,
-            "Push overdriven values back from the opposite side",
-          "wrap-negative"},
-      {METHOD_WRAP_POSITIVE, "Push overdriven values back from the same side",
-          "wrap-positive"},
-      {METHOD_NOCLIP, "No clipping", "none"},
-      {0, NULL, NULL}
-    };
-    gtype = g_enum_register_static ("GstAudioAmplifyClippingMethod", values);
-  }
-  return gtype;
-}
-
-#define ALLOWED_CAPS                                                  \
-    "audio/x-raw,"                                                    \
-    " format=(string) {S8,"GST_AUDIO_NE(S16)","GST_AUDIO_NE(S32)","   \
-                           GST_AUDIO_NE(F32)","GST_AUDIO_NE(F64)"},"  \
-    " rate=(int)[1,MAX],"                                             \
-    " channels=(int)[1,MAX], "                                        \
-    " layout=(string) {interleaved, non-interleaved}"
-
-G_DEFINE_TYPE (GstAudioAmplify, gst_audio_amplify, GST_TYPE_AUDIO_FILTER);
-
-static gboolean gst_audio_amplify_set_process_function (GstAudioAmplify *
-    filter, gint clipping, GstAudioFormat format);
-static void gst_audio_amplify_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec);
-static void gst_audio_amplify_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec);
-
-static gboolean gst_audio_amplify_setup (GstAudioFilter * filter,
-    const GstAudioInfo * info);
-static GstFlowReturn gst_audio_amplify_transform_ip (GstBaseTransform * base,
-    GstBuffer * buf);
-
-#define MIN_gint8 G_MININT8
-#define MAX_gint8 G_MAXINT8
-#define MIN_gint16 G_MININT16
-#define MAX_gint16 G_MAXINT16
-#define MIN_gint32 G_MININT32
-#define MAX_gint32 G_MAXINT32
-
-#define MAKE_INT_FUNCS(type,largetype)                                        \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_clip (GstAudioAmplify * filter,          \
-    void * data, guint num_samples)                                           \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--) {                                                     \
-    largetype val = *d * filter->amplification;                               \
-    *d++ =  CLAMP (val, MIN_##type, MAX_##type);                              \
-  }                                                                           \
-}                                                                             \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_wrap_negative (GstAudioAmplify * filter, \
-    void * data, guint num_samples)                                           \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--) {                                                     \
-    largetype val = *d * filter->amplification;                               \
-    if (val > MAX_##type)                                                     \
-      val = MIN_##type + (val - MIN_##type) % ((largetype) MAX_##type + 1 -   \
-          MIN_##type);                                                        \
-    else if (val < MIN_##type)                                                \
-      val = MAX_##type - (MAX_##type - val) % ((largetype) MAX_##type + 1 -   \
-          MIN_##type);                                                        \
-    *d++ = val;                                                               \
-  }                                                                           \
-}                                                                             \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_wrap_positive (GstAudioAmplify * filter, \
-    void * data, guint num_samples)                                           \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--) {                                                     \
-    largetype val = *d * filter->amplification;                               \
-    do {                                                                      \
-      if (val > MAX_##type)                                                   \
-        val = MAX_##type - (val - MAX_##type);                                \
-      else if (val < MIN_##type)                                              \
-        val = MIN_##type + (MIN_##type - val);                                \
-      else                                                                    \
-        break;                                                                \
-    } while (1);                                                              \
-    *d++ = val;                                                               \
-  }                                                                           \
-}                                                                             \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_noclip (GstAudioAmplify * filter,        \
-    void * data, guint num_samples)                                           \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--)                                                       \
-    *d++ *= filter->amplification;                                            \
-}
-
-#define MAKE_FLOAT_FUNCS(type)                                                \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_clip (GstAudioAmplify * filter,          \
-    void * data, guint num_samples)                                           \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--) {                                                     \
-    type val = *d* filter->amplification;                                     \
-    *d++ = CLAMP (val, -1.0, +1.0);                                           \
-  }                                                                           \
-}                                                                             \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_wrap_negative (GstAudioAmplify *         \
-    filter, void * data, guint num_samples)                                   \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--) {                                                     \
-    type val = *d * filter->amplification;                                    \
-    do {                                                                      \
-      if (val > 1.0)                                                          \
-        val = -1.0 + (val - 1.0);                                             \
-      else if (val < -1.0)                                                    \
-        val = 1.0 - (1.0 - val);                                              \
-      else                                                                    \
-        break;                                                                \
-    } while (1);                                                              \
-    *d++ = val;                                                               \
-  }                                                                           \
-}                                                                             \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_wrap_positive (GstAudioAmplify * filter, \
-    void * data, guint num_samples)                                           \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--) {                                                     \
-    type val = *d* filter->amplification;                                     \
-    do {                                                                      \
-      if (val > 1.0)                                                          \
-        val = 1.0 - (val - 1.0);                                              \
-      else if (val < -1.0)                                                    \
-        val = -1.0 + (-1.0 - val);                                            \
-      else                                                                    \
-        break;                                                                \
-    } while (1);                                                              \
-    *d++ = val;                                                               \
-  }                                                                           \
-}                                                                             \
-static void                                                                   \
-gst_audio_amplify_transform_##type##_noclip (GstAudioAmplify * filter,        \
-    void * data, guint num_samples)                                           \
-{                                                                             \
-  type *d = data;                                                             \
-                                                                              \
-  while (num_samples--)                                                       \
-    *d++ *= filter->amplification;                                            \
-}
-
-/* *INDENT-OFF* */
-MAKE_INT_FUNCS (gint8,gint)
-MAKE_INT_FUNCS (gint16,gint)
-MAKE_INT_FUNCS (gint32,gint64)
-MAKE_FLOAT_FUNCS (gfloat)
-MAKE_FLOAT_FUNCS (gdouble)
-/* *INDENT-ON* */
-
-/* GObject vmethod implementations */
-
-static void
-gst_audio_amplify_class_init (GstAudioAmplifyClass * klass)
-{
-  GObjectClass *gobject_class;
-  GstElementClass *gstelement_class;
-  GstCaps *caps;
-
-  GST_DEBUG_CATEGORY_INIT (gst_audio_amplify_debug, "audioamplify", 0,
-      "audioamplify element");
-
-  gobject_class = (GObjectClass *) klass;
-  gstelement_class = (GstElementClass *) klass;
-
-  gobject_class->set_property = gst_audio_amplify_set_property;
-  gobject_class->get_property = gst_audio_amplify_get_property;
-
-  g_object_class_install_property (gobject_class, PROP_AMPLIFICATION,
-      g_param_spec_float ("amplification", "Amplification",
-          "Factor of amplification", -G_MAXFLOAT, G_MAXFLOAT,
-          1.0,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  /**
-   * GstAudioAmplify:clipping-method
-   *
-   * Clipping method: clip mode set values higher than the maximum to the
-   * maximum. The wrap-negative mode pushes those values back from the
-   * opposite side, wrap-positive pushes them back from the same side.
-   *
-   **/
-  g_object_class_install_property (gobject_class, PROP_CLIPPING_METHOD,
-      g_param_spec_enum ("clipping-method", "Clipping method",
-          "Selects how to handle values higher than the maximum",
-          GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD, METHOD_CLIP,
-          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
-  gst_element_class_set_static_metadata (gstelement_class, "Audio amplifier",
-      "Filter/Effect/Audio",
-      "Amplifies an audio stream by a given factor",
-      "Sebastian Dröge <slomo@circular-chaos.org>");
-
-  caps = gst_caps_from_string (ALLOWED_CAPS);
-  gst_audio_filter_class_add_pad_templates (GST_AUDIO_FILTER_CLASS (klass),
-      caps);
-  gst_caps_unref (caps);
-
-  GST_BASE_TRANSFORM_CLASS (klass)->transform_ip =
-      GST_DEBUG_FUNCPTR (gst_audio_amplify_transform_ip);
-  GST_BASE_TRANSFORM_CLASS (klass)->transform_ip_on_passthrough = FALSE;
-
-  GST_AUDIO_FILTER_CLASS (klass)->setup =
-      GST_DEBUG_FUNCPTR (gst_audio_amplify_setup);
-}
-
-static void
-gst_audio_amplify_init (GstAudioAmplify * filter)
-{
-  filter->amplification = 1.0;
-  gst_audio_amplify_set_process_function (filter, METHOD_CLIP,
-      GST_AUDIO_FORMAT_S16);
-  gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
-  gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM (filter), TRUE);
-}
-
-static GstAudioAmplifyProcessFunc
-gst_audio_amplify_process_function (gint clipping, GstAudioFormat format)
-{
-  static const struct process
-  {
-    GstAudioFormat format;
-    gint clipping;
-    GstAudioAmplifyProcessFunc func;
-  } process[] = {
-    {
-    GST_AUDIO_FORMAT_F32, METHOD_CLIP, gst_audio_amplify_transform_gfloat_clip}, {
-    GST_AUDIO_FORMAT_F32, METHOD_WRAP_NEGATIVE,
-          gst_audio_amplify_transform_gfloat_wrap_negative}, {
-    GST_AUDIO_FORMAT_F32, METHOD_WRAP_POSITIVE,
-          gst_audio_amplify_transform_gfloat_wrap_positive}, {
-    GST_AUDIO_FORMAT_F32, METHOD_NOCLIP,
-          gst_audio_amplify_transform_gfloat_noclip}, {
-    GST_AUDIO_FORMAT_F64, METHOD_CLIP,
-          gst_audio_amplify_transform_gdouble_clip}, {
-    GST_AUDIO_FORMAT_F64, METHOD_WRAP_NEGATIVE,
-          gst_audio_amplify_transform_gdouble_wrap_negative}, {
-    GST_AUDIO_FORMAT_F64, METHOD_WRAP_POSITIVE,
-          gst_audio_amplify_transform_gdouble_wrap_positive}, {
-    GST_AUDIO_FORMAT_F64, METHOD_NOCLIP,
-          gst_audio_amplify_transform_gdouble_noclip}, {
-    GST_AUDIO_FORMAT_S8, METHOD_CLIP, gst_audio_amplify_transform_gint8_clip}, {
-    GST_AUDIO_FORMAT_S8, METHOD_WRAP_NEGATIVE,
-          gst_audio_amplify_transform_gint8_wrap_negative}, {
-    GST_AUDIO_FORMAT_S8, METHOD_WRAP_POSITIVE,
-          gst_audio_amplify_transform_gint8_wrap_positive}, {
-    GST_AUDIO_FORMAT_S8, METHOD_NOCLIP,
-          gst_audio_amplify_transform_gint8_noclip}, {
-    GST_AUDIO_FORMAT_S16, METHOD_CLIP, gst_audio_amplify_transform_gint16_clip}, {
-    GST_AUDIO_FORMAT_S16, METHOD_WRAP_NEGATIVE,
-          gst_audio_amplify_transform_gint16_wrap_negative}, {
-    GST_AUDIO_FORMAT_S16, METHOD_WRAP_POSITIVE,
-          gst_audio_amplify_transform_gint16_wrap_positive}, {
-    GST_AUDIO_FORMAT_S16, METHOD_NOCLIP,
-          gst_audio_amplify_transform_gint16_noclip}, {
-    GST_AUDIO_FORMAT_S32, METHOD_CLIP, gst_audio_amplify_transform_gint32_clip}, {
-    GST_AUDIO_FORMAT_S32, METHOD_WRAP_NEGATIVE,
-          gst_audio_amplify_transform_gint32_wrap_negative}, {
-    GST_AUDIO_FORMAT_S32, METHOD_WRAP_POSITIVE,
-          gst_audio_amplify_transform_gint32_wrap_positive}, {
-    GST_AUDIO_FORMAT_S32, METHOD_NOCLIP,
-          gst_audio_amplify_transform_gint32_noclip}, {
-    0, 0, NULL}
-  };
-  const struct process *p;
-
-  for (p = process; p->func; p++)
-    if (p->format == format && p->clipping == clipping)
-      return p->func;
-  return NULL;
-}
-
-static gboolean
-gst_audio_amplify_set_process_function (GstAudioAmplify * filter, gint
-    clipping_method, GstAudioFormat format)
-{
-  GstAudioAmplifyProcessFunc process;
-
-  /* set processing function */
-
-  process = gst_audio_amplify_process_function (clipping_method, format);
-  if (!process) {
-    GST_DEBUG ("wrong format");
-    return FALSE;
-  }
-
-  filter->process = process;
-  filter->clipping_method = clipping_method;
-  filter->format = format;
-
-  return TRUE;
-}
-
-static void
-gst_audio_amplify_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec)
-{
-  GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (object);
-
-  switch (prop_id) {
-    case PROP_AMPLIFICATION:
-      filter->amplification = g_value_get_float (value);
-      gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter),
-          filter->amplification == 1.0);
-      break;
-    case PROP_CLIPPING_METHOD:
-      gst_audio_amplify_set_process_function (filter, g_value_get_enum (value),
-          filter->format);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-static void
-gst_audio_amplify_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec)
-{
-  GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (object);
-
-  switch (prop_id) {
-    case PROP_AMPLIFICATION:
-      g_value_set_float (value, filter->amplification);
-      break;
-    case PROP_CLIPPING_METHOD:
-      g_value_set_enum (value, filter->clipping_method);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-/* GstAudioFilter vmethod implementations */
-static gboolean
-gst_audio_amplify_setup (GstAudioFilter * base, const GstAudioInfo * info)
-{
-  GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (base);
-
-  return gst_audio_amplify_set_process_function (filter,
-      filter->clipping_method, GST_AUDIO_INFO_FORMAT (info));
-}
-
-/* GstBaseTransform vmethod implementations */
-static GstFlowReturn
-gst_audio_amplify_transform_ip (GstBaseTransform * base, GstBuffer * buf)
-{
-  GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (base);
-  guint num_samples;
-  GstClockTime timestamp, stream_time;
-  GstMapInfo map;
-
-  timestamp = GST_BUFFER_TIMESTAMP (buf);
-  stream_time =
-      gst_segment_to_stream_time (&base->segment, GST_FORMAT_TIME, timestamp);
-
-  GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT,
-      GST_TIME_ARGS (timestamp));
-
-  if (GST_CLOCK_TIME_IS_VALID (stream_time))
-    gst_object_sync_values (GST_OBJECT (filter), stream_time);
-
-  if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
-    return GST_FLOW_OK;
-
-  gst_buffer_map (buf, &map, GST_MAP_READWRITE);
-  num_samples = map.size / GST_AUDIO_FILTER_BPS (filter);
-
-  filter->process (filter, map.data, num_samples);
-
-  gst_buffer_unmap (buf, &map);
-
-  return GST_FLOW_OK;
-}
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiochebband.c	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,660 +0,0 @@
-/* 
- * GStreamer
- * Copyright (C) 2007-2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/* 
- * Chebyshev type 1 filter design based on
- * "The Scientist and Engineer's Guide to DSP", Chapter 20.
- * http://www.dspguide.com/
- *
- * For type 2 and Chebyshev filters in general read
- * http://en.wikipedia.org/wiki/Chebyshev_filter
- *
- * Transformation from lowpass to bandpass/bandreject:
- * http://docs.dewresearch.com/DspHelp/html/IDH_LinearSystems_LowpassToBandPassZ.htm
- * http://docs.dewresearch.com/DspHelp/html/IDH_LinearSystems_LowpassToBandStopZ.htm
- * 
- */
-
-/**
- * SECTION:element-audiochebband
- *
- * Attenuates all frequencies outside (bandpass) or inside (bandreject) of a frequency
- * band. The number of poles and the ripple parameter control the rolloff.
- *
- * This element has the advantage over the windowed sinc bandpass and bandreject filter that it is
- * much faster and produces almost as good results. It's only disadvantages are the highly
- * non-linear phase and the slower rolloff compared to a windowed sinc filter with a large kernel.
- *
- * For type 1 the ripple parameter specifies how much ripple in dB is allowed in the passband, i.e.
- * some frequencies in the passband will be amplified by that value. A higher ripple value will allow
- * a faster rolloff.
- *
- * For type 2 the ripple parameter specifies the stopband attenuation. In the stopband the gain will
- * be at most this value. A lower ripple value will allow a faster rolloff.
- *
- * As a special case, a Chebyshev type 1 filter with no ripple is a Butterworth filter.
- *
- * <note>
- * Be warned that a too large number of poles can produce noise. The most poles are possible with
- * a cutoff frequency at a quarter of the sampling rate.
- * </note>
- *
- * <refsect2>
- * <title>Example launch line</title>
- * |[
- * gst-launch-1.0 audiotestsrc freq=1500 ! audioconvert ! audiochebband mode=band-pass lower-frequency=1000 upper-frequenc=6000 poles=4 ! audioconvert ! alsasink
- * gst-launch-1.0 filesrc location="melo1.ogg" ! oggdemux ! vorbisdec ! audioconvert ! audiochebband mode=band-reject lower-frequency=1000 upper-frequency=4000 ripple=0.2 ! audioconvert ! alsasink
- * gst-launch-1.0 audiotestsrc wave=white-noise ! audioconvert ! audiochebband mode=band-pass lower-frequency=1000 upper-frequency=4000 type=2 ! audioconvert ! alsasink
- * ]|
- * </refsect2>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-
-#include <gst/gst.h>
-#include <gst/base/gstbasetransform.h>
-#include <gst/audio/audio.h>
-#include <gst/audio/gstaudiofilter.h>
-
-#include <math.h>
-
-#include "math_compat.h"
-
-#include "audiochebband.h"
-
-#include "gst/glib-compat-private.h"
-
-#define GST_CAT_DEFAULT gst_audio_cheb_band_debug
-GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
-
-enum
-{
-  PROP_0,
-  PROP_MODE,
-  PROP_TYPE,
-  PROP_LOWER_FREQUENCY,
-  PROP_UPPER_FREQUENCY,
-  PROP_RIPPLE,
-  PROP_POLES
-};
-
-#define gst_audio_cheb_band_parent_class parent_class
-G_DEFINE_TYPE (GstAudioChebBand, gst_audio_cheb_band,
-    GST_TYPE_AUDIO_FX_BASE_IIR_FILTER);
-
-static void gst_audio_cheb_band_set_property (GObject * object,
-    guint prop_id, const GValue * value, GParamSpec * pspec);
-static void gst_audio_cheb_band_get_property (GObject * object,
-    guint prop_id, GValue * value, GParamSpec * pspec);
-static void gst_audio_cheb_band_finalize (GObject * object);
-
-static gboolean gst_audio_cheb_band_setup (GstAudioFilter * filter,
-    const GstAudioInfo * info);
-
-enum
-{
-  MODE_BAND_PASS = 0,
-  MODE_BAND_REJECT
-};
-
-#define GST_TYPE_AUDIO_CHEBYSHEV_FREQ_BAND_MODE (gst_audio_cheb_band_mode_get_type ())
-static GType
-gst_audio_cheb_band_mode_get_type (void)
-{
-  static GType gtype = 0;
-
-  if (gtype == 0) {
-    static const GEnumValue values[] = {
-      {MODE_BAND_PASS, "Band pass (default)",
-          "band-pass"},
-      {MODE_BAND_REJECT, "Band reject",
-          "band-reject"},
-      {0, NULL, NULL}
-    };
-
-    gtype = g_enum_register_static ("GstAudioChebBandMode", values);
-  }
-  return gtype;
-}
-
-/* GObject vmethod implementations */
-
-static void
-gst_audio_cheb_band_class_init (GstAudioChebBandClass * klass)
-{
-  GObjectClass *gobject_class = (GObjectClass *) klass;
-  GstElementClass *gstelement_class = (GstElementClass *) klass;
-  GstAudioFilterClass *filter_class = (GstAudioFilterClass *) klass;
-
-  GST_DEBUG_CATEGORY_INIT (gst_audio_cheb_band_debug, "audiochebband", 0,
-      "audiochebband element");
-
-  gobject_class->set_property = gst_audio_cheb_band_set_property;
-  gobject_class->get_property = gst_audio_cheb_band_get_property;
-  gobject_class->finalize = gst_audio_cheb_band_finalize;
-
-  g_object_class_install_property (gobject_class, PROP_MODE,
-      g_param_spec_enum ("mode", "Mode",
-          "Low pass or high pass mode", GST_TYPE_AUDIO_CHEBYSHEV_FREQ_BAND_MODE,
-          MODE_BAND_PASS,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-  g_object_class_install_property (gobject_class, PROP_TYPE,
-      g_param_spec_int ("type", "Type", "Type of the chebychev filter", 1, 2, 1,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  /* FIXME: Don't use the complete possible range but restrict the upper boundary
-   * so automatically generated UIs can use a slider without */
-  g_object_class_install_property (gobject_class, PROP_LOWER_FREQUENCY,
-      g_param_spec_float ("lower-frequency", "Lower frequency",
-          "Start frequency of the band (Hz)", 0.0, 100000.0,
-          0.0,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-  g_object_class_install_property (gobject_class, PROP_UPPER_FREQUENCY,
-      g_param_spec_float ("upper-frequency", "Upper frequency",
-          "Stop frequency of the band (Hz)", 0.0, 100000.0, 0.0,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-  g_object_class_install_property (gobject_class, PROP_RIPPLE,
-      g_param_spec_float ("ripple", "Ripple", "Amount of ripple (dB)", 0.0,
-          200.0, 0.25,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-  /* FIXME: What to do about this upper boundary? With a frequencies near
-   * rate/4 32 poles are completely possible, with frequencies very low
-   * or very high 16 poles already produces only noise */
-  g_object_class_install_property (gobject_class, PROP_POLES,
-      g_param_spec_int ("poles", "Poles",
-          "Number of poles to use, will be rounded up to the next multiply of four",
-          4, 32, 4,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  gst_element_class_set_static_metadata (gstelement_class,
-      "Band pass & band reject filter", "Filter/Effect/Audio",
-      "Chebyshev band pass and band reject filter",
-      "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
-
-  filter_class->setup = GST_DEBUG_FUNCPTR (gst_audio_cheb_band_setup);
-}
-
-static void
-gst_audio_cheb_band_init (GstAudioChebBand * filter)
-{
-  filter->lower_frequency = filter->upper_frequency = 0.0;
-  filter->mode = MODE_BAND_PASS;
-  filter->type = 1;
-  filter->poles = 4;
-  filter->ripple = 0.25;
-
-  g_mutex_init (&filter->lock);
-}
-
-static void
-generate_biquad_coefficients (GstAudioChebBand * filter,
-    gint p, gint rate, gdouble * b0, gdouble * b1, gdouble * b2, gdouble * b3,
-    gdouble * b4, gdouble * a1, gdouble * a2, gdouble * a3, gdouble * a4)
-{
-  gint np = filter->poles / 2;
-  gdouble ripple = filter->ripple;
-
-  /* pole location in s-plane */
-  gdouble rp, ip;
-
-  /* zero location in s-plane */
-  gdouble iz = 0.0;
-
-  /* transfer function coefficients for the z-plane */
-  gdouble x0, x1, x2, y1, y2;
-  gint type = filter->type;
-
-  /* Calculate pole location for lowpass at frequency 1 */
-  {
-    gdouble angle = (G_PI / 2.0) * (2.0 * p - 1) / np;
-
-    rp = -sin (angle);
-    ip = cos (angle);
-  }
-
-  /* If we allow ripple, move the pole from the unit
-   * circle to an ellipse and keep cutoff at frequency 1 */
-  if (ripple > 0 && type == 1) {
-    gdouble es, vx;
-
-    es = sqrt (pow (10.0, ripple / 10.0) - 1.0);
-
-    vx = (1.0 / np) * asinh (1.0 / es);
-    rp = rp * sinh (vx);
-    ip = ip * cosh (vx);
-  } else if (type == 2) {
-    gdouble es, vx;
-
-    es = sqrt (pow (10.0, ripple / 10.0) - 1.0);
-    vx = (1.0 / np) * asinh (es);
-    rp = rp * sinh (vx);
-    ip = ip * cosh (vx);
-  }
-
-  /* Calculate inverse of the pole location to move from
-   * type I to type II */
-  if (type == 2) {
-    gdouble mag2 = rp * rp + ip * ip;
-
-    rp /= mag2;
-    ip /= mag2;
-  }
-
-  /* Calculate zero location for frequency 1 on the
-   * unit circle for type 2 */
-  if (type == 2) {
-    gdouble angle = G_PI / (np * 2.0) + ((p - 1) * G_PI) / (np);
-    gdouble mag2;
-
-    iz = cos (angle);
-    mag2 = iz * iz;
-    iz /= mag2;
-  }
-
-  /* Convert from s-domain to z-domain by
-   * using the bilinear Z-transform, i.e.
-   * substitute s by (2/t)*((z-1)/(z+1))
-   * with t = 2 * tan(0.5).
-   */
-  if (type == 1) {
-    gdouble t, m, d;
-
-    t = 2.0 * tan (0.5);
-    m = rp * rp + ip * ip;
-    d = 4.0 - 4.0 * rp * t + m * t * t;
-
-    x0 = (t * t) / d;
-    x1 = 2.0 * x0;
-    x2 = x0;
-    y1 = (8.0 - 2.0 * m * t * t) / d;
-    y2 = (-4.0 - 4.0 * rp * t - m * t * t) / d;
-  } else {
-    gdouble t, m, d;
-
-    t = 2.0 * tan (0.5);
-    m = rp * rp + ip * ip;
-    d = 4.0 - 4.0 * rp * t + m * t * t;
-
-    x0 = (t * t * iz * iz + 4.0) / d;
-    x1 = (-8.0 + 2.0 * iz * iz * t * t) / d;
-    x2 = x0;
-    y1 = (8.0 - 2.0 * m * t * t) / d;
-    y2 = (-4.0 - 4.0 * rp * t - m * t * t) / d;
-  }
-
-  /* Convert from lowpass at frequency 1 to either bandpass
-   * or band reject.
-   *
-   * For bandpass substitute z^(-1) with:
-   *
-   *   -2            -1
-   * -z   + alpha * z   - beta
-   * ----------------------------
-   *         -2            -1
-   * beta * z   - alpha * z   + 1
-   *
-   * alpha = (2*a*b)/(1+b)
-   * beta = (b-1)/(b+1)
-   * a = cos((w1 + w0)/2) / cos((w1 - w0)/2)
-   * b = tan(1/2) * cot((w1 - w0)/2)
-   *
-   * For bandreject substitute z^(-1) with:
-   * 
-   *  -2            -1
-   * z   - alpha * z   + beta
-   * ----------------------------
-   *         -2            -1
-   * beta * z   - alpha * z   + 1
-   *
-   * alpha = (2*a)/(1+b)
-   * beta = (1-b)/(1+b)
-   * a = cos((w1 + w0)/2) / cos((w1 - w0)/2)
-   * b = tan(1/2) * tan((w1 - w0)/2)
-   *
-   */
-  {
-    gdouble a, b, d;
-    gdouble alpha, beta;
-    gdouble w0 = 2.0 * G_PI * (filter->lower_frequency / rate);
-    gdouble w1 = 2.0 * G_PI * (filter->upper_frequency / rate);
-
-    if (filter->mode == MODE_BAND_PASS) {
-      a = cos ((w1 + w0) / 2.0) / cos ((w1 - w0) / 2.0);
-      b = tan (1.0 / 2.0) / tan ((w1 - w0) / 2.0);
-
-      alpha = (2.0 * a * b) / (1.0 + b);
-      beta = (b - 1.0) / (b + 1.0);
-
-      d = 1.0 + beta * (y1 - beta * y2);
-
-      *b0 = (x0 + beta * (-x1 + beta * x2)) / d;
-      *b1 = (alpha * (-2.0 * x0 + x1 + beta * x1 - 2.0 * beta * x2)) / d;
-      *b2 =
-          (-x1 - beta * beta * x1 + 2.0 * beta * (x0 + x2) +
-          alpha * alpha * (x0 - x1 + x2)) / d;
-      *b3 = (alpha * (x1 + beta * (-2.0 * x0 + x1) - 2.0 * x2)) / d;
-      *b4 = (beta * (beta * x0 - x1) + x2) / d;
-      *a1 = (alpha * (2.0 + y1 + beta * y1 - 2.0 * beta * y2)) / d;
-      *a2 =
-          (-y1 - beta * beta * y1 - alpha * alpha * (1.0 + y1 - y2) +
-          2.0 * beta * (-1.0 + y2)) / d;
-      *a3 = (alpha * (y1 + beta * (2.0 + y1) - 2.0 * y2)) / d;
-      *a4 = (-beta * beta - beta * y1 + y2) / d;
-    } else {
-      a = cos ((w1 + w0) / 2.0) / cos ((w1 - w0) / 2.0);
-      b = tan (1.0 / 2.0) * tan ((w1 - w0) / 2.0);
-
-      alpha = (2.0 * a) / (1.0 + b);
-      beta = (1.0 - b) / (1.0 + b);
-
-      d = -1.0 + beta * (beta * y2 + y1);
-
-      *b0 = (-x0 - beta * x1 - beta * beta * x2) / d;
-      *b1 = (alpha * (2.0 * x0 + x1 + beta * x1 + 2.0 * beta * x2)) / d;
-      *b2 =
-          (-x1 - beta * beta * x1 - 2.0 * beta * (x0 + x2) -
-          alpha * alpha * (x0 + x1 + x2)) / d;
-      *b3 = (alpha * (x1 + beta * (2.0 * x0 + x1) + 2.0 * x2)) / d;
-      *b4 = (-beta * beta * x0 - beta * x1 - x2) / d;
-      *a1 = (alpha * (-2.0 + y1 + beta * y1 + 2.0 * beta * y2)) / d;
-      *a2 =
-          -(y1 + beta * beta * y1 + 2.0 * beta * (-1.0 + y2) +
-          alpha * alpha * (-1.0 + y1 + y2)) / d;
-      *a3 = (alpha * (beta * (-2.0 + y1) + y1 + 2.0 * y2)) / d;
-      *a4 = -(-beta * beta + beta * y1 + y2) / d;
-    }
-  }
-}
-
-static void
-generate_coefficients (GstAudioChebBand * filter, const GstAudioInfo * info)
-{
-  gint rate;
-
-  if (info) {
-    rate = GST_AUDIO_INFO_RATE (info);
-  } else {
-    rate = GST_AUDIO_FILTER_RATE (filter);
-  }
-
-  if (rate == 0) {
-    gdouble *a = g_new0 (gdouble, 1);
-    gdouble *b = g_new0 (gdouble, 1);
-
-    a[0] = 1.0;
-    b[0] = 1.0;
-    gst_audio_fx_base_iir_filter_set_coefficients (GST_AUDIO_FX_BASE_IIR_FILTER
-        (filter), a, 1, b, 1);
-    GST_LOG_OBJECT (filter, "rate was not set yet");
-    return;
-  }
-
-  if (filter->upper_frequency <= filter->lower_frequency) {
-    gdouble *a = g_new0 (gdouble, 1);
-    gdouble *b = g_new0 (gdouble, 1);
-
-    a[0] = 1.0;
-    b[0] = (filter->mode == MODE_BAND_PASS) ? 0.0 : 1.0;
-    gst_audio_fx_base_iir_filter_set_coefficients (GST_AUDIO_FX_BASE_IIR_FILTER
-        (filter), a, 1, b, 1);
-
-    GST_LOG_OBJECT (filter, "frequency band had no or negative dimension");
-    return;
-  }
-
-  if (filter->upper_frequency > rate / 2) {
-    filter->upper_frequency = rate / 2;
-    GST_LOG_OBJECT (filter, "clipped upper frequency to nyquist frequency");
-  }
-
-  if (filter->lower_frequency < 0.0) {
-    filter->lower_frequency = 0.0;
-    GST_LOG_OBJECT (filter, "clipped lower frequency to 0.0");
-  }
-
-  /* Calculate coefficients for the chebyshev filter */
-  {
-    gint np = filter->poles;
-    gdouble *a, *b;
-    gint i, p;
-
-    a = g_new0 (gdouble, np + 5);
-    b = g_new0 (gdouble, np + 5);
-
-    /* Calculate transfer function coefficients */
-    a[4] = 1.0;
-    b[4] = 1.0;
-
-    for (p = 1; p <= np / 4; p++) {
-      gdouble b0, b1, b2, b3, b4, a1, a2, a3, a4;
-      gdouble *ta = g_new0 (gdouble, np + 5);
-      gdouble *tb = g_new0 (gdouble, np + 5);
-
-      generate_biquad_coefficients (filter, p, rate,
-          &b0, &b1, &b2, &b3, &b4, &a1, &a2, &a3, &a4);
-
-      memcpy (ta, a, sizeof (gdouble) * (np + 5));
-      memcpy (tb, b, sizeof (gdouble) * (np + 5));
-
-      /* add the new coefficients for the new two poles
-       * to the cascade by multiplication of the transfer
-       * functions */
-      for (i = 4; i < np + 5; i++) {
-        b[i] =
-            b0 * tb[i] + b1 * tb[i - 1] + b2 * tb[i - 2] + b3 * tb[i - 3] +
-            b4 * tb[i - 4];
-        a[i] =
-            ta[i] - a1 * ta[i - 1] - a2 * ta[i - 2] - a3 * ta[i - 3] -
-            a4 * ta[i - 4];
-      }
-      g_free (ta);
-      g_free (tb);
-    }
-
-    /* Move coefficients to the beginning of the array to move from
-     * the transfer function's coefficients to the difference
-     * equation's coefficients */
-    for (i = 0; i <= np; i++) {
-      a[i] = a[i + 4];
-      b[i] = b[i + 4];
-    }
-
-    /* Normalize to unity gain at frequency 0 and frequency
-     * 0.5 for bandreject and unity gain at band center frequency
-     * for bandpass */
-    if (filter->mode == MODE_BAND_REJECT) {
-      /* gain is sqrt(H(0)*H(0.5)) */
-
-      gdouble gain1 =
-          gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b, np + 1,
-          1.0, 0.0);
-      gdouble gain2 =
-          gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b, np + 1,
-          -1.0, 0.0);
-
-      gain1 = sqrt (gain1 * gain2);
-
-      for (i = 0; i <= np; i++) {
-        b[i] /= gain1;
-      }
-    } else {
-      /* gain is H(wc), wc = center frequency */
-
-      gdouble w1 = 2.0 * G_PI * (filter->lower_frequency / rate);
-      gdouble w2 = 2.0 * G_PI * (filter->upper_frequency / rate);
-      gdouble w0 = (w2 + w1) / 2.0;
-      gdouble zr = cos (w0), zi = sin (w0);
-      gdouble gain =
-          gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b, np + 1, zr,
-          zi);
-
-      for (i = 0; i <= np; i++) {
-        b[i] /= gain;
-      }
-    }
-
-    gst_audio_fx_base_iir_filter_set_coefficients (GST_AUDIO_FX_BASE_IIR_FILTER
-        (filter), a, np + 1, b, np + 1);
-
-    GST_LOG_OBJECT (filter,
-        "Generated IIR coefficients for the Chebyshev filter");
-    GST_LOG_OBJECT (filter,
-        "mode: %s, type: %d, poles: %d, lower-frequency: %.2f Hz, upper-frequency: %.2f Hz, ripple: %.2f dB",
-        (filter->mode == MODE_BAND_PASS) ? "band-pass" : "band-reject",
-        filter->type, filter->poles, filter->lower_frequency,
-        filter->upper_frequency, filter->ripple);
-
-    GST_LOG_OBJECT (filter, "%.2f dB gain @ 0Hz",
-        20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b,
-                np + 1, 1.0, 0.0)));
-    {
-      gdouble w1 = 2.0 * G_PI * (filter->lower_frequency / rate);
-      gdouble w2 = 2.0 * G_PI * (filter->upper_frequency / rate);
-      gdouble w0 = (w2 + w1) / 2.0;
-      gdouble zr, zi;
-
-      zr = cos (w1);
-      zi = sin (w1);
-      GST_LOG_OBJECT (filter, "%.2f dB gain @ %dHz",
-          20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1,
-                  b, np + 1, zr, zi)), (int) filter->lower_frequency);
-      zr = cos (w0);
-      zi = sin (w0);
-      GST_LOG_OBJECT (filter, "%.2f dB gain @ %dHz",
-          20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1,
-                  b, np + 1, zr, zi)),
-          (int) ((filter->lower_frequency + filter->upper_frequency) / 2.0));
-      zr = cos (w2);
-      zi = sin (w2);
-      GST_LOG_OBJECT (filter, "%.2f dB gain @ %dHz",
-          20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1,
-                  b, np + 1, zr, zi)), (int) filter->upper_frequency);
-    }
-    GST_LOG_OBJECT (filter, "%.2f dB gain @ %dHz",
-        20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b,
-                np + 1, -1.0, 0.0)), rate / 2);
-  }
-}
-
-static void
-gst_audio_cheb_band_finalize (GObject * object)
-{
-  GstAudioChebBand *filter = GST_AUDIO_CHEB_BAND (object);
-
-  g_mutex_clear (&filter->lock);
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gst_audio_cheb_band_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec)
-{
-  GstAudioChebBand *filter = GST_AUDIO_CHEB_BAND (object);
-
-  switch (prop_id) {
-    case PROP_MODE:
-      g_mutex_lock (&filter->lock);
-      filter->mode = g_value_get_enum (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_TYPE:
-      g_mutex_lock (&filter->lock);
-      filter->type = g_value_get_int (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_LOWER_FREQUENCY:
-      g_mutex_lock (&filter->lock);
-      filter->lower_frequency = g_value_get_float (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_UPPER_FREQUENCY:
-      g_mutex_lock (&filter->lock);
-      filter->upper_frequency = g_value_get_float (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_RIPPLE:
-      g_mutex_lock (&filter->lock);
-      filter->ripple = g_value_get_float (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_POLES:
-      g_mutex_lock (&filter->lock);
-      filter->poles = GST_ROUND_UP_4 (g_value_get_int (value));
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-static void
-gst_audio_cheb_band_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec)
-{
-  GstAudioChebBand *filter = GST_AUDIO_CHEB_BAND (object);
-
-  switch (prop_id) {
-    case PROP_MODE:
-      g_value_set_enum (value, filter->mode);
-      break;
-    case PROP_TYPE:
-      g_value_set_int (value, filter->type);
-      break;
-    case PROP_LOWER_FREQUENCY:
-      g_value_set_float (value, filter->lower_frequency);
-      break;
-    case PROP_UPPER_FREQUENCY:
-      g_value_set_float (value, filter->upper_frequency);
-      break;
-    case PROP_RIPPLE:
-      g_value_set_float (value, filter->ripple);
-      break;
-    case PROP_POLES:
-      g_value_set_int (value, filter->poles);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-/* GstAudioFilter vmethod implementations */
-
-static gboolean
-gst_audio_cheb_band_setup (GstAudioFilter * base, const GstAudioInfo * info)
-{
-  GstAudioChebBand *filter = GST_AUDIO_CHEB_BAND (base);
-
-  generate_coefficients (filter, info);
-
-  return GST_AUDIO_FILTER_CLASS (parent_class)->setup (base, info);
-}
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiochebband.h	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * GStreamer
- * Copyright (C) 2007-2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __GST_AUDIO_CHEB_BAND_H__
-#define __GST_AUDIO_CHEB_BAND_H__
-
-#include <gst/gst.h>
-#include <gst/base/gstbasetransform.h>
-#include <gst/audio/audio.h>
-#include <gst/audio/gstaudiofilter.h>
-
-#include "audiofxbaseiirfilter.h"
-
-G_BEGIN_DECLS
-#define GST_TYPE_AUDIO_CHEB_BAND            (gst_audio_cheb_band_get_type())
-#define GST_AUDIO_CHEB_BAND(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_CHEB_BAND,GstAudioChebBand))
-#define GST_IS_AUDIO_CHEB_BAND(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CHEB_BAND))
-#define GST_AUDIO_CHEB_BAND_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_CHEB_BAND,GstAudioChebBandClass))
-#define GST_IS_AUDIO_CHEB_BAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_CHEB_BAND))
-#define GST_AUDIO_CHEB_BAND_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_CHEB_BAND,GstAudioChebBandClass))
-typedef struct _GstAudioChebBand GstAudioChebBand;
-typedef struct _GstAudioChebBandClass GstAudioChebBandClass;
-
-struct _GstAudioChebBand
-{
-  GstAudioFXBaseIIRFilter parent;
-
-  gint mode;
-  gint type;
-  gint poles;
-  gfloat lower_frequency;
-  gfloat upper_frequency;
-  gfloat ripple;
-
-  /* < private > */
-  GMutex lock;
-};
-
-struct _GstAudioChebBandClass
-{
-  GstAudioFXBaseIIRFilterClass parent;
-};
-
-GType gst_audio_cheb_band_get_type (void);
-
-G_END_DECLS
-#endif /* __GST_AUDIO_CHEB_BAND_H__ */
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiocheblimit.c	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,574 +0,0 @@
-/* 
- * GStreamer
- * Copyright (C) 2007-2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/* 
- * Chebyshev type 1 filter design based on
- * "The Scientist and Engineer's Guide to DSP", Chapter 20.
- * http://www.dspguide.com/
- *
- * For type 2 and Chebyshev filters in general read
- * http://en.wikipedia.org/wiki/Chebyshev_filter
- *
- */
-
-/**
- * SECTION:element-audiocheblimit
- *
- * Attenuates all frequencies above the cutoff frequency (low-pass) or all frequencies below the
- * cutoff frequency (high-pass). The number of poles and the ripple parameter control the rolloff.
- *
- * This element has the advantage over the windowed sinc lowpass and highpass filter that it is
- * much faster and produces almost as good results. It's only disadvantages are the highly
- * non-linear phase and the slower rolloff compared to a windowed sinc filter with a large kernel.
- *
- * For type 1 the ripple parameter specifies how much ripple in dB is allowed in the passband, i.e.
- * some frequencies in the passband will be amplified by that value. A higher ripple value will allow
- * a faster rolloff.
- *
- * For type 2 the ripple parameter specifies the stopband attenuation. In the stopband the gain will
- * be at most this value. A lower ripple value will allow a faster rolloff.
- *
- * As a special case, a Chebyshev type 1 filter with no ripple is a Butterworth filter.
- *
- * <note><para>
- * Be warned that a too large number of poles can produce noise. The most poles are possible with
- * a cutoff frequency at a quarter of the sampling rate.
- * </para></note>
- *
- * <refsect2>
- * <title>Example launch line</title>
- * |[
- * gst-launch-1.0 audiotestsrc freq=1500 ! audioconvert ! audiocheblimit mode=low-pass cutoff=1000 poles=4 ! audioconvert ! alsasink
- * gst-launch-1.0 filesrc location="melo1.ogg" ! oggdemux ! vorbisdec ! audioconvert ! audiocheblimit mode=high-pass cutoff=400 ripple=0.2 ! audioconvert ! alsasink
- * gst-launch-1.0 audiotestsrc wave=white-noise ! audioconvert ! audiocheblimit mode=low-pass cutoff=800 type=2 ! audioconvert ! alsasink
- * ]|
- * </refsect2>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-
-#include <gst/gst.h>
-#include <gst/base/gstbasetransform.h>
-#include <gst/audio/audio.h>
-#include <gst/audio/gstaudiofilter.h>
-
-#include <math.h>
-
-#include "math_compat.h"
-
-#include "audiocheblimit.h"
-
-#include "gst/glib-compat-private.h"
-
-#define GST_CAT_DEFAULT gst_audio_cheb_limit_debug
-GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
-
-enum
-{
-  PROP_0,
-  PROP_MODE,
-  PROP_TYPE,
-  PROP_CUTOFF,
-  PROP_RIPPLE,
-  PROP_POLES
-};
-
-#define gst_audio_cheb_limit_parent_class parent_class
-G_DEFINE_TYPE (GstAudioChebLimit,
-    gst_audio_cheb_limit, GST_TYPE_AUDIO_FX_BASE_IIR_FILTER);
-
-static void gst_audio_cheb_limit_set_property (GObject * object,
-    guint prop_id, const GValue * value, GParamSpec * pspec);
-static void gst_audio_cheb_limit_get_property (GObject * object,
-    guint prop_id, GValue * value, GParamSpec * pspec);
-static void gst_audio_cheb_limit_finalize (GObject * object);
-
-static gboolean gst_audio_cheb_limit_setup (GstAudioFilter * filter,
-    const GstAudioInfo * info);
-
-enum
-{
-  MODE_LOW_PASS = 0,
-  MODE_HIGH_PASS
-};
-
-#define GST_TYPE_AUDIO_CHEBYSHEV_FREQ_LIMIT_MODE (gst_audio_cheb_limit_mode_get_type ())
-static GType
-gst_audio_cheb_limit_mode_get_type (void)
-{
-  static GType gtype = 0;
-
-  if (gtype == 0) {
-    static const GEnumValue values[] = {
-      {MODE_LOW_PASS, "Low pass (default)",
-          "low-pass"},
-      {MODE_HIGH_PASS, "High pass",
-          "high-pass"},
-      {0, NULL, NULL}
-    };
-
-    gtype = g_enum_register_static ("GstAudioChebLimitMode", values);
-  }
-  return gtype;
-}
-
-/* GObject vmethod implementations */
-
-static void
-gst_audio_cheb_limit_class_init (GstAudioChebLimitClass * klass)
-{
-  GObjectClass *gobject_class = (GObjectClass *) klass;
-  GstElementClass *gstelement_class = (GstElementClass *) klass;
-  GstAudioFilterClass *filter_class = (GstAudioFilterClass *) klass;
-
-  GST_DEBUG_CATEGORY_INIT (gst_audio_cheb_limit_debug, "audiocheblimit", 0,
-      "audiocheblimit element");
-
-  gobject_class->set_property = gst_audio_cheb_limit_set_property;
-  gobject_class->get_property = gst_audio_cheb_limit_get_property;
-  gobject_class->finalize = gst_audio_cheb_limit_finalize;
-
-  g_object_class_install_property (gobject_class, PROP_MODE,
-      g_param_spec_enum ("mode", "Mode",
-          "Low pass or high pass mode",
-          GST_TYPE_AUDIO_CHEBYSHEV_FREQ_LIMIT_MODE, MODE_LOW_PASS,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-  g_object_class_install_property (gobject_class, PROP_TYPE,
-      g_param_spec_int ("type", "Type", "Type of the chebychev filter", 1, 2, 1,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  /* FIXME: Don't use the complete possible range but restrict the upper boundary
-   * so automatically generated UIs can use a slider without */
-  g_object_class_install_property (gobject_class, PROP_CUTOFF,
-      g_param_spec_float ("cutoff", "Cutoff", "Cut off frequency (Hz)", 0.0,
-          100000.0, 0.0,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-  g_object_class_install_property (gobject_class, PROP_RIPPLE,
-      g_param_spec_float ("ripple", "Ripple", "Amount of ripple (dB)", 0.0,
-          200.0, 0.25,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  /* FIXME: What to do about this upper boundary? With a cutoff frequency of
-   * rate/4 32 poles are completely possible, with a cutoff frequency very low
-   * or very high 16 poles already produces only noise */
-  g_object_class_install_property (gobject_class, PROP_POLES,
-      g_param_spec_int ("poles", "Poles",
-          "Number of poles to use, will be rounded up to the next even number",
-          2, 32, 4,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  gst_element_class_set_static_metadata (gstelement_class,
-      "Low pass & high pass filter",
-      "Filter/Effect/Audio",
-      "Chebyshev low pass and high pass filter",
-      "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
-
-  filter_class->setup = GST_DEBUG_FUNCPTR (gst_audio_cheb_limit_setup);
-}
-
-static void
-gst_audio_cheb_limit_init (GstAudioChebLimit * filter)
-{
-  filter->cutoff = 0.0;
-  filter->mode = MODE_LOW_PASS;
-  filter->type = 1;
-  filter->poles = 4;
-  filter->ripple = 0.25;
-
-  g_mutex_init (&filter->lock);
-}
-
-static void
-generate_biquad_coefficients (GstAudioChebLimit * filter,
-    gint p, gint rate, gdouble * b0, gdouble * b1, gdouble * b2,
-    gdouble * a1, gdouble * a2)
-{
-  gint np = filter->poles;
-  gdouble ripple = filter->ripple;
-
-  /* pole location in s-plane */
-  gdouble rp, ip;
-
-  /* zero location in s-plane */
-  gdouble iz = 0.0;
-
-  /* transfer function coefficients for the z-plane */
-  gdouble x0, x1, x2, y1, y2;
-  gint type = filter->type;
-
-  /* Calculate pole location for lowpass at frequency 1 */
-  {
-    gdouble angle = (G_PI / 2.0) * (2.0 * p - 1) / np;
-
-    rp = -sin (angle);
-    ip = cos (angle);
-  }
-
-  /* If we allow ripple, move the pole from the unit
-   * circle to an ellipse and keep cutoff at frequency 1 */
-  if (ripple > 0 && type == 1) {
-    gdouble es, vx;
-
-    es = sqrt (pow (10.0, ripple / 10.0) - 1.0);
-
-    vx = (1.0 / np) * asinh (1.0 / es);
-    rp = rp * sinh (vx);
-    ip = ip * cosh (vx);
-  } else if (type == 2) {
-    gdouble es, vx;
-
-    es = sqrt (pow (10.0, ripple / 10.0) - 1.0);
-    vx = (1.0 / np) * asinh (es);
-    rp = rp * sinh (vx);
-    ip = ip * cosh (vx);
-  }
-
-  /* Calculate inverse of the pole location to convert from
-   * type I to type II */
-  if (type == 2) {
-    gdouble mag2 = rp * rp + ip * ip;
-
-    rp /= mag2;
-    ip /= mag2;
-  }
-
-  /* Calculate zero location for frequency 1 on the
-   * unit circle for type 2 */
-  if (type == 2) {
-    gdouble angle = G_PI / (np * 2.0) + ((p - 1) * G_PI) / (np);
-    gdouble mag2;
-
-    iz = cos (angle);
-    mag2 = iz * iz;
-    iz /= mag2;
-  }
-
-  /* Convert from s-domain to z-domain by
-   * using the bilinear Z-transform, i.e.
-   * substitute s by (2/t)*((z-1)/(z+1))
-   * with t = 2 * tan(0.5).
-   */
-  if (type == 1) {
-    gdouble t, m, d;
-
-    t = 2.0 * tan (0.5);
-    m = rp * rp + ip * ip;
-    d = 4.0 - 4.0 * rp * t + m * t * t;
-
-    x0 = (t * t) / d;
-    x1 = 2.0 * x0;
-    x2 = x0;
-    y1 = (8.0 - 2.0 * m * t * t) / d;
-    y2 = (-4.0 - 4.0 * rp * t - m * t * t) / d;
-  } else {
-    gdouble t, m, d;
-
-    t = 2.0 * tan (0.5);
-    m = rp * rp + ip * ip;
-    d = 4.0 - 4.0 * rp * t + m * t * t;
-
-    x0 = (t * t * iz * iz + 4.0) / d;
-    x1 = (-8.0 + 2.0 * iz * iz * t * t) / d;
-    x2 = x0;
-    y1 = (8.0 - 2.0 * m * t * t) / d;
-    y2 = (-4.0 - 4.0 * rp * t - m * t * t) / d;
-  }
-
-  /* Convert from lowpass at frequency 1 to either lowpass
-   * or highpass.
-   *
-   * For lowpass substitute z^(-1) with:
-   *  -1
-   * z   - k
-   * ------------
-   *          -1
-   * 1 - k * z
-   *
-   * k = sin((1-w)/2) / sin((1+w)/2)
-   *
-   * For highpass substitute z^(-1) with:
-   *
-   *   -1
-   * -z   - k
-   * ------------
-   *          -1
-   * 1 + k * z
-   *
-   * k = -cos((1+w)/2) / cos((1-w)/2)
-   *
-   */
-  {
-    gdouble k, d;
-    gdouble omega = 2.0 * G_PI * (filter->cutoff / rate);
-
-    if (filter->mode == MODE_LOW_PASS)
-      k = sin ((1.0 - omega) / 2.0) / sin ((1.0 + omega) / 2.0);
-    else
-      k = -cos ((omega + 1.0) / 2.0) / cos ((omega - 1.0) / 2.0);
-
-    d = 1.0 + y1 * k - y2 * k * k;
-    *b0 = (x0 + k * (-x1 + k * x2)) / d;
-    *b1 = (x1 + k * k * x1 - 2.0 * k * (x0 + x2)) / d;
-    *b2 = (x0 * k * k - x1 * k + x2) / d;
-    *a1 = (2.0 * k + y1 + y1 * k * k - 2.0 * y2 * k) / d;
-    *a2 = (-k * k - y1 * k + y2) / d;
-
-    if (filter->mode == MODE_HIGH_PASS) {
-      *a1 = -*a1;
-      *b1 = -*b1;
-    }
-  }
-}
-
-static void
-generate_coefficients (GstAudioChebLimit * filter, const GstAudioInfo * info)
-{
-  gint rate;
-
-  if (info) {
-    rate = GST_AUDIO_INFO_RATE (info);
-  } else {
-    rate = GST_AUDIO_FILTER_RATE (filter);
-  }
-
-  GST_LOG_OBJECT (filter, "cutoff %f", filter->cutoff);
-
-  if (rate == 0) {
-    gdouble *a = g_new0 (gdouble, 1);
-    gdouble *b = g_new0 (gdouble, 1);
-
-    a[0] = 1.0;
-    b[0] = 1.0;
-    gst_audio_fx_base_iir_filter_set_coefficients (GST_AUDIO_FX_BASE_IIR_FILTER
-        (filter), a, 1, b, 1);
-
-    GST_LOG_OBJECT (filter, "rate was not set yet");
-    return;
-  }
-
-  if (filter->cutoff >= rate / 2.0) {
-    gdouble *a = g_new0 (gdouble, 1);
-    gdouble *b = g_new0 (gdouble, 1);
-
-    a[0] = 1.0;
-    b[0] = (filter->mode == MODE_LOW_PASS) ? 1.0 : 0.0;
-    gst_audio_fx_base_iir_filter_set_coefficients (GST_AUDIO_FX_BASE_IIR_FILTER
-        (filter), a, 1, b, 1);
-    GST_LOG_OBJECT (filter, "cutoff was higher than nyquist frequency");
-    return;
-  } else if (filter->cutoff <= 0.0) {
-    gdouble *a = g_new0 (gdouble, 1);
-    gdouble *b = g_new0 (gdouble, 1);
-
-    a[0] = 1.0;
-    b[0] = (filter->mode == MODE_LOW_PASS) ? 0.0 : 1.0;
-    gst_audio_fx_base_iir_filter_set_coefficients (GST_AUDIO_FX_BASE_IIR_FILTER
-        (filter), a, 1, b, 1);
-    GST_LOG_OBJECT (filter, "cutoff is lower than zero");
-    return;
-  }
-
-  /* Calculate coefficients for the chebyshev filter */
-  {
-    gint np = filter->poles;
-    gdouble *a, *b;
-    gint i, p;
-
-    a = g_new0 (gdouble, np + 3);
-    b = g_new0 (gdouble, np + 3);
-
-    /* Calculate transfer function coefficients */
-    a[2] = 1.0;
-    b[2] = 1.0;
-
-    for (p = 1; p <= np / 2; p++) {
-      gdouble b0, b1, b2, a1, a2;
-      gdouble *ta = g_new0 (gdouble, np + 3);
-      gdouble *tb = g_new0 (gdouble, np + 3);
-
-      generate_biquad_coefficients (filter, p, rate, &b0, &b1, &b2, &a1, &a2);
-
-      memcpy (ta, a, sizeof (gdouble) * (np + 3));
-      memcpy (tb, b, sizeof (gdouble) * (np + 3));
-
-      /* add the new coefficients for the new two poles
-       * to the cascade by multiplication of the transfer
-       * functions */
-      for (i = 2; i < np + 3; i++) {
-        b[i] = b0 * tb[i] + b1 * tb[i - 1] + b2 * tb[i - 2];
-        a[i] = ta[i] - a1 * ta[i - 1] - a2 * ta[i - 2];
-      }
-      g_free (ta);
-      g_free (tb);
-    }
-
-    /* Move coefficients to the beginning of the array to move from
-     * the transfer function's coefficients to the difference
-     * equation's coefficients */
-    for (i = 0; i <= np; i++) {
-      a[i] = a[i + 2];
-      b[i] = b[i + 2];
-    }
-
-    /* Normalize to unity gain at frequency 0 for lowpass
-     * and frequency 0.5 for highpass */
-    {
-      gdouble gain;
-
-      if (filter->mode == MODE_LOW_PASS)
-        gain =
-            gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b, np + 1,
-            1.0, 0.0);
-      else
-        gain =
-            gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b, np + 1,
-            -1.0, 0.0);
-
-      for (i = 0; i <= np; i++) {
-        b[i] /= gain;
-      }
-    }
-
-    gst_audio_fx_base_iir_filter_set_coefficients (GST_AUDIO_FX_BASE_IIR_FILTER
-        (filter), a, np + 1, b, np + 1);
-
-    GST_LOG_OBJECT (filter,
-        "Generated IIR coefficients for the Chebyshev filter");
-    GST_LOG_OBJECT (filter,
-        "mode: %s, type: %d, poles: %d, cutoff: %.2f Hz, ripple: %.2f dB",
-        (filter->mode == MODE_LOW_PASS) ? "low-pass" : "high-pass",
-        filter->type, filter->poles, filter->cutoff, filter->ripple);
-    GST_LOG_OBJECT (filter, "%.2f dB gain @ 0 Hz",
-        20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b,
-                np + 1, 1.0, 0.0)));
-
-#ifndef GST_DISABLE_GST_DEBUG
-    {
-      gdouble wc = 2.0 * G_PI * (filter->cutoff / rate);
-      gdouble zr = cos (wc), zi = sin (wc);
-
-      GST_LOG_OBJECT (filter, "%.2f dB gain @ %d Hz",
-          20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1,
-                  b, np + 1, zr, zi)), (int) filter->cutoff);
-    }
-#endif
-
-    GST_LOG_OBJECT (filter, "%.2f dB gain @ %d Hz",
-        20.0 * log10 (gst_audio_fx_base_iir_filter_calculate_gain (a, np + 1, b,
-                np + 1, -1.0, 0.0)), rate);
-  }
-}
-
-static void
-gst_audio_cheb_limit_finalize (GObject * object)
-{
-  GstAudioChebLimit *filter = GST_AUDIO_CHEB_LIMIT (object);
-
-  g_mutex_clear (&filter->lock);
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gst_audio_cheb_limit_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec)
-{
-  GstAudioChebLimit *filter = GST_AUDIO_CHEB_LIMIT (object);
-
-  switch (prop_id) {
-    case PROP_MODE:
-      g_mutex_lock (&filter->lock);
-      filter->mode = g_value_get_enum (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_TYPE:
-      g_mutex_lock (&filter->lock);
-      filter->type = g_value_get_int (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_CUTOFF:
-      g_mutex_lock (&filter->lock);
-      filter->cutoff = g_value_get_float (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_RIPPLE:
-      g_mutex_lock (&filter->lock);
-      filter->ripple = g_value_get_float (value);
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    case PROP_POLES:
-      g_mutex_lock (&filter->lock);
-      filter->poles = GST_ROUND_UP_2 (g_value_get_int (value));
-      generate_coefficients (filter, NULL);
-      g_mutex_unlock (&filter->lock);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-static void
-gst_audio_cheb_limit_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec)
-{
-  GstAudioChebLimit *filter = GST_AUDIO_CHEB_LIMIT (object);
-
-  switch (prop_id) {
-    case PROP_MODE:
-      g_value_set_enum (value, filter->mode);
-      break;
-    case PROP_TYPE:
-      g_value_set_int (value, filter->type);
-      break;
-    case PROP_CUTOFF:
-      g_value_set_float (value, filter->cutoff);
-      break;
-    case PROP_RIPPLE:
-      g_value_set_float (value, filter->ripple);
-      break;
-    case PROP_POLES:
-      g_value_set_int (value, filter->poles);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-/* GstAudioFilter vmethod implementations */
-
-static gboolean
-gst_audio_cheb_limit_setup (GstAudioFilter * base, const GstAudioInfo * info)
-{
-  GstAudioChebLimit *filter = GST_AUDIO_CHEB_LIMIT (base);
-
-  generate_coefficients (filter, info);
-
-  return GST_AUDIO_FILTER_CLASS (parent_class)->setup (base, info);
-}
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiocheblimit.h	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * GStreamer
- * Copyright (C) 2007-2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __GST_AUDIO_CHEB_LIMIT_H__
-#define __GST_AUDIO_CHEB_LIMIT_H__
-
-#include <gst/gst.h>
-#include <gst/base/gstbasetransform.h>
-#include <gst/audio/audio.h>
-#include <gst/audio/gstaudiofilter.h>
-
-#include "audiofxbaseiirfilter.h"
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_AUDIO_CHEB_LIMIT            (gst_audio_cheb_limit_get_type())
-#define GST_AUDIO_CHEB_LIMIT(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_CHEB_LIMIT,GstAudioChebLimit))
-#define GST_IS_AUDIO_CHEB_LIMIT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CHEB_LIMIT))
-#define GST_AUDIO_CHEB_LIMIT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_CHEB_LIMIT,GstAudioChebLimitClass))
-#define GST_IS_AUDIO_CHEB_LIMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_CHEB_LIMIT))
-#define GST_AUDIO_CHEB_LIMIT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_CHEB_LIMIT,GstAudioChebLimitClass))
-
-typedef struct _GstAudioChebLimit GstAudioChebLimit;
-typedef struct _GstAudioChebLimitClass GstAudioChebLimitClass;
-
-struct _GstAudioChebLimit
-{
-  GstAudioFXBaseIIRFilter parent;
-
-  gint mode;
-  gint type;
-  gint poles;
-  gfloat cutoff;
-  gfloat ripple;
-
-  /* < private > */
-  GMutex lock;
-};
-
-struct _GstAudioChebLimitClass
-{
-  GstAudioFXBaseIIRFilterClass parent;
-};
-
-GType gst_audio_cheb_limit_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GST_AUDIO_CHEB_LIMIT_H__ */
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/audiofx/audiodynamic.c	Tue Oct 06 09:17:24 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,721 +0,0 @@
-/* 
- * GStreamer
- * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
- *
- * 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/**
- * SECTION:element-audiodynamic
- *
- * This element can act as a compressor or expander. A compressor changes the
- * amplitude of all samples above a specific threshold with a specific ratio,
- * a expander does the same for all samples below a specific threshold. If
- * soft-knee mode is selected the ratio is applied smoothly.
- *
- * <refsect2>
- * <title>Example launch line</title>
- * |[
- * gst-launch-1.0 audiotestsrc wave=saw ! audiodynamic characteristics=soft-knee mode=compressor threshold=0.5 rate=0.5 ! alsasink
- * gst-launch-1.0 filesrc location="melo1.ogg" ! oggdemux ! vorbisdec ! audioconvert ! audiodynamic characteristics=hard-knee mode=expander threshold=0.2 rate=4.0 ! alsasink
- * gst-launch-1.0 audiotestsrc wave=saw ! audioconvert ! audiodynamic ! audioconvert ! alsasink
- * ]|
- * </refsect2>
- */
-
-/* TODO: Implement attack and release parameters */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gst/gst.h>
-#include <gst/base/gstbasetransform.h>
-#include <gst/audio/audio.h>
-#include <gst/audio/gstaudiofilter.h>
-
-#include "audiodynamic.h"
-
-#define GST_CAT_DEFAULT gst_audio_dynamic_debug
-GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
-
-/* Filter signals and args */
-enum
-{
-  /* FILL ME */
-  LAST_SIGNAL
-};
-
-enum
-{
-  PROP_0,
-  PROP_CHARACTERISTICS,
-  PROP_MODE,
-  PROP_THRESHOLD,
-  PROP_RATIO
-};
-
-#define ALLOWED_CAPS \
-    "audio/x-raw,"                                                \
-    " format=(string) {"GST_AUDIO_NE(S16)","GST_AUDIO_NE(F32)"}," \
-    " rate=(int)[1,MAX],"                                         \
-    " channels=(int)[1,MAX],"                                     \
-    " layout=(string) {interleaved, non-interleaved}"
-
-G_DEFINE_TYPE (GstAudioDynamic, gst_audio_dynamic, GST_TYPE_AUDIO_FILTER);
-
-static void gst_audio_dynamic_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec);
-static void gst_audio_dynamic_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec);
-
-static gboolean gst_audio_dynamic_setup (GstAudioFilter * filter,
-    const GstAudioInfo * info);
-static GstFlowReturn gst_audio_dynamic_transform_ip (GstBaseTransform * base,
-    GstBuffer * buf);
-
-static void
-gst_audio_dynamic_transform_hard_knee_compressor_int (GstAudioDynamic * filter,
-    gint16 * data, guint num_samples);
-static void
-gst_audio_dynamic_transform_hard_knee_compressor_float (GstAudioDynamic *
-    filter, gfloat * data, guint num_samples);
-static void
-gst_audio_dynamic_transform_soft_knee_compressor_int (GstAudioDynamic * filter,
-    gint16 * data, guint num_samples);
-static void
-gst_audio_dynamic_transform_soft_knee_compressor_float (GstAudioDynamic *
-    filter, gfloat * data, guint num_samples);
-static void gst_audio_dynamic_transform_hard_knee_expander_int (GstAudioDynamic
-    * filter, gint16 * data, guint num_samples);
-static void
-gst_audio_dynamic_transform_hard_knee_expander_float (GstAudioDynamic * filter,
-    gfloat * data, guint num_samples);
-static void gst_audio_dynamic_transform_soft_knee_expander_int (GstAudioDynamic
-    * filter, gint16 * data, guint num_samples);
-static void
-gst_audio_dynamic_transform_soft_knee_expander_float (GstAudioDynamic * filter,
-    gfloat * data, guint num_samples);
-
-static GstAudioDynamicProcessFunc process_functions[] = {
-  (GstAudioDynamicProcessFunc)
-      gst_audio_dynamic_transform_hard_knee_compressor_int,
-  (GstAudioDynamicProcessFunc)
-      gst_audio_dynamic_transform_hard_knee_compressor_float,
-  (GstAudioDynamicProcessFunc)
-      gst_audio_dynamic_transform_soft_knee_compressor_int,
-  (GstAudioDynamicProcessFunc)
-      gst_audio_dynamic_transform_soft_knee_compressor_float,
-  (GstAudioDynamicProcessFunc)
-      gst_audio_dynamic_transform_hard_knee_expander_int,
-  (GstAudioDynamicProcessFunc)
-      gst_audio_dynamic_transform_hard_knee_expander_float,
-  (GstAudioDynamicProcessFunc)
-      gst_audio_dynamic_transform_soft_knee_expander_int,
-  (GstAudioDynamicProcessFunc)
-  gst_audio_dynamic_transform_soft_knee_expander_float
-};
-
-enum
-{
-  CHARACTERISTICS_HARD_KNEE = 0,
-  CHARACTERISTICS_SOFT_KNEE
-};
-
-#define GST_TYPE_AUDIO_DYNAMIC_CHARACTERISTICS (gst_audio_dynamic_characteristics_get_type ())
-static GType
-gst_audio_dynamic_characteristics_get_type (void)
-{
-  static GType gtype = 0;
-
-  if (gtype == 0) {
-    static const GEnumValue values[] = {
-      {CHARACTERISTICS_HARD_KNEE, "Hard Knee (default)",
-          "hard-knee"},
-      {CHARACTERISTICS_SOFT_KNEE, "Soft Knee (smooth)",
-          "soft-knee"},
-      {0, NULL, NULL}
-    };
-
-    gtype = g_enum_register_static ("GstAudioDynamicCharacteristics", values);
-  }
-  return gtype;
-}
-
-enum
-{
-  MODE_COMPRESSOR = 0,
-  MODE_EXPANDER
-};
-
-#define GST_TYPE_AUDIO_DYNAMIC_MODE (gst_audio_dynamic_mode_get_type ())
-static GType
-gst_audio_dynamic_mode_get_type (void)
-{
-  static GType gtype = 0;
-
-  if (gtype == 0) {
-    static const GEnumValue values[] = {
-      {MODE_COMPRESSOR, "Compressor (default)",
-          "compressor"},
-      {MODE_EXPANDER, "Expander", "expander"},
-      {0, NULL, NULL}
-    };
-
-    gtype = g_enum_register_static ("GstAudioDynamicMode", values);
-  }
-  return gtype;
-}
-
-static gboolean
-gst_audio_dynamic_set_process_function (GstAudioDynamic * filter,
-    const GstAudioInfo * info)
-{
-  gint func_index;
-
-  if (GST_AUDIO_INFO_FORMAT (info) == GST_AUDIO_FORMAT_UNKNOWN)
-    return FALSE;
-
-  func_index = (filter->mode == MODE_COMPRESSOR) ? 0 : 4;
-  func_index += (filter->characteristics == CHARACTERISTICS_HARD_KNEE) ? 0 : 2;
-  func_index += (GST_AUDIO_INFO_FORMAT (info) == GST_AUDIO_FORMAT_F32) ? 1 : 0;
-
-  if (func_index >= 0 && func_index < 8) {
-    filter->process = process_functions[func_index];
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-/* GObject vmethod implementations */
-
-static void
-gst_audio_dynamic_class_init (GstAudioDynamicClass * klass)
-{
-  GObjectClass *gobject_class;
-  GstElementClass *gstelement_class;
-  GstCaps *caps;
-
-  GST_DEBUG_CATEGORY_INIT (gst_audio_dynamic_debug, "audiodynamic", 0,
-      "audiodynamic element");
-
-  gobject_class = (GObjectClass *) klass;
-  gstelement_class = (GstElementClass *) klass;
-
-  gobject_class->set_property = gst_audio_dynamic_set_property;
-  gobject_class->get_property = gst_audio_dynamic_get_property;
-
-  g_object_class_install_property (gobject_class, PROP_CHARACTERISTICS,
-      g_param_spec_enum ("characteristics", "Characteristics",
-          "Selects whether the ratio should be applied smooth (soft-knee) "
-          "or hard (hard-knee).",
-          GST_TYPE_AUDIO_DYNAMIC_CHARACTERISTICS, CHARACTERISTICS_HARD_KNEE,
-          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_property (gobject_class, PROP_MODE,
-      g_param_spec_enum ("mode", "Mode",
-          "Selects whether the filter should work on loud samples (compressor) or"
-          "quiet samples (expander).",
-          GST_TYPE_AUDIO_DYNAMIC_MODE, MODE_COMPRESSOR,
-          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_property (gobject_class, PROP_THRESHOLD,
-      g_param_spec_float ("threshold", "Threshold",
-          "Threshold until the filter is activated", 0.0, 1.0,
-          0.0,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_property (gobject_class, PROP_RATIO,
-      g_param_spec_float ("ratio", "Ratio",
-          "Ratio that should be applied", 0.0, G_MAXFLOAT,
-          1.0,
-          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
-
-  gst_element_class_set_static_metadata (gstelement_class,
-      "Dynamic range controller", "Filter/Effect/Audio",
-      "Compressor and Expander", "Sebastian Dröge <slomo@circular-chaos.org>");
-
-  caps = gst_caps_from_string (ALLOWED_CAPS);
-  gst_audio_filter_class_add_pad_templates (GST_AUDIO_FILTER_CLASS (klass),
-      caps);
-  gst_caps_unref (caps);
-
-  GST_AUDIO_FILTER_CLASS (klass)->setup =
-      GST_DEBUG_FUNCPTR (gst_audio_dynamic_setup);
-
-  GST_BASE_TRANSFORM_CLASS (klass)->transform_ip =
-      GST_DEBUG_FUNCPTR (gst_audio_dynamic_transform_ip);
-  GST_BASE_TRANSFORM_CLASS (klass)->transform_ip_on_passthrough = FALSE;
-}
-
-static void
-gst_audio_dynamic_init (GstAudioDynamic * filter)
-{
-  filter->ratio = 1.0;
-  filter->threshold = 0.0;
-  filter->characteristics = CHARACTERISTICS_HARD_KNEE;
-  filter->mode = MODE_COMPRESSOR;
-  gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
-  gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM (filter), TRUE);
-}
-
-static void
-gst_audio_dynamic_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec)
-{
-  GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (object);
-
-  switch (prop_id) {
-    case PROP_CHARACTERISTICS:
-      filter->characteristics = g_value_get_enum (value);
-      gst_audio_dynamic_set_process_function (filter,
-          GST_AUDIO_FILTER_INFO (filter));
-      break;
-    case PROP_MODE:
-      filter->mode = g_value_get_enum (value);
-      gst_audio_dynamic_set_process_function (filter,
-          GST_AUDIO_FILTER_INFO (filter));
-      break;
-    case PROP_THRESHOLD:
-      filter->threshold = g_value_get_float (value);
-      break;
-    case PROP_RATIO:
-      filter->ratio = g_value_get_float (value);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-static void
-gst_audio_dynamic_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec)
-{
-  GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (object);
-
-  switch (prop_id) {
-    case PROP_CHARACTERISTICS:
-      g_value_set_enum (value, filter->characteristics);
-      break;
-    case PROP_MODE:
-      g_value_set_enum (value, filter->mode);
-      break;
-    case PROP_THRESHOLD:
-      g_value_set_float (value, filter->threshold);
-      break;
-    case PROP_RATIO:
-      g_value_set_float (value, filter->ratio);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-}
-
-/* GstAudioFilter vmethod implementations */
-
-static gboolean
-gst_audio_dynamic_setup (GstAudioFilter * base, const GstAudioInfo * info)
-{
-  GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (base);
-  gboolean ret = TRUE;
-
-  ret = gst_audio_dynamic_set_process_function (filter, info);
-
-  return ret;
-}
-
-static void
-gst_audio_dynamic_transform_hard_knee_compressor_int (GstAudioDynamic * filter,
-    gint16 * data, guint num_samples)
-{
-  glong val;
-  glong thr_p = filter->threshold * G_MAXINT16;
-  glong thr_n = filter->threshold * G_MININT16;
-
-  /* Nothing to do for us if ratio is 1.0 or if the threshold
-   * equals 1.0. */
-  if (filter->threshold == 1.0 || filter->ratio == 1.0)
-    return;