This is an automated email from the git hooks/post-receive script. ebourg-guest pushed a commit to branch master in repository openjfx.
commit 8bf3db758bcbbf2e38501f7df893efb5b0f3a206 Author: Emmanuel Bourg <[email protected]> Date: Wed Mar 4 10:42:45 2015 +0100 Refreshed the patches --- debian/changelog | 8 + debian/patches/01-skip-verify-java.patch | 2 +- debian/patches/02-use-system-libraries.patch | 18 +- debian/patches/03-buildflags.patch | 4 +- debian/patches/04-libav-compatibility.patch | 1056 -------------------- .../06-disable-architecture-verification.patch | 4 +- debian/patches/08-disable-sse2.patch | 4 +- debian/patches/series | 1 - 8 files changed, 24 insertions(+), 1073 deletions(-) diff --git a/debian/changelog b/debian/changelog index a61f1e5..87688f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +openjfx (8u40-b25-1) UNRELEASED; urgency=medium + + * New upstream release + - Refreshed the patches + - Removed the libav compatibility patch (fixed upstream) + + -- Emmanuel Bourg <[email protected]> Wed, 04 Mar 2015 10:14:28 +0100 + openjfx (8u20-b26-3) unstable; urgency=medium * Install the jar files in an arch independent directory (Closes: #764241) diff --git a/debian/patches/01-skip-verify-java.patch b/debian/patches/01-skip-verify-java.patch index 8d88c51..4327287 100644 --- a/debian/patches/01-skip-verify-java.patch +++ b/debian/patches/01-skip-verify-java.patch @@ -3,7 +3,7 @@ Author: Emmanuel Bourg <[email protected]> Forwarded: not-needed --- a/build.gradle +++ b/build.gradle -@@ -1020,7 +1020,7 @@ +@@ -1055,7 +1055,7 @@ def buildNum = Integer.parseInt(jdkBuildNumber) def minBuildNum = Integer.parseInt(jfxBuildJdkBuildnumMin) if (buildNum < minBuildNum) { diff --git a/debian/patches/02-use-system-libraries.patch b/debian/patches/02-use-system-libraries.patch index 0063d86..5be25d6 100644 --- a/debian/patches/02-use-system-libraries.patch +++ b/debian/patches/02-use-system-libraries.patch @@ -3,7 +3,7 @@ Author: Emmanuel Bourg <[email protected]> Forwarded: not-needed --- a/build.gradle +++ b/build.gradle -@@ -1115,12 +1115,8 @@ +@@ -1144,12 +1144,8 @@ // closed gradle file instead. if (!BUILD_CLOSED) { repositories { @@ -18,7 +18,7 @@ Forwarded: not-needed } } } -@@ -1128,7 +1124,7 @@ +@@ -1157,7 +1153,7 @@ // By default all of our projects require junit for testing so we can just // setup this dependency here. dependencies { @@ -27,7 +27,7 @@ Forwarded: not-needed if (BUILD_CLOSED && DO_JCOV) { testCompile name: "jcov" } -@@ -1265,12 +1261,12 @@ +@@ -1295,12 +1291,12 @@ dependencies { compile project(":base"), BUILD_SRC @@ -45,7 +45,7 @@ Forwarded: not-needed } // Create a single "native" task which will depend on all the individual native tasks for graphics -@@ -1550,9 +1546,9 @@ +@@ -1582,9 +1578,9 @@ copy { into libsDir from f.getParentFile() @@ -58,7 +58,7 @@ Forwarded: not-needed includeEmptyDirs = false } // Have to rename the swt jar because it is some platform specific name but -@@ -1631,7 +1627,7 @@ +@@ -1665,7 +1661,7 @@ } dependencies { compile BUILD_SRC, project(":base"), project(":graphics") @@ -67,7 +67,7 @@ Forwarded: not-needed } } -@@ -1730,7 +1726,7 @@ +@@ -1781,7 +1777,7 @@ } dependencies { @@ -76,7 +76,7 @@ Forwarded: not-needed } // When producing the jar, we need to relocate a few class files -@@ -1928,13 +1924,13 @@ +@@ -2044,13 +2040,13 @@ classes << { // Copy all of the download libraries to libs directory for the sake of the IDEs File libsDir = rootProject.file("build/libs"); @@ -92,7 +92,7 @@ Forwarded: not-needed includeEmptyDirs = false } } -@@ -2304,10 +2300,12 @@ +@@ -2494,10 +2490,12 @@ def targetProperties = project.rootProject.ext[t.upper] def classifier = (t.name != "linux" && t.name != "win") ? t.name : IS_64 ? "${t.name}-amd64" : "${t.name}-i586" @@ -105,7 +105,7 @@ Forwarded: not-needed def webkitOutputDir = "$buildDir/${t.name}" def webkitConfig = IS_DEBUG_NATIVE ? "Debug" : "Release" -@@ -2315,11 +2313,13 @@ +@@ -2505,11 +2503,13 @@ def compileNativeTask = task("compileNative${t.capital}", dependsOn: generateHeaders) << { println "Building Webkit configuration /$webkitConfig/ into $webkitOutputDir" diff --git a/debian/patches/03-buildflags.patch b/debian/patches/03-buildflags.patch index 83a2612..9b133a3 100644 --- a/debian/patches/03-buildflags.patch +++ b/debian/patches/03-buildflags.patch @@ -3,7 +3,7 @@ Author: Emmanuel Bourg <[email protected]> Forwarded: no --- a/buildSrc/linux.gradle +++ b/buildSrc/linux.gradle -@@ -53,7 +53,9 @@ +@@ -55,7 +55,9 @@ commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c", IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten() //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"]) @@ -13,7 +13,7 @@ Forwarded: no // Create $buildDir/linux_tools.properties file and load props from it setupTools("linux_tools", -@@ -182,7 +184,7 @@ +@@ -197,7 +199,7 @@ LINUX.iio.compiler = compiler LINUX.iio.ccFlags = [ccFlags].flatten() LINUX.iio.linker = linker diff --git a/debian/patches/04-libav-compatibility.patch b/debian/patches/04-libav-compatibility.patch deleted file mode 100644 index 18210d5..0000000 --- a/debian/patches/04-libav-compatibility.patch +++ /dev/null @@ -1,1056 +0,0 @@ -Description: Resolves compile time errors for libav54 and libav55 and makes sound workable on these two versions of libav -Author: Kirill Kirichenko <[email protected]> -Bug: https://javafx-jira.kenai.com/browse/RT-37256 ---- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gstregistry.c -+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gstregistry.c -@@ -162,7 +162,7 @@ - #include <link.h> - #include <dlfcn.h> - --static const int AVCODEC_EXPLICIT_VERSIONS[] = { 53 }; -+static const int AVCODEC_EXPLICIT_VERSIONS[] = { 53, 54, 55 }; - - typedef unsigned (*avcodec_version_proto)(); - -@@ -1150,6 +1150,7 @@ - return changed; - } - -+#ifndef GSTREAMER_LITE - static gboolean - is_blacklisted_hidden_directory (const gchar * dirent) - { -@@ -1168,6 +1169,7 @@ - - return FALSE; - } -+#endif - - static gboolean - gst_registry_scan_path_level (GstRegistryScanContext * context, -@@ -1249,7 +1251,7 @@ - { - filename_partial = g_build_filename (path, gstlite_plugins_list[gstlite_plugins_list_index], NULL); - #ifdef LINUX -- if (g_str_has_suffix(filename_partial, "libavplugin") != NULL) // Check libavc version and load correspondent module. -+ if (g_str_has_suffix(filename_partial, "libavplugin")) // Check libav version and load correspondent module. - { - int vi; - for (vi = 0, avcHandle = NULL; ---- a/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.c -+++ b/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.c -@@ -36,6 +36,7 @@ - - #include "audiodecoder.h" - #include <libavformat/avformat.h> -+#include <libavutil/samplefmt.h> - - GST_DEBUG_CATEGORY_STATIC(audiodecoder_debug); - #define GST_CAT_DEFAULT audiodecoder_debug -@@ -131,7 +132,10 @@ - static gboolean audiodecoder_src_query(GstPad * pad, GstQuery* query); - static const GstQueryType * audiodecoder_get_src_query_types(GstPad * pad); - static gboolean audiodecoder_init_state(AudioDecoder *decoder); --static void audiodecoder_init_context(BaseDecoder *decoder); -+ -+#if DECODE_AUDIO4 -+static gboolean audiodecoder_is_oformat_supported(int format); -+#endif - - /* --- GObject vmethod implementations --- */ - -@@ -160,7 +164,6 @@ - static void audiodecoder_class_init(AudioDecoderClass * klass) - { - GST_ELEMENT_CLASS(klass)->change_state = audiodecoder_change_state; -- BASEDECODER_CLASS(klass)->init_context = audiodecoder_init_context; - } - /* - * Initialize the new element. -@@ -194,16 +197,18 @@ - */ - static gboolean audiodecoder_init_state(AudioDecoder *decoder) - { -- decoder->samples = av_mallocz(AVCODEC_MAX_AUDIO_FRAME_SIZE); -+#if NEW_CODEC_ID -+ decoder->codec_id = AV_CODEC_ID_NONE; -+#else -+ decoder->codec_id = CODEC_ID_NONE; -+#endif -+ -+#if !DECODE_AUDIO4 -+ decoder->samples = av_mallocz(AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); - if (!decoder->samples) - return FALSE; -- --#if ! LIBAVCODEC_NEW -- decoder->packet = NULL; -- decoder->packet_size = 0; --#endif // LIBAVCODEC_NEW -- -- decoder->codec_id = CODEC_ID_NONE; -+#endif -+ - decoder->total_samples = 0; - decoder->initial_offset = GST_BUFFER_OFFSET_NONE; - decoder->duration = GST_CLOCK_TIME_NONE; -@@ -217,17 +222,6 @@ - return TRUE; - } - --static void audiodecoder_init_context(BaseDecoder *base) --{ -- AudioDecoder *decoder = AUDIODECODER(base); -- -- base->context->channels = decoder->num_channels; -- base->context->sample_rate = decoder->sample_rate; -- base->context->bit_rate = decoder->bit_rate; -- -- BASEDECODER_CLASS(parent_class)->init_context(base); --} -- - /** - * Reset the state of the AudioDecoder structure. This should happen before - * decoding a new segment. -@@ -244,22 +238,14 @@ - - static void audiodecoder_close_decoder(AudioDecoder *decoder) - { -+#if !DECODE_AUDIO4 - if (decoder->samples) - { - av_free(decoder->samples); - decoder->samples = NULL; - } -- --#if ! LIBAVCODEC_NEW -- if (decoder->packet) -- { -- av_free(decoder->packet); -- -- decoder->packet = NULL; -- decoder->packet_size = 0; -- } - #endif -- -+ - basedecoder_close_decoder(BASEDECODER(decoder)); - } - -@@ -507,7 +493,11 @@ - - if (4 == mpeg_version) - { -+#if NEW_CODEC_ID -+ decoder->codec_id = AV_CODEC_ID_AAC; -+#else - decoder->codec_id = CODEC_ID_AAC; -+#endif - if (base->codec_data) // codec_data is optional for AAC - { - // -@@ -546,8 +536,11 @@ - } - else - { -+#if NEW_CODEC_ID -+ decoder->codec_id = AV_CODEC_ID_MP3; -+#else - decoder->codec_id = CODEC_ID_MP3; -- -+#endif - if (!gst_structure_get_int(caps_struct, "layer", &mpeg_layer)) - mpeg_layer = 3; - -@@ -580,9 +573,6 @@ - } - else - return FALSE; // Type is not "audio/mpeg" -- -- decoder->bytes_per_sample = (AUDIODECODER_BITS_PER_SAMPLE/8)*AUDIODECODER_OUT_NUM_CHANNELS; -- decoder->initial_offset = GST_BUFFER_OFFSET_IS_VALID(buffer) ? GST_BUFFER_OFFSET(buffer) : 0; - } - - if (!base->codec && !basedecoder_open_decoder(base, decoder->codec_id)) -@@ -604,6 +594,9 @@ - "signed", G_TYPE_BOOLEAN, TRUE, - NULL); - -+ decoder->bytes_per_sample = (AUDIODECODER_BITS_PER_SAMPLE/8)*AUDIODECODER_OUT_NUM_CHANNELS; -+ decoder->initial_offset = GST_BUFFER_OFFSET_IS_VALID(buffer) ? GST_BUFFER_OFFSET(buffer) : 0; -+ - // Set the source caps. - base->is_initialized = gst_pad_set_caps(base->srcpad, caps); - -@@ -612,6 +605,12 @@ - return base->is_initialized; - } - -+static inline int16_t float_to_int(float sample) -+{ -+ int value = (int)(sample * INT16_MAX); -+ return value > INT16_MAX ? INT16_MAX : value < INT16_MIN ? INT16_MIN : (int16_t)value; -+} -+ - /* - * Processes a buffer of MPEG audio data pushed to the sink pad. - */ -@@ -620,19 +619,23 @@ - AudioDecoder *decoder = AUDIODECODER(GST_OBJECT_PARENT(pad)); - BaseDecoder *base = BASEDECODER(decoder); - GstFlowReturn ret = GST_FLOW_OK; -- gint outbuf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; - int num_dec = NO_DATA_USED; - -- -+#if DECODE_AUDIO4 -+ gint got_frame = 0; -+ int sample, ci; -+ #else -+ gint outbuf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; -+#endif -+ - #ifdef VERBOSE_DEBUG - g_print("audiodecoder: incoming size=%d, ts=%.4f, duration=%.4f ", GST_BUFFER_SIZE(buf), - GST_BUFFER_TIMESTAMP_IS_VALID(buf) ? (double)GST_BUFFER_TIMESTAMP(buf)/GST_SECOND : -1.0, - GST_BUFFER_DURATION_IS_VALID(buf) ? (double)GST_BUFFER_DURATION(buf)/GST_SECOND : -1.0); - #endif -- -+ - // If we have incoming buffers with PTS, then use them. -- if (GST_BUFFER_TIMESTAMP_IS_VALID(buf)) -- decoder->generate_pts = FALSE; -+ decoder->generate_pts = !GST_BUFFER_TIMESTAMP_IS_VALID(buf); - - // If between FLUSH_START and FLUSH_STOP, reject new buffers. - if (base->is_flushing) -@@ -665,67 +668,44 @@ - decoder->is_synced = TRUE; - } - --#if LIBAVCODEC_NEW -- if (!base->is_hls) -- { -- if (av_new_packet(&decoder->packet, GST_BUFFER_SIZE(buf)) == 0) -- { -- memcpy(decoder->packet.data, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf)); -- num_dec = avcodec_decode_audio3(base->context, (int16_t*)decoder->samples, &outbuf_size, &decoder->packet); -- av_free_packet(&decoder->packet); -- } -- else -- { -- ret = GST_FLOW_ERROR; -- goto _exit; -- } -- } -- else -- { -- av_init_packet(&decoder->packet); -- decoder->packet.data = GST_BUFFER_DATA(buf); -- decoder->packet.size = GST_BUFFER_SIZE(buf); -- num_dec = avcodec_decode_audio3(base->context, (int16_t*)decoder->samples, &outbuf_size, &decoder->packet); -- } --#else // ! LIBAVCODEC_NEW -- if (!base->is_hls) -- { -- if (decoder->packet_size < GST_BUFFER_SIZE(buf)) -- { -- decoder->packet = av_realloc(decoder->packet, GST_BUFFER_SIZE(buf)); -- decoder->packet_size = decoder->packet ? GST_BUFFER_SIZE(buf) : 0; -- } -- -- if (decoder->packet) -- { -- memcpy(decoder->packet, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf)); -- num_dec = avcodec_decode_audio2(base->context, (int16_t*)decoder->samples, &outbuf_size, decoder->packet, GST_BUFFER_SIZE(buf)); -- } -- else -- { -- ret = GST_FLOW_ERROR; -- goto _exit; -- } -- } -- else -- num_dec = avcodec_decode_audio2(base->context, (int16_t*)decoder->samples, -- &outbuf_size, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf)); -- --#endif // LIBAVCODEC_NEW -+ av_init_packet(&decoder->packet); -+ decoder->packet.data = GST_BUFFER_DATA(buf); -+ decoder->packet.size = GST_BUFFER_SIZE(buf); -+ -+#if DECODE_AUDIO4 -+ num_dec = avcodec_decode_audio4(base->context, base->frame, &got_frame, &decoder->packet); -+#else -+ num_dec = avcodec_decode_audio3(base->context, (int16_t*)decoder->samples, &outbuf_size, &decoder->packet); -+#endif - -- if (num_dec < 0) -+ -+#if DECODE_AUDIO4 -+ if (num_dec < 0 || !got_frame) -+#else -+ if (num_dec < 0 || outbuf_size == 0) -+#endif - { -- // avcodec_flush_buffers(base->context); - #ifdef DEBUG_OUTPUT - g_print("audiodecoder_chain error: %s\n", avelement_error_to_string(AVELEMENT(decoder), num_dec)); - #endif - goto _exit; - } - -- if (outbuf_size == 0) -+ GstBuffer *outbuf = NULL; -+#if DECODE_AUDIO4 -+ if (!audiodecoder_is_oformat_supported(base->frame->format)) -+ { -+ gst_element_message_full(GST_ELEMENT(decoder), GST_MESSAGE_ERROR, GST_CORE_ERROR, GST_CORE_ERROR_NOT_IMPLEMENTED, -+ g_strdup("Unsupported decoded audio format"), NULL, ("audiodecoder.c"), ("audiodecoder_chain"), 0); - goto _exit; -+ } -+ -+ int outbuf_size = av_samples_get_buffer_size(NULL, base->context->channels, base->frame->nb_samples, AV_SAMPLE_FMT_S16, 1); -+ if (outbuf_size < 0) { -+ goto _exit; -+ } -+#endif - -- GstBuffer *outbuf = NULL; - ret = gst_pad_alloc_buffer_and_set_caps(base->srcpad, GST_BUFFER_OFFSET_NONE, - outbuf_size, GST_PAD_CAPS(base->srcpad), &outbuf); - -@@ -734,14 +714,39 @@ - { - if (ret != GST_FLOW_WRONG_STATE) - { -- gst_element_message_full(GST_ELEMENT(decoder), GST_MESSAGE_ERROR, GST_CORE_ERROR, GST_CORE_ERROR_SEEK, -+ gst_element_message_full(GST_ELEMENT(decoder), GST_MESSAGE_ERROR, GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_NO_SPACE_LEFT, - g_strdup("Decoded audio buffer allocation failed"), NULL, ("audiodecoder.c"), ("audiodecoder_chain"), 0); - } - goto _exit; - } - -+#if DECODE_AUDIO4 -+ if (base->frame->format == AV_SAMPLE_FMT_S16P) -+ { -+ // Reformat the output frame into single buffer. -+ int16_t *buffer = (int16_t*)GST_BUFFER_DATA(outbuf); -+ for (sample = 0; sample < base->frame->nb_samples; sample++) -+ { -+ for (ci = 0; ci < base->context->channels && ci < AV_NUM_DATA_POINTERS; ci++) -+ buffer[2*sample + ci] = ((int16_t*)base->frame->data[ci])[sample]; -+ } -+ } -+ else if (base->frame->format == AV_SAMPLE_FMT_FLTP) -+ { -+ // Reformat the output frame into single buffer and convert float [-1.0;1.0] to int16 -+ int16_t *buffer = (int16_t*)GST_BUFFER_DATA(outbuf); -+ for (sample = 0; sample < base->frame->nb_samples; sample++) -+ { -+ for (ci = 0; ci < base->context->channels && ci < AV_NUM_DATA_POINTERS; ci++) -+ buffer[2*sample + ci] = float_to_int(((float*)base->frame->data[ci])[sample]); -+ } -+ } -+ else if (base->frame->format == AV_SAMPLE_FMT_S16) -+ memcpy(GST_BUFFER_DATA(outbuf), base->frame->data[0], GST_BUFFER_SIZE(outbuf)); -+#else - memcpy(GST_BUFFER_DATA(outbuf), decoder->samples, GST_BUFFER_SIZE(outbuf)); -- -+#endif -+ - // Set output buffer properties. - if (decoder->generate_pts) - { -@@ -776,18 +781,30 @@ - goto _exit; - } - -+#ifdef VERBOSE_DEBUG -+ g_print("ret=%s, num_dec=%d, Buffer: size=%d, ts=%.4f, duration=%.4f, offset=%ld, offset_end=%ld\n", -+ gst_flow_get_name(ret), num_dec, outbuf_size, -+ (double)GST_BUFFER_TIMESTAMP(outbuf)/GST_SECOND, (double)GST_BUFFER_DURATION(outbuf)/GST_SECOND, -+ GST_BUFFER_OFFSET(outbuf), GST_BUFFER_OFFSET_END(outbuf)); -+#endif -+ - ret = gst_pad_push(base->srcpad, outbuf); - -- _exit: -+_exit: - --#ifdef VERBOSE_DEBUG -- g_print("ret=%s, num_dec=%d\n", gst_flow_get_name(ret), num_dec); --#endif - // INLINE - gst_buffer_unref() - gst_buffer_unref(buf); - return ret; - } - -+#if DECODE_AUDIO4 -+static gboolean audiodecoder_is_oformat_supported(int format) -+{ -+ return (format == AV_SAMPLE_FMT_S16P || format == AV_SAMPLE_FMT_FLTP || -+ format == AV_SAMPLE_FMT_S16); -+} -+#endif -+ - // -------------------------------------------------------------------------- - gboolean audiodecoder_plugin_init(GstPlugin * audiodecoder) { - GST_DEBUG_CATEGORY_INIT(audiodecoder_debug, AV_AUDIO_DECODER_PLUGIN_NAME, ---- a/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.h -+++ b/modules/media/src/main/native/gstreamer/plugins/av/audiodecoder.h -@@ -53,13 +53,15 @@ - struct _AudioDecoder { - BaseDecoder parent; - -+#if !DECODE_AUDIO4 - guint8 *samples; // temporary output buffer -- -+#endif -+ - gboolean is_synced; // whether the first audio frame has been found - gboolean is_discont; // whether the next frame is a discontinuity - -- enum CodecID codec_id; // the libavcodec codec ID -- -+ CodecIDType codec_id; -+ - gint num_channels; // channels / stream - guint bytes_per_sample; // bytes / sample - gint sample_rate; // samples / second -@@ -72,12 +74,7 @@ - guint64 total_samples; // sample offset from zero at current time - gboolean generate_pts; - --#if LIBAVCODEC_NEW -- AVPacket packet; --#else // ! LIBAVCODEC_NEW -- uint8_t *packet; -- int packet_size; --#endif // LIBAVCODEC_NEW -+ AVPacket packet; - }; - - struct _AudioDecoderClass ---- a/modules/media/src/main/native/gstreamer/plugins/av/avelement.c -+++ b/modules/media/src/main/native/gstreamer/plugins/av/avelement.c -@@ -89,42 +89,8 @@ - ***********************************************************************************/ - const char* avelement_error_to_string(AVElement *element, int ret) - { --#if LIBAVCODEC_NEW - if (av_strerror(ret, element->error_string, ERROR_STRING_SIZE) < 0) - g_strlcpy(element->error_string, "Unknown", ERROR_STRING_SIZE); - - return element->error_string; --#else -- switch(ret) -- { -- case AVERROR_IO: -- return "I/O error"; -- case AVERROR_NUMEXPECTED: -- return "Number syntax expected in filename"; -- -- case AVERROR_INVALIDDATA: -- return "invalid data found"; -- -- case AVERROR_NOMEM: -- return "not enough memory"; -- -- case AVERROR_NOFMT: -- return "unknown format"; -- -- case AVERROR_NOTSUPP: -- return "Operation not supported"; -- -- case AVERROR_NOENT: -- return "No such file or directory"; -- -- case AVERROR_EOF: -- return "End of file"; -- -- case AVERROR_PATCHWELCOME: -- return "Patches welcome"; -- -- default: -- return "Unknown"; -- } --#endif - } ---- a/modules/media/src/main/native/gstreamer/plugins/av/avelement.h -+++ b/modules/media/src/main/native/gstreamer/plugins/av/avelement.h -@@ -28,13 +28,10 @@ - - #include <gst/gst.h> - #include <libavcodec/avcodec.h> -+#include "avdefines.h" - - G_BEGIN_DECLS - --// According to ffmpeg Git they introduced --// _decode_video2 and _decode_audio3 in version 52.25.0 --#define LIBAVCODEC_NEW (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,1)) -- - // Maximum size of the buffer for string representation of errors - #define ERROR_STRING_SIZE 256 - -@@ -52,9 +49,7 @@ - { - GstElement element; - --#if LIBAVCODEC_NEW - char error_string[ERROR_STRING_SIZE]; --#endif // LIBAVCODEC_NEW - }; - - struct _AVElementClass -@@ -66,6 +61,13 @@ - - const char* avelement_error_to_string(AVElement *avelement, int ret); - -+#if NEW_CODEC_ID -+typedef enum AVCodecID CodecIDType; -+#else -+typedef enum CodecID CodecIDType; -+#endif -+ -+ - G_END_DECLS - - #endif // __AV_ELEMENT_H__ ---- a/modules/media/src/main/native/gstreamer/plugins/av/decoder.c -+++ b/modules/media/src/main/native/gstreamer/plugins/av/decoder.c -@@ -24,6 +24,11 @@ - */ - - #include "decoder.h" -+#include <libavutil/mem.h> -+ -+#if NEW_ALLOC_FRAME -+#include <libavutil/frame.h> -+#endif - - /*********************************************************************************** - * Static AVCodec library lock. One for all instances. Necessary for avcodec_open -@@ -79,6 +84,7 @@ - decoder->codec_data = NULL; - decoder->codec_data_size = 0; - -+ decoder->frame = NULL; - decoder->context = NULL; - decoder->codec = NULL; - -@@ -87,32 +93,32 @@ - decoder->is_hls = FALSE; - } - --gboolean basedecoder_open_decoder(BaseDecoder *decoder, enum CodecID id) -+gboolean basedecoder_open_decoder(BaseDecoder *decoder, CodecIDType id) - { - gboolean result = TRUE; - -+#if NEW_ALLOC_FRAME -+ decoder->frame = av_frame_alloc(); -+#else -+ decoder->frame = avcodec_alloc_frame(); -+#endif -+ if (!decoder->frame) -+ return FALSE; // Can't create frame -+ - g_static_mutex_lock(&avlib_lock); - - decoder->codec = avcodec_find_decoder(id); - result = (decoder->codec != NULL); - if (result) - { --#if LIBAVCODEC_NEW - decoder->context = avcodec_alloc_context3(decoder->codec); --#else -- decoder->context = avcodec_alloc_context(); --#endif - result = (decoder->context != NULL); - - if (result) - { - basedecoder_init_context(decoder); - --#if LIBAVCODEC_NEW - int ret = avcodec_open2(decoder->context, decoder->codec, NULL); --#else -- int ret = avcodec_open(decoder->context, decoder->codec); --#endif - if (ret < 0) // Can't open codec - { - av_free(decoder->context); -@@ -160,10 +166,7 @@ - void basedecoder_flush(BaseDecoder *decoder) - { - if (decoder->context) -- { - avcodec_flush_buffers(decoder->context); -- avcodec_default_free_buffers(decoder->context); -- } - } - - void basedecoder_close_decoder(BaseDecoder *decoder) -@@ -180,4 +183,14 @@ - g_free(decoder->codec_data); - decoder->codec_data = NULL; - } -+ -+ if (decoder->frame) -+ { -+#if NEW_ALLOC_FRAME -+ av_frame_free(&decoder->frame); -+#else -+ av_free(decoder->frame); -+ decoder->frame = NULL; -+#endif -+ } - } ---- a/modules/media/src/main/native/gstreamer/plugins/av/decoder.h -+++ b/modules/media/src/main/native/gstreamer/plugins/av/decoder.h -@@ -59,6 +59,8 @@ - guint8 *codec_data; // codec-specific data - gint codec_data_size; // number of bytes of codec-specific data - -+ AVFrame *frame; -+ - AVCodec *codec; // the libavcodec decoder reference - AVCodecContext *context; // the libavcodec context - }; -@@ -74,7 +76,7 @@ - - void basedecoder_init_state(BaseDecoder *decoder); - --gboolean basedecoder_open_decoder(BaseDecoder *decoder, enum CodecID id); -+gboolean basedecoder_open_decoder(BaseDecoder *decoder, CodecIDType id); - - void basedecoder_set_codec_data(BaseDecoder *decoder, GstStructure *s); - ---- a/modules/media/src/main/native/gstreamer/plugins/av/mpegtsdemuxer.c -+++ b/modules/media/src/main/native/gstreamer/plugins/av/mpegtsdemuxer.c -@@ -49,7 +49,7 @@ - GstClockTime offset_time; - - int stream_index; -- enum CodecID codec_id; -+ CodecIDType codec_id; - } Stream; - - typedef enum -@@ -533,16 +533,16 @@ - { - switch (demuxer->context->streams[i]->codec->codec_type) - { --#if LIBAVCODEC_NEW - case AVMEDIA_TYPE_VIDEO: --#else -- case CODEC_TYPE_VIDEO: --#endif // LIBAVCODEC_NEW - - if (demuxer->video.stream_index < 0) - { - AVStream *stream = demuxer->context->streams[i]; -+#if NEW_CODEC_ID -+ if (stream->codec->codec_id == AV_CODEC_ID_H264) -+#else - if (stream->codec->codec_id == CODEC_ID_H264) -+#endif - { - demuxer->video.stream_index = i; - demuxer->video.codec_id = stream->codec->codec_id; -@@ -565,15 +565,15 @@ - } - break; - --#if LIBAVCODEC_NEW - case AVMEDIA_TYPE_AUDIO: --#else -- case CODEC_TYPE_AUDIO: --#endif // LIBAVCODEC_NEW - if (demuxer->audio.stream_index < 0) - { - AVStream *stream = demuxer->context->streams[i]; -+#if NEW_CODEC_ID -+ if (stream->codec->codec_id == AV_CODEC_ID_AAC) -+#else - if (stream->codec->codec_id == CODEC_ID_AAC) -+#endif - { - demuxer->audio.stream_index = i; - demuxer->audio.codec_id = stream->codec->codec_id; -@@ -875,20 +875,6 @@ - result = PA_STOP; - break; - --#if !LIBAVCODEC_NEW -- case AVERROR_IO: // Workaround for older version. It returns AVERROR_IO at the end. --#ifdef DEBUG_OUTPUT -- g_print("MpegTS process: AVERROR_IO %s\n", demuxer->is_eos ? "generating EOS" : "send error"); --#endif -- if (demuxer->is_eos) -- mpegts_demuxer_push_to_sources(demuxer, gst_event_new_eos()); -- else -- post_error(demuxer, "LibAV stream parse error", ret, GST_STREAM_ERROR_DEMUX); -- -- result = PA_STOP; -- break; --#endif //!LIBAVCODEC_NEW -- - default: - post_error(demuxer, "LibAV stream parse error", ret, GST_STREAM_ERROR_DEMUX); - result = PA_STOP; -@@ -938,7 +924,6 @@ - return NULL; - } - --#if LIBAVCODEC_NEW - AVIOContext *io_context = avio_alloc_context(io_buffer, // buffer - BUFFER_SIZE, // buffer size - 0, // read only -@@ -946,15 +931,6 @@ - mpegts_demuxer_read_packet, // read callback - NULL, // write callback - mpegts_demuxer_seek); // seek callback --#else -- ByteIOContext *io_context = av_alloc_put_byte(io_buffer, // buffer -- BUFFER_SIZE, // buffer size -- 0, // read only -- demuxer, // opaque reference -- mpegts_demuxer_read_packet, // read callback -- NULL, // write callback -- mpegts_demuxer_seek); // seek callback --#endif // LIBAVCODEC_NEW - - if (!io_context) - { -@@ -970,20 +946,12 @@ - - AVInputFormat* iformat = av_find_input_format("mpegts"); - --#if LIBAVCODEC_NEW - action = get_init_action(demuxer, avformat_open_input(&demuxer->context, "", iformat, NULL)); --#else -- action = get_init_action(demuxer, av_open_input_stream(&demuxer->context, io_context, "", iformat, NULL)); --#endif - - if (action != PA_READ_FRAME) - break; - --#if LIBAVCODEC_NEW - action = get_init_action(demuxer, avformat_find_stream_info(demuxer->context, NULL)); --#else -- action = get_init_action(demuxer, av_find_stream_info(demuxer->context)); --#endif - - g_mutex_lock(demuxer->lock); - gint available = gst_adapter_available(demuxer->sink_adapter); -@@ -1013,11 +981,7 @@ - { - av_free(demuxer->context->pb->buffer); - av_free(demuxer->context->pb); --#if LIBAVCODEC_NEW - avformat_free_context(demuxer->context); --#else -- av_free(demuxer->context); --#endif - demuxer->context = NULL; - } - break; -@@ -1078,14 +1042,7 @@ - } - } - else -- { --#if LIBAVCODEC_NEW - result = AVERROR_EXIT; --#else -- result = AVERROR_IO; --#endif // LIBAVCODEC_NEW -- -- } - - g_mutex_unlock(demuxer->lock); - -@@ -1268,11 +1225,7 @@ - { - av_free(demuxer->context->pb->buffer); - av_free(demuxer->context->pb); --#if LIBAVCODEC_NEW - avformat_free_context(demuxer->context); --#else -- av_free(demuxer->context); --#endif - demuxer->context = NULL; - } - ---- a/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.c -+++ b/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.c -@@ -117,7 +117,7 @@ - - gst_element_class_set_details_simple(element_class, - "Videodecoder", -- "Codec/Decoder/Video", -+ "Codec/Decoder/Video", - "Decode video stream", - "Oracle Corporation"); - -@@ -135,7 +135,6 @@ - static GstFlowReturn videodecoder_chain(GstPad *pad, GstBuffer *buf); - - static void videodecoder_init_state(VideoDecoder *decoder); --static void videodecoder_close_decoder(VideoDecoder *decoder); - static void videodecoder_state_reset(VideoDecoder *decoder); - - static void videodecoder_class_init(VideoDecoderClass *klass) -@@ -189,7 +188,7 @@ - switch (transition) - { - case GST_STATE_CHANGE_PAUSED_TO_READY: -- videodecoder_close_decoder(decoder); -+ basedecoder_close_decoder(BASEDECODER(decoder)); - break; - default: - break; -@@ -249,8 +248,6 @@ - ***********************************************************************************/ - static void videodecoder_init_state(VideoDecoder *decoder) - { -- decoder->yuv_frame = NULL; -- - decoder->width = decoder->height = 0; - decoder->u_offset = 0; - decoder->v_offset = 0; -@@ -258,47 +255,9 @@ - decoder->frame_size = 0; - decoder->discont = FALSE; - --#if ! LIBAVCODEC_NEW -- decoder->packet = NULL; -- decoder->packet_size = 0; --#endif // LIBAVCODEC_NEW -- - basedecoder_init_state(BASEDECODER(decoder)); - } - --static gboolean videodecoder_open_decoder(VideoDecoder *decoder) --{ -- if (!basedecoder_open_decoder(BASEDECODER(decoder), CODEC_ID_H264)) -- return FALSE; -- -- decoder->yuv_frame = avcodec_alloc_frame(); -- if (!decoder->yuv_frame) -- return FALSE; // Can't create frame -- -- return TRUE; --} -- --static void videodecoder_close_decoder(VideoDecoder *decoder) --{ -- if (decoder->yuv_frame) -- { -- av_free(decoder->yuv_frame); -- decoder->yuv_frame = NULL; -- } -- --#if ! LIBAVCODEC_NEW -- if (decoder->packet) -- { -- av_free(decoder->packet); -- -- decoder->packet = NULL; -- decoder->packet_size = 0; -- } --#endif -- -- basedecoder_close_decoder(BASEDECODER(decoder)); --} -- - static gboolean videodecoder_configure(VideoDecoder *decoder, GstCaps *sink_caps) - { - BaseDecoder *base = BASEDECODER(decoder); -@@ -311,7 +270,11 @@ - // Pass stencil context to init against if there is one. - basedecoder_set_codec_data(base, s); - -- base->is_initialized = videodecoder_open_decoder(decoder); -+#if NEW_CODEC_ID -+ base->is_initialized = basedecoder_open_decoder(BASEDECODER(decoder), AV_CODEC_ID_H264); -+#else -+ base->is_initialized = basedecoder_open_decoder(BASEDECODER(decoder), CODEC_ID_H264); -+#endif - return base->is_initialized; - } - -@@ -334,19 +297,19 @@ - - decoder->discont = (GST_PAD_CAPS(base->srcpad) != NULL); - -- decoder->u_offset = decoder->yuv_frame->linesize[0] * decoder->height; -- decoder->uv_blocksize = decoder->yuv_frame->linesize[1] * decoder->height / 2; -+ decoder->u_offset = base->frame->linesize[0] * decoder->height; -+ decoder->uv_blocksize = base->frame->linesize[1] * decoder->height / 2; - - decoder->v_offset = decoder->u_offset + decoder->uv_blocksize; -- decoder->frame_size = (decoder->yuv_frame->linesize[0] + decoder->yuv_frame->linesize[1]) * decoder->height; -+ decoder->frame_size = (base->frame->linesize[0] + base->frame->linesize[1]) * decoder->height; - - GstCaps *src_caps = gst_caps_new_simple("video/x-raw-yuv", - "format", GST_TYPE_FOURCC, GST_STR_FOURCC("YV12"), - "width", G_TYPE_INT, decoder->width, - "height", G_TYPE_INT, decoder->height, -- "stride-y", G_TYPE_INT, decoder->yuv_frame->linesize[0], -- "stride-u", G_TYPE_INT, decoder->yuv_frame->linesize[1], -- "stride-v", G_TYPE_INT, decoder->yuv_frame->linesize[2], -+ "stride-y", G_TYPE_INT, base->frame->linesize[0], -+ "stride-u", G_TYPE_INT, base->frame->linesize[1], -+ "stride-v", G_TYPE_INT, base->frame->linesize[2], - "offset-y", G_TYPE_INT, 0, - "offset-u", G_TYPE_INT, decoder->u_offset, - "offset-v", G_TYPE_INT, decoder->v_offset, -@@ -389,7 +352,6 @@ - goto _exit; - } - --#if LIBAVCODEC_NEW - if (!base->is_hls) - { - if (av_new_packet(&decoder->packet, GST_BUFFER_SIZE(buf)) == 0) -@@ -399,7 +361,7 @@ - base->context->reordered_opaque = GST_BUFFER_TIMESTAMP(buf); - else - base->context->reordered_opaque = AV_NOPTS_VALUE; -- num_dec = avcodec_decode_video2(base->context, decoder->yuv_frame, &decoder->frame_finished, &decoder->packet); -+ num_dec = avcodec_decode_video2(base->context, base->frame, &decoder->frame_finished, &decoder->packet); - av_free_packet(&decoder->packet); - } - else -@@ -418,43 +380,8 @@ - else - base->context->reordered_opaque = AV_NOPTS_VALUE; - -- num_dec = avcodec_decode_video2(base->context, decoder->yuv_frame, &decoder->frame_finished, &decoder->packet); -- } -- --#else // ! LIBAVCODEC_NEW -- if (!base->is_hls) -- { -- if (decoder->packet_size < GST_BUFFER_SIZE(buf)) -- { -- decoder->packet = av_realloc(decoder->packet, GST_BUFFER_SIZE(buf)); -- decoder->packet_size = decoder->packet ? GST_BUFFER_SIZE(buf) : 0; -- } -- -- if (decoder->packet) -- { -- memcpy(decoder->packet, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf)); -- if (GST_BUFFER_TIMESTAMP_IS_VALID(buf)) -- base->context->reordered_opaque = GST_BUFFER_TIMESTAMP(buf); -- else -- base->context->reordered_opaque = AV_NOPTS_VALUE; -- num_dec = avcodec_decode_video(base->context, decoder->yuv_frame, &decoder->frame_finished, decoder->packet, GST_BUFFER_SIZE(buf)); -- } -- else -- { -- result = GST_FLOW_ERROR; -- goto _exit; -- } -+ num_dec = avcodec_decode_video2(base->context, base->frame, &decoder->frame_finished, &decoder->packet); - } -- else -- { -- if (GST_BUFFER_TIMESTAMP_IS_VALID(buf)) -- base->context->reordered_opaque = GST_BUFFER_TIMESTAMP(buf); -- else -- base->context->reordered_opaque = AV_NOPTS_VALUE; -- num_dec = avcodec_decode_video(base->context, decoder->yuv_frame, &decoder->frame_finished, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf)); -- } -- --#endif // LIBAVCODEC_NEW - - if (num_dec < 0) - { -@@ -486,17 +413,17 @@ - } - else - { -- if (decoder->yuv_frame->reordered_opaque != AV_NOPTS_VALUE) -+ if (base->frame->reordered_opaque != AV_NOPTS_VALUE) - { -- GST_BUFFER_TIMESTAMP(outbuf) = decoder->yuv_frame->reordered_opaque; -+ GST_BUFFER_TIMESTAMP(outbuf) = base->frame->reordered_opaque; - GST_BUFFER_DURATION(outbuf) = GST_BUFFER_DURATION(buf); // Duration for video usually same - } - GST_BUFFER_SIZE(outbuf) = decoder->frame_size; - - // Copy image by parts from different arrays. -- memcpy(GST_BUFFER_DATA(outbuf), decoder->yuv_frame->data[0], decoder->u_offset); -- memcpy(GST_BUFFER_DATA(outbuf) + decoder->u_offset, decoder->yuv_frame->data[1], decoder->uv_blocksize); -- memcpy(GST_BUFFER_DATA(outbuf) + decoder->v_offset, decoder->yuv_frame->data[2], decoder->uv_blocksize); -+ memcpy(GST_BUFFER_DATA(outbuf), base->frame->data[0], decoder->u_offset); -+ memcpy(GST_BUFFER_DATA(outbuf) + decoder->u_offset, base->frame->data[1], decoder->uv_blocksize); -+ memcpy(GST_BUFFER_DATA(outbuf) + decoder->v_offset, base->frame->data[2], decoder->uv_blocksize); - - GST_BUFFER_OFFSET_END(outbuf) = GST_BUFFER_OFFSET_NONE; - ---- a/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.h -+++ b/modules/media/src/main/native/gstreamer/plugins/av/videodecoder.h -@@ -58,14 +58,8 @@ - int u_offset; - int v_offset; - int uv_blocksize; -- AVFrame *yuv_frame; - --#if LIBAVCODEC_NEW - AVPacket packet; --#else // ! LIBAVCODEC_NEW -- uint8_t *packet; -- int packet_size; --#endif // LIBAVCODEC_NEW - }; - - struct _VideoDecoderClass ---- /dev/null -+++ b/modules/media/src/main/native/gstreamer/plugins/av/avdefines.h -@@ -0,0 +1,40 @@ -+/* -+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+#ifndef AVDEFINES_H -+#define AVDEFINES_H -+ -+// According to ffmpeg Git they introduced -+// _decode_audio4 in version 53.25.0 -+#define DECODE_AUDIO4 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0)) -+ -+// New AVCodecID was introduced in 54.25.0 -+#define NEW_CODEC_ID (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0)) -+ -+// New Frame alloc functions were introduced in 55.28.0 -+#define NEW_ALLOC_FRAME (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,0)) -+ -+#endif /* AVDEFINES_H */ -+ diff --git a/debian/patches/06-disable-architecture-verification.patch b/debian/patches/06-disable-architecture-verification.patch index ca26b63..d76fd64 100644 --- a/debian/patches/06-disable-architecture-verification.patch +++ b/debian/patches/06-disable-architecture-verification.patch @@ -3,7 +3,7 @@ Author: Emmanuel Bourg <[email protected]> Forwarded: no --- a/build.gradle +++ b/build.gradle -@@ -661,6 +661,7 @@ +@@ -693,6 +693,7 @@ // at present building on PI is not supported, but we would only need to make // some changes on assumptions on what should be built (like SWT / Swing) and // such and we could probably make it work. @@ -11,7 +11,7 @@ Forwarded: no if (!IS_MAC && !IS_WINDOWS && !IS_LINUX) logger.error("Unsupported build OS ${OS_NAME}") if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64") { throw new Exception("Unknown and unsupported build architecture: $OS_ARCH") -@@ -669,6 +670,7 @@ +@@ -701,6 +702,7 @@ } else if (IS_LINUX && OS_ARCH != "i386" && OS_ARCH != "amd64") { throw new Exception("Unknown and unsupported build architecture: $OS_ARCH") } diff --git a/debian/patches/08-disable-sse2.patch b/debian/patches/08-disable-sse2.patch index 2597a67..ef6a208 100644 --- a/debian/patches/08-disable-sse2.patch +++ b/debian/patches/08-disable-sse2.patch @@ -3,7 +3,7 @@ Author: Emmanuel Bourg <[email protected]> Forwarded: no --- a/modules/media/src/main/native/gstreamer/projects/linux/avplugin/Makefile +++ b/modules/media/src/main/native/gstreamer/projects/linux/avplugin/Makefile -@@ -14,7 +14,6 @@ +@@ -19,7 +19,6 @@ CFLAGS = -fPIC \ -Werror=implicit-function-declaration \ @@ -11,7 +11,7 @@ Forwarded: no -fbuiltin \ -DHAVE_STDINT_H \ -DLINUX \ -@@ -27,6 +26,11 @@ +@@ -32,6 +31,11 @@ CFLAGS += -g -Wall endif diff --git a/debian/patches/series b/debian/patches/series index 7df81a9..c34dc84 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,7 +1,6 @@ 01-skip-verify-java.patch 02-use-system-libraries.patch 03-buildflags.patch -04-libav-compatibility.patch 05-set-antlr-timeout.patch 06-disable-architecture-verification.patch 07-disable-assembler-on-unsupported-archs.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/openjfx.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

