+
+#include "attributes.h"
+#include "version.h"
+#include "libavutil/avconfig.h"
+
+#if AV_HAVE_BIGENDIAN
+# define AV_NE(be, le) (be)
+#else
+# define AV_NE(be, le) (le)
+#endif
+
+//rounded division & shift
+#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
+/* assume b>0 */
+#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
+#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
+#define FFSIGN(a) ((a) > 0 ? 1 : -1)
+
+#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
+#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
+#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
+
+#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
+#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
+
+/* misc math functions */
+
+#if FF_API_AV_REVERSE
+extern attribute_deprecated const uint8_t av_reverse[256];
+#endif
+
+#ifdef HAVE_AV_CONFIG_H
+# include "config.h"
+# include "intmath.h"
+#endif
+
+/* Pull in unguarded fallback defines at the end of this file. */
+#include "common.h"
+
+#ifndef av_log2
+av_const int av_log2(unsigned v);
+#endif
+
+#ifndef av_log2_16bit
+av_const int av_log2_16bit(unsigned v);
+#endif
+
+/**
+ * Clip a signed integer value into the amin-amax range.
+ * @param a value to clip
+ * @param amin minimum value of the clip range
+ * @param amax maximum value of the clip range
+ * @return clipped value
+ */
+static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
+{
+ if (a < amin) return amin;
+ else if (a > amax) return amax;
+ else return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-255 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
+{
+ if (a&(~0xFF)) return (-a)>>31;
+ else return a;
+}
+
+/**
+ * Clip a signed integer value into the -128,127 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int8_t av_clip_int8_c(int a)
+{
+ if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
+ else return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-65535 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
+{
+ if (a&(~0xFFFF)) return (-a)>>31;
+ else return a;
+}
+
+/**
+ * Clip a signed integer value into the -32768,32767 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int16_t av_clip_int16_c(int a)
+{
+ if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
+ else return a;
+}
+
+/**
+ * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
+{
+ if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
+ else return a;
+}
+
+/**
+ * Clip a signed integer to an unsigned power of two range.
+ * @param a value to clip
+ * @param p bit position to clip at
+ * @return clipped value
+ */
+static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
+{
+ if (a & ~((1<> 31 & ((1<
amax) return amax;
+ else return a;
+}
+
+/** Compute ceil(log2(x)).
+ * @param x value used to compute ceil(log2(x))
+ * @return computed ceiling of log2(x)
+ */
+static av_always_inline av_const int av_ceil_log2_c(int x)
+{
+ return av_log2((x - 1) << 1);
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount_c(uint32_t x)
+{
+ x -= (x >> 1) & 0x55555555;
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0F0F0F0F;
+ x += x >> 8;
+ return (x + (x >> 16)) & 0x3F;
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount64_c(uint64_t x)
+{
+ return av_popcount(x) + av_popcount(x >> 32);
+}
+
+#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
+#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
+
+/**
+ * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val Output value, must be an lvalue of type uint32_t.
+ * @param GET_BYTE Expression reading one byte from the input.
+ * Evaluated up to 7 times (4 for the currently
+ * assigned Unicode range). With a memory buffer
+ * input, this could be *ptr++.
+ * @param ERROR Expression to be evaluated on invalid input,
+ * typically a goto statement.
+ */
+#define GET_UTF8(val, GET_BYTE, ERROR)\
+ val= GET_BYTE;\
+ {\
+ uint32_t top = (val & 128) >> 1;\
+ if ((val & 0xc0) == 0x80)\
+ ERROR\
+ while (val & top) {\
+ int tmp= GET_BYTE - 128;\
+ if(tmp>>6)\
+ ERROR\
+ val= (val<<6) + tmp;\
+ top <<= 5;\
+ }\
+ val &= (top << 1) - 1;\
+ }
+
+/**
+ * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val Output value, must be an lvalue of type uint32_t.
+ * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
+ * to native byte order. Evaluated one or two times.
+ * @param ERROR Expression to be evaluated on invalid input,
+ * typically a goto statement.
+ */
+#define GET_UTF16(val, GET_16BIT, ERROR)\
+ val = GET_16BIT;\
+ {\
+ unsigned int hi = val - 0xD800;\
+ if (hi < 0x800) {\
+ val = GET_16BIT - 0xDC00;\
+ if (val > 0x3FFU || hi > 0x3FFU)\
+ ERROR\
+ val += (hi<<10) + 0x10000;\
+ }\
+ }\
+
+/**
+ * @def PUT_UTF8(val, tmp, PUT_BYTE)
+ * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint8_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_BYTE.
+ * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
+ * It could be a function or a statement, and uses tmp as the input byte.
+ * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
+ * executed up to 4 times for values in the valid UTF-8 range and up to
+ * 7 times in the general case, depending on the length of the converted
+ * Unicode character.
+ */
+#define PUT_UTF8(val, tmp, PUT_BYTE)\
+ {\
+ int bytes, shift;\
+ uint32_t in = val;\
+ if (in < 0x80) {\
+ tmp = in;\
+ PUT_BYTE\
+ } else {\
+ bytes = (av_log2(in) + 4) / 5;\
+ shift = (bytes - 1) * 6;\
+ tmp = (256 - (256 >> bytes)) | (in >> shift);\
+ PUT_BYTE\
+ while (shift >= 6) {\
+ shift -= 6;\
+ tmp = 0x80 | ((in >> shift) & 0x3f);\
+ PUT_BYTE\
+ }\
+ }\
+ }
+
+/**
+ * @def PUT_UTF16(val, tmp, PUT_16BIT)
+ * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint16_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_16BIT.
+ * @param PUT_16BIT writes the converted UTF-16 data to any proper destination
+ * in desired endianness. It could be a function or a statement, and uses tmp
+ * as the input byte. For example, PUT_BYTE could be "*output++ = tmp;"
+ * PUT_BYTE will be executed 1 or 2 times depending on input character.
+ */
+#define PUT_UTF16(val, tmp, PUT_16BIT)\
+ {\
+ uint32_t in = val;\
+ if (in < 0x10000) {\
+ tmp = in;\
+ PUT_16BIT\
+ } else {\
+ tmp = 0xD800 | ((in - 0x10000) >> 10);\
+ PUT_16BIT\
+ tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
+ PUT_16BIT\
+ }\
+ }\
+
+
+
+#include "mem.h"
+
+#ifdef HAVE_AV_CONFIG_H
+# include "internal.h"
+#endif /* HAVE_AV_CONFIG_H */
+
+#endif /* AVUTIL_COMMON_H */
+
+/*
+ * The following definitions are outside the multiple inclusion guard
+ * to ensure they are immediately available in intmath.h.
+ */
+
+#ifndef av_ceil_log2
+# define av_ceil_log2 av_ceil_log2_c
+#endif
+#ifndef av_clip
+# define av_clip av_clip_c
+#endif
+#ifndef av_clip_uint8
+# define av_clip_uint8 av_clip_uint8_c
+#endif
+#ifndef av_clip_int8
+# define av_clip_int8 av_clip_int8_c
+#endif
+#ifndef av_clip_uint16
+# define av_clip_uint16 av_clip_uint16_c
+#endif
+#ifndef av_clip_int16
+# define av_clip_int16 av_clip_int16_c
+#endif
+#ifndef av_clipl_int32
+# define av_clipl_int32 av_clipl_int32_c
+#endif
+#ifndef av_clip_uintp2
+# define av_clip_uintp2 av_clip_uintp2_c
+#endif
+#ifndef av_sat_add32
+# define av_sat_add32 av_sat_add32_c
+#endif
+#ifndef av_sat_dadd32
+# define av_sat_dadd32 av_sat_dadd32_c
+#endif
+#ifndef av_clipf
+# define av_clipf av_clipf_c
+#endif
+#ifndef av_popcount
+# define av_popcount av_popcount_c
+#endif
+#ifndef av_popcount64
+# define av_popcount64 av_popcount64_c
+#endif
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h
new file mode 100644
index 000000000..8f2af2854
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CPU_H
+#define AVUTIL_CPU_H
+
+#include "version.h"
+
+#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
+
+ /* lower 16 bits - CPU features */
+#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
+#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
+#if FF_API_CPU_FLAG_MMX2
+#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
+#endif
+#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW
+#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions
+#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions
+#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
+#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt
+#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions
+#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
+#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions
+#define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower
+#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions
+#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions
+#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
+#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions
+#define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions
+#define AV_CPU_FLAG_CMOV 0x1000 ///< i686 cmov
+
+#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
+
+#define AV_CPU_FLAG_ARMV5TE (1 << 0)
+#define AV_CPU_FLAG_ARMV6 (1 << 1)
+#define AV_CPU_FLAG_ARMV6T2 (1 << 2)
+#define AV_CPU_FLAG_VFP (1 << 3)
+#define AV_CPU_FLAG_VFPV3 (1 << 4)
+#define AV_CPU_FLAG_NEON (1 << 5)
+
+/**
+ * Return the flags which specify extensions supported by the CPU.
+ */
+int av_get_cpu_flags(void);
+
+/**
+ * Set a mask on flags returned by av_get_cpu_flags().
+ * This function is mainly useful for testing.
+ *
+ * @warning this function is not thread safe.
+ */
+void av_set_cpu_flags_mask(int mask);
+
+/**
+ * Parse CPU flags from a string.
+ *
+ * @return a combination of AV_CPU_* flags, negative on error.
+ */
+int av_parse_cpu_flags(const char *s);
+
+/**
+ * @return the number of logical CPU cores present.
+ */
+int av_cpu_count(void);
+
+#endif /* AVUTIL_CPU_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h
new file mode 100644
index 000000000..0540619d2
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h
@@ -0,0 +1,74 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CRC_H
+#define AVUTIL_CRC_H
+
+#include
+#include
+#include "attributes.h"
+
+typedef uint32_t AVCRC;
+
+typedef enum {
+ AV_CRC_8_ATM,
+ AV_CRC_16_ANSI,
+ AV_CRC_16_CCITT,
+ AV_CRC_32_IEEE,
+ AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
+ AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
+}AVCRCId;
+
+/**
+ * Initialize a CRC table.
+ * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
+ * @param le If 1, the lowest bit represents the coefficient for the highest
+ * exponent of the corresponding polynomial (both for poly and
+ * actual CRC).
+ * If 0, you must swap the CRC parameter and the result of av_crc
+ * if you need the standard representation (can be simplified in
+ * most cases to e.g. bswap16):
+ * av_bswap32(crc << (32-bits))
+ * @param bits number of bits for the CRC
+ * @param poly generator polynomial without the x**bits coefficient, in the
+ * representation as specified by le
+ * @param ctx_size size of ctx in bytes
+ * @return <0 on failure
+ */
+int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
+
+/**
+ * Get an initialized standard CRC table.
+ * @param crc_id ID of a standard CRC
+ * @return a pointer to the CRC table or NULL on failure
+ */
+const AVCRC *av_crc_get_table(AVCRCId crc_id);
+
+/**
+ * Calculate the CRC of a block.
+ * @param crc CRC of previous blocks if any or initial value for CRC
+ * @return CRC updated with the data from the given block
+ *
+ * @see av_crc_init() "le" parameter
+ */
+uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
+ const uint8_t *buffer, size_t length) av_pure;
+
+#endif /* AVUTIL_CRC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h
new file mode 100644
index 000000000..ab23f26e6
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h
@@ -0,0 +1,146 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Public dictionary API.
+ */
+
+#ifndef AVUTIL_DICT_H
+#define AVUTIL_DICT_H
+
+/**
+ * @addtogroup lavu_dict AVDictionary
+ * @ingroup lavu_data
+ *
+ * @brief Simple key:value store
+ *
+ * @{
+ * Dictionaries are used for storing key:value pairs. To create
+ * an AVDictionary, simply pass an address of a NULL pointer to
+ * av_dict_set(). NULL can be used as an empty dictionary wherever
+ * a pointer to an AVDictionary is required.
+ * Use av_dict_get() to retrieve an entry or iterate over all
+ * entries and finally av_dict_free() to free the dictionary
+ * and all its contents.
+ *
+ * @code
+ * AVDictionary *d = NULL; // "create" an empty dictionary
+ * av_dict_set(&d, "foo", "bar", 0); // add an entry
+ *
+ * char *k = av_strdup("key"); // if your strings are already allocated,
+ * char *v = av_strdup("value"); // you can avoid copying them like this
+ * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
+ *
+ * AVDictionaryEntry *t = NULL;
+ * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
+ * <....> // iterate over all entries in d
+ * }
+ *
+ * av_dict_free(&d);
+ * @endcode
+ *
+ */
+
+#define AV_DICT_MATCH_CASE 1
+#define AV_DICT_IGNORE_SUFFIX 2
+#define AV_DICT_DONT_STRDUP_KEY 4 /**< Take ownership of a key that's been
+ allocated with av_malloc() and children. */
+#define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been
+ allocated with av_malloc() and chilren. */
+#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries.
+#define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no
+ delimiter is added, the strings are simply concatenated. */
+
+typedef struct AVDictionaryEntry {
+ char *key;
+ char *value;
+} AVDictionaryEntry;
+
+typedef struct AVDictionary AVDictionary;
+
+/**
+ * Get a dictionary entry with matching key.
+ *
+ * @param prev Set to the previous matching element to find the next.
+ * If set to NULL the first matching element is returned.
+ * @param flags Allows case as well as suffix-insensitive comparisons.
+ * @return Found entry or NULL, changing key or value leads to undefined behavior.
+ */
+AVDictionaryEntry *
+av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
+
+/**
+ * Get number of entries in dictionary.
+ *
+ * @param m dictionary
+ * @return number of entries in dictionary
+ */
+int av_dict_count(const AVDictionary *m);
+
+/**
+ * Set the given entry in *pm, overwriting an existing entry.
+ *
+ * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
+ * a dictionary struct is allocated and put in *pm.
+ * @param key entry key to add to *pm (will be av_strduped depending on flags)
+ * @param value entry value to add to *pm (will be av_strduped depending on flags).
+ * Passing a NULL value will cause an existing entry to be deleted.
+ * @return >= 0 on success otherwise an error code <0
+ */
+int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
+
+/**
+ * Parse the key/value pairs list and add to a dictionary.
+ *
+ * @param key_val_sep a 0-terminated list of characters used to separate
+ * key from value
+ * @param pairs_sep a 0-terminated list of characters used to separate
+ * two pairs from each other
+ * @param flags flags to use when adding to dictionary.
+ * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL
+ * are ignored since the key/value tokens will always
+ * be duplicated.
+ * @return 0 on success, negative AVERROR code on failure
+ */
+int av_dict_parse_string(AVDictionary **pm, const char *str,
+ const char *key_val_sep, const char *pairs_sep,
+ int flags);
+
+/**
+ * Copy entries from one AVDictionary struct into another.
+ * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ * this function will allocate a struct for you and put it in *dst
+ * @param src pointer to source AVDictionary struct
+ * @param flags flags to use when setting entries in *dst
+ * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+ */
+void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
+
+/**
+ * Free all the memory allocated for an AVDictionary struct
+ * and all keys and values.
+ */
+void av_dict_free(AVDictionary **m);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_DICT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h
new file mode 100644
index 000000000..3dfd8807f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h
@@ -0,0 +1,83 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * error code definitions
+ */
+
+#ifndef AVUTIL_ERROR_H
+#define AVUTIL_ERROR_H
+
+#include
+#include
+#include "avutil.h"
+
+/**
+ * @addtogroup lavu_error
+ *
+ * @{
+ */
+
+
+/* error handling */
+#if EDOM > 0
+#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions.
+#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
+#else
+/* Some platforms have E* and errno already negated. */
+#define AVERROR(e) (e)
+#define AVUNERROR(e) (e)
+#endif
+
+#define AVERROR_BSF_NOT_FOUND (-0x39acbd08) ///< Bitstream filter not found
+#define AVERROR_DECODER_NOT_FOUND (-0x3cbabb08) ///< Decoder not found
+#define AVERROR_DEMUXER_NOT_FOUND (-0x32babb08) ///< Demuxer not found
+#define AVERROR_ENCODER_NOT_FOUND (-0x3cb1ba08) ///< Encoder not found
+#define AVERROR_EOF (-0x5fb9b0bb) ///< End of file
+#define AVERROR_EXIT (-0x2bb6a7bb) ///< Immediate exit was requested; the called function should not be restarted
+#define AVERROR_FILTER_NOT_FOUND (-0x33b6b908) ///< Filter not found
+#define AVERROR_INVALIDDATA (-0x3ebbb1b7) ///< Invalid data found when processing input
+#define AVERROR_MUXER_NOT_FOUND (-0x27aab208) ///< Muxer not found
+#define AVERROR_OPTION_NOT_FOUND (-0x2bafb008) ///< Option not found
+#define AVERROR_PATCHWELCOME (-0x3aa8beb0) ///< Not yet implemented in Libav, patches welcome
+#define AVERROR_PROTOCOL_NOT_FOUND (-0x30adaf08) ///< Protocol not found
+#define AVERROR_STREAM_NOT_FOUND (-0x2dabac08) ///< Stream not found
+#define AVERROR_BUG (-0x5fb8aabe) ///< Bug detected, please report the issue
+#define AVERROR_UNKNOWN (-0x31b4b1ab) ///< Unknown error, typically from an external library
+#define AVERROR_EXPERIMENTAL (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
+
+/**
+ * Put a description of the AVERROR code errnum in errbuf.
+ * In case of failure the global variable errno is set to indicate the
+ * error. Even in case of failure av_strerror() will print a generic
+ * error message indicating the errnum provided to errbuf.
+ *
+ * @param errnum error code to describe
+ * @param errbuf buffer to which description is written
+ * @param errbuf_size the size in bytes of errbuf
+ * @return 0 on success, a negative value if a description for errnum
+ * cannot be found
+ */
+int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_ERROR_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h
new file mode 100644
index 000000000..ccb29e7a3
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2002 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * simple arithmetic expression evaluator
+ */
+
+#ifndef AVUTIL_EVAL_H
+#define AVUTIL_EVAL_H
+
+#include "avutil.h"
+
+typedef struct AVExpr AVExpr;
+
+/**
+ * Parse and evaluate an expression.
+ * Note, this is significantly slower than av_expr_eval().
+ *
+ * @param res a pointer to a double where is put the result value of
+ * the expression, or NAN in case of error
+ * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
+ * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
+ * @param const_values a zero terminated array of values for the identifiers from const_names
+ * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
+ * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
+ * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
+ * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
+ * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
+ * @param log_ctx parent logging context
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_expr_parse_and_eval(double *res, const char *s,
+ const char * const *const_names, const double *const_values,
+ const char * const *func1_names, double (* const *funcs1)(void *, double),
+ const char * const *func2_names, double (* const *funcs2)(void *, double, double),
+ void *opaque, int log_offset, void *log_ctx);
+
+/**
+ * Parse an expression.
+ *
+ * @param expr a pointer where is put an AVExpr containing the parsed
+ * value in case of successful parsing, or NULL otherwise.
+ * The pointed to AVExpr must be freed with av_expr_free() by the user
+ * when it is not needed anymore.
+ * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
+ * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
+ * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
+ * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
+ * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
+ * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
+ * @param log_ctx parent logging context
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_expr_parse(AVExpr **expr, const char *s,
+ const char * const *const_names,
+ const char * const *func1_names, double (* const *funcs1)(void *, double),
+ const char * const *func2_names, double (* const *funcs2)(void *, double, double),
+ int log_offset, void *log_ctx);
+
+/**
+ * Evaluate a previously parsed expression.
+ *
+ * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
+ * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
+ * @return the value of the expression
+ */
+double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
+
+/**
+ * Free a parsed expression previously created with av_expr_parse().
+ */
+void av_expr_free(AVExpr *e);
+
+/**
+ * Parse the string in numstr and return its value as a double. If
+ * the string is empty, contains only whitespaces, or does not contain
+ * an initial substring that has the expected syntax for a
+ * floating-point number, no conversion is performed. In this case,
+ * returns a value of zero and the value returned in tail is the value
+ * of numstr.
+ *
+ * @param numstr a string representing a number, may contain one of
+ * the International System number postfixes, for example 'K', 'M',
+ * 'G'. If 'i' is appended after the postfix, powers of 2 are used
+ * instead of powers of 10. The 'B' postfix multiplies the value for
+ * 8, and can be appended after another postfix or used alone. This
+ * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
+ * @param tail if non-NULL puts here the pointer to the char next
+ * after the last parsed character
+ */
+double av_strtod(const char *numstr, char **tail);
+
+#endif /* AVUTIL_EVAL_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h
new file mode 100644
index 000000000..ea30f5d2b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h
@@ -0,0 +1,131 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * a very simple circular buffer FIFO implementation
+ */
+
+#ifndef AVUTIL_FIFO_H
+#define AVUTIL_FIFO_H
+
+#include
+#include "avutil.h"
+#include "attributes.h"
+
+typedef struct AVFifoBuffer {
+ uint8_t *buffer;
+ uint8_t *rptr, *wptr, *end;
+ uint32_t rndx, wndx;
+} AVFifoBuffer;
+
+/**
+ * Initialize an AVFifoBuffer.
+ * @param size of FIFO
+ * @return AVFifoBuffer or NULL in case of memory allocation failure
+ */
+AVFifoBuffer *av_fifo_alloc(unsigned int size);
+
+/**
+ * Free an AVFifoBuffer.
+ * @param f AVFifoBuffer to free
+ */
+void av_fifo_free(AVFifoBuffer *f);
+
+/**
+ * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
+ * @param f AVFifoBuffer to reset
+ */
+void av_fifo_reset(AVFifoBuffer *f);
+
+/**
+ * Return the amount of data in bytes in the AVFifoBuffer, that is the
+ * amount of data you can read from it.
+ * @param f AVFifoBuffer to read from
+ * @return size
+ */
+int av_fifo_size(AVFifoBuffer *f);
+
+/**
+ * Return the amount of space in bytes in the AVFifoBuffer, that is the
+ * amount of data you can write into it.
+ * @param f AVFifoBuffer to write into
+ * @return size
+ */
+int av_fifo_space(AVFifoBuffer *f);
+
+/**
+ * Feed data from an AVFifoBuffer to a user-supplied callback.
+ * @param f AVFifoBuffer to read from
+ * @param buf_size number of bytes to read
+ * @param func generic read function
+ * @param dest data destination
+ */
+int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
+
+/**
+ * Feed data from a user-supplied callback to an AVFifoBuffer.
+ * @param f AVFifoBuffer to write to
+ * @param src data source; non-const since it may be used as a
+ * modifiable context by the function defined in func
+ * @param size number of bytes to write
+ * @param func generic write function; the first parameter is src,
+ * the second is dest_buf, the third is dest_buf_size.
+ * func must return the number of bytes written to dest_buf, or <= 0 to
+ * indicate no more data available to write.
+ * If func is NULL, src is interpreted as a simple byte array for source data.
+ * @return the number of bytes written to the FIFO
+ */
+int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
+
+/**
+ * Resize an AVFifoBuffer.
+ * @param f AVFifoBuffer to resize
+ * @param size new AVFifoBuffer size in bytes
+ * @return <0 for failure, >=0 otherwise
+ */
+int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
+
+/**
+ * Read and discard the specified amount of data from an AVFifoBuffer.
+ * @param f AVFifoBuffer to read from
+ * @param size amount of data to read in bytes
+ */
+void av_fifo_drain(AVFifoBuffer *f, int size);
+
+/**
+ * Return a pointer to the data stored in a FIFO buffer at a certain offset.
+ * The FIFO buffer is not modified.
+ *
+ * @param f AVFifoBuffer to peek at, f must be non-NULL
+ * @param offs an offset in bytes, its absolute value must be less
+ * than the used buffer size or the returned pointer will
+ * point outside to the buffer data.
+ * The used buffer size can be checked with av_fifo_size().
+ */
+static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
+{
+ uint8_t *ptr = f->rptr + offs;
+ if (ptr >= f->end)
+ ptr = f->buffer + (ptr - f->end);
+ else if (ptr < f->buffer)
+ ptr = f->end - (f->buffer - ptr);
+ return ptr;
+}
+
+#endif /* AVUTIL_FIFO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h
new file mode 100644
index 000000000..e3f02a830
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_FILE_H
+#define AVUTIL_FILE_H
+
+#include
+
+#include "avutil.h"
+
+/**
+ * @file
+ * Misc file utilities.
+ */
+
+/**
+ * Read the file with name filename, and put its content in a newly
+ * allocated buffer or map it with mmap() when available.
+ * In case of success set *bufptr to the read or mmapped buffer, and
+ * *size to the size in bytes of the buffer in *bufptr.
+ * The returned buffer must be released with av_file_unmap().
+ *
+ * @param log_offset loglevel offset used for logging
+ * @param log_ctx context used for logging
+ * @return a non negative number in case of success, a negative value
+ * corresponding to an AVERROR error code in case of failure
+ */
+int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
+ int log_offset, void *log_ctx);
+
+/**
+ * Unmap or free the buffer bufptr created by av_file_map().
+ *
+ * @param size size in bytes of bufptr, must be the same as returned
+ * by av_file_map()
+ */
+void av_file_unmap(uint8_t *bufptr, size_t size);
+
+#endif /* AVUTIL_FILE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h
new file mode 100644
index 000000000..d71948db0
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h
@@ -0,0 +1,491 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_FRAME_H
+#define AVUTIL_FRAME_H
+
+#include
+
+#include "libavcodec/version.h"
+
+#include "avutil.h"
+#include "buffer.h"
+#include "dict.h"
+#include "rational.h"
+#include "samplefmt.h"
+
+enum AVFrameSideDataType {
+ /**
+ * The data is the AVPanScan struct defined in libavcodec.
+ */
+ AV_FRAME_DATA_PANSCAN,
+};
+
+typedef struct AVFrameSideData {
+ enum AVFrameSideDataType type;
+ uint8_t *data;
+ int size;
+ AVDictionary *metadata;
+} AVFrameSideData;
+
+/**
+ * This structure describes decoded (raw) audio or video data.
+ *
+ * AVFrame must be allocated using av_frame_alloc(). Not that this only
+ * allocates the AVFrame itself, the buffers for the data must be managed
+ * through other means (see below).
+ * AVFrame must be freed with av_frame_free().
+ *
+ * AVFrame is typically allocated once and then reused multiple times to hold
+ * different data (e.g. a single AVFrame to hold frames received from a
+ * decoder). In such a case, av_frame_unref() will free any references held by
+ * the frame and reset it to its original clean state before it
+ * is reused again.
+ *
+ * The data described by an AVFrame is usually reference counted through the
+ * AVBuffer API. The underlying buffer references are stored in AVFrame.buf /
+ * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at
+ * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case,
+ * every single data plane must be contained in one of the buffers in
+ * AVFrame.buf or AVFrame.extended_buf.
+ * There may be a single buffer for all the data, or one separate buffer for
+ * each plane, or anything in between.
+ *
+ * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
+ * to the end with a minor bump.
+ */
+typedef struct AVFrame {
+#define AV_NUM_DATA_POINTERS 8
+ /**
+ * pointer to the picture/channel planes.
+ * This might be different from the first allocated byte
+ */
+ uint8_t *data[AV_NUM_DATA_POINTERS];
+
+ /**
+ * For video, size in bytes of each picture line.
+ * For audio, size in bytes of each plane.
+ *
+ * For audio, only linesize[0] may be set. For planar audio, each channel
+ * plane must be the same size.
+ */
+ int linesize[AV_NUM_DATA_POINTERS];
+
+ /**
+ * pointers to the data planes/channels.
+ *
+ * For video, this should simply point to data[].
+ *
+ * For planar audio, each channel has a separate data pointer, and
+ * linesize[0] contains the size of each channel buffer.
+ * For packed audio, there is just one data pointer, and linesize[0]
+ * contains the total size of the buffer for all channels.
+ *
+ * Note: Both data and extended_data should always be set in a valid frame,
+ * but for planar audio with more channels that can fit in data,
+ * extended_data must be used in order to access all channels.
+ */
+ uint8_t **extended_data;
+
+ /**
+ * width and height of the video frame
+ */
+ int width, height;
+
+ /**
+ * number of audio samples (per channel) described by this frame
+ */
+ int nb_samples;
+
+ /**
+ * format of the frame, -1 if unknown or unset
+ * Values correspond to enum AVPixelFormat for video frames,
+ * enum AVSampleFormat for audio)
+ */
+ int format;
+
+ /**
+ * 1 -> keyframe, 0-> not
+ */
+ int key_frame;
+
+ /**
+ * Picture type of the frame.
+ */
+ enum AVPictureType pict_type;
+
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
+ uint8_t *base[AV_NUM_DATA_POINTERS];
+#endif
+
+ /**
+ * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
+ */
+ AVRational sample_aspect_ratio;
+
+ /**
+ * Presentation timestamp in time_base units (time when frame should be shown to user).
+ */
+ int64_t pts;
+
+ /**
+ * PTS copied from the AVPacket that was decoded to produce this frame.
+ */
+ int64_t pkt_pts;
+
+ /**
+ * DTS copied from the AVPacket that triggered returning this frame.
+ */
+ int64_t pkt_dts;
+
+ /**
+ * picture number in bitstream order
+ */
+ int coded_picture_number;
+ /**
+ * picture number in display order
+ */
+ int display_picture_number;
+
+ /**
+ * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
+ */
+ int quality;
+
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
+ int reference;
+
+ /**
+ * QP table
+ */
+ attribute_deprecated
+ int8_t *qscale_table;
+ /**
+ * QP store stride
+ */
+ attribute_deprecated
+ int qstride;
+
+ attribute_deprecated
+ int qscale_type;
+
+ /**
+ * mbskip_table[mb]>=1 if MB didn't change
+ * stride= mb_width = (width+15)>>4
+ */
+ attribute_deprecated
+ uint8_t *mbskip_table;
+
+ /**
+ * motion vector table
+ * @code
+ * example:
+ * int mv_sample_log2= 4 - motion_subsample_log2;
+ * int mb_width= (width+15)>>4;
+ * int mv_stride= (mb_width << mv_sample_log2) + 1;
+ * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
+ * @endcode
+ */
+ attribute_deprecated
+ int16_t (*motion_val[2])[2];
+
+ /**
+ * macroblock type table
+ * mb_type_base + mb_width + 2
+ */
+ attribute_deprecated
+ uint32_t *mb_type;
+
+ /**
+ * DCT coefficients
+ */
+ attribute_deprecated
+ short *dct_coeff;
+
+ /**
+ * motion reference frame index
+ * the order in which these are stored can depend on the codec.
+ */
+ attribute_deprecated
+ int8_t *ref_index[2];
+#endif
+
+ /**
+ * for some private data of the user
+ */
+ void *opaque;
+
+ /**
+ * error
+ */
+ uint64_t error[AV_NUM_DATA_POINTERS];
+
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
+ int type;
+#endif
+
+ /**
+ * When decoding, this signals how much the picture must be delayed.
+ * extra_delay = repeat_pict / (2*fps)
+ */
+ int repeat_pict;
+
+ /**
+ * The content of the picture is interlaced.
+ */
+ int interlaced_frame;
+
+ /**
+ * If the content is interlaced, is top field displayed first.
+ */
+ int top_field_first;
+
+ /**
+ * Tell user application that palette has changed from previous frame.
+ */
+ int palette_has_changed;
+
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
+ int buffer_hints;
+
+ /**
+ * Pan scan.
+ */
+ attribute_deprecated
+ struct AVPanScan *pan_scan;
+#endif
+
+ /**
+ * reordered opaque 64bit (generally an integer or a double precision float
+ * PTS but can be anything).
+ * The user sets AVCodecContext.reordered_opaque to represent the input at
+ * that time,
+ * the decoder reorders values as needed and sets AVFrame.reordered_opaque
+ * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
+ * @deprecated in favor of pkt_pts
+ */
+ int64_t reordered_opaque;
+
+#if FF_API_AVFRAME_LAVC
+ /**
+ * @deprecated this field is unused
+ */
+ attribute_deprecated void *hwaccel_picture_private;
+
+ attribute_deprecated
+ struct AVCodecContext *owner;
+ attribute_deprecated
+ void *thread_opaque;
+
+ /**
+ * log2 of the size of the block which a single vector in motion_val represents:
+ * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
+ */
+ attribute_deprecated
+ uint8_t motion_subsample_log2;
+#endif
+
+ /**
+ * Sample rate of the audio data.
+ */
+ int sample_rate;
+
+ /**
+ * Channel layout of the audio data.
+ */
+ uint64_t channel_layout;
+
+ /**
+ * AVBuffer references backing the data for this frame. If all elements of
+ * this array are NULL, then this frame is not reference counted.
+ *
+ * There may be at most one AVBuffer per data plane, so for video this array
+ * always contains all the references. For planar audio with more than
+ * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
+ * this array. Then the extra AVBufferRef pointers are stored in the
+ * extended_buf array.
+ */
+ AVBufferRef *buf[AV_NUM_DATA_POINTERS];
+
+ /**
+ * For planar audio which requires more than AV_NUM_DATA_POINTERS
+ * AVBufferRef pointers, this array will hold all the references which
+ * cannot fit into AVFrame.buf.
+ *
+ * Note that this is different from AVFrame.extended_data, which always
+ * contains all the pointers. This array only contains the extra pointers,
+ * which cannot fit into AVFrame.buf.
+ *
+ * This array is always allocated using av_malloc() by whoever constructs
+ * the frame. It is freed in av_frame_unref().
+ */
+ AVBufferRef **extended_buf;
+ /**
+ * Number of elements in extended_buf.
+ */
+ int nb_extended_buf;
+
+ AVFrameSideData **side_data;
+ int nb_side_data;
+} AVFrame;
+
+/**
+ * Allocate an AVFrame and set its fields to default values. The resulting
+ * struct must be freed using av_frame_free().
+ *
+ * @return An AVFrame filled with default values or NULL on failure.
+ *
+ * @note this only allocates the AVFrame itself, not the data buffers. Those
+ * must be allocated through other means, e.g. with av_frame_get_buffer() or
+ * manually.
+ */
+AVFrame *av_frame_alloc(void);
+
+/**
+ * Free the frame and any dynamically allocated objects in it,
+ * e.g. extended_data. If the frame is reference counted, it will be
+ * unreferenced first.
+ *
+ * @param frame frame to be freed. The pointer will be set to NULL.
+ */
+void av_frame_free(AVFrame **frame);
+
+/**
+ * Setup a new reference to the data described by an given frame.
+ *
+ * Copy frame properties from src to dst and create a new reference for each
+ * AVBufferRef from src.
+ *
+ * If src is not reference counted, new buffers are allocated and the data is
+ * copied.
+ *
+ * @return 0 on success, a negative AVERROR on error
+ */
+int av_frame_ref(AVFrame *dst, AVFrame *src);
+
+/**
+ * Create a new frame that references the same data as src.
+ *
+ * This is a shortcut for av_frame_alloc()+av_frame_ref().
+ *
+ * @return newly created AVFrame on success, NULL on error.
+ */
+AVFrame *av_frame_clone(AVFrame *src);
+
+/**
+ * Unreference all the buffers referenced by frame and reset the frame fields.
+ */
+void av_frame_unref(AVFrame *frame);
+
+/**
+ * Move everythnig contained in src to dst and reset src.
+ */
+void av_frame_move_ref(AVFrame *dst, AVFrame *src);
+
+/**
+ * Allocate new buffer(s) for audio or video data.
+ *
+ * The following fields must be set on frame before calling this function:
+ * - format (pixel format for video, sample format for audio)
+ * - width and height for video
+ * - nb_samples and channel_layout for audio
+ *
+ * This function will fill AVFrame.data and AVFrame.buf arrays and, if
+ * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
+ * For planar formats, one buffer will be allocated for each plane.
+ *
+ * @param frame frame in which to store the new buffers.
+ * @param align required buffer size alignment
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ */
+int av_frame_get_buffer(AVFrame *frame, int align);
+
+/**
+ * Check if the frame data is writable.
+ *
+ * @return A positive value if the frame data is writable (which is true if and
+ * only if each of the underlying buffers has only one reference, namely the one
+ * stored in this frame). Return 0 otherwise.
+ *
+ * If 1 is returned the answer is valid until av_buffer_ref() is called on any
+ * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly).
+ *
+ * @see av_frame_make_writable(), av_buffer_is_writable()
+ */
+int av_frame_is_writable(AVFrame *frame);
+
+/**
+ * Ensure that the frame data is writable, avoiding data copy if possible.
+ *
+ * Do nothing if the frame is writable, allocate new buffers and copy the data
+ * if it is not.
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ *
+ * @see av_frame_is_writable(), av_buffer_is_writable(),
+ * av_buffer_make_writable()
+ */
+int av_frame_make_writable(AVFrame *frame);
+
+/**
+ * Copy only "metadata" fields from src to dst.
+ *
+ * Metadata for the purpose of this function are those fields that do not affect
+ * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample
+ * aspect ratio (for video), but not width/height or channel layout.
+ * Side data is also copied.
+ */
+int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
+
+/**
+ * Get the buffer reference a given data plane is stored in.
+ *
+ * @param plane index of the data plane of interest in frame->extended_data.
+ *
+ * @return the buffer reference that contains the plane or NULL if the input
+ * frame is not valid.
+ */
+AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
+
+/**
+ * Add a new side data to a frame.
+ *
+ * @param frame a frame to which the side data should be added
+ * @param type type of the added side data
+ * @param size size of the side data
+ *
+ * @return newly added side data on success, NULL on error
+ */
+AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
+ enum AVFrameSideDataType type,
+ int size);
+
+/**
+ * @return a pointer to the side data of a given type on success, NULL if there
+ * is no side data with such type in this frame.
+ */
+AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
+ enum AVFrameSideDataType type);
+
+#endif /* AVUTIL_FRAME_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h
new file mode 100644
index 000000000..28c2062b1
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2012 Martin Storsjo
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_HMAC_H
+#define AVUTIL_HMAC_H
+
+#include
+
+/**
+ * @defgroup lavu_hmac HMAC
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+enum AVHMACType {
+ AV_HMAC_MD5,
+ AV_HMAC_SHA1,
+};
+
+typedef struct AVHMAC AVHMAC;
+
+/**
+ * Allocate an AVHMAC context.
+ * @param type The hash function used for the HMAC.
+ */
+AVHMAC *av_hmac_alloc(enum AVHMACType type);
+
+/**
+ * Free an AVHMAC context.
+ * @param ctx The context to free, may be NULL
+ */
+void av_hmac_free(AVHMAC *ctx);
+
+/**
+ * Initialize an AVHMAC context with an authentication key.
+ * @param ctx The HMAC context
+ * @param key The authentication key
+ * @param keylen The length of the key, in bytes
+ */
+void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen);
+
+/**
+ * Hash data with the HMAC.
+ * @param ctx The HMAC context
+ * @param data The data to hash
+ * @param len The length of the data, in bytes
+ */
+void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len);
+
+/**
+ * Finish hashing and output the HMAC digest.
+ * @param ctx The HMAC context
+ * @param out The output buffer to write the digest into
+ * @param outlen The length of the out buffer, in bytes
+ * @return The number of bytes written to out, or a negative error code.
+ */
+int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen);
+
+/**
+ * Hash an array of data with a key.
+ * @param ctx The HMAC context
+ * @param data The data to hash
+ * @param len The length of the data, in bytes
+ * @param key The authentication key
+ * @param keylen The length of the key, in bytes
+ * @param out The output buffer to write the digest into
+ * @param outlen The length of the out buffer, in bytes
+ * @return The number of bytes written to out, or a negative error code.
+ */
+int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len,
+ const uint8_t *key, unsigned int keylen,
+ uint8_t *out, unsigned int outlen);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_HMAC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h
new file mode 100644
index 000000000..71510132a
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h
@@ -0,0 +1,138 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_IMGUTILS_H
+#define AVUTIL_IMGUTILS_H
+
+/**
+ * @file
+ * misc image utilities
+ *
+ * @addtogroup lavu_picture
+ * @{
+ */
+
+#include "avutil.h"
+#include "pixdesc.h"
+
+/**
+ * Compute the max pixel step for each plane of an image with a
+ * format described by pixdesc.
+ *
+ * The pixel step is the distance in bytes between the first byte of
+ * the group of bytes which describe a pixel component and the first
+ * byte of the successive group in the same plane for the same
+ * component.
+ *
+ * @param max_pixsteps an array which is filled with the max pixel step
+ * for each plane. Since a plane may contain different pixel
+ * components, the computed max_pixsteps[plane] is relative to the
+ * component in the plane with the max pixel step.
+ * @param max_pixstep_comps an array which is filled with the component
+ * for each plane which has the max pixel step. May be NULL.
+ */
+void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
+ const AVPixFmtDescriptor *pixdesc);
+
+/**
+ * Compute the size of an image line with format pix_fmt and width
+ * width for the plane plane.
+ *
+ * @return the computed size in bytes
+ */
+int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
+
+/**
+ * Fill plane linesizes for an image with pixel format pix_fmt and
+ * width width.
+ *
+ * @param linesizes array to be filled with the linesize for each plane
+ * @return >= 0 in case of success, a negative error code otherwise
+ */
+int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
+
+/**
+ * Fill plane data pointers for an image with pixel format pix_fmt and
+ * height height.
+ *
+ * @param data pointers array to be filled with the pointer for each image plane
+ * @param ptr the pointer to a buffer which will contain the image
+ * @param linesizes the array containing the linesize for each
+ * plane, should be filled by av_image_fill_linesizes()
+ * @return the size in bytes required for the image buffer, a negative
+ * error code in case of failure
+ */
+int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
+ uint8_t *ptr, const int linesizes[4]);
+
+/**
+ * Allocate an image with size w and h and pixel format pix_fmt, and
+ * fill pointers and linesizes accordingly.
+ * The allocated image buffer has to be freed by using
+ * av_freep(&pointers[0]).
+ *
+ * @param align the value to use for buffer size alignment
+ * @return the size in bytes required for the image buffer, a negative
+ * error code in case of failure
+ */
+int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
+ int w, int h, enum AVPixelFormat pix_fmt, int align);
+
+/**
+ * Copy image plane from src to dst.
+ * That is, copy "height" number of lines of "bytewidth" bytes each.
+ * The first byte of each successive line is separated by *_linesize
+ * bytes.
+ *
+ * @param dst_linesize linesize for the image plane in dst
+ * @param src_linesize linesize for the image plane in src
+ */
+void av_image_copy_plane(uint8_t *dst, int dst_linesize,
+ const uint8_t *src, int src_linesize,
+ int bytewidth, int height);
+
+/**
+ * Copy image in src_data to dst_data.
+ *
+ * @param dst_linesizes linesizes for the image in dst_data
+ * @param src_linesizes linesizes for the image in src_data
+ */
+void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
+ const uint8_t *src_data[4], const int src_linesizes[4],
+ enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Check if the given dimension of an image is valid, meaning that all
+ * bytes of the image can be addressed with a signed int.
+ *
+ * @param w the width of the picture
+ * @param h the height of the picture
+ * @param log_offset the offset to sum to the log level for logging with log_ctx
+ * @param log_ctx the parent logging context, it may be NULL
+ * @return >= 0 if valid, a negative error code otherwise
+ */
+int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
+
+int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
+
+/**
+ * @}
+ */
+
+
+#endif /* AVUTIL_IMGUTILS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h
new file mode 100644
index 000000000..38d26ad87
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTFLOAT_H
+#define AVUTIL_INTFLOAT_H
+
+#include
+#include "attributes.h"
+
+union av_intfloat32 {
+ uint32_t i;
+ float f;
+};
+
+union av_intfloat64 {
+ uint64_t i;
+ double f;
+};
+
+/**
+ * Reinterpret a 32-bit integer as a float.
+ */
+static av_always_inline float av_int2float(uint32_t i)
+{
+ union av_intfloat32 v;
+ v.i = i;
+ return v.f;
+}
+
+/**
+ * Reinterpret a float as a 32-bit integer.
+ */
+static av_always_inline uint32_t av_float2int(float f)
+{
+ union av_intfloat32 v;
+ v.f = f;
+ return v.i;
+}
+
+/**
+ * Reinterpret a 64-bit integer as a double.
+ */
+static av_always_inline double av_int2double(uint64_t i)
+{
+ union av_intfloat64 v;
+ v.i = i;
+ return v.f;
+}
+
+/**
+ * Reinterpret a double as a 64-bit integer.
+ */
+static av_always_inline uint64_t av_double2int(double f)
+{
+ union av_intfloat64 v;
+ v.f = f;
+ return v.i;
+}
+
+#endif /* AVUTIL_INTFLOAT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h
new file mode 100644
index 000000000..f093b92cd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h
@@ -0,0 +1,40 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTFLOAT_READWRITE_H
+#define AVUTIL_INTFLOAT_READWRITE_H
+
+#include
+#include "attributes.h"
+
+/* IEEE 80 bits extended float */
+typedef struct AVExtFloat {
+ uint8_t exponent[2];
+ uint8_t mantissa[8];
+} AVExtFloat;
+
+attribute_deprecated double av_int2dbl(int64_t v) av_const;
+attribute_deprecated float av_int2flt(int32_t v) av_const;
+attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
+attribute_deprecated int64_t av_dbl2int(double d) av_const;
+attribute_deprecated int32_t av_flt2int(float d) av_const;
+attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
+
+#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h
new file mode 100644
index 000000000..f77fd60f3
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h
@@ -0,0 +1,549 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTREADWRITE_H
+#define AVUTIL_INTREADWRITE_H
+
+#include
+#include "libavutil/avconfig.h"
+#include "attributes.h"
+#include "bswap.h"
+
+typedef union {
+ uint64_t u64;
+ uint32_t u32[2];
+ uint16_t u16[4];
+ uint8_t u8 [8];
+ double f64;
+ float f32[2];
+} av_alias av_alias64;
+
+typedef union {
+ uint32_t u32;
+ uint16_t u16[2];
+ uint8_t u8 [4];
+ float f32;
+} av_alias av_alias32;
+
+typedef union {
+ uint16_t u16;
+ uint8_t u8 [2];
+} av_alias av_alias16;
+
+/*
+ * Arch-specific headers can provide any combination of
+ * AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
+ * Preprocessor symbols must be defined, even if these are implemented
+ * as inline functions.
+ */
+
+#ifdef HAVE_AV_CONFIG_H
+
+#include "config.h"
+
+#if ARCH_ARM
+# include "arm/intreadwrite.h"
+#elif ARCH_AVR32
+# include "avr32/intreadwrite.h"
+#elif ARCH_MIPS
+# include "mips/intreadwrite.h"
+#elif ARCH_PPC
+# include "ppc/intreadwrite.h"
+#elif ARCH_TOMI
+# include "tomi/intreadwrite.h"
+#elif ARCH_X86
+# include "x86/intreadwrite.h"
+#endif
+
+#endif /* HAVE_AV_CONFIG_H */
+
+/*
+ * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
+ */
+
+#if AV_HAVE_BIGENDIAN
+
+# if defined(AV_RN16) && !defined(AV_RB16)
+# define AV_RB16(p) AV_RN16(p)
+# elif !defined(AV_RN16) && defined(AV_RB16)
+# define AV_RN16(p) AV_RB16(p)
+# endif
+
+# if defined(AV_WN16) && !defined(AV_WB16)
+# define AV_WB16(p, v) AV_WN16(p, v)
+# elif !defined(AV_WN16) && defined(AV_WB16)
+# define AV_WN16(p, v) AV_WB16(p, v)
+# endif
+
+# if defined(AV_RN24) && !defined(AV_RB24)
+# define AV_RB24(p) AV_RN24(p)
+# elif !defined(AV_RN24) && defined(AV_RB24)
+# define AV_RN24(p) AV_RB24(p)
+# endif
+
+# if defined(AV_WN24) && !defined(AV_WB24)
+# define AV_WB24(p, v) AV_WN24(p, v)
+# elif !defined(AV_WN24) && defined(AV_WB24)
+# define AV_WN24(p, v) AV_WB24(p, v)
+# endif
+
+# if defined(AV_RN32) && !defined(AV_RB32)
+# define AV_RB32(p) AV_RN32(p)
+# elif !defined(AV_RN32) && defined(AV_RB32)
+# define AV_RN32(p) AV_RB32(p)
+# endif
+
+# if defined(AV_WN32) && !defined(AV_WB32)
+# define AV_WB32(p, v) AV_WN32(p, v)
+# elif !defined(AV_WN32) && defined(AV_WB32)
+# define AV_WN32(p, v) AV_WB32(p, v)
+# endif
+
+# if defined(AV_RN64) && !defined(AV_RB64)
+# define AV_RB64(p) AV_RN64(p)
+# elif !defined(AV_RN64) && defined(AV_RB64)
+# define AV_RN64(p) AV_RB64(p)
+# endif
+
+# if defined(AV_WN64) && !defined(AV_WB64)
+# define AV_WB64(p, v) AV_WN64(p, v)
+# elif !defined(AV_WN64) && defined(AV_WB64)
+# define AV_WN64(p, v) AV_WB64(p, v)
+# endif
+
+#else /* AV_HAVE_BIGENDIAN */
+
+# if defined(AV_RN16) && !defined(AV_RL16)
+# define AV_RL16(p) AV_RN16(p)
+# elif !defined(AV_RN16) && defined(AV_RL16)
+# define AV_RN16(p) AV_RL16(p)
+# endif
+
+# if defined(AV_WN16) && !defined(AV_WL16)
+# define AV_WL16(p, v) AV_WN16(p, v)
+# elif !defined(AV_WN16) && defined(AV_WL16)
+# define AV_WN16(p, v) AV_WL16(p, v)
+# endif
+
+# if defined(AV_RN24) && !defined(AV_RL24)
+# define AV_RL24(p) AV_RN24(p)
+# elif !defined(AV_RN24) && defined(AV_RL24)
+# define AV_RN24(p) AV_RL24(p)
+# endif
+
+# if defined(AV_WN24) && !defined(AV_WL24)
+# define AV_WL24(p, v) AV_WN24(p, v)
+# elif !defined(AV_WN24) && defined(AV_WL24)
+# define AV_WN24(p, v) AV_WL24(p, v)
+# endif
+
+# if defined(AV_RN32) && !defined(AV_RL32)
+# define AV_RL32(p) AV_RN32(p)
+# elif !defined(AV_RN32) && defined(AV_RL32)
+# define AV_RN32(p) AV_RL32(p)
+# endif
+
+# if defined(AV_WN32) && !defined(AV_WL32)
+# define AV_WL32(p, v) AV_WN32(p, v)
+# elif !defined(AV_WN32) && defined(AV_WL32)
+# define AV_WN32(p, v) AV_WL32(p, v)
+# endif
+
+# if defined(AV_RN64) && !defined(AV_RL64)
+# define AV_RL64(p) AV_RN64(p)
+# elif !defined(AV_RN64) && defined(AV_RL64)
+# define AV_RN64(p) AV_RL64(p)
+# endif
+
+# if defined(AV_WN64) && !defined(AV_WL64)
+# define AV_WL64(p, v) AV_WN64(p, v)
+# elif !defined(AV_WN64) && defined(AV_WL64)
+# define AV_WN64(p, v) AV_WL64(p, v)
+# endif
+
+#endif /* !AV_HAVE_BIGENDIAN */
+
+/*
+ * Define AV_[RW]N helper macros to simplify definitions not provided
+ * by per-arch headers.
+ */
+
+#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
+
+union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
+union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
+union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
+
+# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
+# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
+
+#elif defined(__DECC)
+
+# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
+# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
+
+#elif AV_HAVE_FAST_UNALIGNED
+
+# define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
+# define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
+
+#else
+
+#ifndef AV_RB16
+# define AV_RB16(x) \
+ ((((const uint8_t*)(x))[0] << 8) | \
+ ((const uint8_t*)(x))[1])
+#endif
+#ifndef AV_WB16
+# define AV_WB16(p, d) do { \
+ ((uint8_t*)(p))[1] = (d); \
+ ((uint8_t*)(p))[0] = (d)>>8; \
+ } while(0)
+#endif
+
+#ifndef AV_RL16
+# define AV_RL16(x) \
+ ((((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL16
+# define AV_WL16(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ } while(0)
+#endif
+
+#ifndef AV_RB32
+# define AV_RB32(x) \
+ (((uint32_t)((const uint8_t*)(x))[0] << 24) | \
+ (((const uint8_t*)(x))[1] << 16) | \
+ (((const uint8_t*)(x))[2] << 8) | \
+ ((const uint8_t*)(x))[3])
+#endif
+#ifndef AV_WB32
+# define AV_WB32(p, d) do { \
+ ((uint8_t*)(p))[3] = (d); \
+ ((uint8_t*)(p))[2] = (d)>>8; \
+ ((uint8_t*)(p))[1] = (d)>>16; \
+ ((uint8_t*)(p))[0] = (d)>>24; \
+ } while(0)
+#endif
+
+#ifndef AV_RL32
+# define AV_RL32(x) \
+ (((uint32_t)((const uint8_t*)(x))[3] << 24) | \
+ (((const uint8_t*)(x))[2] << 16) | \
+ (((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL32
+# define AV_WL32(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[2] = (d)>>16; \
+ ((uint8_t*)(p))[3] = (d)>>24; \
+ } while(0)
+#endif
+
+#ifndef AV_RB64
+# define AV_RB64(x) \
+ (((uint64_t)((const uint8_t*)(x))[0] << 56) | \
+ ((uint64_t)((const uint8_t*)(x))[1] << 48) | \
+ ((uint64_t)((const uint8_t*)(x))[2] << 40) | \
+ ((uint64_t)((const uint8_t*)(x))[3] << 32) | \
+ ((uint64_t)((const uint8_t*)(x))[4] << 24) | \
+ ((uint64_t)((const uint8_t*)(x))[5] << 16) | \
+ ((uint64_t)((const uint8_t*)(x))[6] << 8) | \
+ (uint64_t)((const uint8_t*)(x))[7])
+#endif
+#ifndef AV_WB64
+# define AV_WB64(p, d) do { \
+ ((uint8_t*)(p))[7] = (d); \
+ ((uint8_t*)(p))[6] = (d)>>8; \
+ ((uint8_t*)(p))[5] = (d)>>16; \
+ ((uint8_t*)(p))[4] = (d)>>24; \
+ ((uint8_t*)(p))[3] = (d)>>32; \
+ ((uint8_t*)(p))[2] = (d)>>40; \
+ ((uint8_t*)(p))[1] = (d)>>48; \
+ ((uint8_t*)(p))[0] = (d)>>56; \
+ } while(0)
+#endif
+
+#ifndef AV_RL64
+# define AV_RL64(x) \
+ (((uint64_t)((const uint8_t*)(x))[7] << 56) | \
+ ((uint64_t)((const uint8_t*)(x))[6] << 48) | \
+ ((uint64_t)((const uint8_t*)(x))[5] << 40) | \
+ ((uint64_t)((const uint8_t*)(x))[4] << 32) | \
+ ((uint64_t)((const uint8_t*)(x))[3] << 24) | \
+ ((uint64_t)((const uint8_t*)(x))[2] << 16) | \
+ ((uint64_t)((const uint8_t*)(x))[1] << 8) | \
+ (uint64_t)((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL64
+# define AV_WL64(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[2] = (d)>>16; \
+ ((uint8_t*)(p))[3] = (d)>>24; \
+ ((uint8_t*)(p))[4] = (d)>>32; \
+ ((uint8_t*)(p))[5] = (d)>>40; \
+ ((uint8_t*)(p))[6] = (d)>>48; \
+ ((uint8_t*)(p))[7] = (d)>>56; \
+ } while(0)
+#endif
+
+#if AV_HAVE_BIGENDIAN
+# define AV_RN(s, p) AV_RB##s(p)
+# define AV_WN(s, p, v) AV_WB##s(p, v)
+#else
+# define AV_RN(s, p) AV_RL##s(p)
+# define AV_WN(s, p, v) AV_WL##s(p, v)
+#endif
+
+#endif /* HAVE_FAST_UNALIGNED */
+
+#ifndef AV_RN16
+# define AV_RN16(p) AV_RN(16, p)
+#endif
+
+#ifndef AV_RN32
+# define AV_RN32(p) AV_RN(32, p)
+#endif
+
+#ifndef AV_RN64
+# define AV_RN64(p) AV_RN(64, p)
+#endif
+
+#ifndef AV_WN16
+# define AV_WN16(p, v) AV_WN(16, p, v)
+#endif
+
+#ifndef AV_WN32
+# define AV_WN32(p, v) AV_WN(32, p, v)
+#endif
+
+#ifndef AV_WN64
+# define AV_WN64(p, v) AV_WN(64, p, v)
+#endif
+
+#if AV_HAVE_BIGENDIAN
+# define AV_RB(s, p) AV_RN##s(p)
+# define AV_WB(s, p, v) AV_WN##s(p, v)
+# define AV_RL(s, p) av_bswap##s(AV_RN##s(p))
+# define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v))
+#else
+# define AV_RB(s, p) av_bswap##s(AV_RN##s(p))
+# define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v))
+# define AV_RL(s, p) AV_RN##s(p)
+# define AV_WL(s, p, v) AV_WN##s(p, v)
+#endif
+
+#define AV_RB8(x) (((const uint8_t*)(x))[0])
+#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0)
+
+#define AV_RL8(x) AV_RB8(x)
+#define AV_WL8(p, d) AV_WB8(p, d)
+
+#ifndef AV_RB16
+# define AV_RB16(p) AV_RB(16, p)
+#endif
+#ifndef AV_WB16
+# define AV_WB16(p, v) AV_WB(16, p, v)
+#endif
+
+#ifndef AV_RL16
+# define AV_RL16(p) AV_RL(16, p)
+#endif
+#ifndef AV_WL16
+# define AV_WL16(p, v) AV_WL(16, p, v)
+#endif
+
+#ifndef AV_RB32
+# define AV_RB32(p) AV_RB(32, p)
+#endif
+#ifndef AV_WB32
+# define AV_WB32(p, v) AV_WB(32, p, v)
+#endif
+
+#ifndef AV_RL32
+# define AV_RL32(p) AV_RL(32, p)
+#endif
+#ifndef AV_WL32
+# define AV_WL32(p, v) AV_WL(32, p, v)
+#endif
+
+#ifndef AV_RB64
+# define AV_RB64(p) AV_RB(64, p)
+#endif
+#ifndef AV_WB64
+# define AV_WB64(p, v) AV_WB(64, p, v)
+#endif
+
+#ifndef AV_RL64
+# define AV_RL64(p) AV_RL(64, p)
+#endif
+#ifndef AV_WL64
+# define AV_WL64(p, v) AV_WL(64, p, v)
+#endif
+
+#ifndef AV_RB24
+# define AV_RB24(x) \
+ ((((const uint8_t*)(x))[0] << 16) | \
+ (((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[2])
+#endif
+#ifndef AV_WB24
+# define AV_WB24(p, d) do { \
+ ((uint8_t*)(p))[2] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[0] = (d)>>16; \
+ } while(0)
+#endif
+
+#ifndef AV_RL24
+# define AV_RL24(x) \
+ ((((const uint8_t*)(x))[2] << 16) | \
+ (((const uint8_t*)(x))[1] << 8) | \
+ ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL24
+# define AV_WL24(p, d) do { \
+ ((uint8_t*)(p))[0] = (d); \
+ ((uint8_t*)(p))[1] = (d)>>8; \
+ ((uint8_t*)(p))[2] = (d)>>16; \
+ } while(0)
+#endif
+
+/*
+ * The AV_[RW]NA macros access naturally aligned data
+ * in a type-safe way.
+ */
+
+#define AV_RNA(s, p) (((const av_alias##s*)(p))->u##s)
+#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v))
+
+#ifndef AV_RN16A
+# define AV_RN16A(p) AV_RNA(16, p)
+#endif
+
+#ifndef AV_RN32A
+# define AV_RN32A(p) AV_RNA(32, p)
+#endif
+
+#ifndef AV_RN64A
+# define AV_RN64A(p) AV_RNA(64, p)
+#endif
+
+#ifndef AV_WN16A
+# define AV_WN16A(p, v) AV_WNA(16, p, v)
+#endif
+
+#ifndef AV_WN32A
+# define AV_WN32A(p, v) AV_WNA(32, p, v)
+#endif
+
+#ifndef AV_WN64A
+# define AV_WN64A(p, v) AV_WNA(64, p, v)
+#endif
+
+/*
+ * The AV_COPYxxU macros are suitable for copying data to/from unaligned
+ * memory locations.
+ */
+
+#define AV_COPYU(n, d, s) AV_WN##n(d, AV_RN##n(s));
+
+#ifndef AV_COPY16U
+# define AV_COPY16U(d, s) AV_COPYU(16, d, s)
+#endif
+
+#ifndef AV_COPY32U
+# define AV_COPY32U(d, s) AV_COPYU(32, d, s)
+#endif
+
+#ifndef AV_COPY64U
+# define AV_COPY64U(d, s) AV_COPYU(64, d, s)
+#endif
+
+#ifndef AV_COPY128U
+# define AV_COPY128U(d, s) \
+ do { \
+ AV_COPY64U(d, s); \
+ AV_COPY64U((char *)(d) + 8, (const char *)(s) + 8); \
+ } while(0)
+#endif
+
+/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
+ * naturally aligned. They may be implemented using MMX,
+ * so emms_c() must be called before using any float code
+ * afterwards.
+ */
+
+#define AV_COPY(n, d, s) \
+ (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
+
+#ifndef AV_COPY16
+# define AV_COPY16(d, s) AV_COPY(16, d, s)
+#endif
+
+#ifndef AV_COPY32
+# define AV_COPY32(d, s) AV_COPY(32, d, s)
+#endif
+
+#ifndef AV_COPY64
+# define AV_COPY64(d, s) AV_COPY(64, d, s)
+#endif
+
+#ifndef AV_COPY128
+# define AV_COPY128(d, s) \
+ do { \
+ AV_COPY64(d, s); \
+ AV_COPY64((char*)(d)+8, (char*)(s)+8); \
+ } while(0)
+#endif
+
+#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
+
+#ifndef AV_SWAP64
+# define AV_SWAP64(a, b) AV_SWAP(64, a, b)
+#endif
+
+#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0)
+
+#ifndef AV_ZERO16
+# define AV_ZERO16(d) AV_ZERO(16, d)
+#endif
+
+#ifndef AV_ZERO32
+# define AV_ZERO32(d) AV_ZERO(32, d)
+#endif
+
+#ifndef AV_ZERO64
+# define AV_ZERO64(d) AV_ZERO(64, d)
+#endif
+
+#ifndef AV_ZERO128
+# define AV_ZERO128(d) \
+ do { \
+ AV_ZERO64(d); \
+ AV_ZERO64((char*)(d)+8); \
+ } while(0)
+#endif
+
+#endif /* AVUTIL_INTREADWRITE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h
new file mode 100644
index 000000000..5e526c1da
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h
@@ -0,0 +1,62 @@
+/*
+ * Lagged Fibonacci PRNG
+ * Copyright (c) 2008 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LFG_H
+#define AVUTIL_LFG_H
+
+typedef struct AVLFG {
+ unsigned int state[64];
+ int index;
+} AVLFG;
+
+void av_lfg_init(AVLFG *c, unsigned int seed);
+
+/**
+ * Get the next random unsigned 32-bit number using an ALFG.
+ *
+ * Please also consider a simple LCG like state= state*1664525+1013904223,
+ * it may be good enough and faster for your specific use case.
+ */
+static inline unsigned int av_lfg_get(AVLFG *c){
+ c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
+ return c->state[c->index++ & 63];
+}
+
+/**
+ * Get the next random unsigned 32-bit number using a MLFG.
+ *
+ * Please also consider av_lfg_get() above, it is faster.
+ */
+static inline unsigned int av_mlfg_get(AVLFG *c){
+ unsigned int a= c->state[(c->index-55) & 63];
+ unsigned int b= c->state[(c->index-24) & 63];
+ return c->state[c->index++ & 63] = 2*a*b+a+b;
+}
+
+/**
+ * Get the next two numbers generated by a Box-Muller Gaussian
+ * generator using the random numbers issued by lfg.
+ *
+ * @param out array where the two generated numbers are placed
+ */
+void av_bmg_get(AVLFG *lfg, double out[2]);
+
+#endif /* AVUTIL_LFG_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h
new file mode 100644
index 000000000..7b173302f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h
@@ -0,0 +1,173 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LOG_H
+#define AVUTIL_LOG_H
+
+#include
+#include "avutil.h"
+#include "attributes.h"
+
+/**
+ * Describe the class of an AVClass context structure. That is an
+ * arbitrary struct of which the first field is a pointer to an
+ * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
+ */
+typedef struct AVClass {
+ /**
+ * The name of the class; usually it is the same name as the
+ * context structure type to which the AVClass is associated.
+ */
+ const char* class_name;
+
+ /**
+ * A pointer to a function which returns the name of a context
+ * instance ctx associated with the class.
+ */
+ const char* (*item_name)(void* ctx);
+
+ /**
+ * a pointer to the first option specified in the class if any or NULL
+ *
+ * @see av_set_default_options()
+ */
+ const struct AVOption *option;
+
+ /**
+ * LIBAVUTIL_VERSION with which this structure was created.
+ * This is used to allow fields to be added without requiring major
+ * version bumps everywhere.
+ */
+
+ int version;
+
+ /**
+ * Offset in the structure where log_level_offset is stored.
+ * 0 means there is no such variable
+ */
+ int log_level_offset_offset;
+
+ /**
+ * Offset in the structure where a pointer to the parent context for
+ * logging is stored. For example a decoder could pass its AVCodecContext
+ * to eval as such a parent context, which an av_log() implementation
+ * could then leverage to display the parent context.
+ * The offset can be NULL.
+ */
+ int parent_log_context_offset;
+
+ /**
+ * Return next AVOptions-enabled child or NULL
+ */
+ void* (*child_next)(void *obj, void *prev);
+
+ /**
+ * Return an AVClass corresponding to the next potential
+ * AVOptions-enabled child.
+ *
+ * The difference between child_next and this is that
+ * child_next iterates over _already existing_ objects, while
+ * child_class_next iterates over _all possible_ children.
+ */
+ const struct AVClass* (*child_class_next)(const struct AVClass *prev);
+} AVClass;
+
+/* av_log API */
+
+#define AV_LOG_QUIET -8
+
+/**
+ * Something went really wrong and we will crash now.
+ */
+#define AV_LOG_PANIC 0
+
+/**
+ * Something went wrong and recovery is not possible.
+ * For example, no header was found for a format which depends
+ * on headers or an illegal combination of parameters is used.
+ */
+#define AV_LOG_FATAL 8
+
+/**
+ * Something went wrong and cannot losslessly be recovered.
+ * However, not all future data is affected.
+ */
+#define AV_LOG_ERROR 16
+
+/**
+ * Something somehow does not look correct. This may or may not
+ * lead to problems. An example would be the use of '-vstrict -2'.
+ */
+#define AV_LOG_WARNING 24
+
+#define AV_LOG_INFO 32
+#define AV_LOG_VERBOSE 40
+
+/**
+ * Stuff which is only useful for libav* developers.
+ */
+#define AV_LOG_DEBUG 48
+
+/**
+ * Send the specified message to the log if the level is less than or equal
+ * to the current av_log_level. By default, all logging messages are sent to
+ * stderr. This behavior can be altered by setting a different av_vlog callback
+ * function.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param fmt The format string (printf-compatible) that specifies how
+ * subsequent arguments are converted to output.
+ * @see av_vlog
+ */
+void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
+
+void av_vlog(void *avcl, int level, const char *fmt, va_list);
+int av_log_get_level(void);
+void av_log_set_level(int);
+void av_log_set_callback(void (*)(void*, int, const char*, va_list));
+void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
+const char* av_default_item_name(void* ctx);
+
+/**
+ * av_dlog macros
+ * Useful to print debug messages that shouldn't get compiled in normally.
+ */
+
+#ifdef DEBUG
+# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
+#else
+# define av_dlog(pctx, ...)
+#endif
+
+/**
+ * Skip repeated messages, this requires the user app to use av_log() instead of
+ * (f)printf as the 2 would otherwise interfere and lead to
+ * "Last message repeated x times" messages below (f)printf messages with some
+ * bad luck.
+ * Also to receive the last, "last repeated" line if any, the user app must
+ * call av_log(NULL, AV_LOG_QUIET, ""); at the end
+ */
+#define AV_LOG_SKIP_REPEATED 1
+void av_log_set_flags(int arg);
+
+#endif /* AVUTIL_LOG_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h
new file mode 100644
index 000000000..9d7e8f1dc
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h
@@ -0,0 +1,66 @@
+/*
+ * LZO 1x decompression
+ * copyright (c) 2006 Reimar Doeffinger
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LZO_H
+#define AVUTIL_LZO_H
+
+/**
+ * @defgroup lavu_lzo LZO
+ * @ingroup lavu_crypto
+ *
+ * @{
+ */
+
+#include
+
+/** @name Error flags returned by av_lzo1x_decode
+ * @{ */
+/// end of the input buffer reached before decoding finished
+#define AV_LZO_INPUT_DEPLETED 1
+/// decoded data did not fit into output buffer
+#define AV_LZO_OUTPUT_FULL 2
+/// a reference to previously decoded data was wrong
+#define AV_LZO_INVALID_BACKPTR 4
+/// a non-specific error in the compressed bitstream
+#define AV_LZO_ERROR 8
+/** @} */
+
+#define AV_LZO_INPUT_PADDING 8
+#define AV_LZO_OUTPUT_PADDING 12
+
+/**
+ * @brief Decodes LZO 1x compressed data.
+ * @param out output buffer
+ * @param outlen size of output buffer, number of bytes left are returned here
+ * @param in input buffer
+ * @param inlen size of input buffer, number of bytes left are returned here
+ * @return 0 on success, otherwise a combination of the error flags above
+ *
+ * Make sure all buffers are appropriately padded, in must provide
+ * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
+ */
+int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_LZO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h
new file mode 100644
index 000000000..043dd0faf
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h
@@ -0,0 +1,111 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_MATHEMATICS_H
+#define AVUTIL_MATHEMATICS_H
+
+#include
+#include
+#include "attributes.h"
+#include "rational.h"
+#include "intfloat.h"
+
+#ifndef M_LOG2_10
+#define M_LOG2_10 3.32192809488736234787 /* log_2 10 */
+#endif
+#ifndef M_PHI
+#define M_PHI 1.61803398874989484820 /* phi / golden ratio */
+#endif
+#ifndef NAN
+#define NAN av_int2float(0x7fc00000)
+#endif
+#ifndef INFINITY
+#define INFINITY av_int2float(0x7f800000)
+#endif
+
+/**
+ * @addtogroup lavu_math
+ * @{
+ */
+
+
+enum AVRounding {
+ AV_ROUND_ZERO = 0, ///< Round toward zero.
+ AV_ROUND_INF = 1, ///< Round away from zero.
+ AV_ROUND_DOWN = 2, ///< Round toward -infinity.
+ AV_ROUND_UP = 3, ///< Round toward +infinity.
+ AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
+};
+
+/**
+ * Return the greatest common divisor of a and b.
+ * If both a and b are 0 or either or both are <0 then behavior is
+ * undefined.
+ */
+int64_t av_const av_gcd(int64_t a, int64_t b);
+
+/**
+ * Rescale a 64-bit integer with rounding to nearest.
+ * A simple a*b/c isn't possible as it can overflow.
+ */
+int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
+
+/**
+ * Rescale a 64-bit integer with specified rounding.
+ * A simple a*b/c isn't possible as it can overflow.
+ */
+int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
+
+/**
+ * Rescale a 64-bit integer by 2 rational numbers.
+ */
+int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
+
+/**
+ * Rescale a 64-bit integer by 2 rational numbers with specified rounding.
+ */
+int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
+ enum AVRounding) av_const;
+
+/**
+ * Compare 2 timestamps each in its own timebases.
+ * The result of the function is undefined if one of the timestamps
+ * is outside the int64_t range when represented in the others timebase.
+ * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
+ */
+int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
+
+/**
+ * Compare 2 integers modulo mod.
+ * That is we compare integers a and b for which only the least
+ * significant log2(mod) bits are known.
+ *
+ * @param mod must be a power of 2
+ * @return a negative value if a is smaller than b
+ * a positive value if a is greater than b
+ * 0 if a equals b
+ */
+int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MATHEMATICS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h
new file mode 100644
index 000000000..29e4e7c2b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h
@@ -0,0 +1,51 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_MD5_H
+#define AVUTIL_MD5_H
+
+#include
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_md5 MD5
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_md5_size;
+#endif
+
+struct AVMD5;
+
+struct AVMD5 *av_md5_alloc(void);
+void av_md5_init(struct AVMD5 *ctx);
+void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
+void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
+void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MD5_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h
new file mode 100644
index 000000000..8a4fcd90a
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h
@@ -0,0 +1,209 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * memory handling functions
+ */
+
+#ifndef AVUTIL_MEM_H
+#define AVUTIL_MEM_H
+
+#include
+#include
+
+#include "attributes.h"
+#include "avutil.h"
+
+/**
+ * @addtogroup lavu_mem
+ * @{
+ */
+
+
+#if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C)
+ #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+ #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
+#elif defined(__TI_COMPILER_VERSION__)
+ #define DECLARE_ALIGNED(n,t,v) \
+ AV_PRAGMA(DATA_ALIGN(v,n)) \
+ t __attribute__((aligned(n))) v
+ #define DECLARE_ASM_CONST(n,t,v) \
+ AV_PRAGMA(DATA_ALIGN(v,n)) \
+ static const t __attribute__((aligned(n))) v
+#elif defined(__GNUC__)
+ #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
+ #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
+#elif defined(_MSC_VER)
+ #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
+ #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
+#else
+ #define DECLARE_ALIGNED(n,t,v) t v
+ #define DECLARE_ASM_CONST(n,t,v) static const t v
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+ #define av_malloc_attrib __attribute__((__malloc__))
+#else
+ #define av_malloc_attrib
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+ #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#else
+ #define av_alloc_size(...)
+#endif
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU).
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ */
+void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Helper function to allocate a block of size * nmemb bytes with
+ * using av_malloc()
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_malloc()
+ */
+av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
+{
+ if (size <= 0 || nmemb >= INT_MAX / size)
+ return NULL;
+ return av_malloc(nmemb * size);
+}
+
+/**
+ * Allocate or reallocate a block of memory.
+ * If ptr is NULL and size > 0, allocate a new block. If
+ * size is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a memory block already allocated with
+ * av_malloc(z)() or av_realloc() or NULL.
+ * @param size Size in bytes for the memory block to be allocated or
+ * reallocated.
+ * @return Pointer to a newly reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
+ * @see av_fast_realloc()
+ */
+void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
+
+/**
+ * Allocate or reallocate an array.
+ * If ptr is NULL and nmemb > 0, allocate a new block. If
+ * nmemb is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a memory block already allocated with
+ * av_malloc(z)() or av_realloc() or NULL.
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to a newly reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
+ */
+av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
+
+/**
+ * Allocate or reallocate an array.
+ * If *ptr is NULL and nmemb > 0, allocate a new block. If
+ * nmemb is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a pointer to a memory block already allocated
+ * with av_malloc(z)() or av_realloc(), or pointer to a pointer to NULL.
+ * The pointer is updated on success, or freed on failure.
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Zero on success, an AVERROR error code on failure.
+ */
+av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc().
+ * @param ptr Pointer to the memory block which should be freed.
+ * @note ptr = NULL is explicitly allowed.
+ * @note It is recommended that you use av_freep() instead.
+ * @see av_freep()
+ */
+void av_free(void *ptr);
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU) and
+ * zero all the bytes of the block.
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if it cannot be allocated.
+ * @see av_malloc()
+ */
+void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Helper function to allocate a block of size * nmemb bytes with
+ * using av_mallocz()
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ * @see av_malloc_array()
+ */
+av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
+{
+ if (size <= 0 || nmemb >= INT_MAX / size)
+ return NULL;
+ return av_mallocz(nmemb * size);
+}
+
+/**
+ * Duplicate the string s.
+ * @param s string to be duplicated
+ * @return Pointer to a newly allocated string containing a
+ * copy of s or NULL if the string cannot be allocated.
+ */
+char *av_strdup(const char *s) av_malloc_attrib;
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc() and set the pointer pointing to it to NULL.
+ * @param ptr Pointer to the pointer to the memory block which should
+ * be freed.
+ * @see av_free()
+ */
+void av_freep(void *ptr);
+
+/**
+ * @brief deliberately overlapping memcpy implementation
+ * @param dst destination buffer
+ * @param back how many bytes back we start (the initial size of the overlapping window)
+ * @param cnt number of bytes to copy, must be >= 0
+ *
+ * cnt > back is valid, this will copy the bytes we just copied,
+ * thus creating a repeating pattern with a period length of back.
+ */
+void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MEM_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h
new file mode 100644
index 000000000..a0ae06b89
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h
@@ -0,0 +1,132 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_OLD_PIX_FMTS_H
+#define AVUTIL_OLD_PIX_FMTS_H
+
+/*
+ * This header exists to prevent new pixel formats from being accidentally added
+ * to the deprecated list.
+ * Do not include it directly. It will be removed on next major bump
+ *
+ * Do not add new items to this list. Use the AVPixelFormat enum instead.
+ */
+ PIX_FMT_NONE = AV_PIX_FMT_NONE,
+ PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+ PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+ PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+ PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+ PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+ PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+ PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+ PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+ PIX_FMT_GRAY8, ///< Y , 8bpp
+ PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+ PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+ PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
+ PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+ PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+ PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+ PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+ PIX_FMT_XVMC_MPEG2_IDCT,
+ PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+ PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+ PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
+ PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+ PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
+ PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
+ PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+ PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
+ PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+ PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
+
+ PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+ PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+ PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+ PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+ PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
+ PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
+ PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+ PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+ PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+#if FF_API_VDPAU
+ PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+ PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+ PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+ PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
+ PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
+ PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+ PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+ PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
+ PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
+ PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+ PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+ PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+ PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+ PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+ PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+ PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+ PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+ PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+ PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+ PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+#if FF_API_VDPAU
+ PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+ PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+ PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+ PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+ PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+ PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+ PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha
+ PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+ PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+ PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+ PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+ PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+ PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+ PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+ PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+ PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+ PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+ PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+ PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+ PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+ PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+ PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
+ PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
+ PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
+ PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
+ PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
+ PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
+ PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
+ PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
+ PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h
new file mode 100644
index 000000000..0181379b7
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h
@@ -0,0 +1,516 @@
+/*
+ * AVOptions
+ * copyright (c) 2005 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_OPT_H
+#define AVUTIL_OPT_H
+
+/**
+ * @file
+ * AVOptions
+ */
+
+#include "rational.h"
+#include "avutil.h"
+#include "dict.h"
+#include "log.h"
+
+/**
+ * @defgroup avoptions AVOptions
+ * @ingroup lavu_data
+ * @{
+ * AVOptions provide a generic system to declare options on arbitrary structs
+ * ("objects"). An option can have a help text, a type and a range of possible
+ * values. Options may then be enumerated, read and written to.
+ *
+ * @section avoptions_implement Implementing AVOptions
+ * This section describes how to add AVOptions capabilities to a struct.
+ *
+ * All AVOptions-related information is stored in an AVClass. Therefore
+ * the first member of the struct must be a pointer to an AVClass describing it.
+ * The option field of the AVClass must be set to a NULL-terminated static array
+ * of AVOptions. Each AVOption must have a non-empty name, a type, a default
+ * value and for number-type AVOptions also a range of allowed values. It must
+ * also declare an offset in bytes from the start of the struct, where the field
+ * associated with this AVOption is located. Other fields in the AVOption struct
+ * should also be set when applicable, but are not required.
+ *
+ * The following example illustrates an AVOptions-enabled struct:
+ * @code
+ * typedef struct test_struct {
+ * AVClass *class;
+ * int int_opt;
+ * char *str_opt;
+ * uint8_t *bin_opt;
+ * int bin_len;
+ * } test_struct;
+ *
+ * static const AVOption test_options[] = {
+ * { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt),
+ * AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX },
+ * { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt),
+ * AV_OPT_TYPE_STRING },
+ * { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt),
+ * AV_OPT_TYPE_BINARY },
+ * { NULL },
+ * };
+ *
+ * static const AVClass test_class = {
+ * .class_name = "test class",
+ * .item_name = av_default_item_name,
+ * .option = test_options,
+ * .version = LIBAVUTIL_VERSION_INT,
+ * };
+ * @endcode
+ *
+ * Next, when allocating your struct, you must ensure that the AVClass pointer
+ * is set to the correct value. Then, av_opt_set_defaults() must be called to
+ * initialize defaults. After that the struct is ready to be used with the
+ * AVOptions API.
+ *
+ * When cleaning up, you may use the av_opt_free() function to automatically
+ * free all the allocated string and binary options.
+ *
+ * Continuing with the above example:
+ *
+ * @code
+ * test_struct *alloc_test_struct(void)
+ * {
+ * test_struct *ret = av_malloc(sizeof(*ret));
+ * ret->class = &test_class;
+ * av_opt_set_defaults(ret);
+ * return ret;
+ * }
+ * void free_test_struct(test_struct **foo)
+ * {
+ * av_opt_free(*foo);
+ * av_freep(foo);
+ * }
+ * @endcode
+ *
+ * @subsection avoptions_implement_nesting Nesting
+ * It may happen that an AVOptions-enabled struct contains another
+ * AVOptions-enabled struct as a member (e.g. AVCodecContext in
+ * libavcodec exports generic options, while its priv_data field exports
+ * codec-specific options). In such a case, it is possible to set up the
+ * parent struct to export a child's options. To do that, simply
+ * implement AVClass.child_next() and AVClass.child_class_next() in the
+ * parent struct's AVClass.
+ * Assuming that the test_struct from above now also contains a
+ * child_struct field:
+ *
+ * @code
+ * typedef struct child_struct {
+ * AVClass *class;
+ * int flags_opt;
+ * } child_struct;
+ * static const AVOption child_opts[] = {
+ * { "test_flags", "This is a test option of flags type.",
+ * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX },
+ * { NULL },
+ * };
+ * static const AVClass child_class = {
+ * .class_name = "child class",
+ * .item_name = av_default_item_name,
+ * .option = child_opts,
+ * .version = LIBAVUTIL_VERSION_INT,
+ * };
+ *
+ * void *child_next(void *obj, void *prev)
+ * {
+ * test_struct *t = obj;
+ * if (!prev && t->child_struct)
+ * return t->child_struct;
+ * return NULL
+ * }
+ * const AVClass child_class_next(const AVClass *prev)
+ * {
+ * return prev ? NULL : &child_class;
+ * }
+ * @endcode
+ * Putting child_next() and child_class_next() as defined above into
+ * test_class will now make child_struct's options accessible through
+ * test_struct (again, proper setup as described above needs to be done on
+ * child_struct right after it is created).
+ *
+ * From the above example it might not be clear why both child_next()
+ * and child_class_next() are needed. The distinction is that child_next()
+ * iterates over actually existing objects, while child_class_next()
+ * iterates over all possible child classes. E.g. if an AVCodecContext
+ * was initialized to use a codec which has private options, then its
+ * child_next() will return AVCodecContext.priv_data and finish
+ * iterating. OTOH child_class_next() on AVCodecContext.av_class will
+ * iterate over all available codecs with private options.
+ *
+ * @subsection avoptions_implement_named_constants Named constants
+ * It is possible to create named constants for options. Simply set the unit
+ * field of the option the constants should apply to to a string and
+ * create the constants themselves as options of type AV_OPT_TYPE_CONST
+ * with their unit field set to the same string.
+ * Their default_val field should contain the value of the named
+ * constant.
+ * For example, to add some named constants for the test_flags option
+ * above, put the following into the child_opts array:
+ * @code
+ * { "test_flags", "This is a test option of flags type.",
+ * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, "test_unit" },
+ * { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { .i64 = 16 }, 0, 0, "test_unit" },
+ * @endcode
+ *
+ * @section avoptions_use Using AVOptions
+ * This section deals with accessing options in an AVOptions-enabled struct.
+ * Such structs in Libav are e.g. AVCodecContext in libavcodec or
+ * AVFormatContext in libavformat.
+ *
+ * @subsection avoptions_use_examine Examining AVOptions
+ * The basic functions for examining options are av_opt_next(), which iterates
+ * over all options defined for one object, and av_opt_find(), which searches
+ * for an option with the given name.
+ *
+ * The situation is more complicated with nesting. An AVOptions-enabled struct
+ * may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag
+ * to av_opt_find() will make the function search children recursively.
+ *
+ * For enumerating there are basically two cases. The first is when you want to
+ * get all options that may potentially exist on the struct and its children
+ * (e.g. when constructing documentation). In that case you should call
+ * av_opt_child_class_next() recursively on the parent struct's AVClass. The
+ * second case is when you have an already initialized struct with all its
+ * children and you want to get all options that can be actually written or read
+ * from it. In that case you should call av_opt_child_next() recursively (and
+ * av_opt_next() on each result).
+ *
+ * @subsection avoptions_use_get_set Reading and writing AVOptions
+ * When setting options, you often have a string read directly from the
+ * user. In such a case, simply passing it to av_opt_set() is enough. For
+ * non-string type options, av_opt_set() will parse the string according to the
+ * option type.
+ *
+ * Similarly av_opt_get() will read any option type and convert it to a string
+ * which will be returned. Do not forget that the string is allocated, so you
+ * have to free it with av_free().
+ *
+ * In some cases it may be more convenient to put all options into an
+ * AVDictionary and call av_opt_set_dict() on it. A specific case of this
+ * are the format/codec open functions in lavf/lavc which take a dictionary
+ * filled with option as a parameter. This allows to set some options
+ * that cannot be set otherwise, since e.g. the input file format is not known
+ * before the file is actually opened.
+ */
+
+enum AVOptionType{
+ AV_OPT_TYPE_FLAGS,
+ AV_OPT_TYPE_INT,
+ AV_OPT_TYPE_INT64,
+ AV_OPT_TYPE_DOUBLE,
+ AV_OPT_TYPE_FLOAT,
+ AV_OPT_TYPE_STRING,
+ AV_OPT_TYPE_RATIONAL,
+ AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
+ AV_OPT_TYPE_CONST = 128,
+};
+
+/**
+ * AVOption
+ */
+typedef struct AVOption {
+ const char *name;
+
+ /**
+ * short English help text
+ * @todo What about other languages?
+ */
+ const char *help;
+
+ /**
+ * The offset relative to the context structure where the option
+ * value is stored. It should be 0 for named constants.
+ */
+ int offset;
+ enum AVOptionType type;
+
+ /**
+ * the default value for scalar options
+ */
+ union {
+ int64_t i64;
+ double dbl;
+ const char *str;
+ /* TODO those are unused now */
+ AVRational q;
+ } default_val;
+ double min; ///< minimum valid value for the option
+ double max; ///< maximum valid value for the option
+
+ int flags;
+#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
+#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
+#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
+#define AV_OPT_FLAG_AUDIO_PARAM 8
+#define AV_OPT_FLAG_VIDEO_PARAM 16
+#define AV_OPT_FLAG_SUBTITLE_PARAM 32
+//FIXME think about enc-audio, ... style flags
+
+ /**
+ * The logical unit to which the option belongs. Non-constant
+ * options and corresponding named constants share the same
+ * unit. May be NULL.
+ */
+ const char *unit;
+} AVOption;
+
+/**
+ * Show the obj options.
+ *
+ * @param req_flags requested flags for the options to show. Show only the
+ * options for which it is opt->flags & req_flags.
+ * @param rej_flags rejected flags for the options to show. Show only the
+ * options for which it is !(opt->flags & req_flags).
+ * @param av_log_obj log context to use for showing the options
+ */
+int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
+
+/**
+ * Set the values of all AVOption fields to their default values.
+ *
+ * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
+ */
+void av_opt_set_defaults(void *s);
+
+/**
+ * Parse the key/value pairs list in opts. For each key/value pair
+ * found, stores the value in the field in ctx that is named like the
+ * key. ctx must be an AVClass context, storing is done using
+ * AVOptions.
+ *
+ * @param key_val_sep a 0-terminated list of characters used to
+ * separate key from value
+ * @param pairs_sep a 0-terminated list of characters used to separate
+ * two pairs from each other
+ * @return the number of successfully set key/value pairs, or a negative
+ * value corresponding to an AVERROR code in case of error:
+ * AVERROR(EINVAL) if opts cannot be parsed,
+ * the error code issued by av_set_string3() if a key/value pair
+ * cannot be set
+ */
+int av_set_options_string(void *ctx, const char *opts,
+ const char *key_val_sep, const char *pairs_sep);
+
+/**
+ * Free all string and binary options in obj.
+ */
+void av_opt_free(void *obj);
+
+/**
+ * Check whether a particular flag is set in a flags field.
+ *
+ * @param field_name the name of the flag field option
+ * @param flag_name the name of the flag to check
+ * @return non-zero if the flag is set, zero if the flag isn't set,
+ * isn't of the right type, or the flags field doesn't exist.
+ */
+int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
+
+/*
+ * Set all the options from a given dictionary on an object.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass
+ * @param options options to process. This dictionary will be freed and replaced
+ * by a new one containing all options not found in obj.
+ * Of course this new dictionary needs to be freed by caller
+ * with av_dict_free().
+ *
+ * @return 0 on success, a negative AVERROR if some option was found in obj,
+ * but could not be set.
+ *
+ * @see av_dict_copy()
+ */
+int av_opt_set_dict(void *obj, struct AVDictionary **options);
+
+/**
+ * @defgroup opt_eval_funcs Evaluating option strings
+ * @{
+ * This group of functions can be used to evaluate option strings
+ * and get numbers out of them. They do the same thing as av_opt_set(),
+ * except the result is written into the caller-supplied pointer.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass.
+ * @param o an option for which the string is to be evaluated.
+ * @param val string to be evaluated.
+ * @param *_out value of the string will be written here.
+ *
+ * @return 0 on success, a negative number on failure.
+ */
+int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out);
+int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out);
+int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out);
+int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out);
+int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out);
+int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out);
+/**
+ * @}
+ */
+
+#define AV_OPT_SEARCH_CHILDREN 0x0001 /**< Search in possible children of the
+ given object first. */
+/**
+ * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass
+ * instead of a required pointer to a struct containing AVClass. This is
+ * useful for searching for options without needing to allocate the corresponding
+ * object.
+ */
+#define AV_OPT_SEARCH_FAKE_OBJ 0x0002
+
+/**
+ * Look for an option in an object. Consider only options which
+ * have all the specified flags set.
+ *
+ * @param[in] obj A pointer to a struct whose first element is a
+ * pointer to an AVClass.
+ * Alternatively a double pointer to an AVClass, if
+ * AV_OPT_SEARCH_FAKE_OBJ search flag is set.
+ * @param[in] name The name of the option to look for.
+ * @param[in] unit When searching for named constants, name of the unit
+ * it belongs to.
+ * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ *
+ * @return A pointer to the option found, or NULL if no option
+ * was found.
+ *
+ * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable
+ * directly with av_set_string3(). Use special calls which take an options
+ * AVDictionary (e.g. avformat_open_input()) to set options found with this
+ * flag.
+ */
+const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
+ int opt_flags, int search_flags);
+
+/**
+ * Look for an option in an object. Consider only options which
+ * have all the specified flags set.
+ *
+ * @param[in] obj A pointer to a struct whose first element is a
+ * pointer to an AVClass.
+ * Alternatively a double pointer to an AVClass, if
+ * AV_OPT_SEARCH_FAKE_OBJ search flag is set.
+ * @param[in] name The name of the option to look for.
+ * @param[in] unit When searching for named constants, name of the unit
+ * it belongs to.
+ * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ * @param[out] target_obj if non-NULL, an object to which the option belongs will be
+ * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present
+ * in search_flags. This parameter is ignored if search_flags contain
+ * AV_OPT_SEARCH_FAKE_OBJ.
+ *
+ * @return A pointer to the option found, or NULL if no option
+ * was found.
+ */
+const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
+ int opt_flags, int search_flags, void **target_obj);
+
+/**
+ * Iterate over all AVOptions belonging to obj.
+ *
+ * @param obj an AVOptions-enabled struct or a double pointer to an
+ * AVClass describing it.
+ * @param prev result of the previous call to av_opt_next() on this object
+ * or NULL
+ * @return next AVOption or NULL
+ */
+const AVOption *av_opt_next(void *obj, const AVOption *prev);
+
+/**
+ * Iterate over AVOptions-enabled children of obj.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return next AVOptions-enabled child or NULL
+ */
+void *av_opt_child_next(void *obj, void *prev);
+
+/**
+ * Iterate over potential AVOptions-enabled children of parent.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return AVClass corresponding to next potential child or NULL
+ */
+const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
+
+/**
+ * @defgroup opt_set_funcs Option setting functions
+ * @{
+ * Those functions set the field of obj with the given name to value.
+ *
+ * @param[in] obj A struct whose first element is a pointer to an AVClass.
+ * @param[in] name the name of the field to set
+ * @param[in] val The value to set. In case of av_opt_set() if the field is not
+ * of a string type, then the given string is parsed.
+ * SI postfixes and some named scalars are supported.
+ * If the field is of a numeric type, it has to be a numeric or named
+ * scalar. Behavior with more than one scalar and +- infix operators
+ * is undefined.
+ * If the field is of a flags type, it has to be a sequence of numeric
+ * scalars or named flags separated by '+' or '-'. Prefixing a flag
+ * with '+' causes it to be set without affecting the other flags;
+ * similarly, '-' unsets a flag.
+ * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be set on a child of obj.
+ *
+ * @return 0 if the value has been set, or an AVERROR code in case of
+ * error:
+ * AVERROR_OPTION_NOT_FOUND if no matching option exists
+ * AVERROR(ERANGE) if the value is out of range
+ * AVERROR(EINVAL) if the value is not valid
+ */
+int av_opt_set (void *obj, const char *name, const char *val, int search_flags);
+int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
+int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
+int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
+int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
+/**
+ * @}
+ */
+
+/**
+ * @defgroup opt_get_funcs Option getting functions
+ * @{
+ * Those functions get a value of the option with the given name from an object.
+ *
+ * @param[in] obj a struct whose first element is a pointer to an AVClass.
+ * @param[in] name name of the option to get.
+ * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be found in a child of obj.
+ * @param[out] out_val value of the option will be written here
+ * @return 0 on success, a negative error code otherwise
+ */
+/**
+ * @note the returned string will av_malloc()ed and must be av_free()ed by the caller
+ */
+int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
+int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
+int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val);
+int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
+/**
+ * @}
+ * @}
+ */
+
+#endif /* AVUTIL_OPT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h
new file mode 100644
index 000000000..0844abb2f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h
@@ -0,0 +1,124 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PARSEUTILS_H
+#define AVUTIL_PARSEUTILS_H
+
+#include
+
+#include "rational.h"
+
+/**
+ * @file
+ * misc parsing utilities
+ */
+
+/**
+ * Parse str and put in width_ptr and height_ptr the detected values.
+ *
+ * @param[in,out] width_ptr pointer to the variable which will contain the detected
+ * width value
+ * @param[in,out] height_ptr pointer to the variable which will contain the detected
+ * height value
+ * @param[in] str the string to parse: it has to be a string in the format
+ * width x height or a valid video size abbreviation.
+ * @return >= 0 on success, a negative error code otherwise
+ */
+int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str);
+
+/**
+ * Parse str and store the detected values in *rate.
+ *
+ * @param[in,out] rate pointer to the AVRational which will contain the detected
+ * frame rate
+ * @param[in] str the string to parse: it has to be a string in the format
+ * rate_num / rate_den, a float number or a valid video rate abbreviation
+ * @return >= 0 on success, a negative error code otherwise
+ */
+int av_parse_video_rate(AVRational *rate, const char *str);
+
+/**
+ * Put the RGBA values that correspond to color_string in rgba_color.
+ *
+ * @param color_string a string specifying a color. It can be the name of
+ * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
+ * possibly followed by "@" and a string representing the alpha
+ * component.
+ * The alpha component may be a string composed by "0x" followed by an
+ * hexadecimal number or a decimal number between 0.0 and 1.0, which
+ * represents the opacity value (0x00/0.0 means completely transparent,
+ * 0xff/1.0 completely opaque).
+ * If the alpha component is not specified then 0xff is assumed.
+ * The string "random" will result in a random color.
+ * @param slen length of the initial part of color_string containing the
+ * color. It can be set to -1 if color_string is a null terminated string
+ * containing nothing else than the color.
+ * @return >= 0 in case of success, a negative value in case of
+ * failure (for example if color_string cannot be parsed).
+ */
+int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
+ void *log_ctx);
+
+/**
+ * Parse timestr and return in *time a corresponding number of
+ * microseconds.
+ *
+ * @param timeval puts here the number of microseconds corresponding
+ * to the string in timestr. If the string represents a duration, it
+ * is the number of microseconds contained in the time interval. If
+ * the string is a date, is the number of microseconds since 1st of
+ * January, 1970 up to the time of the parsed date. If timestr cannot
+ * be successfully parsed, set *time to INT64_MIN.
+
+ * @param timestr a string representing a date or a duration.
+ * - If a date the syntax is:
+ * @code
+ * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
+ * now
+ * @endcode
+ * If the value is "now" it takes the current time.
+ * Time is local time unless Z is appended, in which case it is
+ * interpreted as UTC.
+ * If the year-month-day part is not specified it takes the current
+ * year-month-day.
+ * - If a duration the syntax is:
+ * @code
+ * [-]HH[:MM[:SS[.m...]]]
+ * [-]S+[.m...]
+ * @endcode
+ * @param duration flag which tells how to interpret timestr, if not
+ * zero timestr is interpreted as a duration, otherwise as a date
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_parse_time(int64_t *timeval, const char *timestr, int duration);
+
+/**
+ * Attempt to find a specific tag in a URL.
+ *
+ * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
+ * Return 1 if found.
+ */
+int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
+
+/**
+ * Convert the decomposed UTC time in tm to a time_t value.
+ */
+time_t av_timegm(struct tm *tm);
+
+#endif /* AVUTIL_PARSEUTILS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h
new file mode 100644
index 000000000..b1ba03f08
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h
@@ -0,0 +1,276 @@
+/*
+ * pixel format descriptor
+ * Copyright (c) 2009 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXDESC_H
+#define AVUTIL_PIXDESC_H
+
+#include
+
+#include "attributes.h"
+#include "pixfmt.h"
+
+typedef struct AVComponentDescriptor{
+ uint16_t plane :2; ///< which of the 4 planes contains the component
+
+ /**
+ * Number of elements between 2 horizontally consecutive pixels minus 1.
+ * Elements are bits for bitstream formats, bytes otherwise.
+ */
+ uint16_t step_minus1 :3;
+
+ /**
+ * Number of elements before the component of the first pixel plus 1.
+ * Elements are bits for bitstream formats, bytes otherwise.
+ */
+ uint16_t offset_plus1 :3;
+ uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value
+ uint16_t depth_minus1 :4; ///< number of bits in the component minus 1
+}AVComponentDescriptor;
+
+/**
+ * Descriptor that unambiguously describes how the bits of a pixel are
+ * stored in the up to 4 data planes of an image. It also stores the
+ * subsampling factors and number of components.
+ *
+ * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
+ * and all the YUV variants) AVPixFmtDescriptor just stores how values
+ * are stored not what these values represent.
+ */
+typedef struct AVPixFmtDescriptor{
+ const char *name;
+ uint8_t nb_components; ///< The number of components each pixel has, (1-4)
+
+ /**
+ * Amount to shift the luma width right to find the chroma width.
+ * For YV12 this is 1 for example.
+ * chroma_width = -((-luma_width) >> log2_chroma_w)
+ * The note above is needed to ensure rounding up.
+ * This value only refers to the chroma components.
+ */
+ uint8_t log2_chroma_w; ///< chroma_width = -((-luma_width )>>log2_chroma_w)
+
+ /**
+ * Amount to shift the luma height right to find the chroma height.
+ * For YV12 this is 1 for example.
+ * chroma_height= -((-luma_height) >> log2_chroma_h)
+ * The note above is needed to ensure rounding up.
+ * This value only refers to the chroma components.
+ */
+ uint8_t log2_chroma_h;
+ uint8_t flags;
+
+ /**
+ * Parameters that describe how pixels are packed. If the format
+ * has chroma components, they must be stored in comp[1] and
+ * comp[2].
+ */
+ AVComponentDescriptor comp[4];
+}AVPixFmtDescriptor;
+
+/**
+ * Pixel format is big-endian.
+ */
+#define AV_PIX_FMT_FLAG_BE (1 << 0)
+/**
+ * Pixel format has a palette in data[1], values are indexes in this palette.
+ */
+#define AV_PIX_FMT_FLAG_PAL (1 << 1)
+/**
+ * All values of a component are bit-wise packed end to end.
+ */
+#define AV_PIX_FMT_FLAG_BITSTREAM (1 << 2)
+/**
+ * Pixel format is an HW accelerated format.
+ */
+#define AV_PIX_FMT_FLAG_HWACCEL (1 << 3)
+/**
+ * At least one pixel component is not in the first data plane.
+ */
+#define AV_PIX_FMT_FLAG_PLANAR (1 << 4)
+/**
+ * The pixel format contains RGB-like data (as opposed to YUV/grayscale).
+ */
+#define AV_PIX_FMT_FLAG_RGB (1 << 5)
+/**
+ * The pixel format is "pseudo-paletted". This means that Libav treats it as
+ * paletted internally, but the palette is generated by the decoder and is not
+ * stored in the file.
+ */
+#define AV_PIX_FMT_FLAG_PSEUDOPAL (1 << 6)
+/**
+ * The pixel format has an alpha channel.
+ */
+#define AV_PIX_FMT_FLAG_ALPHA (1 << 7)
+
+#if FF_API_PIX_FMT
+/**
+ * @deprecate use the AV_PIX_FMT_FLAG_* flags
+ */
+#define PIX_FMT_BE AV_PIX_FMT_FLAG_BE
+#define PIX_FMT_PAL AV_PIX_FMT_FLAG_PAL
+#define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
+#define PIX_FMT_HWACCEL AV_PIX_FMT_FLAG_HWACCEL
+#define PIX_FMT_PLANAR AV_PIX_FMT_FLAG_PLANAR
+#define PIX_FMT_RGB AV_PIX_FMT_FLAG_RGB
+#define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
+#define PIX_FMT_ALPHA AV_PIX_FMT_FLAG_ALPHA
+#endif
+
+#if FF_API_PIX_FMT_DESC
+/**
+ * The array of all the pixel format descriptors.
+ */
+extern attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[];
+#endif
+
+/**
+ * Read a line from an image, and write the values of the
+ * pixel format component c to dst.
+ *
+ * @param data the array containing the pointers to the planes of the image
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to read
+ * @param y the vertical coordinate of the first pixel to read
+ * @param w the width of the line to read, that is the number of
+ * values to write to dst
+ * @param read_pal_component if not zero and the format is a paletted
+ * format writes the values corresponding to the palette
+ * component c in data[1] to dst, rather than the palette indexes in
+ * data[0]. The behavior is undefined if the format is not paletted.
+ */
+void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
+ const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
+
+/**
+ * Write the values from src to the pixel format component c of an
+ * image line.
+ *
+ * @param src array containing the values to write
+ * @param data the array containing the pointers to the planes of the
+ * image to write into. It is supposed to be zeroed.
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to write
+ * @param y the vertical coordinate of the first pixel to write
+ * @param w the width of the line to write, that is the number of
+ * values to write to the image line
+ */
+void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
+ const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
+
+/**
+ * Return the pixel format corresponding to name.
+ *
+ * If there is no pixel format with name name, then looks for a
+ * pixel format with the name corresponding to the native endian
+ * format of name.
+ * For example in a little-endian system, first looks for "gray16",
+ * then for "gray16le".
+ *
+ * Finally if no pixel format has been found, returns PIX_FMT_NONE.
+ */
+enum AVPixelFormat av_get_pix_fmt(const char *name);
+
+/**
+ * Return the short name for a pixel format, NULL in case pix_fmt is
+ * unknown.
+ *
+ * @see av_get_pix_fmt(), av_get_pix_fmt_string()
+ */
+const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
+
+/**
+ * Print in buf the string corresponding to the pixel format with
+ * number pix_fmt, or an header if pix_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param pix_fmt the number of the pixel format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ */
+char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
+
+/**
+ * Return the number of bits per pixel used by the pixel format
+ * described by pixdesc. Note that this is not the same as the number
+ * of bits per sample.
+ *
+ * The returned number of bits refers to the number of bits actually
+ * used for storing the pixel information, that is padding bits are
+ * not counted.
+ */
+int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
+
+/**
+ * @return a pixel format descriptor for provided pixel format or NULL if
+ * this pixel format is unknown.
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
+
+/**
+ * Iterate over all pixel format descriptors known to libavutil.
+ *
+ * @param prev previous descriptor. NULL to get the first descriptor.
+ *
+ * @return next descriptor or NULL after the last descriptor
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
+
+/**
+ * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
+ * is not a valid pointer to a pixel format descriptor.
+ */
+enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
+
+/**
+ * Utility function to access log2_chroma_w log2_chroma_h from
+ * the pixel format AVPixFmtDescriptor.
+ *
+ * @param[in] pix_fmt the pixel format
+ * @param[out] h_shift store log2_chroma_h
+ * @param[out] v_shift store log2_chroma_w
+ *
+ * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
+ */
+int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
+ int *h_shift, int *v_shift);
+
+/**
+ * @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a
+ * valid pixel format.
+ */
+int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt);
+
+
+/**
+ * Utility function to swap the endianness of a pixel format.
+ *
+ * @param[in] pix_fmt the pixel format
+ *
+ * @return pixel format with swapped endianness if it exists,
+ * otherwise AV_PIX_FMT_NONE
+ */
+enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
+
+
+#endif /* AVUTIL_PIXDESC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h
new file mode 100644
index 000000000..77305cacd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h
@@ -0,0 +1,277 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXFMT_H
+#define AVUTIL_PIXFMT_H
+
+/**
+ * @file
+ * pixel format definitions
+ *
+ */
+
+#include "libavutil/avconfig.h"
+#include "libavutil/version.h"
+
+/**
+ * Pixel format.
+ *
+ * @note
+ * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
+ * color is put together as:
+ * (A << 24) | (R << 16) | (G << 8) | B
+ * This is stored as BGRA on little-endian CPU architectures and ARGB on
+ * big-endian CPUs.
+ *
+ * @par
+ * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
+ * image data is stored in AVFrame.data[0]. The palette is transported in
+ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
+ * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
+ * also endian-specific). Note also that the individual RGB palette
+ * components stored in AVFrame.data[1] should be in the range 0..255.
+ * This is important as many custom PAL8 video codecs that were designed
+ * to run on the IBM VGA graphics adapter use 6-bit palette components.
+ *
+ * @par
+ * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
+ * for pal8. This palette is filled in automatically by the function
+ * allocating the picture.
+ *
+ * @note
+ * Make sure that all newly added big-endian formats have pix_fmt & 1 == 1
+ * and that all newly added little-endian formats have pix_fmt & 1 == 0.
+ * This allows simpler detection of big vs little-endian.
+ */
+enum AVPixelFormat {
+ AV_PIX_FMT_NONE = -1,
+ AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+ AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+ AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+ AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+ AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+ AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+ AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+ AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+ AV_PIX_FMT_GRAY8, ///< Y , 8bpp
+ AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+ AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+ AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
+ AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+ AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+ AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+ AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+ AV_PIX_FMT_XVMC_MPEG2_IDCT,
+ AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+ AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+ AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
+ AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+ AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
+ AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
+ AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+ AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
+ AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+ AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
+
+ AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+ AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+ AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+ AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+ AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
+ AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
+ AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+ AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+ AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+#if FF_API_VDPAU
+ AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+ AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+ AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+ AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
+ AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
+ AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+ AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+ AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
+ AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
+ AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+ AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+ AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+ AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+ AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+ AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+ AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+ AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+ AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+ AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+ AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+#if FF_API_VDPAU
+ AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+ AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+ AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+ AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+ AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+ AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+ AV_PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha
+ AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+ AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+ AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+ AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+ AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+ AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+ AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+ AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+ AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+ AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+ AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+ AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+ AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+ AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+ AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
+ AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
+ AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian
+ AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian
+ AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian
+ AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian
+ AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian
+ AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian
+ AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+ AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+ AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
+ AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
+ AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
+ AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
+ AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
+ AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
+ AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
+ AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
+ AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
+ AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
+ AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
+ AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
+ AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
+ AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
+ AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
+ AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
+ AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
+ AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
+ AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface
+ AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
+ AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
+ AV_PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#if FF_API_PIX_FMT
+#include "old_pix_fmts.h"
+#endif
+};
+
+#if AV_HAVE_BIGENDIAN
+# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be
+#else
+# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
+#endif
+
+#define AV_PIX_FMT_RGB32 AV_PIX_FMT_NE(ARGB, BGRA)
+#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
+#define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA)
+#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
+
+#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
+#define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE)
+#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
+#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
+#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
+#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE)
+#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
+#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
+#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
+
+#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
+#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
+#define AV_PIX_FMT_YUV444P9 AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
+#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
+#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
+#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
+#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
+#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
+#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
+
+#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE , GBRP9LE)
+#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE)
+#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE)
+
+#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
+#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
+#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
+#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
+#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
+#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
+#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
+#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
+#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
+
+#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
+
+#if FF_API_PIX_FMT
+#define PixelFormat AVPixelFormat
+
+#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
+
+#define PIX_FMT_RGB32 AV_PIX_FMT_RGB32
+#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
+#define PIX_FMT_BGR32 AV_PIX_FMT_BGR32
+#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
+
+#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
+#define PIX_FMT_RGB48 AV_PIX_FMT_RGB48
+#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
+#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
+#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
+#define PIX_FMT_BGR48 AV_PIX_FMT_BGR48
+#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
+#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
+#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
+
+#define PIX_FMT_YUV420P9 AV_PIX_FMT_YUV420P9
+#define PIX_FMT_YUV422P9 AV_PIX_FMT_YUV422P9
+#define PIX_FMT_YUV444P9 AV_PIX_FMT_YUV444P9
+#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
+#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
+#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
+#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
+#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
+#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
+
+#define PIX_FMT_GBRP9 AV_PIX_FMT_GBRP9
+#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
+#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
+#endif
+
+#endif /* AVUTIL_PIXFMT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h
new file mode 100644
index 000000000..b1fad13d0
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009 Baptiste Coudurier
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_RANDOM_SEED_H
+#define AVUTIL_RANDOM_SEED_H
+
+#include
+/**
+ * @addtogroup lavu_crypto
+ * @{
+ */
+
+/**
+ * Get random data.
+ *
+ * This function can be called repeatedly to generate more random bits
+ * as needed. It is generally quite slow, and usually used to seed a
+ * PRNG. As it uses /dev/urandom and /dev/random, the quality of the
+ * returned random data depends on the platform.
+ */
+uint32_t av_get_random_seed(void);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_RANDOM_SEED_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h
new file mode 100644
index 000000000..5d7dab7fd
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h
@@ -0,0 +1,155 @@
+/*
+ * rational numbers
+ * Copyright (c) 2003 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * rational numbers
+ * @author Michael Niedermayer
+ */
+
+#ifndef AVUTIL_RATIONAL_H
+#define AVUTIL_RATIONAL_H
+
+#include
+#include
+#include "attributes.h"
+
+/**
+ * @addtogroup lavu_math
+ * @{
+ */
+
+/**
+ * rational number numerator/denominator
+ */
+typedef struct AVRational{
+ int num; ///< numerator
+ int den; ///< denominator
+} AVRational;
+
+/**
+ * Compare two rationals.
+ * @param a first rational
+ * @param b second rational
+ * @return 0 if a==b, 1 if a>b, -1 if a>63)|1;
+ else if(b.den && a.den) return 0;
+ else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
+ else return INT_MIN;
+}
+
+/**
+ * Convert rational to double.
+ * @param a rational to convert
+ * @return (double) a
+ */
+static inline double av_q2d(AVRational a){
+ return a.num / (double) a.den;
+}
+
+/**
+ * Reduce a fraction.
+ * This is useful for framerate calculations.
+ * @param dst_num destination numerator
+ * @param dst_den destination denominator
+ * @param num source numerator
+ * @param den source denominator
+ * @param max the maximum allowed for dst_num & dst_den
+ * @return 1 if exact, 0 otherwise
+ */
+int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
+
+/**
+ * Multiply two rationals.
+ * @param b first rational
+ * @param c second rational
+ * @return b*c
+ */
+AVRational av_mul_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Divide one rational by another.
+ * @param b first rational
+ * @param c second rational
+ * @return b/c
+ */
+AVRational av_div_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Add two rationals.
+ * @param b first rational
+ * @param c second rational
+ * @return b+c
+ */
+AVRational av_add_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Subtract one rational from another.
+ * @param b first rational
+ * @param c second rational
+ * @return b-c
+ */
+AVRational av_sub_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Invert a rational.
+ * @param q value
+ * @return 1 / q
+ */
+static av_always_inline AVRational av_inv_q(AVRational q)
+{
+ AVRational r = { q.den, q.num };
+ return r;
+}
+
+/**
+ * Convert a double precision floating point number to a rational.
+ * inf is expressed as {1,0} or {-1,0} depending on the sign.
+ *
+ * @param d double to convert
+ * @param max the maximum allowed numerator and denominator
+ * @return (AVRational) d
+ */
+AVRational av_d2q(double d, int max) av_const;
+
+/**
+ * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
+ * than q1, 0 if they have the same distance.
+ */
+int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
+
+/**
+ * Find the nearest value in q_list to q.
+ * @param q_list an array of rationals terminated by {0, 0}
+ * @return the index of the nearest value found in the array
+ */
+int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_RATIONAL_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h
new file mode 100644
index 000000000..33cbdedf5
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h
@@ -0,0 +1,220 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_SAMPLEFMT_H
+#define AVUTIL_SAMPLEFMT_H
+
+#include
+
+#include "avutil.h"
+#include "attributes.h"
+
+/**
+ * Audio Sample Formats
+ *
+ * @par
+ * The data described by the sample format is always in native-endian order.
+ * Sample values can be expressed by native C types, hence the lack of a signed
+ * 24-bit sample format even though it is a common raw audio data format.
+ *
+ * @par
+ * The floating-point formats are based on full volume being in the range
+ * [-1.0, 1.0]. Any values outside this range are beyond full volume level.
+ *
+ * @par
+ * The data layout as used in av_samples_fill_arrays() and elsewhere in Libav
+ * (such as AVFrame in libavcodec) is as follows:
+ *
+ * For planar sample formats, each audio channel is in a separate data plane,
+ * and linesize is the buffer size, in bytes, for a single plane. All data
+ * planes must be the same size. For packed sample formats, only the first data
+ * plane is used, and samples for each channel are interleaved. In this case,
+ * linesize is the buffer size, in bytes, for the 1 plane.
+ */
+enum AVSampleFormat {
+ AV_SAMPLE_FMT_NONE = -1,
+ AV_SAMPLE_FMT_U8, ///< unsigned 8 bits
+ AV_SAMPLE_FMT_S16, ///< signed 16 bits
+ AV_SAMPLE_FMT_S32, ///< signed 32 bits
+ AV_SAMPLE_FMT_FLT, ///< float
+ AV_SAMPLE_FMT_DBL, ///< double
+
+ AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar
+ AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar
+ AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar
+ AV_SAMPLE_FMT_FLTP, ///< float, planar
+ AV_SAMPLE_FMT_DBLP, ///< double, planar
+
+ AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically
+};
+
+/**
+ * Return the name of sample_fmt, or NULL if sample_fmt is not
+ * recognized.
+ */
+const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
+
+/**
+ * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
+ * on error.
+ */
+enum AVSampleFormat av_get_sample_fmt(const char *name);
+
+/**
+ * Get the packed alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in packed format, the format returned is
+ * the same as the input.
+ *
+ * @return the packed alternative form of the given sample format or
+ AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
+ * Get the planar alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in planar format, the format returned is
+ * the same as the input.
+ *
+ * @return the planar alternative form of the given sample format or
+ AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
+ * Generate a string corresponding to the sample format with
+ * sample_fmt, or a header if sample_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param sample_fmt the number of the sample format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ * @return the pointer to the filled buffer or NULL if sample_fmt is
+ * unknown or in case of other errors
+ */
+char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
+
+/**
+ * Return number of bytes per sample.
+ *
+ * @param sample_fmt the sample format
+ * @return number of bytes per sample or zero if unknown for the given
+ * sample format
+ */
+int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
+
+/**
+ * Check if the sample format is planar.
+ *
+ * @param sample_fmt the sample format to inspect
+ * @return 1 if the sample format is planar, 0 if it is interleaved
+ */
+int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
+
+/**
+ * Get the required buffer size for the given audio parameters.
+ *
+ * @param[out] linesize calculated linesize, may be NULL
+ * @param nb_channels the number of channels
+ * @param nb_samples the number of samples in a single channel
+ * @param sample_fmt the sample format
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
+ * @return required buffer size, or negative error code on failure
+ */
+int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
+ enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Fill channel data pointers and linesize for samples with sample
+ * format sample_fmt.
+ *
+ * The pointers array is filled with the pointers to the samples data:
+ * for planar, set the start point of each channel's data within the buffer,
+ * for packed, set the start point of the entire buffer only.
+ *
+ * The linesize array is filled with the aligned size of each channel's data
+ * buffer for planar layout, or the aligned size of the buffer for all channels
+ * for packed layout.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param[out] audio_data array to be filled with the pointer for each channel
+ * @param[out] linesize calculated linesize, may be NULL
+ * @param buf the pointer to a buffer containing the samples
+ * @param nb_channels the number of channels
+ * @param nb_samples the number of samples in a single channel
+ * @param sample_fmt the sample format
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
+ * @return 0 on success or a negative error code on failure
+ */
+int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
+ const uint8_t *buf,
+ int nb_channels, int nb_samples,
+ enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Allocate a samples buffer for nb_samples samples, and fill data pointers and
+ * linesize accordingly.
+ * The allocated samples buffer can be freed by using av_freep(&audio_data[0])
+ * Allocated data will be initialized to silence.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param[out] audio_data array to be filled with the pointer for each channel
+ * @param[out] linesize aligned size for audio buffer(s), may be NULL
+ * @param nb_channels number of audio channels
+ * @param nb_samples number of samples per channel
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
+ * @return 0 on success or a negative error code on failure
+ * @see av_samples_fill_arrays()
+ */
+int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
+ int nb_samples, enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Copy samples from src to dst.
+ *
+ * @param dst destination array of pointers to data planes
+ * @param src source array of pointers to data planes
+ * @param dst_offset offset in samples at which the data will be written to dst
+ * @param src_offset offset in samples at which the data will be read from src
+ * @param nb_samples number of samples to be copied
+ * @param nb_channels number of audio channels
+ * @param sample_fmt audio sample format
+ */
+int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
+ int src_offset, int nb_samples, int nb_channels,
+ enum AVSampleFormat sample_fmt);
+
+/**
+ * Fill an audio buffer with silence.
+ *
+ * @param audio_data array of pointers to data planes
+ * @param offset offset in samples at which to start filling
+ * @param nb_samples number of samples to fill
+ * @param nb_channels number of audio channels
+ * @param sample_fmt audio sample format
+ */
+int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
+ int nb_channels, enum AVSampleFormat sample_fmt);
+
+#endif /* AVUTIL_SAMPLEFMT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h
new file mode 100644
index 000000000..4c9a0c909
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2007 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_SHA_H
+#define AVUTIL_SHA_H
+
+#include
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_sha SHA
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_sha_size;
+#endif
+
+struct AVSHA;
+
+/**
+ * Allocate an AVSHA context.
+ */
+struct AVSHA *av_sha_alloc(void);
+
+/**
+ * Initialize SHA-1 or SHA-2 hashing.
+ *
+ * @param context pointer to the function context (of size av_sha_size)
+ * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
+ * @return zero if initialization succeeded, -1 otherwise
+ */
+int av_sha_init(struct AVSHA* context, int bits);
+
+/**
+ * Update hash value.
+ *
+ * @param context hash function context
+ * @param data input data to update hash with
+ * @param len input data length
+ */
+void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len);
+
+/**
+ * Finish hashing and output digest value.
+ *
+ * @param context hash function context
+ * @param digest buffer where output digest value is stored
+ */
+void av_sha_final(struct AVSHA* context, uint8_t *digest);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_SHA_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h
new file mode 100644
index 000000000..b01a97d77
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h
@@ -0,0 +1,39 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_TIME_H
+#define AVUTIL_TIME_H
+
+#include
+
+/**
+ * Get the current time in microseconds.
+ */
+int64_t av_gettime(void);
+
+/**
+ * Sleep for a period of time. Although the duration is expressed in
+ * microseconds, the actual delay may be rounded to the precision of the
+ * system timer.
+ *
+ * @param usec Number of microseconds to sleep.
+ * @return zero on success or (negative) error code.
+ */
+int av_usleep(unsigned usec);
+
+#endif /* AVUTIL_TIME_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h
new file mode 100644
index 000000000..c760d8d75
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h
@@ -0,0 +1,96 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_VERSION_H
+#define AVUTIL_VERSION_H
+
+#include "avutil.h"
+
+/**
+ * @file
+ * @ingroup lavu
+ * Libavutil version macros
+ */
+
+/**
+ * @defgroup lavu_ver Version and Build diagnostics
+ *
+ * Macros and function useful to check at compiletime and at runtime
+ * which version of libavutil is in use.
+ *
+ * @{
+ */
+
+#define LIBAVUTIL_VERSION_MAJOR 52
+#define LIBAVUTIL_VERSION_MINOR 14
+#define LIBAVUTIL_VERSION_MICRO 0
+
+#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+ LIBAVUTIL_VERSION_MINOR, \
+ LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
+ LIBAVUTIL_VERSION_MINOR, \
+ LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
+
+#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
+
+/**
+ * @}
+ *
+ * @defgroup depr_guards Deprecation guards
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ *
+ * @{
+ */
+
+#ifndef FF_API_PIX_FMT
+#define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_CONTEXT_SIZE
+#define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_PIX_FMT_DESC
+#define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_AV_REVERSE
+#define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_AUDIOCONVERT
+#define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_CPU_FLAG_MMX2
+#define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_LLS_PRIVATE
+#define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_AVFRAME_LAVC
+#define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+#ifndef FF_API_VDPAU
+#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h
new file mode 100644
index 000000000..7d2b07bbc
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h
@@ -0,0 +1,61 @@
+/*
+ * A 32-bit implementation of the XTEA algorithm
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_XTEA_H
+#define AVUTIL_XTEA_H
+
+#include
+
+/**
+ * @defgroup lavu_xtea XTEA
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+typedef struct AVXTEA {
+ uint32_t key[16];
+} AVXTEA;
+
+/**
+ * Initialize an AVXTEA context.
+ *
+ * @param ctx an AVXTEA context
+ * @param key a key of 16 bytes used for encryption/decryption
+ */
+void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVXTEA context
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param count number of 8 byte blocks
+ * @param iv initialization vector for CBC mode, if NULL then ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
+ int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_XTEA_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h
new file mode 100644
index 000000000..95e8a5a09
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
+ *
+ * This file is part of libswresample
+ *
+ * libswresample 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.1 of the License, or (at your option) any later version.
+ *
+ * libswresample 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 libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWRESAMPLE_SWRESAMPLE_H
+#define SWRESAMPLE_SWRESAMPLE_H
+
+/**
+ * @file
+ * @ingroup lswr
+ * libswresample public header
+ */
+
+/**
+ * @defgroup lswr Libswresample
+ * @{
+ *
+ * Libswresample (lswr) is a library that handles audio resampling, sample
+ * format conversion and mixing.
+ *
+ * Interaction with lswr is done through SwrContext, which is
+ * allocated with swr_alloc() or swr_alloc_set_opts(). It is opaque, so all parameters
+ * must be set with the @ref avoptions API.
+ *
+ * For example the following code will setup conversion from planar float sample
+ * format to interleaved signed 16-bit integer, downsampling from 48kHz to
+ * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
+ * matrix):
+ * @code
+ * SwrContext *swr = swr_alloc();
+ * av_opt_set_int(swr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0);
+ * av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
+ * av_opt_set_int(swr, "in_sample_rate", 48000, 0);
+ * av_opt_set_int(swr, "out_sample_rate", 44100, 0);
+ * av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
+ * av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);
+ * @endcode
+ *
+ * Once all values have been set, it must be initialized with swr_init(). If
+ * you need to change the conversion parameters, you can change the parameters
+ * as described above, or by using swr_alloc_set_opts(), then call swr_init()
+ * again.
+ *
+ * The conversion itself is done by repeatedly calling swr_convert().
+ * Note that the samples may get buffered in swr if you provide insufficient
+ * output space or if sample rate conversion is done, which requires "future"
+ * samples. Samples that do not require future input can be retrieved at any
+ * time by using swr_convert() (in_count can be set to 0).
+ * At the end of conversion the resampling buffer can be flushed by calling
+ * swr_convert() with NULL in and 0 in_count.
+ *
+ * The delay between input and output, can at any time be found by using
+ * swr_get_delay().
+ *
+ * The following code demonstrates the conversion loop assuming the parameters
+ * from above and caller-defined functions get_input() and handle_output():
+ * @code
+ * uint8_t **input;
+ * int in_samples;
+ *
+ * while (get_input(&input, &in_samples)) {
+ * uint8_t *output;
+ * int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
+ * in_samples, 44100, 48000, AV_ROUND_UP);
+ * av_samples_alloc(&output, NULL, 2, out_samples,
+ * AV_SAMPLE_FMT_S16, 0);
+ * out_samples = swr_convert(swr, &output, out_samples,
+ * input, in_samples);
+ * handle_output(output, out_samples);
+ * av_freep(&output);
+ * }
+ * @endcode
+ *
+ * When the conversion is finished, the conversion
+ * context and everything associated with it must be freed with swr_free().
+ * There will be no memory leak if the data is not completely flushed before
+ * swr_free().
+ */
+
+#include
+#include "libavutil/samplefmt.h"
+
+#include "libswresample/version.h"
+
+#if LIBSWRESAMPLE_VERSION_MAJOR < 1
+#define SWR_CH_MAX 32 ///< Maximum number of channels
+#endif
+
+#define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
+//TODO use int resample ?
+//long term TODO can we enable this dynamically?
+
+enum SwrDitherType {
+ SWR_DITHER_NONE = 0,
+ SWR_DITHER_RECTANGULAR,
+ SWR_DITHER_TRIANGULAR,
+ SWR_DITHER_TRIANGULAR_HIGHPASS,
+
+ SWR_DITHER_NS = 64, ///< not part of API/ABI
+ SWR_DITHER_NS_LIPSHITZ,
+ SWR_DITHER_NS_F_WEIGHTED,
+ SWR_DITHER_NS_MODIFIED_E_WEIGHTED,
+ SWR_DITHER_NS_IMPROVED_E_WEIGHTED,
+ SWR_DITHER_NS_SHIBATA,
+ SWR_DITHER_NS_LOW_SHIBATA,
+ SWR_DITHER_NS_HIGH_SHIBATA,
+ SWR_DITHER_NB, ///< not part of API/ABI
+};
+
+/** Resampling Engines */
+enum SwrEngine {
+ SWR_ENGINE_SWR, /**< SW Resampler */
+ SWR_ENGINE_SOXR, /**< SoX Resampler */
+ SWR_ENGINE_NB, ///< not part of API/ABI
+};
+
+/** Resampling Filter Types */
+enum SwrFilterType {
+ SWR_FILTER_TYPE_CUBIC, /**< Cubic */
+ SWR_FILTER_TYPE_BLACKMAN_NUTTALL, /**< Blackman Nuttall Windowed Sinc */
+ SWR_FILTER_TYPE_KAISER, /**< Kaiser Windowed Sinc */
+};
+
+typedef struct SwrContext SwrContext;
+
+/**
+ * Get the AVClass for swrContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *swr_get_class(void);
+
+/**
+ * Allocate SwrContext.
+ *
+ * If you use this function you will need to set the parameters (manually or
+ * with swr_alloc_set_opts()) before calling swr_init().
+ *
+ * @see swr_alloc_set_opts(), swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc(void);
+
+/**
+ * Initialize context after user parameters have been set.
+ *
+ * @return AVERROR error code in case of failure.
+ */
+int swr_init(struct SwrContext *s);
+
+/**
+ * Allocate SwrContext if needed and set/reset common parameters.
+ *
+ * This function does not require s to be allocated with swr_alloc(). On the
+ * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters
+ * on the allocated context.
+ *
+ * @param s Swr context, can be NULL
+ * @param out_ch_layout output channel layout (AV_CH_LAYOUT_*)
+ * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_*).
+ * @param out_sample_rate output sample rate (frequency in Hz)
+ * @param in_ch_layout input channel layout (AV_CH_LAYOUT_*)
+ * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_*).
+ * @param in_sample_rate input sample rate (frequency in Hz)
+ * @param log_offset logging level offset
+ * @param log_ctx parent logging context, can be NULL
+ *
+ * @see swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
+ int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+ int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
+ int log_offset, void *log_ctx);
+
+/**
+ * Free the given SwrContext and set the pointer to NULL.
+ */
+void swr_free(struct SwrContext **s);
+
+/**
+ * Convert audio.
+ *
+ * in and in_count can be set to 0 to flush the last few samples out at the
+ * end.
+ *
+ * If more input is provided than output space then the input will be buffered.
+ * You can avoid this buffering by providing more output space than input.
+ * Convertion will run directly without copying whenever possible.
+ *
+ * @param s allocated Swr context, with parameters set
+ * @param out output buffers, only the first one need be set in case of packed audio
+ * @param out_count amount of space available for output in samples per channel
+ * @param in input buffers, only the first one need to be set in case of packed audio
+ * @param in_count number of input samples available in one channel
+ *
+ * @return number of samples output per channel, negative value on error
+ */
+int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
+ const uint8_t **in , int in_count);
+
+/**
+ * Convert the next timestamp from input to output
+ * timestamps are in 1/(in_sample_rate * out_sample_rate) units.
+ *
+ * @note There are 2 slightly differently behaving modes.
+ * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
+ * in this case timestamps will be passed through with delays compensated
+ * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX)
+ * in this case the output timestamps will match output sample numbers
+ *
+ * @param pts timestamp for the next input sample, INT64_MIN if unknown
+ * @return the output timestamp for the next output sample
+ */
+int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
+
+/**
+ * Activate resampling compensation.
+ */
+int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
+
+/**
+ * Set a customized input channel mapping.
+ *
+ * @param s allocated Swr context, not yet initialized
+ * @param channel_map customized input channel mapping (array of channel
+ * indexes, -1 for a muted channel)
+ * @return AVERROR error code in case of failure.
+ */
+int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
+
+/**
+ * Set a customized remix matrix.
+ *
+ * @param s allocated Swr context, not yet initialized
+ * @param matrix remix coefficients; matrix[i + stride * o] is
+ * the weight of input channel i in output channel o
+ * @param stride offset between lines of the matrix
+ * @return AVERROR error code in case of failure.
+ */
+int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
+
+/**
+ * Drops the specified number of output samples.
+ */
+int swr_drop_output(struct SwrContext *s, int count);
+
+/**
+ * Injects the specified number of silence samples.
+ */
+int swr_inject_silence(struct SwrContext *s, int count);
+
+/**
+ * Gets the delay the next input sample will experience relative to the next output sample.
+ *
+ * Swresample can buffer data if more input has been provided than available
+ * output space, also converting between sample rates needs a delay.
+ * This function returns the sum of all such delays.
+ * The exact delay is not necessarily an integer value in either input or
+ * output sample rate. Especially when downsampling by a large value, the
+ * output sample rate may be a poor choice to represent the delay, similarly
+ * for upsampling and the input sample rate.
+ *
+ * @param s swr context
+ * @param base timebase in which the returned delay will be
+ * if its set to 1 the returned delay is in seconds
+ * if its set to 1000 the returned delay is in milli seconds
+ * if its set to the input sample rate then the returned delay is in input samples
+ * if its set to the output sample rate then the returned delay is in output samples
+ * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate)
+ * @returns the delay in 1/base units.
+ */
+int64_t swr_get_delay(struct SwrContext *s, int64_t base);
+
+/**
+ * Return the LIBSWRESAMPLE_VERSION_INT constant.
+ */
+unsigned swresample_version(void);
+
+/**
+ * Return the swr build-time configuration.
+ */
+const char *swresample_configuration(void);
+
+/**
+ * Return the swr license.
+ */
+const char *swresample_license(void);
+
+/**
+ * @}
+ */
+
+#endif /* SWRESAMPLE_SWRESAMPLE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h
new file mode 100644
index 000000000..df9df480c
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h
@@ -0,0 +1,45 @@
+/*
+ * Version macros.
+ *
+ * This file is part of libswresample
+ *
+ * libswresample 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.1 of the License, or (at your option) any later version.
+ *
+ * libswresample 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 libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWR_VERSION_H
+#define SWR_VERSION_H
+
+/**
+ * @file
+ * Libswresample version macros
+ */
+
+#include "libavutil/avutil.h"
+
+#define LIBSWRESAMPLE_VERSION_MAJOR 0
+#define LIBSWRESAMPLE_VERSION_MINOR 17
+#define LIBSWRESAMPLE_VERSION_MICRO 102
+
+#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
+ LIBSWRESAMPLE_VERSION_MINOR, \
+ LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
+ LIBSWRESAMPLE_VERSION_MINOR, \
+ LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT
+
+#define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
+
+#endif /* SWR_VERSION_H */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 0feca9f45..7f57138a7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -197,13 +197,33 @@ public interface GLMediaPlayer extends TextureSequence {
* {@link URI#getScheme() URI scheme} name {@value} for camera input. E.g. camera://0
* for the 1st camera device.
*
- * Note: the {@link URI#getHost() URI host} is being used to identify the camera:
+ * The {@link URI#getRawPath() URI path} is being used to identify the camera,
+ * where the root fwd-slash is being cut-off.
+ *
+ *
+ * The {@link URI#getRawQuery() URI query} is used to pass options to the camera.
+ *
+ *
+ * camera:/
+ * camera://somewhere/
+ * camera://somewhere/?width=640&height=480&rate=15
+ *
*
- * camera://
+ * URI: [scheme:][//authority][path][?query][#fragment]
+ * w/ authority: [user-info@]host[:port]
+ * Note: 'path' starts w/ fwd slash
*
*
*/
public static final String CameraInputScheme = "camera";
+ /** Camera property {@value}, size as string, e.g. 1280x720
, hd720
. May not be supported on all platforms. See {@link #CameraInputScheme}. */
+ public static final String CameraPropSizeS = "size";
+ /** Camera property {@value}. See {@link #CameraInputScheme}. */
+ public static final String CameraPropWidth = "width";
+ /** Camera property {@value}. See {@link #CameraInputScheme}. */
+ public static final String CameraPropHeight = "height";
+ /** Camera property {@value}. See {@link #CameraInputScheme}. */
+ public static final String CameraPropRate = "rate";
/** Maximum video frame async of {@value} milliseconds. */
public static final int MAXIMUM_VIDEO_ASYNC = 22;
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 056998c0c..38faf62a6 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -254,12 +254,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
return;
}
if( null == mp && null == cam ) {
- if( null == cameraHostPart ) {
+ if( null == cameraPath ) {
mp = new MediaPlayer();
} else {
int cameraId = 0;
try {
- cameraId = Integer.valueOf(cameraHostPart);
+ cameraId = Integer.valueOf(cameraPath);
} catch (NumberFormatException nfe) {}
if( 0 <= cameraId && cameraId < Camera.getNumberOfCameras() ) {
cam = Camera.open(cameraId);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 5286c86b8..ab0e2eebd 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -31,6 +31,7 @@ import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.Map;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.opengl.GL;
@@ -44,6 +45,7 @@ import javax.media.opengl.GLProfile;
import jogamp.opengl.Debug;
+import com.jogamp.common.net.URIQueryProps;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.LFRingbuffer;
import com.jogamp.common.util.Ringbuffer;
@@ -89,10 +91,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected URI streamLoc = null;
/**
* In case {@link #streamLoc} is a {@link GLMediaPlayer#CameraInputScheme},
- * {@link #cameraHostPart} holds the URI's path portion
+ * {@link #cameraPath} holds the URI's path portion
* as parsed in {@link #initStream(URI, int, int, int)}.
+ * @see #cameraProps
*/
- protected String cameraHostPart = null;
+ protected String cameraPath = null;
+ /** Optional camera properties, see {@link #cameraPath}. */
+ protected Map cameraProps = null;
protected volatile float playSpeed = 1.0f;
protected float audioVolume = 1.0f;
@@ -472,11 +477,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.streamLoc = streamLoc;
// Pre-parse for camera-input scheme
+ cameraPath = null;
+ cameraProps = null;
final String streamLocScheme = streamLoc.getScheme();
if( null != streamLocScheme && streamLocScheme.equals(CameraInputScheme) ) {
- cameraHostPart = streamLoc.getHost();
- } else {
- cameraHostPart = null;
+ final String rawPath = streamLoc.getRawPath();
+ if( null != rawPath && rawPath.length() > 0 ) {
+ // cut-off root fwd-slash
+ cameraPath = rawPath.substring(1);
+ final URIQueryProps props = URIQueryProps.create(streamLoc);
+ cameraProps = props.getProperties();
+ } else {
+ throw new IllegalArgumentException("Camera path is empty: "+streamLoc.toString());
+ }
}
this.vid = vid;
@@ -526,6 +539,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
if( STREAM_ID_NONE != vid ) {
removeAllTextureFrames(gl);
initGLImpl(gl);
+ if(DEBUG) {
+ System.err.println("initGLImpl.X "+this);
+ }
videoFramesOrig = createTexFrames(gl, textureCount);
videoFramesFree = new LFRingbuffer(videoFramesOrig);
videoFramesDecoded = new LFRingbuffer(TextureFrame[].class, textureCount);
@@ -615,13 +631,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
final int err = gl.glGetError();
if( GL.GL_NO_ERROR != err ) {
throw new RuntimeException("Couldn't create TexImage2D RGBA "+tWidth+"x"+tHeight+", target "+toHexString(textureTarget)+
- ", ifmt "+toHexString(GL.GL_RGBA)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+
+ ", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+
", err "+toHexString(err));
}
}
if(DEBUG) {
System.err.println("Created TexImage2D RGBA "+tWidth+"x"+tHeight+", target "+toHexString(textureTarget)+
- ", ifmt "+toHexString(GL.GL_RGBA)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType));
+ ", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType));
}
}
gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, texMinMagFilter[0]);
@@ -1322,10 +1338,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed );
- final String camPath = null != cameraHostPart ? ", camera: "+cameraHostPart : "";
+ final String camPath = null != cameraPath ? ", camera: "+cameraPath : "";
return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s)], "+
"speed "+playSpeed+", "+bps_stream+" bps, "+
- "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", target "+toHexString(textureTarget)+", format "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+
+ "Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+
"Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
"Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]";
}
@@ -1394,4 +1410,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected static final String toHexString(int v) {
return "0x"+Integer.toHexString(v);
}
+ protected static final int getPropIntVal(Map props, String key) {
+ final String val = props.get(key);
+ try {
+ return Integer.valueOf(val).intValue();
+ } catch (NumberFormatException nfe) {
+ if(DEBUG) {
+ System.err.println("Not a valid integer for <"+key+">: <"+val+">");
+ }
+ }
+ return 0;
+ }
}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index f327cddd4..400788a24 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -32,10 +32,8 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import javax.media.opengl.GLProfile;
@@ -53,12 +51,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
private static final List glueLibNames = new ArrayList(); // none
- private static final int symbolCount = 54;
+ private static final int symbolCount = 65;
private static final String[] symbolNames = {
- "avcodec_version",
- "avformat_version",
"avutil_version",
-/* 4 */ "avresample_version",
+ "avformat_version",
+ "avcodec_version",
+ "avresample_version",
+/* 5 */ "swresample_version",
// libavcodec
"avcodec_register_all",
@@ -69,15 +68,20 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"avcodec_alloc_frame",
"avcodec_get_frame_defaults",
"avcodec_free_frame", // 54.28.0 (opt)
- "avcodec_default_get_buffer",
- "avcodec_default_release_buffer",
+ "avcodec_default_get_buffer", // <= 54 (opt), else sp_avcodec_default_get_buffer2
+ "avcodec_default_release_buffer", // <= 54 (opt), else sp_av_frame_unref
+ "avcodec_default_get_buffer2", // 55 (opt)
+ "avcodec_get_edge_width",
+ "av_image_fill_linesizes",
+ "avcodec_align_dimensions",
+ "avcodec_align_dimensions2",
"avcodec_flush_buffers",
"av_init_packet",
"av_new_packet",
"av_destruct_packet",
"av_free_packet",
"avcodec_decode_audio4", // 53.25.0 (opt)
-/* 21 */ "avcodec_decode_video2", // 52.23.0
+/* 27 */ "avcodec_decode_video2", // 52.23.0
// libavutil
"av_pix_fmt_descriptors",
@@ -91,7 +95,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"av_dict_get",
"av_dict_count", // 54.* (opt)
"av_dict_set",
-/* 33 */ "av_dict_free",
+/* 28 */ "av_dict_free",
// libavformat
"avformat_alloc_context",
@@ -108,22 +112,25 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"av_read_pause",
"avformat_network_init", // 53.13.0 (opt)
"avformat_network_deinit", // 53.13.0 (opt)
-/* 48 */ "avformat_find_stream_info", // 53.3.0 (opt)
+/* 54 */ "avformat_find_stream_info", // 53.3.0 (opt)
// libavdevice
-/* 49 */ "avdevice_register_all", // ???
+/* 55 */ "avdevice_register_all", // ???
// libavresample
"avresample_alloc_context", // 1.0.1
"avresample_open",
"avresample_close",
"avresample_free",
-/* 54 */ "avresample_convert"
- };
-
- // alternate symbol names
- private static final String[][] altSymbolNames = {
- // { "av_find_stream_info", "avformat_find_stream_info" }, // old, 53.3.0
+/* 60 */ "avresample_convert",
+
+ // libavresample
+ "av_opt_set_sample_fmt", // actually lavu .. but exist only w/ swresample!
+ "swr_alloc",
+ "swr_init",
+ "swr_free",
+/* 65 */ "swr_convert",
+
};
// optional symbol names
@@ -132,8 +139,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"avcodec_free_frame", // 54.28.0 (opt)
"av_frame_unref", // 55.0.0 (opt)
"av_dict_count", // 54.* (opt)
+ "avcodec_default_get_buffer", // <= 54 (opt), else sp_avcodec_default_get_buffer2
+ "avcodec_default_release_buffer", // <= 54 (opt), else sp_av_frame_unref
+ "avcodec_default_get_buffer2", // 55 (opt)
+
// libavdevice
"avdevice_register_all", // 53.0.0 (opt)
+
// libavresample
"avresample_version", // 1.0.1
"avresample_alloc_context", // 1.0.1
@@ -141,41 +153,60 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"avresample_close",
"avresample_free",
"avresample_convert",
+
+ // libavresample
+ "av_opt_set_sample_fmt", // actually lavu .. but exist only w/ swresample!
+ "swresample_version", // 0
+ "swr_alloc",
+ "swr_init",
+ "swr_free",
+ "swr_convert",
};
private static final long[] symbolAddr = new long[symbolCount];
private static final boolean ready;
- private static final boolean libsLoaded;
+ private static final boolean libsUFCLoaded;
private static final boolean avresampleLoaded; // optional
+ private static final boolean swresampleLoaded; // optional
private static final boolean avdeviceLoaded; // optional
static final VersionNumber avCodecVersion;
static final VersionNumber avFormatVersion;
static final VersionNumber avUtilVersion;
static final VersionNumber avResampleVersion;
+ static final VersionNumber swResampleVersion;
private static final FFMPEGNatives natives;
+ private static final int LIB_IDX_UTI = 0;
+ private static final int LIB_IDX_FMT = 1;
+ private static final int LIB_IDX_COD = 2;
+ private static final int LIB_IDX_DEV = 3;
+ private static final int LIB_IDX_AVR = 4;
+ private static final int LIB_IDX_SWR = 5;
+
static {
// native ffmpeg media player implementation is included in jogl_desktop and jogl_mobile
GLProfile.initSingleton();
boolean _ready = false;
- boolean[] _libsLoaded= { false };
- boolean[] _avdeviceLoaded= { false };
- boolean[] _avresampleLoaded= { false };
- VersionNumber[] _versions = new VersionNumber[4];
+ /** util, format, codec, device, avresample, swresample */
+ boolean[] _loaded= new boolean[6];
+ /** util, format, codec, avresample, swresample */
+ VersionNumber[] _versions = new VersionNumber[5];
try {
- _ready = initSymbols(_libsLoaded, _avdeviceLoaded, _avresampleLoaded, _versions);
+ _ready = initSymbols(_loaded, _versions);
} catch (Throwable t) {
t.printStackTrace();
}
- libsLoaded = _libsLoaded[0];
- avdeviceLoaded = _avdeviceLoaded[0];
- avresampleLoaded = _avresampleLoaded[0];
- avCodecVersion = _versions[0];
+ libsUFCLoaded = _loaded[LIB_IDX_UTI] && _loaded[LIB_IDX_FMT] && _loaded[LIB_IDX_COD];
+ avdeviceLoaded = _loaded[LIB_IDX_DEV];
+ avresampleLoaded = _loaded[LIB_IDX_AVR];
+ swresampleLoaded = _loaded[LIB_IDX_SWR];
+ avUtilVersion = _versions[0];
avFormatVersion = _versions[1];
- avUtilVersion = _versions[2];
+ avCodecVersion = _versions[2];
avResampleVersion = _versions[3];
- if(!libsLoaded) {
- System.err.println("LIB_AV Not Available");
+ swResampleVersion = _versions[4];
+ if(!libsUFCLoaded) {
+ System.err.println("LIB_AV Not Available: lavu, lavc, lavu");
natives = null;
ready = false;
} else if(!_ready) {
@@ -183,12 +214,15 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
natives = null;
ready = false;
} else {
- if( avCodecVersion.getMajor() <= 53 && avFormatVersion.getMajor() <= 53 && avUtilVersion.getMajor() <= 51 ) {
+ if( avCodecVersion.getMajor() == 53 && avFormatVersion.getMajor() == 53 && avUtilVersion.getMajor() == 51 ) {
// lavc53.lavf53.lavu51
natives = new FFMPEGv08Natives();
- } else if( avCodecVersion.getMajor() == 54 && avFormatVersion.getMajor() <= 54 && avUtilVersion.getMajor() <= 52 ) {
+ } else if( avCodecVersion.getMajor() == 54 && avFormatVersion.getMajor() == 54 && avUtilVersion.getMajor() == 52 ) {
// lavc54.lavf54.lavu52.lavr01
natives = new FFMPEGv09Natives();
+ } else if( avCodecVersion.getMajor() == 55 && avFormatVersion.getMajor() == 55 && avUtilVersion.getMajor() == 52 ) {
+ // lavc55.lavf55.lavu52.lavr01
+ natives = new FFMPEGv10Natives();
} else {
System.err.println("LIB_AV No Version/Native-Impl Match");
natives = null;
@@ -201,29 +235,33 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
}
}
- static boolean libsLoaded() { return libsLoaded; }
+ static boolean libsLoaded() { return libsUFCLoaded; }
static boolean avDeviceLoaded() { return avdeviceLoaded; }
static boolean avResampleLoaded() { return avresampleLoaded; }
+ static boolean swResampleLoaded() { return swresampleLoaded; }
static FFMPEGNatives getNatives() { return natives; }
static boolean initSingleton() { return ready; }
-
- private static final boolean initSymbols(boolean[] libsLoaded, boolean[] avdeviceLoaded, boolean[] avresampleLoaded,
- VersionNumber[] versions) {
- libsLoaded[0] = false;
+
+ /**
+ * @param loaded 6: util, format, codec, device, avresample, swresample
+ * @param versions 5: util, format, codec, avresample, swresample
+ * @return
+ */
+ private static final boolean initSymbols(boolean[] loaded, VersionNumber[] versions) {
+ for(int i=0; i<6; i++) {
+ loaded[i] = false;
+ }
final DynamicLibraryBundle dl = AccessController.doPrivileged(new PrivilegedAction() {
public DynamicLibraryBundle run() {
return new DynamicLibraryBundle(new FFMPEGDynamicLibraryBundleInfo());
} } );
- final boolean avutilLoaded = dl.isToolLibLoaded(0);
- final boolean avformatLoaded = dl.isToolLibLoaded(1);
- final boolean avcodecLoaded = dl.isToolLibLoaded(2);
- if(!avutilLoaded || !avformatLoaded || !avcodecLoaded) {
- throw new RuntimeException("FFMPEG Tool library incomplete: [ avutil "+avutilLoaded+", avformat "+avformatLoaded+", avcodec "+avcodecLoaded+"]");
+ dl.toString();
+ for(int i=0; i<6; i++) {
+ loaded[i] = dl.isToolLibLoaded(i);
+ }
+ if( !loaded[LIB_IDX_UTI] || !loaded[LIB_IDX_FMT] || !loaded[LIB_IDX_COD] ) {
+ throw new RuntimeException("FFMPEG Tool library incomplete: [ avutil "+loaded[LIB_IDX_UTI]+", avformat "+loaded[LIB_IDX_FMT]+", avcodec "+loaded[LIB_IDX_COD]+"]");
}
- avdeviceLoaded[0] = dl.isToolLibLoaded(3);
- avresampleLoaded[0] = dl.isToolLibLoaded(4);
- libsLoaded[0] = true;
-
if(symbolNames.length != symbolCount) {
throw new InternalError("XXX0 "+symbolNames.length+" != "+symbolCount);
}
@@ -232,20 +270,6 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
final Set optionalSymbolNameSet = new HashSet();
optionalSymbolNameSet.addAll(Arrays.asList(optionalSymbolNames));
- // alternate symbol name mapping to indexed array
- final Map mAltSymbolNames = new HashMap();
- final int[][] iAltSymbolNames = new int[altSymbolNames.length][];
- {
- final List symbolNameList = Arrays.asList(symbolNames);
- for(int i=0; i() {
public Object run() {
@@ -262,33 +286,18 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
// no symbol, check optional and alternative symbols
final String symbol = symbolNames[i];
if ( !optionalSymbolNameSet.contains(symbol) ) {
- // check for API changed symbols
- boolean ok = false;
- final Integer cI = mAltSymbolNames.get(symbol);
- if ( null != cI ) {
- // check whether alternative symbol is available
- final int ci = cI.intValue();
- for(int j=0; !ok && j, but has alternative <"+symbolNames[si]+">");
- }
- }
- }
- if(!ok) {
- System.err.println("Fail: Could not resolve symbol <"+symbolNames[i]+">: not optional, no alternatives.");
- res = false;
- }
+ System.err.println("Fail: Could not resolve symbol <"+symbolNames[i]+">: not optional, no alternatives.");
+ res = false;
} else if(DEBUG) {
System.err.println("OK: Unresolved optional symbol <"+symbolNames[i]+">");
}
}
}
- versions[0] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvCodecVersion0(symbolAddr[0]));
- versions[1] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvFormatVersion0(symbolAddr[1]));
- versions[2] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvUtilVersion0(symbolAddr[2]));
- versions[3] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvResampleVersion0(symbolAddr[3]));
+ versions[0] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[0]));
+ versions[1] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[1]));
+ versions[2] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[2]));
+ versions[3] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[3]));
+ versions[4] = FFMPEGStaticNatives.getAVVersion(FFMPEGStaticNatives.getAvVersion0(symbolAddr[4]));
return res;
}
@@ -319,16 +328,18 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
public final List> getToolLibNames() {
List> libsList = new ArrayList>();
+ // 6: util, format, codec, device, avresample, swresample
+
final List avutil = new ArrayList();
avutil.add("avutil"); // default
avutil.add("libavutil.so.53"); // dummy future proof
- avutil.add("libavutil.so.52"); // 9
+ avutil.add("libavutil.so.52"); // ffmpeg 1.2 + 2 / libav 9 + 10
avutil.add("libavutil.so.51"); // 0.8
avutil.add("libavutil.so.50"); // 0.7
avutil.add("avutil-53"); // dummy future proof
- avutil.add("avutil-52"); // 9
+ avutil.add("avutil-52"); // ffmpeg 1.2 + 2 / libav 9 + 10
avutil.add("avutil-51"); // 0.8
avutil.add("avutil-50"); // 0.7
libsList.add(avutil);
@@ -336,51 +347,69 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
final List avformat = new ArrayList();
avformat.add("avformat"); // default
- avformat.add("libavformat.so.55"); // dummy future proof
- avformat.add("libavformat.so.54"); // 9
+ avformat.add("libavformat.so.56"); // dummy future proof
+ avformat.add("libavformat.so.55"); // ffmpeg 2 / libav 10
+ avformat.add("libavformat.so.54"); // ffmpeg 1.2 / libav 9
avformat.add("libavformat.so.53"); // 0.8
avformat.add("libavformat.so.52"); // 0.7
- avformat.add("avformat-55"); // dummy future proof
- avformat.add("avformat-54"); // 9
+ avformat.add("avformat-56"); // dummy future proof
+ avformat.add("avformat-55"); // ffmpeg 2 / libav 10
+ avformat.add("avformat-54"); // ffmpeg 1.2 / libav 9
avformat.add("avformat-53"); // 0.8
- avformat.add("avformat-52"); // 0.7
+ avformat.add("avformat-52"); // 0.7
libsList.add(avformat);
final List avcodec = new ArrayList();
avcodec.add("avcodec"); // default
- avcodec.add("libavcodec.so.55"); // dummy future proof
- avcodec.add("libavcodec.so.54"); // 9
+ avcodec.add("libavcodec.so.56"); // dummy future proof
+ avcodec.add("libavcodec.so.55"); // ffmpeg 2/ libav 10
+ avcodec.add("libavcodec.so.54"); // ffmpeg 1.2 / libav 9
avcodec.add("libavcodec.so.53"); // 0.8
avcodec.add("libavcodec.so.52"); // 0.7
- avcodec.add("avcodec-55"); // dummy future proof
- avcodec.add("avcodec-54"); // 9
+ avcodec.add("avcodec-56"); // dummy future proof
+ avcodec.add("avcodec-55"); // ffmpeg 2/ libav 10
+ avcodec.add("avcodec-54"); // ffmpeg 1.2 / libav 9
avcodec.add("avcodec-53"); // 0.8
- avcodec.add("avcodec-52"); // 0.7
+ avcodec.add("avcodec-52"); // 0.7
libsList.add(avcodec);
final List avdevice = new ArrayList();
avdevice.add("avdevice"); // default
- avdevice.add("libavdevice.so.54"); // dummy future proof
- avdevice.add("libavdevice.so.53"); // 0.8 && 9
+ avdevice.add("libavdevice.so.56"); // dummy future proof
+ avdevice.add("libavdevice.so.55"); // ffmpeg 2
+ avdevice.add("libavdevice.so.54"); // ffmpeg 1.2 / libav 10
+ avdevice.add("libavdevice.so.53"); // 0.8 && libav 9
- avdevice.add("avdevice-54"); // dummy future proof
- avdevice.add("avdevice-53"); // 0.8 && 9
+ avdevice.add("avdevice-56"); // dummy future proof
+ avdevice.add("avdevice-55"); // ffmpeg 2
+ avdevice.add("avdevice-54"); // ffmpeg 1.2 / libav 10
+ avdevice.add("avdevice-53"); // 0.8 && libav 9
libsList.add(avdevice);
final List avresample = new ArrayList();
avresample.add("avresample"); // default
avresample.add("libavresample.so.2"); // dummy future proof
- avresample.add("libavresample.so.1"); // 9
+ avresample.add("libavresample.so.1"); // libav 9 + 10
avresample.add("avresample-2"); // dummy future proof
- avresample.add("avresample-1"); // 9
+ avresample.add("avresample-1"); // libav 9 + 10
libsList.add(avresample);
+ final List swresample = new ArrayList();
+ swresample.add("swresample"); // default
+
+ swresample.add("libswresample.so.1"); // dummy future proof
+ swresample.add("libswresample.so.0"); // ffmpeg 1.2 + 2.x
+
+ swresample.add("swresample-1"); // dummy future proof
+ swresample.add("swresample-0"); // ffmpeg 1.2 + 2.x
+ libsList.add(swresample);
+
return libsList;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
index 2dd60074c..269500399 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -55,7 +55,7 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
/***
* Implementation utilizes Libav
- * or FFmpeg which is ubiquitous
+ * or FFmpeg which are ubiquitous
* available and usually pre-installed on Unix platforms.
*
* Due to legal reasons we cannot deploy binaries of it, which contains patented codecs.
@@ -83,6 +83,7 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
*
{@link PixelFormat#YUV422P}
* {@link PixelFormat#YUVJ422P}
* {@link PixelFormat#YUYV422}
+ * {@link PixelFormat#BGR24}
*
*
*
@@ -104,9 +105,10 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
*
* Currently we are binary compatible w/:
*
- * release | lavc | lavf | lavu | lavr | FFMPEG* class |
- * 0.8 | 53 | 53 | 51 | | FFMPEGv08 |
- * 9.0 | 54 | 54 | 52 | 01 | FFMPEGv09 |
+ * libav / ffmpeg | lavc | lavf | lavu | lavr | FFMPEG* class |
+ * 0.8 | 53 | 53 | 51 | | FFMPEGv08 |
+ * 9.0 / 1.2 | 54 | 54 | 52 | 01/00 | FFMPEGv09 |
+ * 10 / 2 | 55 | 55 | 52 | 01/00 | FFMPEGv10 |
*
*
*
@@ -122,14 +124,19 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
* TODO:
*
*
- * - better pts sync handling
+ * - better audio synchronization handling? (video is synchronized)
*
*
*
- * LibAV Availability
+ * FFMPEG / LibAV Availability
*
*
- * - Windows: http://win32.libav.org/releases/
+ * - GNU/Linux: ffmpeg or libav are deployed in most distributions.
+ * - Windows:
+ *
+ * - http://ffmpeg.zeranoe.com/builds/ (ffmpeg)
+ * - http://win32.libav.org/releases/ (libav)
+ *
* - MacOSX: http://ffmpegmac.net/
* - OpenIndiana/Solaris:
* pkg set-publisher -p http://pkg.openindiana.org/sfe-encumbered.
@@ -148,7 +155,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
private static final int avUtilMajorVersionCC;
private static final int avFormatMajorVersionCC;
private static final int avCodecMajorVersionCC;
- private static final int avResampleMajorVersionCC;
+ private static final int avResampleMajorVersionCC;
+ private static final int swResampleMajorVersionCC;
private static final boolean available;
static {
@@ -156,24 +164,38 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
final boolean libAVVersionGood;
if( FFMPEGDynamicLibraryBundleInfo.libsLoaded() ) {
natives = FFMPEGDynamicLibraryBundleInfo.getNatives();
- avCodecMajorVersionCC = natives.getAvCodecMajorVersionCC0();
- avFormatMajorVersionCC = natives.getAvFormatMajorVersionCC0();
- avUtilMajorVersionCC = natives.getAvUtilMajorVersionCC0();
- avResampleMajorVersionCC = natives.getAvResampleMajorVersionCC0();
+ if( null != natives ) {
+ avCodecMajorVersionCC = natives.getAvCodecMajorVersionCC0();
+ avFormatMajorVersionCC = natives.getAvFormatMajorVersionCC0();
+ avUtilMajorVersionCC = natives.getAvUtilMajorVersionCC0();
+ avResampleMajorVersionCC = natives.getAvResampleMajorVersionCC0();
+ swResampleMajorVersionCC = natives.getSwResampleMajorVersionCC0();
+ } else {
+ avUtilMajorVersionCC = 0;
+ avFormatMajorVersionCC = 0;
+ avCodecMajorVersionCC = 0;
+ avResampleMajorVersionCC = 0;
+ swResampleMajorVersionCC = 0;
+ }
final VersionNumber avCodecVersion = FFMPEGDynamicLibraryBundleInfo.avCodecVersion;
final VersionNumber avFormatVersion = FFMPEGDynamicLibraryBundleInfo.avFormatVersion;
final VersionNumber avUtilVersion = FFMPEGDynamicLibraryBundleInfo.avUtilVersion;
- final VersionNumber avResampleVersion = FFMPEGDynamicLibraryBundleInfo.avResampleVersion;
+ final VersionNumber avResampleVersion = FFMPEGDynamicLibraryBundleInfo.avResampleVersion;
+ final boolean avResampleLoaded = FFMPEGDynamicLibraryBundleInfo.avResampleLoaded();
+ final VersionNumber swResampleVersion = FFMPEGDynamicLibraryBundleInfo.swResampleVersion;
+ final boolean swResampleLoaded = FFMPEGDynamicLibraryBundleInfo.swResampleLoaded();
System.err.println("LIB_AV Codec : "+avCodecVersion+" [cc "+avCodecMajorVersionCC+"]");
System.err.println("LIB_AV Format : "+avFormatVersion+" [cc "+avFormatMajorVersionCC+"]");
System.err.println("LIB_AV Util : "+avUtilVersion+" [cc "+avUtilMajorVersionCC+"]");
- System.err.println("LIB_AV Resample: "+FFMPEGDynamicLibraryBundleInfo.avResampleVersion+" [cc "+avResampleMajorVersionCC+", loaded "+FFMPEGDynamicLibraryBundleInfo.avResampleLoaded()+"]");
+ System.err.println("LIB_AV Resample: "+avResampleVersion+" [cc "+avResampleMajorVersionCC+", loaded "+avResampleLoaded+"]");
+ System.err.println("LIB_SW Resample: "+swResampleVersion+" [cc "+swResampleMajorVersionCC+", loaded "+swResampleLoaded+"]");
System.err.println("LIB_AV Device : [loaded "+FFMPEGDynamicLibraryBundleInfo.avDeviceLoaded()+"]");
- System.err.println("LIB_AV Class : "+natives.getClass().getSimpleName());
+ System.err.println("LIB_AV Class : "+(null!= natives ? natives.getClass().getSimpleName() : "n/a"));
libAVVersionGood = avCodecMajorVersionCC == avCodecVersion.getMajor() &&
avFormatMajorVersionCC == avFormatVersion.getMajor() &&
avUtilMajorVersionCC == avUtilVersion.getMajor() &&
- avResampleMajorVersionCC == avResampleVersion.getMajor();
+ ( !avResampleLoaded || avResampleMajorVersionCC == avResampleVersion.getMajor() ) &&
+ ( !swResampleLoaded || swResampleMajorVersionCC == swResampleVersion.getMajor() ) ;
if( !libAVVersionGood ) {
System.err.println("LIB_AV Not Matching Compile-Time / Runtime Major-Version");
}
@@ -183,6 +205,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
avFormatMajorVersionCC = 0;
avCodecMajorVersionCC = 0;
avResampleMajorVersionCC = 0;
+ swResampleMajorVersionCC = 0;
libAVVersionGood = false;
}
available = libAVGood && libAVVersionGood && null != natives ? natives.initIDs0() : false;
@@ -268,8 +291,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
System.err.println("initStream: p2 preferred "+preferredAudioFormat+", "+this);
}
- final boolean isCameraInput = null != cameraHostPart;
+ final boolean isCameraInput = null != cameraPath;
final String resStreamLocS;
+ int rw=640, rh=480, rr=15;
+ String sizes = null;
if( isCameraInput ) {
switch(Platform.OS_TYPE) {
case ANDROID:
@@ -278,10 +303,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
case HPUX:
case LINUX:
case SUNOS:
- resStreamLocS = dev_video_linux + cameraHostPart;
+ resStreamLocS = dev_video_linux + cameraPath;
break;
case WINDOWS:
- resStreamLocS = cameraHostPart;
+ resStreamLocS = cameraPath;
break;
case MACOS:
case OPENKODE:
@@ -289,13 +314,22 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
resStreamLocS = streamLocS; // FIXME: ??
break;
}
+ if( null != cameraProps ) {
+ sizes = cameraProps.get(CameraPropSizeS);
+ int v = getPropIntVal(cameraProps, CameraPropWidth);
+ if( v > 0 ) { rw = v; }
+ v = getPropIntVal(cameraProps, CameraPropHeight);
+ if( v > 0 ) { rh = v; }
+ v = getPropIntVal(cameraProps, CameraPropRate);
+ if( v > 0 ) { rr = v; }
+ }
} else {
resStreamLocS = streamLocS;
}
final int aMaxChannelCount = audioSink.getMaxSupportedChannels();
final int aPrefSampleRate = preferredAudioFormat.sampleRate;
// setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
- natives.setStream0(moviePtr, resStreamLocS, isCameraInput, vid, aid, aMaxChannelCount, aPrefSampleRate);
+ natives.setStream0(moviePtr, resStreamLocS, isCameraInput, vid, sizes, rw, rh, rr, aid, aMaxChannelCount, aPrefSampleRate);
}
@Override
@@ -373,11 +407,19 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
tf = GL2ES2.GL_RG; tif=GL2ES2.GL_RG; break;
}
case 3: tf = GL2ES2.GL_RGB; tif=GL.GL_RGB; break;
- case 4: tf = GL2ES2.GL_RGBA; tif=GL.GL_RGBA; break;
+ case 4: if( vPixelFmt == PixelFormat.BGRA ) {
+ tf = GL2ES2.GL_BGRA; tif=GL.GL_RGBA; break;
+ } else {
+ tf = GL2ES2.GL_RGBA; tif=GL.GL_RGBA; break;
+ }
default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane);
}
setTextureFormat(tif, tf);
setTextureType(tt);
+ if(DEBUG) {
+ System.err.println("initGL: p5: video "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane+
+ ", tex "+texWidth+"x"+texHeight+", usesTexLookupShader "+usesTexLookupShader);
+ }
}
}
@Override
@@ -470,9 +512,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param planes
* @param bitsPerPixel
* @param bytesPerPixelPerPlane
- * @param lSz0
- * @param lSz1
- * @param lSz2
* @param tWd0
* @param tWd1
* @param tWd2
@@ -483,7 +522,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param audioSamplesPerFrameAndChannel in audio samples per frame and channel
*/
void updateAttributes2(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
- int lSz0, int lSz1, int lSz2,
int tWd0, int tWd1, int tWd2, int vW, int vH,
int aid, int audioSampleFmt, int audioSampleRate,
int audioChannels, int audioSamplesPerFrameAndChannel) {
@@ -495,7 +533,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
usesTexLookupShader = false;
texWidth = 0; texHeight = 0;
- final int[] vLinesize = { 0, 0, 0 }; // per plane
final int[] vTexWidth = { 0, 0, 0 }; // per plane
if( STREAM_ID_NONE != vid ) {
@@ -503,7 +540,6 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
vPlanes = planes;
vBitsPerPixel = bitsPerPixel;
vBytesPerPixelPerPlane = bytesPerPixelPerPlane;
- vLinesize[0] = lSz0; vLinesize[1] = lSz1; vLinesize[2] = lSz2;
vTexWidth[0] = tWd0; vTexWidth[1] = tWd1; vTexWidth[2] = tWd2;
switch(vPixelFmt) {
@@ -533,11 +569,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
texWidth = vTexWidth[0] + vTexWidth[1] + vTexWidth[2]; texHeight = vH;
break;
case YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr - stuffed into RGBA half width texture
+ case BGR24:
usesTexLookupShader = true;
texWidth = vTexWidth[0]; texHeight = vH;
break;
+
case RGB24:
- case BGR24:
case ARGB:
case RGBA:
case ABGR:
@@ -567,9 +604,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
System.err.println("audio: id "+aid+", fmt "+aSampleFmt+", "+avChosenAudioFormat+", aFrameSize/fc "+audioSamplesPerFrameAndChannel);
System.err.println("video: id "+vid+", fmt "+vW+"x"+vH+", "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane+", usesTexLookupShader "+usesTexLookupShader);
for(int i=0; i<3; i++) {
- System.err.println("video: "+i+": "+vTexWidth[i]+"/"+vLinesize[i]);
+ System.err.println("video: p["+i+"]: "+vTexWidth[i]);
}
System.err.println("video: total tex "+texWidth+"x"+texHeight);
+ System.err.println(this.toString());
}
}
@@ -674,6 +712,15 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
" return vec4(r, g, b, 1);\n"+
"}\n"
;
+ case BGR24:
+ return
+ "vec4 "+texLookupFuncName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
+ " "+
+ " vec3 bgr = texture2D(image, texCoord).rgb;\n"+
+ " return vec4(bgr.b, bgr.g, bgr.r, 1);\n"+ /* just swizzle */
+ "}\n"
+ ;
+
default: // FIXME: Add more formats !
throw new InternalError("Add proper mapping of: vPixelFmt "+vPixelFmt+", usesTexLookupShader "+usesTexLookupShader);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 3ee87b5da..b919f22c7 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -27,7 +27,6 @@
*/
package jogamp.opengl.util.av.impl;
-import com.jogamp.opengl.util.av.AudioSink;
import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
interface FFMPEGNatives {
@@ -37,6 +36,7 @@ interface FFMPEGNatives {
int getAvFormatMajorVersionCC0();
int getAvCodecMajorVersionCC0();
int getAvResampleMajorVersionCC0();
+ int getSwResampleMajorVersionCC0();
boolean initIDs0();
long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
@@ -45,21 +45,22 @@ interface FFMPEGNatives {
/**
* Issues {@link #updateAttributes(int, int, int, int, int, int, int, float, int, int, String, String)}
* and {@link #updateAttributes2(int, int, int, int, int, int, int, int, int, int)}.
- *
- * Always uses {@link AudioSink.AudioFormat}:
- *
- * [type PCM, sampleRate [10000(?)..44100..48000], sampleSize 16, channelCount 1-2, signed, littleEndian]
- *
- *
*
* @param moviePtr
* @param url
* @param vid
+ * @param sizes requested video size as string, i.e. 'hd720'. May be null to favor vWidth and vHeight.
+ * @param vWidth requested video width (for camera mode)
+ * @param vHeight requested video width (for camera mode)
+ * @param vRate requested video framerate (for camera mode)
* @param aid
- * @param aPrefChannelCount
* @param aPrefSampleRate
+ * @param aPrefChannelCount
*/
- void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+ void setStream0(long moviePtr, String url, boolean isCameraInput,
+ int vid, String sizes, int vWidth, int vHeight,
+ int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
+
void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
int getVideoPTS0(long moviePtr);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
index 9ee0198f4..16ee2dd4b 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
@@ -35,8 +35,5 @@ class FFMPEGStaticNatives {
( vers >> 8 ) & 0xFF,
( vers >> 0 ) & 0xFF );
}
- static native int getAvUtilVersion0(long func);
- static native int getAvFormatVersion0(long func);
- static native int getAvCodecVersion0(long func);
- static native int getAvResampleVersion0(long func);
+ static native int getAvVersion0(long func);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
index 3b2567655..2a0c9dc3d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
@@ -43,6 +43,9 @@ class FFMPEGv08Natives implements FFMPEGNatives {
@Override
public native int getAvResampleMajorVersionCC0();
+ @Override
+ public native int getSwResampleMajorVersionCC0();
+
@Override
public native boolean initIDs0();
@@ -53,7 +56,7 @@ class FFMPEGv08Natives implements FFMPEGNatives {
public native void destroyInstance0(long moviePtr);
@Override
- public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+ public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, String sizes, int vWidth, int vHeight, int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
@Override
public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
index 6c56d3ccb..422f1ceb0 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
@@ -43,6 +43,9 @@ class FFMPEGv09Natives implements FFMPEGNatives {
@Override
public native int getAvResampleMajorVersionCC0();
+ @Override
+ public native int getSwResampleMajorVersionCC0();
+
@Override
public native boolean initIDs0();
@@ -53,7 +56,7 @@ class FFMPEGv09Natives implements FFMPEGNatives {
public native void destroyInstance0(long moviePtr);
@Override
- public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, int aid, int aMaxChannelCount, int aPrefSampleRate);
+ public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, String sizes, int vWidth, int vHeight, int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
@Override
public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
new file mode 100644
index 000000000..e3007ab69
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
@@ -0,0 +1,81 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.av.impl;
+
+class FFMPEGv10Natives implements FFMPEGNatives {
+ @Override
+ public native boolean initSymbols0(long[] symbols, int count);
+
+ @Override
+ public native int getAvUtilMajorVersionCC0();
+
+ @Override
+ public native int getAvFormatMajorVersionCC0();
+
+ @Override
+ public native int getAvCodecMajorVersionCC0();
+
+ @Override
+ public native int getAvResampleMajorVersionCC0();
+
+ @Override
+ public native int getSwResampleMajorVersionCC0();
+
+ @Override
+ public native boolean initIDs0();
+
+ @Override
+ public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
+
+ @Override
+ public native void destroyInstance0(long moviePtr);
+
+ @Override
+ public native void setStream0(long moviePtr, String url, boolean isCameraInput, int vid, String sizes, int vWidth, int vHeight, int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
+
+ @Override
+ public native void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
+
+ @Override
+ public native int getVideoPTS0(long moviePtr);
+
+ @Override
+ public native int getAudioPTS0(long moviePtr);
+
+ @Override
+ public native int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
+
+ @Override
+ public native int play0(long moviePtr);
+
+ @Override
+ public native int pause0(long moviePtr);
+
+ @Override
+ public native int seek0(long moviePtr, int position);
+}
diff --git a/src/jogl/native/libav/ffmpeg_dshow.c b/src/jogl/native/libav/ffmpeg_dshow.c
new file mode 100644
index 000000000..4f8fedb9f
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_dshow.c
@@ -0,0 +1,209 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+#include "ffmpeg_dshow.h"
+
+#ifdef _WIN32
+
+#include
+#include
+#include
+#include
+
+static HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum)
+{
+ // Create the System Device Enumerator.
+ ICreateDevEnum *pDevEnum;
+ void *pv = NULL;
+
+ HRESULT hr = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, &IID_ICreateDevEnum, (void**)&pDevEnum);
+
+ if (SUCCEEDED(hr)) {
+ // Create an enumerator for the category.
+ hr = pDevEnum->lpVtbl->CreateClassEnumerator(pDevEnum, category, ppEnum,0);
+ if (hr == S_FALSE)
+ {
+ hr = VFW_E_NOT_FOUND; // The category is empty. Treat as an error.
+ }
+ pDevEnum->lpVtbl->Release(pDevEnum);
+ }
+ return hr;
+}
+
+static void getBSTRChars(BSTR bstr, char *pDest, int destLen) {
+
+ #ifdef UNICODE
+ _sntprintf(pDest, destLen, _T("%s"), bstr);
+ #else
+ _sntprintf(pDest, destLen, _T("%S"), bstr);
+ #endif
+}
+
+
+static int GetDeviceInformation(IEnumMoniker *pEnum, int verbose, int devIdx,
+ char *pDescr, int descrSize,
+ char *pName, int nameSize,
+ char *pPath, int pathSize, int *pWaveID) {
+ IMoniker *pMoniker = NULL;
+ int i=0;
+ int res = devIdx >= 0 ? -1 : 0;
+
+ if( NULL != pDescr ) {
+ *pDescr=0;
+ }
+ if( NULL != pName ) {
+ *pName=0;
+ }
+ if( NULL != pPath ) {
+ *pPath=0;
+ }
+ if( NULL != pWaveID ) {
+ *pWaveID=0;
+ }
+
+ while (pEnum->lpVtbl->Next(pEnum, 1, &pMoniker, NULL) == S_OK) {
+ IPropertyBag *pPropBag;
+ HRESULT hr;
+
+ hr = pMoniker->lpVtbl->BindToStorage(pMoniker, 0, 0, &IID_IPropertyBag, (void**)&pPropBag);
+ if (FAILED(hr)) {
+ if( verbose ) {
+ fprintf(stderr, "DShowParser: Dev[%d]: bind failed ...\n", i);
+ }
+ pMoniker->lpVtbl->Release(pMoniker);
+ continue;
+ }
+ VARIANT var;
+ VariantInit(&var);
+
+ // Get description or friendly name.
+ hr = pPropBag->lpVtbl->Read(pPropBag, L"Description", &var, 0);
+ if (SUCCEEDED(hr)) {
+ if( i == devIdx && NULL != pDescr ) {
+ res = 0;
+ getBSTRChars(var.bstrVal, pDescr, descrSize);
+ }
+ if( verbose ) {
+ fprintf(stderr, "DShowParser: Dev[%d]: Descr %S\n", i, var.bstrVal);
+ }
+ VariantClear(&var);
+ } else if( verbose ) {
+ fprintf(stderr, "DShowParser: Dev[%d]: cannot read Descr..\n", i);
+ }
+
+ hr = pPropBag->lpVtbl->Read(pPropBag, L"FriendlyName", &var, 0);
+ if (SUCCEEDED(hr)) {
+ if( i == devIdx && NULL != pName ) {
+ res = 0;
+ getBSTRChars(var.bstrVal, pName, nameSize);
+ }
+ if( verbose ) {
+ fprintf(stderr, "DShowParser: Dev[%d]: FName %S\n", i, var.bstrVal);
+ }
+ VariantClear(&var);
+ } else if( verbose ) {
+ fprintf(stderr, "DShowParser: Dev[%d]: cannot read FName..\n", i);
+ }
+
+ hr = pPropBag->lpVtbl->Write(pPropBag, L"FriendlyName", &var);
+
+ // WaveInID applies only to audio capture devices.
+ hr = pPropBag->lpVtbl->Read(pPropBag, L"WaveInID", &var, 0);
+ if (SUCCEEDED(hr)) {
+ if( i == devIdx && NULL != pWaveID ) {
+ res = 0;
+ *pWaveID=(int)var.lVal;
+ }
+ if( verbose ) {
+ fprintf(stderr, "DShowParser: Dev[%d]: WaveInID %d\n", i, var.lVal);
+ }
+ VariantClear(&var);
+ }
+
+ hr = pPropBag->lpVtbl->Read(pPropBag, L"DevicePath", &var, 0);
+ if (SUCCEEDED(hr)) {
+ if( i == devIdx && NULL != pPath ) {
+ res = 0;
+ getBSTRChars(var.bstrVal, pPath, pathSize);
+ }
+ if( verbose ) {
+ fprintf(stderr, "DShowParser: Dev[%d]: Path %S\n", i, var.bstrVal);
+ }
+ VariantClear(&var);
+ }
+
+ pPropBag->lpVtbl->Release(pPropBag);
+ pMoniker->lpVtbl->Release(pMoniker);
+
+ if( devIdx >= 0 && i == devIdx ) {
+ break; // done!
+ }
+ i++;
+ }
+ return res;
+}
+
+int findDShowVideoDevice(char * dest, int destSize, int devIdx, int verbose) {
+ int res = -1;
+
+ HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ if (SUCCEEDED(hr)) {
+ IEnumMoniker *pEnum;
+
+ hr = EnumerateDevices(&CLSID_VideoInputDeviceCategory, &pEnum);
+ if (SUCCEEDED(hr)) {
+ res = GetDeviceInformation(pEnum, verbose, devIdx, NULL /* pDescr */, 0, dest, destSize, NULL /* pPath */, 0, NULL /* pWaveID */);
+ pEnum->lpVtbl->Release(pEnum);
+ if( verbose ) {
+ fprintf(stderr, "DShowParser: Get VideoInputDevice: res %d, '%s'\n", res, dest);
+ }
+ } else if( verbose ) {
+ fprintf(stderr, "DShowParser: Get VideoInputDevice failed\n");
+ }
+ /**
+ hr = EnumerateDevices(&CLSID_AudioInputDeviceCategory, &pEnum);
+ if (SUCCEEDED(hr)) {
+ res = GetDeviceInformation(pEnum, verbose, devIdx, NULL, 0, NULL, 0, NULL, 0, NULL);
+ pEnum->lpVtbl->Release(pEnum);
+ } else if( verbose ) {
+ fprintf(stderr, "DShowParser: Get AudioInputDevice failed\n");
+ } */
+ CoUninitialize();
+ } else if( verbose ) {
+ fprintf(stderr, "DShowParser: CoInit failed\n");
+ }
+ return res;
+}
+
+#else
+
+int findDShowVideoDevice(char * dest, int destSize, int devIdx, int verbose) {
+ return -1;
+}
+
+#endif
diff --git a/src/jogl/native/libav/ffmpeg_dshow.h b/src/jogl/native/libav/ffmpeg_dshow.h
new file mode 100644
index 000000000..e4ef7096b
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_dshow.h
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+#ifndef _FFMPEG_TOOL_H
+#define _FFMPEG_TOOL_H
+
+#ifdef _WIN32
+
+#include
+
+#endif // _WIN32
+
+#include
+#include
+#include
+#include
+
+extern int findDShowVideoDevice(char * dest, int destSize, int devIdx, int verbose);
+
+
+#endif // _FFMPEG_TOOL_H
+
diff --git a/src/jogl/native/libav/ffmpeg_impl_template.c b/src/jogl/native/libav/ffmpeg_impl_template.c
index 822007136..9f371a720 100644
--- a/src/jogl/native/libav/ffmpeg_impl_template.c
+++ b/src/jogl/native/libav/ffmpeg_impl_template.c
@@ -30,6 +30,7 @@
#include "JoglCommon.h"
#include "ffmpeg_tool.h"
+#include "ffmpeg_dshow.h"
#include "libavutil/pixdesc.h"
#include "libavutil/samplefmt.h"
@@ -50,28 +51,35 @@ static jmethodID jni_mid_isAudioFormatSupported = NULL;
#define HAS_FUNC(f) (NULL!=(f))
-typedef unsigned (APIENTRYP AVCODEC_VERSION)(void);
typedef unsigned (APIENTRYP AVUTIL_VERSION)(void);
typedef unsigned (APIENTRYP AVFORMAT_VERSION)(void);
+typedef unsigned (APIENTRYP AVCODEC_VERSION)(void);
typedef unsigned (APIENTRYP AVRESAMPLE_VERSION)(void);
+typedef unsigned (APIENTRYP SWRESAMPLE_VERSION)(void);
-static AVCODEC_VERSION sp_avcodec_version;
-static AVFORMAT_VERSION sp_avformat_version;
static AVUTIL_VERSION sp_avutil_version;
+static AVFORMAT_VERSION sp_avformat_version;
+static AVCODEC_VERSION sp_avcodec_version;
static AVRESAMPLE_VERSION sp_avresample_version;
-// count: 4
+static SWRESAMPLE_VERSION sp_swresample_version;
+// count: 5
// libavcodec
typedef int (APIENTRYP AVCODEC_REGISTER_ALL)(void);
typedef int (APIENTRYP AVCODEC_CLOSE)(AVCodecContext *avctx);
typedef void (APIENTRYP AVCODEC_STRING)(char *buf, int buf_size, AVCodecContext *enc, int encode);
-typedef AVCodec *(APIENTRYP AVCODEC_FIND_DECODER)(enum CodecID id);
+typedef AVCodec *(APIENTRYP AVCODEC_FIND_DECODER)(int avCodecID); // lavc 53: 'enum CodecID id', lavc 54: 'enum AVCodecID id'
typedef int (APIENTRYP AVCODEC_OPEN2)(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options); // 53.6.0
typedef AVFrame *(APIENTRYP AVCODEC_ALLOC_FRAME)(void);
typedef void (APIENTRYP AVCODEC_GET_FRAME_DEFAULTS)(AVFrame *frame);
typedef void (APIENTRYP AVCODEC_FREE_FRAME)(AVFrame **frame);
-typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER)(AVCodecContext *s, AVFrame *pic);
-typedef void (APIENTRYP AVCODEC_DEFAULT_RELEASE_BUFFER)(AVCodecContext *s, AVFrame *pic);
+typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER)(AVCodecContext *s, AVFrame *pic); // <= 54 (opt), else AVCODEC_DEFAULT_GET_BUFFER2
+typedef void (APIENTRYP AVCODEC_DEFAULT_RELEASE_BUFFER)(AVCodecContext *s, AVFrame *pic); // <= 54 (opt), else AV_FRAME_UNREF
+typedef int (APIENTRYP AVCODEC_DEFAULT_GET_BUFFER2)(AVCodecContext *s, AVFrame *frame, int flags); // 55. (opt)
+typedef int (APIENTRYP AVCODEC_GET_EDGE_WIDTH)();
+typedef int (APIENTRYP AV_IMAGE_FILL_LINESIZES)(int linesizes[4], int pix_fmt, int width); // lavu 51: 'enum PixelFormat pix_fmt', lavu 53: 'enum AVPixelFormat pix_fmt'
+typedef void (APIENTRYP AVCODEC_ALIGN_DIMENSIONS)(AVCodecContext *s, int *width, int *height);
+typedef void (APIENTRYP AVCODEC_ALIGN_DIMENSIONS2)(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]);
typedef void (APIENTRYP AVCODEC_FLUSH_BUFFERS)(AVCodecContext *avctx);
typedef void (APIENTRYP AV_INIT_PACKET)(AVPacket *pkt);
typedef int (APIENTRYP AV_NEW_PACKET)(AVPacket *pkt, int size);
@@ -88,8 +96,13 @@ static AVCODEC_OPEN2 sp_avcodec_open2; // 53.6.0
static AVCODEC_ALLOC_FRAME sp_avcodec_alloc_frame;
static AVCODEC_GET_FRAME_DEFAULTS sp_avcodec_get_frame_defaults;
static AVCODEC_FREE_FRAME sp_avcodec_free_frame;
-static AVCODEC_DEFAULT_GET_BUFFER sp_avcodec_default_get_buffer;
-static AVCODEC_DEFAULT_RELEASE_BUFFER sp_avcodec_default_release_buffer;
+static AVCODEC_DEFAULT_GET_BUFFER sp_avcodec_default_get_buffer; // <= 54 (opt), else sp_avcodec_default_get_buffer2
+static AVCODEC_DEFAULT_RELEASE_BUFFER sp_avcodec_default_release_buffer; // <= 54 (opt), else sp_av_frame_unref
+static AVCODEC_DEFAULT_GET_BUFFER2 sp_avcodec_default_get_buffer2; // 55. (opt)
+static AVCODEC_GET_EDGE_WIDTH sp_avcodec_get_edge_width;
+static AV_IMAGE_FILL_LINESIZES sp_av_image_fill_linesizes;
+static AVCODEC_ALIGN_DIMENSIONS sp_avcodec_align_dimensions;
+static AVCODEC_ALIGN_DIMENSIONS2 sp_avcodec_align_dimensions2;
static AVCODEC_FLUSH_BUFFERS sp_avcodec_flush_buffers;
static AV_INIT_PACKET sp_av_init_packet;
static AV_NEW_PACKET sp_av_new_packet;
@@ -97,7 +110,7 @@ static AV_DESTRUCT_PACKET sp_av_destruct_packet;
static AV_FREE_PACKET sp_av_free_packet;
static AVCODEC_DECODE_AUDIO4 sp_avcodec_decode_audio4; // 53.25.0
static AVCODEC_DECODE_VIDEO2 sp_avcodec_decode_video2; // 52.23.0
-// count: 21
+// count: 27
// libavutil
typedef void (APIENTRYP AV_FRAME_UNREF)(AVFrame *frame);
@@ -108,7 +121,7 @@ typedef int (APIENTRYP AV_SAMPLES_GET_BUFFER_SIZE)(int *linesize, int nb_channel
typedef int (APIENTRYP AV_GET_BYTES_PER_SAMPLE)(enum AVSampleFormat sample_fmt);
typedef int (APIENTRYP AV_OPT_SET_INT)(void *obj, const char *name, int64_t val, int search_flags);
typedef AVDictionaryEntry* (APIENTRYP AV_DICT_GET)(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
-typedef int (APIENTRYP AV_DICT_COUNT)(AVDictionary **m);
+typedef int (APIENTRYP AV_DICT_COUNT)(AVDictionary *m);
typedef int (APIENTRYP AV_DICT_SET)(AVDictionary **pm, const char *key, const char *value, int flags);
typedef void (APIENTRYP AV_DICT_FREE)(AVDictionary **m);
@@ -124,7 +137,7 @@ static AV_DICT_GET sp_av_dict_get;
static AV_DICT_COUNT sp_av_dict_count;
static AV_DICT_SET sp_av_dict_set;
static AV_DICT_FREE sp_av_dict_free;
-// count: 33
+// count: 39
// libavformat
typedef AVFormatContext *(APIENTRYP AVFORMAT_ALLOC_CONTEXT)(void);
@@ -158,12 +171,12 @@ static AV_READ_PAUSE sp_av_read_pause;
static AVFORMAT_NETWORK_INIT sp_avformat_network_init; // 53.13.0
static AVFORMAT_NETWORK_DEINIT sp_avformat_network_deinit; // 53.13.0
static AVFORMAT_FIND_STREAM_INFO sp_avformat_find_stream_info; // 53.3.0
-// count: 48
+// count: 54
// libavdevice [53.0.0]
typedef int (APIENTRYP AVDEVICE_REGISTER_ALL)(void);
static AVDEVICE_REGISTER_ALL sp_avdevice_register_all;
-// count: 49
+// count: 55
// libavresample [1.0.1]
typedef AVAudioResampleContext* (APIENTRYP AVRESAMPLE_ALLOC_CONTEXT)(void); // 1.0.1
@@ -178,9 +191,23 @@ static AVRESAMPLE_OPEN sp_avresample_open;
static AVRESAMPLE_CLOSE sp_avresample_close;
static AVRESAMPLE_FREE sp_avresample_free;
static AVRESAMPLE_CONVERT sp_avresample_convert;
-// count: 54
+// count: 60
+
+// libswresample [1...]
+typedef int (APIENTRYP AV_OPT_SET_SAMPLE_FMT)(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags); // actually lavu .. but exist only w/ swresample!
+typedef struct SwrContext *(APIENTRYP SWR_ALLOC)(void);
+typedef int (APIENTRYP SWR_INIT)(struct SwrContext *s);
+typedef void (APIENTRYP SWR_FREE)(struct SwrContext **s);
+typedef int (APIENTRYP SWR_CONVERT)(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count);
-#define SYMBOL_COUNT 54
+static AV_OPT_SET_SAMPLE_FMT sp_av_opt_set_sample_fmt;
+static SWR_ALLOC sp_swr_alloc;
+static SWR_INIT sp_swr_init;
+static SWR_FREE sp_swr_free;
+static SWR_CONVERT sp_swr_convert;
+// count: 65
+
+#define SYMBOL_COUNT 65
JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
(JNIEnv *env, jobject instance, jobject jSymbols, jint count)
@@ -198,10 +225,11 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
i = 0;
symbols = (int64_t *) (*env)->GetPrimitiveArrayCritical(env, jSymbols, NULL);
- sp_avcodec_version = (AVCODEC_VERSION) (intptr_t) symbols[i++];
- sp_avformat_version = (AVFORMAT_VERSION) (intptr_t) symbols[i++];
sp_avutil_version = (AVUTIL_VERSION) (intptr_t) symbols[i++];
+ sp_avformat_version = (AVFORMAT_VERSION) (intptr_t) symbols[i++];
+ sp_avcodec_version = (AVCODEC_VERSION) (intptr_t) symbols[i++];
sp_avresample_version = (AVRESAMPLE_VERSION) (intptr_t) symbols[i++];
+ sp_swresample_version = (SWRESAMPLE_VERSION) (intptr_t) symbols[i++];
sp_avcodec_register_all = (AVCODEC_REGISTER_ALL) (intptr_t) symbols[i++];
sp_avcodec_close = (AVCODEC_CLOSE) (intptr_t) symbols[i++];
@@ -213,6 +241,11 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
sp_avcodec_free_frame = (AVCODEC_FREE_FRAME) (intptr_t) symbols[i++];
sp_avcodec_default_get_buffer = (AVCODEC_DEFAULT_GET_BUFFER) (intptr_t) symbols[i++];
sp_avcodec_default_release_buffer = (AVCODEC_DEFAULT_RELEASE_BUFFER) (intptr_t) symbols[i++];
+ sp_avcodec_default_get_buffer2 = (AVCODEC_DEFAULT_GET_BUFFER2) (intptr_t) symbols[i++];
+ sp_avcodec_get_edge_width = (AVCODEC_GET_EDGE_WIDTH) (intptr_t) symbols[i++];
+ sp_av_image_fill_linesizes = (AV_IMAGE_FILL_LINESIZES) (intptr_t) symbols[i++];
+ sp_avcodec_align_dimensions = (AVCODEC_ALIGN_DIMENSIONS) (intptr_t) symbols[i++];
+ sp_avcodec_align_dimensions2 = (AVCODEC_ALIGN_DIMENSIONS2) (intptr_t) symbols[i++];
sp_avcodec_flush_buffers = (AVCODEC_FLUSH_BUFFERS) (intptr_t) symbols[i++];
sp_av_init_packet = (AV_INIT_PACKET) (intptr_t) symbols[i++];
sp_av_new_packet = (AV_NEW_PACKET) (intptr_t) symbols[i++];
@@ -258,6 +291,12 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initSymbols0)
sp_avresample_free = (AVRESAMPLE_FREE) (intptr_t) symbols[i++];
sp_avresample_convert = (AVRESAMPLE_CONVERT) (intptr_t) symbols[i++];
+ sp_av_opt_set_sample_fmt = (AV_OPT_SET_SAMPLE_FMT) (intptr_t) symbols[i++];
+ sp_swr_alloc = (SWR_ALLOC) (intptr_t) symbols[i++];
+ sp_swr_init = (SWR_INIT) (intptr_t) symbols[i++];
+ sp_swr_free = (SWR_FREE) (intptr_t) symbols[i++];
+ sp_swr_convert = (SWR_CONVERT) (intptr_t) symbols[i++];
+
(*env)->ReleasePrimitiveArrayCritical(env, jSymbols, symbols, 0);
if(SYMBOL_COUNT != i) {
@@ -282,7 +321,6 @@ static void _updateJavaAttributes(JNIEnv *env, jobject instance, FFMPEGToolBasic
(*env)->CallVoidMethod(env, pAV->ffmpegMediaPlayer, jni_mid_updateAttributes2,
pAV->vid, pAV->vPixFmt, pAV->vBufferPlanes,
pAV->vBitsPerPixel, pAV->vBytesPerPixelPerPlane,
- pAV->vLinesize[0], pAV->vLinesize[1], pAV->vLinesize[2],
pAV->vTexWidth[0], pAV->vTexWidth[1], pAV->vTexWidth[2],
pAV->vWidth, pAV->vHeight,
pAV->aid, pAV->aSampleFmtOut, pAV->aSampleRateOut, pAV->aChannelsOut, pAV->aFrameSize);
@@ -300,9 +338,13 @@ static void freeInstance(JNIEnv *env, FFMPEGToolBasicAV_t* pAV) {
int i;
if(NULL != pAV) {
// Close the A resampler
- if( NULL != pAV->aResampleCtx ) {
- sp_avresample_free(&pAV->aResampleCtx);
- pAV->aResampleCtx = NULL;
+ if( NULL != pAV->avResampleCtx ) {
+ sp_avresample_free(&pAV->avResampleCtx);
+ pAV->avResampleCtx = NULL;
+ }
+ if( NULL != pAV->swResampleCtx ) {
+ sp_swr_free(&pAV->swResampleCtx);
+ pAV->swResampleCtx = NULL;
}
if( NULL != pAV->aResampleBuffer ) {
sp_av_free(pAV->aResampleBuffer);
@@ -430,9 +472,15 @@ JNIEXPORT jint JNICALL FF_FUNC(getAvResampleMajorVersionCC0)
return (jint) LIBAVRESAMPLE_VERSION_MAJOR;
}
+JNIEXPORT jint JNICALL FF_FUNC(getSwResampleMajorVersionCC0)
+ (JNIEnv *env, jobject instance) {
+ return (jint) LIBSWRESAMPLE_VERSION_MAJOR;
+}
+
JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
(JNIEnv *env, jobject instance)
{
+ jboolean res = JNI_TRUE;
JoglCommon_init(env);
jclass c;
@@ -452,7 +500,7 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
jni_mid_pushSound = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "pushSound", "(Ljava/nio/ByteBuffer;II)V");
jni_mid_updateAttributes1 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes", "(IIIIIIIFIIILjava/lang/String;Ljava/lang/String;)V");
- jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIIIIII)V");
+ jni_mid_updateAttributes2 = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "updateAttributes2", "(IIIIIIIIIIIIIII)V");
jni_mid_isAudioFormatSupported = (*env)->GetMethodID(env, ffmpegMediaPlayerClazz, "isAudioFormatSupported", "(III)Z");
if(jni_mid_pushSound == NULL ||
@@ -461,7 +509,22 @@ JNIEXPORT jboolean JNICALL FF_FUNC(initIDs0)
jni_mid_isAudioFormatSupported == NULL) {
return JNI_FALSE;
}
- return JNI_TRUE;
+ #if LIBAVCODEC_VERSION_MAJOR >= 55
+ if(!HAS_FUNC(sp_avcodec_default_get_buffer2) ||
+ !HAS_FUNC(sp_av_frame_unref) ) {
+ fprintf(stderr, "avcodec >= 55: avcodec_default_get_buffer2 %p, av_frame_unref %p\n",
+ sp_avcodec_default_get_buffer2, sp_av_frame_unref);
+ res = JNI_FALSE;
+ }
+ #else
+ if(!HAS_FUNC(sp_avcodec_default_get_buffer) ||
+ !HAS_FUNC(sp_avcodec_default_release_buffer)) {
+ fprintf(stderr, "avcodec < 55: avcodec_default_get_buffer %p, sp_avcodec_default_release_buffer %p\n",
+ sp_avcodec_default_get_buffer2, sp_avcodec_default_release_buffer);
+ res = JNI_FALSE;
+ }
+ #endif
+ return res;
}
JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
@@ -480,6 +543,11 @@ JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
} else {
pAV->avresampleVersion = 0;
}
+ if(HAS_FUNC(sp_swresample_version)) {
+ pAV->swresampleVersion = sp_swresample_version();
+ } else {
+ pAV->swresampleVersion = 0;
+ }
#if LIBAVCODEC_VERSION_MAJOR >= 55
// TODO: We keep code on using 1 a/v frame per decoding cycle now.
@@ -496,6 +564,10 @@ JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
pAV->vid=AV_STREAM_ID_AUTO;
pAV->aid=AV_STREAM_ID_AUTO;
+ if(pAV->verbose) {
+ fprintf(stderr, "Info: Use avresample %d, swresample %d, device %d, refCount %d\n",
+ AV_HAS_API_AVRESAMPLE(pAV), AV_HAS_API_SWRESAMPLE(pAV), HAS_FUNC(sp_avdevice_register_all), pAV->useRefCountedFrames);
+ }
return (jlong) (intptr_t) pAV;
}
@@ -529,7 +601,7 @@ static int64_t evalPTS(PTSStats *ptsStats, int64_t inPTS, int64_t inDTS);
static AVInputFormat* tryAVInputFormat(const char * name, int verbose) {
AVInputFormat* inFmt = sp_av_find_input_format(name);
if( verbose) {
- if ( inFmt == NULL ) {
+ if ( NULL == inFmt ) {
fprintf(stderr, "Warning: Could not find input format '%s'\n", name);
} else {
fprintf(stderr, "Info: Found input format '%s'\n", name);
@@ -565,10 +637,41 @@ static AVInputFormat* findAVInputFormat(int verbose) {
return inFmt;
}
+#if 0
+static void getAlignedLinesizes(AVCodecContext *avctx, int linesize[/*4*/]) {
+ int stride_align[AV_NUM_DATA_POINTERS];
+ int w = avctx->width;
+ int h = avctx->height;
+ int unaligned;
+ int i;
+
+ sp_avcodec_align_dimensions2(avctx, &w, &h, stride_align);
+
+ if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
+ int edge_width = sp_avcodec_get_edge_width();
+ w += edge_width * 2;
+ h += edge_width * 2;
+ }
+
+ do {
+ // Get alignment for all planes (-> YUVP .. etc)
+ sp_av_image_fill_linesizes(linesize, avctx->pix_fmt, w);
+ // increase alignment of w for next try (rhs gives the lowest bit set in w)
+ w += w & ~(w - 1);
+
+ unaligned = 0;
+ for (i = 0; i < 4; i++)
+ unaligned |= linesize[i] % stride_align[i];
+ } while (unaligned);
+}
+#endif
+
JNIEXPORT void JNICALL FF_FUNC(setStream0)
- (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jboolean jIsCameraInput, jint vid, jint aid,
- jint aMaxChannelCount, jint aPrefSampleRate)
+ (JNIEnv *env, jobject instance, jlong ptr, jstring jURL, jboolean jIsCameraInput,
+ jint vid, jstring jSizeS, jint vWidth, jint vHeight, jint vRate,
+ jint aid, jint aMaxChannelCount, jint aPrefSampleRate)
{
+ char cameraName[256];
int res, i;
jboolean iscopy;
FFMPEGToolBasicAV_t *pAV = (FFMPEGToolBasicAV_t *)(intptr_t)ptr;
@@ -592,31 +695,59 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
pAV->pFormatCtx = sp_avformat_alloc_context();
const char *urlPath = (*env)->GetStringUTFChars(env, jURL, &iscopy);
+ const char *filename = urlPath; // allow changing path for camera ..
// Open video file
AVDictionary *inOpts = NULL;
AVInputFormat* inFmt = NULL;
if( jIsCameraInput ) {
+ char buffer[256];
inFmt = findAVInputFormat(pAV->verbose);
if( NULL == inFmt ) {
JoglCommon_throwNewRuntimeException(env, "Couldn't find input format for camera: %s", urlPath);
(*env)->ReleaseStringChars(env, jURL, (const jchar *)urlPath);
return;
}
- // set maximum values, driver shall 'degrade' ..
- // sp_av_dict_set(&inOpts, "video_size", "640x480", 0);
- // sp_av_dict_set(&inOpts, "video_size", "1280x720", 0);
- sp_av_dict_set(&inOpts, "video_size", "hd720", 0); // video4linux, vfwcap, ..
- // sp_av_dict_set(&inOpts, "video_size", "1280x1024", 0);
- // sp_av_dict_set(&inOpts, "video_size", "320x240", 0);
- sp_av_dict_set(&inOpts, "framerate", "60", 0); // not setting a framerate causes some drivers to crash!
+ if(pAV->verbose) {
+ fprintf(stderr, "Camera: Format: %s (%s)\n", inFmt->long_name, inFmt->name);
+ }
+ if( 0 == strncmp(inFmt->name, "dshow", 255) ) {
+ int devIdx = atoi(urlPath);
+ strncpy(cameraName, "video=", sizeof(cameraName));
+ res = findDShowVideoDevice(cameraName+6, sizeof(cameraName)-6, devIdx, pAV->verbose);
+ if( 0 == res ) {
+ if(pAV->verbose) {
+ fprintf(stderr, "Camera %d found: %s\n", devIdx, cameraName);
+ }
+ filename = cameraName;
+ } else if(pAV->verbose) {
+ fprintf(stderr, "Camera %d not found\n", devIdx);
+ }
+ }
+
+ const char *sizeS = NULL != jSizeS ? (*env)->GetStringUTFChars(env, jSizeS, &iscopy) : NULL;
+ if( NULL != sizeS ) {
+ snprintf(buffer, sizeof(buffer), "%s", sizeS);
+ (*env)->ReleaseStringChars(env, jSizeS, (const jchar *)sizeS);
+ } else {
+ snprintf(buffer, sizeof(buffer), "%dx%d", vWidth, vHeight);
+ }
+ if(pAV->verbose) {
+ fprintf(stderr, "Camera: Size: %s\n", buffer);
+ }
+ sp_av_dict_set(&inOpts, "video_size", buffer, 0);
+ snprintf(buffer, sizeof(buffer), "%d", vRate);
+ if(pAV->verbose) {
+ fprintf(stderr, "Camera: FPS: %s\n", buffer);
+ }
+ sp_av_dict_set(&inOpts, "framerate", buffer, 0); // not setting a framerate causes some drivers to crash!
}
- res = sp_avformat_open_input(&pAV->pFormatCtx, urlPath, inFmt, NULL != inOpts ? &inOpts : NULL);
+ res = sp_avformat_open_input(&pAV->pFormatCtx, filename, inFmt, NULL != inOpts ? &inOpts : NULL);
if( NULL != inOpts ) {
sp_av_dict_free(&inOpts);
}
if(res != 0) {
- JoglCommon_throwNewRuntimeException(env, "Couldn't open URI: %s, err %d", urlPath, res);
+ JoglCommon_throwNewRuntimeException(env, "Couldn't open URI: %s [%dx%d @ %d hz], err %d", filename, vWidth, vHeight, vRate, res);
(*env)->ReleaseStringChars(env, jURL, (const jchar *)urlPath);
return;
}
@@ -630,9 +761,11 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
if(pAV->verbose) {
// Dump information about file onto standard error
- sp_av_dump_format(pAV->pFormatCtx, 0, urlPath, JNI_FALSE);
+ sp_av_dump_format(pAV->pFormatCtx, 0, filename, JNI_FALSE);
}
(*env)->ReleaseStringChars(env, jURL, (const jchar *)urlPath);
+
+
// FIXME: Libav Binary compatibility! JAU01
if (pAV->pFormatCtx->duration != AV_NOPTS_VALUE) {
pAV->duration = pAV->pFormatCtx->duration / AV_TIME_BASE_MSEC;
@@ -707,9 +840,10 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
pAV->pACodecCtx->request_sample_fmt=AV_SAMPLE_FMT_S16;
if( 1 <= aMaxChannelCount && aMaxChannelCount <= 2 ) {
pAV->pACodecCtx->request_channel_layout=getDefaultAudioChannelLayout(aMaxChannelCount);
- if( AV_HAS_API_REQUEST_CHANNELS(pAV) ) {
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+ /** Until 55.0.0, but stopped working w/ 54 already :( */
pAV->pACodecCtx->request_channels=aMaxChannelCount;
- }
+ #endif
}
pAV->pACodecCtx->skip_frame=AVDISCARD_DEFAULT;
@@ -745,12 +879,23 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
pAV->frames_audio = pAV->pAStream->nb_frames;
pAV->aSinkSupport = _isAudioFormatSupported(env, pAV->ffmpegMediaPlayer, pAV->aSampleFmt, pAV->aSampleRate, pAV->aChannels);
if( pAV->verbose ) {
- fprintf(stderr, "A channels %d [l %d], sample_rate %d, frame_size %d, frame_number %d, r_frame_rate %f, avg_frame_rate %f, nb_frames %d, [maxChan %d, prefRate %d, req_chan_layout %d, req_chan %d], sink-support %d \n",
+ fprintf(stderr, "A channels %d [l %d], sample_rate %d, frame_size %d, frame_number %d, [afps %f, rfps %f, cfps %f, sfps %f], nb_frames %d, [maxChan %d, prefRate %d, req_chan_layout %d, req_chan %d], sink-support %d \n",
pAV->aChannels, pAV->pACodecCtx->channel_layout, pAV->aSampleRate, pAV->aFrameSize, pAV->pACodecCtx->frame_number,
- my_av_q2f(pAV->pAStream->r_frame_rate),
my_av_q2f(pAV->pAStream->avg_frame_rate),
+ #if LIBAVCODEC_VERSION_MAJOR < 55
+ my_av_q2f(pAV->pVStream->r_frame_rate),
+ #else
+ 0.0f,
+ #endif
+ my_av_q2f_r(pAV->pAStream->codec->time_base),
+ my_av_q2f_r(pAV->pAStream->time_base),
pAV->pAStream->nb_frames,
- aMaxChannelCount, aPrefSampleRate, pAV->pACodecCtx->request_channel_layout, pAV->pACodecCtx->request_channels,
+ aMaxChannelCount, aPrefSampleRate, pAV->pACodecCtx->request_channel_layout,
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+ pAV->pACodecCtx->request_channels,
+ #else
+ 0,
+ #endif
pAV->aSinkSupport);
}
@@ -759,11 +904,11 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
pAV->aChannelsOut = pAV->aChannels;
pAV->aSampleRateOut = pAV->aSampleRate;
- if( AV_HAS_API_AVRESAMPLE(pAV) &&
+ if( ( AV_HAS_API_AVRESAMPLE(pAV) || AV_HAS_API_SWRESAMPLE(pAV) ) &&
( pAV->aSampleFmt != AV_SAMPLE_FMT_S16 ||
- ( 0 != aPrefSampleRate && pAV->aSampleRate != aPrefSampleRate ) ||
- !pAV->aSinkSupport )
- ) {
+ ( 0 != aPrefSampleRate && pAV->aSampleRate != aPrefSampleRate ) ||
+ !pAV->aSinkSupport ) ) {
+
if( 0 == aPrefSampleRate ) {
aPrefSampleRate = pAV->aSampleRate;
}
@@ -782,25 +927,48 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
aSampleRateOut = aPrefSampleRate;
aSinkSupport = 1;
}
+
if( aSinkSupport ) {
- pAV->aResampleCtx = sp_avresample_alloc_context();
- sp_av_opt_set_int(pAV->aResampleCtx, "in_channel_layout", pAV->pACodecCtx->channel_layout, 0);
- sp_av_opt_set_int(pAV->aResampleCtx, "out_channel_layout", getDefaultAudioChannelLayout(aChannelsOut), 0);
- sp_av_opt_set_int(pAV->aResampleCtx, "in_sample_rate", pAV->aSampleRate, 0);
- sp_av_opt_set_int(pAV->aResampleCtx, "out_sample_rate", aSampleRateOut, 0);
- sp_av_opt_set_int(pAV->aResampleCtx, "in_sample_fmt", pAV->aSampleFmt, 0);
- sp_av_opt_set_int(pAV->aResampleCtx, "out_sample_fmt", aSampleFmtOut, 0);
-
- if ( sp_avresample_open(pAV->aResampleCtx) < 0 ) {
- sp_avresample_free(&pAV->aResampleCtx);
- pAV->aResampleCtx = NULL;
- fprintf(stderr, "error initializing libavresample\n");
- } else {
- // OK
- pAV->aSampleFmtOut = aSampleFmtOut;
- pAV->aChannelsOut = aChannelsOut;
- pAV->aSampleRateOut = aSampleRateOut;
- pAV->aSinkSupport = 1;
+ if( AV_HAS_API_AVRESAMPLE(pAV) ) {
+ pAV->avResampleCtx = sp_avresample_alloc_context();
+ sp_av_opt_set_int(pAV->avResampleCtx, "in_channel_layout", pAV->pACodecCtx->channel_layout, 0);
+ sp_av_opt_set_int(pAV->avResampleCtx, "out_channel_layout", getDefaultAudioChannelLayout(aChannelsOut), 0);
+ sp_av_opt_set_int(pAV->avResampleCtx, "in_sample_rate", pAV->aSampleRate, 0);
+ sp_av_opt_set_int(pAV->avResampleCtx, "out_sample_rate", aSampleRateOut, 0);
+ sp_av_opt_set_int(pAV->avResampleCtx, "in_sample_fmt", pAV->aSampleFmt, 0);
+ sp_av_opt_set_int(pAV->avResampleCtx, "out_sample_fmt", aSampleFmtOut, 0);
+
+ if ( sp_avresample_open(pAV->avResampleCtx) < 0 ) {
+ sp_avresample_free(&pAV->avResampleCtx);
+ pAV->avResampleCtx = NULL;
+ fprintf(stderr, "error initializing avresample ctx\n");
+ } else {
+ // OK
+ pAV->aSampleFmtOut = aSampleFmtOut;
+ pAV->aChannelsOut = aChannelsOut;
+ pAV->aSampleRateOut = aSampleRateOut;
+ pAV->aSinkSupport = 1;
+ }
+ } else if( AV_HAS_API_SWRESAMPLE(pAV) ) {
+ pAV->swResampleCtx = sp_swr_alloc();
+ sp_av_opt_set_int(pAV->swResampleCtx, "in_channel_layout", pAV->pACodecCtx->channel_layout, 0);
+ sp_av_opt_set_int(pAV->swResampleCtx, "out_channel_layout", getDefaultAudioChannelLayout(aChannelsOut), 0);
+ sp_av_opt_set_int(pAV->swResampleCtx, "in_sample_rate", pAV->aSampleRate, 0);
+ sp_av_opt_set_int(pAV->swResampleCtx, "out_sample_rate", aSampleRateOut, 0);
+ sp_av_opt_set_sample_fmt(pAV->swResampleCtx, "in_sample_fmt", pAV->aSampleFmt, 0);
+ sp_av_opt_set_sample_fmt(pAV->swResampleCtx, "out_sample_fmt", aSampleFmtOut, 0);
+
+ if ( sp_swr_init(pAV->swResampleCtx) < 0 ) {
+ sp_swr_free(&pAV->swResampleCtx);
+ pAV->swResampleCtx = NULL;
+ fprintf(stderr, "error initializing swresample ctx\n");
+ } else {
+ // OK
+ pAV->aSampleFmtOut = aSampleFmtOut;
+ pAV->aChannelsOut = aChannelsOut;
+ pAV->aSampleRateOut = aSampleRateOut;
+ pAV->aSinkSupport = 1;
+ }
}
}
}
@@ -867,10 +1035,18 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
pAV->pVCodecCtx->time_base.den=1000;
}
// FIXME: Libav Binary compatibility! JAU01
- if( 0 < pAV->pVStream->avg_frame_rate.den ) {
+ if( pAV->pVStream->avg_frame_rate.den && pAV->pVStream->avg_frame_rate.num ) {
pAV->fps = my_av_q2f(pAV->pVStream->avg_frame_rate);
- } else {
+ #if LIBAVCODEC_VERSION_MAJOR < 55
+ } else if( pAV->pVStream->r_frame_rate.den && pAV->pVStream->r_frame_rate.num ) {
pAV->fps = my_av_q2f(pAV->pVStream->r_frame_rate);
+ #endif
+ } else if( pAV->pVStream->codec->time_base.den && pAV->pVStream->codec->time_base.num ) {
+ pAV->fps = my_av_q2f_r(pAV->pVStream->codec->time_base);
+ } else if( pAV->pVStream->time_base.den && pAV->pVStream->time_base.num ) {
+ pAV->fps = my_av_q2f_r(pAV->pVStream->time_base);
+ } else {
+ pAV->fps = 0.0f; // duh!
}
pAV->frames_video = pAV->pVStream->nb_frames;
@@ -886,35 +1062,78 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
}
if( pAV->verbose ) {
- fprintf(stderr, "V frame_size %d, frame_number %d, r_frame_rate %f %d/%d, avg_frame_rate %f %d/%d, nb_frames %d, size %dx%d, fmt 0x%X, bpp %d, planes %d\n",
+ fprintf(stderr, "V frame_size %d, frame_number %d, [afps %f, rfps %f, cfps %f, sfps %f] -> %f fps, nb_frames %d, size %dx%d, fmt 0x%X, bpp %d, planes %d, codecCaps 0x%X\n",
pAV->pVCodecCtx->frame_size, pAV->pVCodecCtx->frame_number,
- my_av_q2f(pAV->pVStream->r_frame_rate), pAV->pVStream->r_frame_rate.num, pAV->pVStream->r_frame_rate.den,
- my_av_q2f(pAV->pVStream->avg_frame_rate), pAV->pVStream->avg_frame_rate.num, pAV->pVStream->avg_frame_rate.den,
+ my_av_q2f(pAV->pVStream->avg_frame_rate),
+ #if LIBAVCODEC_VERSION_MAJOR < 55
+ my_av_q2f(pAV->pVStream->r_frame_rate),
+ #else
+ 0.0f,
+ #endif
+ my_av_q2f_r(pAV->pVStream->codec->time_base),
+ my_av_q2f_r(pAV->pVStream->time_base),
+ pAV->fps,
pAV->pVStream->nb_frames,
- pAV->vWidth, pAV->vHeight, pAV->vPixFmt, pAV->vBitsPerPixel, pAV->vBufferPlanes);
+ pAV->vWidth, pAV->vHeight, pAV->vPixFmt, pAV->vBitsPerPixel, pAV->vBufferPlanes, pAV->pVCodecCtx->codec->capabilities);
+ }
+ #if 0
+ // Check CODEC_CAP_DR1, i.e. codec must handle get_buffer(), i.e. allocs 'em.
+ {
+ int codecHandlesBuffers = 0 != ( pAV->pVCodecCtx->codec->capabilities & CODEC_CAP_DR1 );
+ if( !codecHandlesBuffers ) {
+ JoglCommon_throwNewRuntimeException(env, "Codec does not handle buffers (!CODEC_CAP_DR1)");
+ return;
+ }
}
+ #endif
pAV->pVFrame=sp_avcodec_alloc_frame();
if( pAV->pVFrame == NULL ) {
JoglCommon_throwNewRuntimeException(env, "Couldn't alloc video frame");
return;
}
- res = sp_avcodec_default_get_buffer(pAV->pVCodecCtx, pAV->pVFrame);
- if(0==res) {
+ {
const int32_t bytesPerPixel = ( pAV->vBitsPerPixel + 7 ) / 8 ;
if(1 == pAV->vBufferPlanes) {
pAV->vBytesPerPixelPerPlane = bytesPerPixel;
} else {
pAV->vBytesPerPixelPerPlane = 1;
}
+ int32_t vLinesize[4];
if( pAV->vBufferPlanes > 1 ) {
- for(i=0; i<3; i++) {
- // FIXME: Libav Binary compatibility! JAU01
- pAV->vLinesize[i] = pAV->pVFrame->linesize[i];
- pAV->vTexWidth[i] = pAV->vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
- }
+ #if 0
+ getAlignedLinesizes(pAV->pVCodecCtx, vLinesize);
+ for(i=0; ivBufferPlanes; i++) {
+ // FIXME: Libav Binary compatibility! JAU01
+ pAV->vTexWidth[i] = vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
+ }
+ #else
+ // Min. requirement for 'get_buffer2' !
+ pAV->pVFrame->width = pAV->pVCodecCtx->width;
+ pAV->pVFrame->height = pAV->pVCodecCtx->height;
+ pAV->pVFrame->format = pAV->pVCodecCtx->pix_fmt;
+ #if LIBAVCODEC_VERSION_MAJOR >= 55
+ res = sp_avcodec_default_get_buffer2(pAV->pVCodecCtx, pAV->pVFrame, 0);
+ #else
+ res = sp_avcodec_default_get_buffer(pAV->pVCodecCtx, pAV->pVFrame);
+ #endif
+ if(0!=res) {
+ JoglCommon_throwNewRuntimeException(env, "Couldn't peek video buffer dimension");
+ return;
+ }
+ for(i=0; ivBufferPlanes; i++) {
+ // FIXME: Libav Binary compatibility! JAU01
+ vLinesize[i] = pAV->pVFrame->linesize[i];
+ pAV->vTexWidth[i] = vLinesize[i] / pAV->vBytesPerPixelPerPlane ;
+ }
+ #if LIBAVCODEC_VERSION_MAJOR >= 55
+ sp_av_frame_unref(pAV->pVFrame);
+ #else
+ sp_avcodec_default_release_buffer(pAV->pVCodecCtx, pAV->pVFrame);
+ #endif
+ #endif
} else {
- pAV->vLinesize[0] = pAV->pVCodecCtx->width * pAV->vBytesPerPixelPerPlane;
+ vLinesize[0] = pAV->pVCodecCtx->width * pAV->vBytesPerPixelPerPlane;
if( pAV->vPixFmt == PIX_FMT_YUYV422 ) {
// Stuff 2x 16bpp (YUYV) into one RGBA pixel!
pAV->vTexWidth[0] = pAV->pVCodecCtx->width / 2;
@@ -922,10 +1141,11 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
pAV->vTexWidth[0] = pAV->pVCodecCtx->width;
}
}
- sp_avcodec_default_release_buffer(pAV->pVCodecCtx, pAV->pVFrame);
- } else {
- JoglCommon_throwNewRuntimeException(env, "Couldn't peek video buffer dimension");
- return;
+ if( pAV->verbose ) {
+ for(i=0; ivBufferPlanes; i++) {
+ fprintf(stderr, "P[%d]: %d texw * %d bytesPP -> %d line\n", i, pAV->vTexWidth[i], pAV->vBytesPerPixelPerPlane, vLinesize[i]);
+ }
+ }
}
}
pAV->vPTS=0;
@@ -945,7 +1165,7 @@ JNIEXPORT void JNICALL FF_FUNC(setGLFuncs0)
pAV->procAddrGLFinish = (PFNGLFINISH) (intptr_t)jProcAddrGLFinish;
}
-#if 0
+#if 1
#define DBG_TEXSUBIMG2D_a(c,p,w1,w2,h,i) fprintf(stderr, "TexSubImage2D.%c offset %d / %d, size %d x %d, ", c, (w1*p->pVCodecCtx->width)/w2, p->pVCodecCtx->height/h, p->vTexWidth[i], p->pVCodecCtx->height/h)
#define DBG_TEXSUBIMG2D_b(p) fprintf(stderr, "err 0x%X\n", pAV->procAddrGLGetError())
#else
@@ -1046,7 +1266,7 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
if( NULL != env ) {
void* data_ptr = pAFrameCurrent->data[0]; // default
- if( NULL != pAV->aResampleCtx ) {
+ if( NULL != pAV->avResampleCtx || NULL != pAV->swResampleCtx ) {
enum AVSampleFormat aSampleFmtOut; // out fmt
int32_t aChannelsOut;
int32_t aSampleRateOut;
@@ -1068,12 +1288,18 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
}
pAV->aResampleBuffer = tmp_out;
- out_samples = sp_avresample_convert(pAV->aResampleCtx,
- &pAV->aResampleBuffer,
- out_linesize, nb_samples,
- pAFrameCurrent->data,
- pAFrameCurrent->linesize[0],
- pAFrameCurrent->nb_samples);
+ if( NULL != pAV->avResampleCtx ) {
+ out_samples = sp_avresample_convert(pAV->avResampleCtx,
+ &pAV->aResampleBuffer,
+ out_linesize, nb_samples,
+ pAFrameCurrent->data,
+ pAFrameCurrent->linesize[0],
+ pAFrameCurrent->nb_samples);
+ } else if( NULL != pAV->swResampleCtx ) {
+ out_samples = sp_swr_convert(pAV->swResampleCtx,
+ &pAV->aResampleBuffer, nb_samples,
+ (const uint8_t **)pAFrameCurrent->data, pAFrameCurrent->nb_samples);
+ }
if (out_samples < 0) {
JoglCommon_throwNewRuntimeException(env, "avresample_convert() failed");
return;
@@ -1154,11 +1380,17 @@ JNIEXPORT jint JNICALL FF_FUNC(readNextPacket0)
const int32_t frame_repeat_i = pAV->pVFrame->repeat_pict * (frame_delay_i / 2);
const char * warn = frame_repeat_i > 0 ? "REPEAT" : "NORMAL" ;
+ const char * oopsLsz = pAV->pVFrame->linesize[0] <= 0 ? "Ooops LSZ" : "OK" ;
- fprintf(stderr, "V fix_pts %d, pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], time d(%lf s + r %lf = %lf s), i(%d ms + r %d = %d ms) - %s - f# %d\n",
+ fprintf(stderr, "V fix_pts %d, pts %d [pkt_pts %ld], dts %d [pkt_dts %ld], time d(%lf s + r %lf = %lf s), i(%d ms + r %d = %d ms) - %s - f# %d, data %p, lsz %d (%s)\n",
pAV->vPTS, vPTS, pkt_pts, vDTS, pkt_dts,
frame_delay_d, frame_repeat_d, (frame_delay_d + frame_repeat_d),
- frame_delay_i, frame_repeat_i, (frame_delay_i + frame_repeat_i), warn, frameCount);
+ frame_delay_i, frame_repeat_i, (frame_delay_i + frame_repeat_i), warn, frameCount,
+ pAV->pVFrame->data[0], pAV->pVFrame->linesize[0], oopsLsz);
+ }
+ if( pAV->pVFrame->linesize[0] <= 0 ) {
+ // Ooops !
+ continue;
}
resPTS = pAV->vPTS; // Video Frame!
diff --git a/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c b/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c
new file mode 100644
index 000000000..277100398
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+#include "jogamp_opengl_util_av_impl_FFMPEGv10Natives.h"
+
+#define FF_FUNC(METHOD) Java_jogamp_opengl_util_av_impl_FFMPEGv10Natives_ ## METHOD
+
+#include "ffmpeg_impl_template.c"
diff --git a/src/jogl/native/libav/ffmpeg_static.c b/src/jogl/native/libav/ffmpeg_static.c
index 171dda6a7..f079ee841 100644
--- a/src/jogl/native/libav/ffmpeg_static.c
+++ b/src/jogl/native/libav/ffmpeg_static.c
@@ -28,9 +28,6 @@
#ifdef _WIN32
#include
- // __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
-
- #define usleep(t) Sleep((t) / 1000)
#endif
#include
@@ -46,34 +43,7 @@
typedef unsigned (APIENTRYP AV_GET_VERSION)(void);
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvUtilVersion0
- (JNIEnv *env, jclass clazz, jlong func) {
- if( 0 != func ) {
- return (jint) ((AV_GET_VERSION)func)();
- } else {
- return 0;
- }
-}
-
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvFormatVersion0
- (JNIEnv *env, jclass clazz, jlong func) {
- if( 0 != func ) {
- return (jint) ((AV_GET_VERSION)func)();
- } else {
- return 0;
- }
-}
-
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvCodecVersion0
- (JNIEnv *env, jclass clazz, jlong func) {
- if( 0 != func ) {
- return (jint) ((AV_GET_VERSION)func)();
- } else {
- return 0;
- }
-}
-
-JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvResampleVersion0
+JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvVersion0
(JNIEnv *env, jclass clazz, jlong func) {
if( 0 != func ) {
return (jint) ((AV_GET_VERSION)func)();
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index ea9625da6..e4b10f95f 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -45,13 +45,20 @@
#include "libavformat/avformat.h"
#include "libavutil/avutil.h"
#if LIBAVCODEC_VERSION_MAJOR >= 54
-#include "libavresample/avresample.h"
+ #include "libavresample/avresample.h"
+ #include "libswresample/swresample.h"
#endif
#ifndef LIBAVRESAMPLE_VERSION_MAJOR
-#define LIBAVRESAMPLE_VERSION_MAJOR 0
+#define LIBAVRESAMPLE_VERSION_MAJOR -1
+// Opaque
typedef void* AVAudioResampleContext;
#endif
+#ifndef LIBSWRESAMPLE_VERSION_MAJOR
+#define LIBSWRESAMPLE_VERSION_MAJOR -1
+// Opaque
+typedef struct SwrContext SwrContext;
+#endif
#include
#include
@@ -88,24 +95,27 @@ typedef void (APIENTRYP PFNGLFINISH) (void);
/** Constant PTS marking the end of the stream, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == {@value}. Sync w/ TimeFrameI.END_OF_STREAM_PTS */
#define END_OF_STREAM_PTS 0x7FFFFFFF
-/** Until 55.0.0, but stopped working w/ 54 already :( */
-#define AV_HAS_API_REQUEST_CHANNELS(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) < 54)
-
-/** Since 55.0.0 */
-#define AV_HAS_API_REFCOUNTED_FRAMES(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) >= 55)
-
/** Since 54.0.0.1 */
-#define AV_HAS_API_AVRESAMPLE(pAV) (AV_VERSION_MAJOR(pAV->avresampleVersion) >= 1)
+#define AV_HAS_API_AVRESAMPLE(pAV) ( pAV->avresampleVersion != 0 )
+
+/** Since 55.0.0.1 */
+#define AV_HAS_API_SWRESAMPLE(pAV) ( pAV->swresampleVersion != 0 )
#define MAX_INT(a,b) ( (a >= b) ? a : b )
#define MIN_INT(a,b) ( (a <= b) ? a : b )
static inline float my_av_q2f(AVRational a){
- return a.num / (float) a.den;
+ return (float)a.num / (float)a.den;
+}
+static inline float my_av_q2f_r(AVRational a){
+ return (float)a.den / (float)a.num;
}
static inline int32_t my_av_q2i32(int64_t snum, AVRational a){
return (int32_t) ( ( snum * (int64_t) a.num ) / (int64_t)a.den );
}
+static inline int my_align(int v, int a){
+ return ( v + a - 1 ) & ~( a - 1 );
+}
typedef struct {
void *origPtr;
@@ -129,6 +139,7 @@ typedef struct {
uint32_t avformatVersion;
uint32_t avutilVersion;
uint32_t avresampleVersion;
+ uint32_t swresampleVersion;
int32_t useRefCountedFrames;
@@ -149,8 +160,7 @@ typedef struct {
enum PixelFormat vPixFmt; // native decoder fmt
int32_t vPTS; // msec - overall last video PTS
PTSStats vPTSStats;
- int32_t vLinesize[3]; // decoded video linesize in bytes for each plane
- int32_t vTexWidth[3]; // decoded video tex width in bytes for each plane
+ int32_t vTexWidth[AV_NUM_DATA_POINTERS]; // decoded video tex width in bytes for each plane
int32_t vWidth;
int32_t vHeight;
@@ -167,7 +177,8 @@ typedef struct {
int32_t aSampleRate;
int32_t aChannels;
int32_t aSinkSupport; // supported by AudioSink
- AVAudioResampleContext *aResampleCtx;
+ AVAudioResampleContext* avResampleCtx;
+ struct SwrContext* swResampleCtx;
uint8_t* aResampleBuffer;
enum AVSampleFormat aSampleFmtOut; // out fmt
int32_t aChannelsOut;
--
cgit v1.2.3
From 5ee2fa951894ee3fdaab7b002e475c173ab5cf17 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Wed, 18 Sep 2013 17:31:45 +0200
Subject: AWTTilePainter: Fix case with no GLOrientation, i.e. no
vertical-flip. Tile location and destination must follow same math as w/
vertical-flip.
.. clipping and tile-height was not considered.
---
make/scripts/tests-win.bat | 9 +++++++++
make/scripts/tests-x64-dbg.bat | 3 ++-
make/scripts/tests.sh | 6 +++---
.../classes/jogamp/opengl/awt/AWTTilePainter.java | 13 ++-----------
.../jogl/tile/TestTiledPrintingGearsSwingAWT.java | 19 +++++++++++++++++--
5 files changed, 33 insertions(+), 17 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index af01ee2e1..6759994a2 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -52,6 +52,15 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestJScrollPaneMi
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestBug642JSplitPaneMixHwLw01AWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestIsRealizedConcurrency01AWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledRendering1GL2NEWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledRendering2NEWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering2GL2NEWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering3GL2AWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT %*
+
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestGearsES1NEWT %*
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 986aba8ec..ddecbc3f7 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -29,7 +29,7 @@ REM set D_ARGS="-Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.Capabili
REM set D_ARGS="-Djogl.debug.GLSLCode" "-Djogl.debug.GLMediaPlayer"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.AudioSink"
-set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.GLMediaPlayer.Native"
+REM set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.GLMediaPlayer.Native"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25" "-Djogl.debug.GLMediaPlayer"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
REM set D_ARGS="-Djogl.debug.AudioSink"
@@ -47,6 +47,7 @@ REM set D_ARGS="-Djogl.debug=all"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.windows.useWGLVersionOf5WGLGDIFuncSet"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch"
+set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 9e2a06dac..05f5f9652 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -216,7 +216,7 @@ function jrun() {
#D_ARGS="-Djogl.debug.GLContext -Dnewt.debug=all -Djogamp.debug.Lock -Djogamp.common.utils.locks.Lock.timeout=10000"
#D_ARGS="-Djogl.debug.GLContext -Dnewt.debug=all"
#D_ARGS="-Dnewt.debug=all"
- #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.GLJPanel -Djogl.debug.TileRenderer"
+ D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.GLJPanel -Djogl.debug.TileRenderer"
#D_ARGS="-Djogl.debug.PNGImage"
#D_ARGS="-Djogl.debug.JPEGImage"
#D_ARGS="-Djogl.debug.GLDrawable -Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.CapabilitiesChooser"
@@ -330,9 +330,9 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering2GL2NEWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering3GL2AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT $*
-#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT $*
+testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT $*
-testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT $*
#
# core/newt (testnoawt and testawt)
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index a06dbcb3d..f3aba3902 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -212,11 +212,7 @@ public class AWTTilePainter {
renderer.setImageSize(iImageSizeScaled.width, iImageSizeScaled.height);
renderer.clipImageSize(iClipScaled.width, iClipScaled.height);
final int clipH = Math.min(iImageSizeScaled.height, iClipScaled.height);
- if( flipVertical ) {
- renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
- } else {
- renderer.setTileOffset(iClipScaled.x, iClipScaled.y);
- }
+ renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
if( verbose ) {
System.err.println("AWT print.0: image "+dImageSizeOrig + " -> " + dImageSizeScaled + " -> " + iImageSizeScaled);
System.err.println("AWT print.0: clip "+gClipOrigR + " -> " + dClipOrig + " -> " + dClipScaled + " -> " + iClipScaled);
@@ -290,12 +286,7 @@ public class AWTTilePainter {
final int pX = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS);
final int pY = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS);
final int pYOff = renderer.getParam(TileRenderer.TR_TILE_Y_OFFSET);
- final int pYf;
- if( flipVertical ) {
- pYf = cis.getHeight() - ( pY - pYOff + tHeight ) + scaledYOffset;
- } else {
- pYf = pY;
- }
+ final int pYf = cis.getHeight() - ( pY - pYOff + tHeight ) + scaledYOffset;
// Copy temporary data into raster of BufferedImage for faster
// blitting Note that we could avoid this copy in the cases
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
index 72f4871b8..f331f5d88 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
@@ -64,7 +64,7 @@ import com.jogamp.newt.event.TraceKeyAdapter;
import com.jogamp.newt.event.TraceWindowAdapter;
import com.jogamp.newt.event.awt.AWTKeyAdapter;
import com.jogamp.newt.event.awt.AWTWindowAdapter;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquareES1;
import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
@@ -120,7 +120,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
} else {
glJPanel2.setBounds(0, 0, glc_sz.width, glc_sz.height);
}
- glJPanel2.addGLEventListener(new RedSquareES2());
+ glJPanel2.addGLEventListener(new RedSquareES1());
// glJPanel2.addGLEventListener(new Gears());
final JComponent demoPanel;
@@ -272,6 +272,21 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
runTestGL(caps, true);
}
+ @Test
+ public void test01_aa0_bitmap() throws InterruptedException, InvocationTargetException {
+ GLCapabilities caps = new GLCapabilities(glp);
+ caps.setBitmap(true);
+ runTestGL(caps, false);
+ }
+
+ @Test
+ public void test01_aa0_bitmap_layered() throws InterruptedException, InvocationTargetException {
+ GLCapabilities caps = new GLCapabilities(glp);
+ caps.setBitmap(true);
+ caps.setAlphaBits(8);
+ runTestGL(caps, true);
+ }
+
@Test
public void test02_aa8() throws InterruptedException, InvocationTargetException {
GLCapabilities caps = new GLCapabilities(glp);
--
cgit v1.2.3
From 99e303b6bc7f87a31efb82856bd1baae9ba3e52b Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Thu, 19 Sep 2013 04:17:51 +0200
Subject: Bump to JDK/JRE 7u40.
---
make/scripts/make.jogl.all.win32.bat | 4 ++--
make/scripts/make.jogl.all.win64.bat | 4 ++--
make/scripts/tests-javaws-x64.bat | 2 +-
make/scripts/tests-x32-dbg.bat | 4 ++--
make/scripts/tests-x32.bat | 4 ++--
make/scripts/tests-x64-dbg.bat | 4 ++--
make/scripts/tests-x64.bat | 4 ++--
7 files changed, 13 insertions(+), 13 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/make.jogl.all.win32.bat b/make/scripts/make.jogl.all.win32.bat
index 7b0243f1e..041d8c71f 100755
--- a/make/scripts/make.jogl.all.win32.bat
+++ b/make/scripts/make.jogl.all.win32.bat
@@ -1,7 +1,7 @@
set THISDIR="C:\JOGL"
-set J2RE_HOME=c:\jre1.7.0_25_x32
-set JAVA_HOME=c:\jdk1.7.0_25_x32
+set J2RE_HOME=c:\jre1.7.0_40_x32
+set JAVA_HOME=c:\jdk1.7.0_40_x32
set ANT_PATH=C:\apache-ant-1.8.2
set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
diff --git a/make/scripts/make.jogl.all.win64.bat b/make/scripts/make.jogl.all.win64.bat
index c08c5260e..d263f0c17 100755
--- a/make/scripts/make.jogl.all.win64.bat
+++ b/make/scripts/make.jogl.all.win64.bat
@@ -1,7 +1,7 @@
set THISDIR="C:\JOGL"
-set J2RE_HOME=c:\jre1.7.0_25_x64
-set JAVA_HOME=c:\jdk1.7.0_25_x64
+set J2RE_HOME=c:\jre1.7.0_40_x64
+set JAVA_HOME=c:\jdk1.7.0_40_x64
set ANT_PATH=C:\apache-ant-1.8.2
set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw64\bin;%PATH%
diff --git a/make/scripts/tests-javaws-x64.bat b/make/scripts/tests-javaws-x64.bat
index c14ea5ffe..87cf52990 100755
--- a/make/scripts/tests-javaws-x64.bat
+++ b/make/scripts/tests-javaws-x64.bat
@@ -1,4 +1,4 @@
-set JRE_PATH=C:\jre1.7.0_25_x64\bin
+set JRE_PATH=C:\jre1.7.0_40_x64\bin
set LOG_PATH=%USERPROFILE%\AppData\LocalLow\Sun\Java\Deployment\log
%JRE_PATH%\javaws -uninstall
diff --git a/make/scripts/tests-x32-dbg.bat b/make/scripts/tests-x32-dbg.bat
index 4c9c3421f..261f621a2 100755
--- a/make/scripts/tests-x32-dbg.bat
+++ b/make/scripts/tests-x32-dbg.bat
@@ -1,7 +1,7 @@
set BLD_SUB=build-win32
-set J2RE_HOME=c:\jre1.7.0_25_x32
-set JAVA_HOME=c:\jdk1.7.0_25_x32
+set J2RE_HOME=c:\jre1.7.0_40_x32
+set JAVA_HOME=c:\jdk1.7.0_40_x32
set ANT_PATH=C:\apache-ant-1.8.2
set PROJECT_ROOT=D:\projects\jogamp\jogl
diff --git a/make/scripts/tests-x32.bat b/make/scripts/tests-x32.bat
index 1c646fd37..1f932a85b 100755
--- a/make/scripts/tests-x32.bat
+++ b/make/scripts/tests-x32.bat
@@ -1,7 +1,7 @@
set BLD_SUB=build-win32
-set J2RE_HOME=c:\jre1.7.0_25_x32
-set JAVA_HOME=c:\jdk1.7.0_25_x32
+set J2RE_HOME=c:\jre1.7.0_40_x32
+set JAVA_HOME=c:\jdk1.7.0_40_x32
set ANT_PATH=C:\apache-ant-1.8.2
set PROJECT_ROOT=D:\projects\jogamp\jogl
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index ddecbc3f7..c9b98ffb8 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -1,7 +1,7 @@
set BLD_SUB=build-win64
-set J2RE_HOME=c:\jre1.7.0_25_x64
-set JAVA_HOME=c:\jdk1.7.0_25_x64
+set J2RE_HOME=c:\jre1.7.0_40_x64
+set JAVA_HOME=c:\jdk1.7.0_40_x64
set ANT_PATH=C:\apache-ant-1.8.2
set PROJECT_ROOT=D:\projects\jogamp\jogl
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat
index 2801e0eb5..6e132e5d7 100755
--- a/make/scripts/tests-x64.bat
+++ b/make/scripts/tests-x64.bat
@@ -1,7 +1,7 @@
set BLD_SUB=build-win64
-set J2RE_HOME=c:\jre1.7.0_25_x64
-set JAVA_HOME=c:\jdk1.7.0_25_x64
+set J2RE_HOME=c:\jre1.7.0_40_x64
+set JAVA_HOME=c:\jdk1.7.0_40_x64
set ANT_PATH=C:\apache-ant-1.8.2
REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc53_lavf53_lavu51-ffmpeg\x64
--
cgit v1.2.3
From 939d6304d464e69b1d1d2a104c3da5536d3bf326 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Fri, 20 Sep 2013 12:29:49 +0200
Subject: AWT Printing: Fix non vertical-flipped printing, i.e. cut-off
top-row's tile upper area, cleanup.
TestTiledPrintingGearsSwingAWT2: Provoked !flipped bug where top-row was positioned too low
due to using full size tile-height.
Cutting of the unused top-row's upper area corrects this issue.
vertical-flip mode does not expose this situation, since flipping
shifts the payload to the upper tile area.
TestTiledPrintingGearsSwingAWT2: Also tests an alternative transparent overlapping mode
without layout.
---
make/scripts/tests-win.bat | 3 +-
make/scripts/tests-x64-dbg.bat | 1 +
make/scripts/tests.sh | 4 +-
.../classes/jogamp/opengl/awt/AWTTilePainter.java | 39 +--
.../jogl/tile/TestTiledPrintingGearsSwingAWT.java | 11 +-
.../jogl/tile/TestTiledPrintingGearsSwingAWT2.java | 340 +++++++++++++++++++++
.../test/junit/jogl/tile/TransparentPanel.java | 59 ++++
7 files changed, 432 insertions(+), 25 deletions(-)
create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java
create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index 6759994a2..b3029f94c 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -57,7 +57,8 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledRenderi
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering2GL2NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering3GL2AWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT2 %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT %*
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index c9b98ffb8..3447605c7 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -47,6 +47,7 @@ REM set D_ARGS="-Djogl.debug=all"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.windows.useWGLVersionOf5WGLGDIFuncSet"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch"
+REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer" "-Djogl.debug.TileRenderer.PNG"
set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index b94e23dc1..7c2d90075 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -332,7 +332,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering3GL2AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT $*
-#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT2 $*
+testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT2 $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT $*
@@ -474,7 +474,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestGLCanvasAWTActionDeadlock00AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestGLCanvasAWTActionDeadlock01AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestGLCanvasAWTActionDeadlock02AWT $*
-testawt com.jogamp.opengl.test.junit.jogl.awt.TestGLJPanelTextureStateAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestGLJPanelTextureStateAWT $*
#testawt com.jogamp.opengl.test.bugs.Bug735Inv0AppletAWT $*
#testawt com.jogamp.opengl.test.bugs.Bug735Inv1AppletAWT $*
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 0b24fadae..0aab049a0 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -196,6 +196,7 @@ public class AWTTilePainter {
final Rectangle2D dImageSizeOrig = new Rectangle2D.Double(0, 0, width, height);
// Retrieve scaled image-size and clip-bounds
+ // Note: Clip bounds lie within image-size!
final Rectangle2D dImageSizeScaled, dClipScaled;
{
final AffineTransform scaledATI;
@@ -212,13 +213,15 @@ public class AWTTilePainter {
s0 = saveAT.createTransformedShape(dClipOrig); // user in
dClipScaled = scaledATI.createTransformedShape(s0).getBounds2D(); // scaled out
}
- }
+ }
final Rectangle iClipScaled = getRoundedRect(dClipScaled);
final Rectangle iImageSizeScaled = getRoundedRect(dImageSizeScaled);
- scaledYOffset = iClipScaled.y;
renderer.setImageSize(iImageSizeScaled.width, iImageSizeScaled.height);
renderer.clipImageSize(iClipScaled.width, iClipScaled.height);
final int clipH = Math.min(iImageSizeScaled.height, iClipScaled.height);
+ // Clip bounds lie within image-size!
+ // GL y-offset is lower-left origin, AWT y-offset upper-left.
+ scaledYOffset = iClipScaled.y;
renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
// Scale actual Grahics2D matrix
@@ -294,10 +297,11 @@ public class AWTTilePainter {
final DimensionImmutable cis = renderer.getClippedImageSize();
final int tWidth = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_WIDTH);
final int tHeight = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_HEIGHT);
- final int pX = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS);
- final int pY = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS);
- final int pYOff = renderer.getParam(TileRenderer.TR_TILE_Y_OFFSET);
- final int pYf = cis.getHeight() - ( pY - pYOff + tHeight ) + scaledYOffset;
+ final int tY = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS);
+ final int tYOff = renderer.getParam(TileRenderer.TR_TILE_Y_OFFSET);
+ final int imgYOff = flipVertical ? 0 : renderer.getParam(TileRenderer.TR_TILE_HEIGHT) - tHeight; // imgYOff will be cut-off via sub-image
+ final int pX = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS); // tileX == pX
+ final int pY = cis.getHeight() - ( tY - tYOff + tHeight ) + scaledYOffset;
// Copy temporary data into raster of BufferedImage for faster
// blitting Note that we could avoid this copy in the cases
@@ -309,7 +313,7 @@ public class AWTTilePainter {
_counter,
renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
tWidth, tHeight,
- pX, pY, pYOff, pX, pYf).replace(' ', '_');
+ pX, tY, tYOff, pX, pY).replace(' ', '_');
System.err.println("XXX file "+fname);
final File fout = new File(fname);
try {
@@ -340,7 +344,7 @@ public class AWTTilePainter {
_counter,
renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
tWidth, tHeight,
- pX, pY, pYOff, pX, pYf).replace(' ', '_');
+ pX, tY, tYOff, pX, pY).replace(' ', '_');
System.err.println("XXX file "+fname);
final File fout = new File(fname);
try {
@@ -351,17 +355,15 @@ public class AWTTilePainter {
_counter++;
}
// Draw resulting image in one shot
- final Shape oClip = g2d.getClip();
- // g2d.clipRect(pX, pYf, tWidth, tHeight);
- final BufferedImage outImage = dstImage.getSubimage(0, 0, tWidth, tHeight); // instead of clipping
- final boolean drawDone = g2d.drawImage(outImage, pX, pYf, null); // Null ImageObserver since image data is ready.
- // final boolean drawDone = g2d.drawImage(dstImage, pX, pYf, dstImage.getWidth(), dstImage.getHeight(), null); // Null ImageObserver since image data is ready.
+ final BufferedImage outImage = dstImage.getSubimage(0, imgYOff, tWidth, tHeight);
+ final boolean drawDone = g2d.drawImage(outImage, pX, pY, null); // Null ImageObserver since image data is ready.
if( verbose ) {
- System.err.println("XXX tile-post.X clippedImageSize "+cis);
- System.err.println("XXX tile-post.X pYf "+cis.getHeight()+" - ( "+pY+" - "+pYOff+" + "+tHeight+" ) "+scaledYOffset+" = "+ pYf);
- System.err.println("XXX tile-post.X clip "+oClip+" + "+pX+" / [pY "+pY+", pYOff "+pYOff+", pYf "+pYf+"] "+tWidth+"x"+tHeight+" -> "+g2d.getClip());
+ final Shape oClip = g2d.getClip();
+ System.err.println("XXX tile-post.X tile 0 / "+imgYOff+" "+tWidth+"x"+tHeight+", clippedImgSize "+cis);
+ System.err.println("XXX tile-post.X pYf "+cis.getHeight()+" - ( "+tY+" - "+tYOff+" + "+tHeight+" ) "+scaledYOffset+" = "+ pY);
+ System.err.println("XXX tile-post.X clip "+oClip+" + "+pX+" / [pY "+tY+", pYOff "+tYOff+", pYf "+pY+"] -> "+g2d.getClip());
g2d.setColor(Color.BLACK);
- g2d.drawRect(pX, pYf, tWidth, tHeight);
+ g2d.drawRect(pX, pY, tWidth, tHeight);
if( null != oClip ) {
final Rectangle r = oClip.getBounds();
g2d.setColor(Color.YELLOW);
@@ -370,9 +372,8 @@ public class AWTTilePainter {
System.err.println("XXX tile-post.X "+renderer);
System.err.println("XXX tile-post.X dst-img "+dstImage.getWidth()+"x"+dstImage.getHeight());
System.err.println("XXX tile-post.X out-img "+outImage.getWidth()+"x"+outImage.getHeight());
- System.err.println("XXX tile-post.X y-flip "+flipVertical+" -> "+pX+"/"+pYf+", drawDone "+drawDone);
+ System.err.println("XXX tile-post.X y-flip "+flipVertical+" -> "+pX+"/"+pY+", drawDone "+drawDone);
}
- // g2d.setClip(oClip);
}
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
index 476513207..b4f5ad988 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
@@ -68,6 +68,7 @@ import com.jogamp.newt.event.awt.AWTWindowAdapter;
import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquareES1;
import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
@@ -306,9 +307,13 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
for(int i=0; i awtUtilitiesClass =
+ Class.forName("com.sun.awt.AWTUtilities");
+ mSetComponentMixing =
+ awtUtilitiesClass.getMethod(
+ "setComponentMixingCutoutShape",
+ Component.class, Shape.class);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ // Cut out the shape
+ if (mSetComponentMixing != null) {
+ try {
+ mSetComponentMixing.invoke( null, this, s );
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+}
--
cgit v1.2.3
From 8be1fc983e584082b9960b4da19c56af5834d08e Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Wed, 9 Oct 2013 05:24:45 +0200
Subject: NEWT Reparent/Fullscreen: Fixes X11 unsuccessful return to parent
window; Add reparentWindow(..) top-level position arguments; Misc
- Fixes X11 unsuccessful return to parent window
On X11 when returning to parent window (-> CHILD),
we have to set the window invisible and wait for the result.
Otherwise it sometimes happens that the WM's reparent operation fails,
i.e. the window won't become a child of desired parent and is positioned randomly.
- Add reparentWindow(..) top-level position arguments
.. allows bringing the child-window to top-level w/ a desired position.
Otherwise the window would be positioned elsewhere as a top-level
as the plain reparenting operation.
X11 needs to set position and size _after_ making the window visible,
otherwise WM may ignore the XConfigureWindow request.
- Reparent recreate shall always store the desired position and size
On OSX/CALayer when recreation is being used, we need to store the pos/size
for later creation.
- Tests: Use 'NewtAWTReparentingKeyAdapter' where possible (reparent/fullscreen)
instead of duplicating such code.
NewtAWTReparentingKeyAdapter: Performs reparenting and fullscreen operations
off-thread (i.e. not on AWT/NEW EDT) while decorating the action w/
revoking/restoring the ExclusiveContextThread (ECT).
Manually tested 'TestGearsES2NewtCanvasAWT' reparenting and fullscreen
on X11, Windows and OSX/CALayer w/ JDK 7u40 successful.
---
make/scripts/tests-x64-dbg.bat | 4 +-
make/scripts/tests.sh | 3 +-
src/newt/classes/com/jogamp/newt/Window.java | 19 +++-
.../classes/com/jogamp/newt/opengl/GLWindow.java | 4 +-
src/newt/classes/jogamp/newt/WindowImpl.java | 95 ++++++++++--------
src/newt/native/X11Window.c | 6 +-
.../acore/TestOffscreenLayer02NewtCanvasAWT.java | 2 +-
.../demos/es2/newt/TestGearsES2NewtCanvasAWT.java | 53 +---------
.../es2/newt/TestLandscapeES2NewtCanvasAWT.java | 53 +---------
.../parenting/NewtAWTReparentingKeyAdapter.java | 111 ++++++++++++++-------
.../junit/newt/parenting/TestParenting01NEWT.java | 8 +-
.../junit/newt/parenting/TestParenting03AWT.java | 4 +-
.../TestParentingFocusTraversal01AWT.java | 2 +-
13 files changed, 170 insertions(+), 194 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 3447605c7..c1a14c1a2 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -48,8 +48,8 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLC
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.windows.useWGLVersionOf5WGLGDIFuncSet"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer" "-Djogl.debug.TileRenderer.PNG"
-set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
-REM set D_ARGS="-Dnewt.debug.Window"
+REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
+set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 5c693f33c..4bafdf15d 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -144,7 +144,6 @@ function jrun() {
#D_ARGS="-Djogl.debug.GLDrawable"
#D_ARGS="-Dnewt.debug.Screen -Dnewt.debug.Window"
#D_ARGS="-Dnewt.debug.Screen"
- D_ARGS="-Dnewt.debug.Window"
#D_ARGS="-Dnewt.test.Screen.disableRandR13"
#D_ARGS="-Dnewt.test.Screen.disableScreenMode -Dnewt.debug.Screen"
#D_ARGS="-Dnewt.debug.Screen -Djogl.debug.Animator"
@@ -194,6 +193,8 @@ function jrun() {
#D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug.JAWT -Djogl.debug.Animator"
#D_ARGS="-Dnewt.debug.Window -Djogl.debug.GLDrawable"
#D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Window.KeyEvent"
+ #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent"
+ D_ARGS="-Dnewt.debug.Window"
#D_ARGS="-Xprof"
#D_ARGS="-Dnativewindow.debug=all"
#D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel"
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index f63c03738..8a43ef153 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -351,10 +351,27 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
* @param newParent The new parent NativeWindow. If null, this Window becomes a top level window.
*
* @return The issued reparent action type (strategy) as defined in Window.ReparentAction
+ * @see #reparentWindow(NativeWindow, int, int, boolean)
*/
ReparentOperation reparentWindow(NativeWindow newParent);
- ReparentOperation reparentWindow(NativeWindow newParent, boolean forceDestroyCreate);
+ /**
+ * Change this window's parent window.
+ *
+ * In case the old parent is not null and a Window,
+ * this window is removed from it's list of children.
+ * In case the new parent is not null and a Window,
+ * this window is added to it's list of children.
+ *
+ * @param newParent The new parent NativeWindow. If null, this Window becomes a top level window.
+ * @param x new top-level position, use -1 for default position.
+ * @param y new top-level position, use -1 for default position.
+ * @param forceDestroyCreate if true, uses re-creation strategy for reparenting, default is false
.
+ *
+ * @return The issued reparent action type (strategy) as defined in Window.ReparentAction
+ * @see #reparentWindow(NativeWindow)
+ */
+ ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, boolean forceDestroyCreate);
/**
* Enable or disable fullscreen mode for this window.
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 45ab2a44c..eace0f2af 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -390,8 +390,8 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final ReparentOperation reparentWindow(NativeWindow newParent, boolean forceDestroyCreate) {
- return window.reparentWindow(newParent, forceDestroyCreate);
+ public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, boolean forceDestroyCreate) {
+ return window.reparentWindow(newParent, x, y, forceDestroyCreate);
}
@Override
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index a2338b93d..300ca5c3f 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -414,7 +414,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
if(postParentlockFocus) {
// harmonize focus behavior for all platforms: focus on creation
- requestFocusInt(isFullscreen() /* skipFocusAction */);
+ requestFocusInt(isFullscreen() /* skipFocusAction if fullscreen */);
((DisplayImpl) screen.getDisplay()).dispatchMessagesNative(); // status up2date
}
if(DEBUG_IMPLEMENTATION) {
@@ -1033,7 +1033,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
removeScreenReference();
Display dpy = screen.getDisplay();
if(null != dpy) {
- dpy.validateEDT();
+ dpy.validateEDTStopped();
}
// send synced destroyed notification
@@ -1112,12 +1112,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
private class ReparentAction implements Runnable {
- NativeWindow newParentWindow;
+ final NativeWindow newParentWindow;
+ final int topLevelX, topLevelY;
boolean forceDestroyCreate;
ReparentOperation operation;
- private ReparentAction(NativeWindow newParentWindow, boolean forceDestroyCreate) {
+ private ReparentAction(NativeWindow newParentWindow, int topLevelX, int topLevelY, boolean forceDestroyCreate) {
this.newParentWindow = newParentWindow;
+ this.topLevelX = topLevelX;
+ this.topLevelY = topLevelY;
this.forceDestroyCreate = forceDestroyCreate | DEBUG_TEST_REPARENT_INCOMPATIBLE;
this.operation = ReparentOperation.ACTION_INVALID; // ensure it's set
}
@@ -1144,10 +1147,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private void reparent() {
// mirror pos/size so native change notification can get overwritten
- int x = getX();
- int y = getY();
- int width = getWidth();
- int height = getHeight();
+ final int oldX = getX();
+ final int oldY = getY();
+ final int oldWidth = getWidth();
+ final int oldHeight = getHeight();
+ final int x, y;
+ int width = oldWidth;
+ int height = oldHeight;
boolean wasVisible;
final RecursiveLock _lock = windowLock;
@@ -1168,10 +1174,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
long newParentWindowHandle = 0 ;
if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.reparent: START ("+getThreadName()+") valid "+isNativeValid()+", windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)+", visible "+wasVisible+", old parentWindow: "+Display.hashCodeNullSafe(parentWindow)+", new parentWindow: "+Display.hashCodeNullSafe(newParentWindow)+", forceDestroyCreate "+forceDestroyCreate+", "+x+"/"+y+" "+width+"x"+height);
+ System.err.println("Window.reparent: START ("+getThreadName()+") valid "+isNativeValid()+", windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)+", visible "+wasVisible+", old parentWindow: "+Display.hashCodeNullSafe(parentWindow)+", new parentWindow: "+Display.hashCodeNullSafe(newParentWindow)+", forceDestroyCreate "+forceDestroyCreate);
}
if(null!=newParentWindow) {
+ // REPARENT TO CHILD WINDOW
+
// reset position to 0/0 within parent space
x = 0;
y = 0;
@@ -1233,12 +1241,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
operation = ReparentOperation.ACTION_NOP;
}
} else {
- if( null != parentWindow ) {
+ // REPARENT TO TOP-LEVEL WINDOW
+ if( 0 <= topLevelX && 0 <= topLevelY ) {
+ x = topLevelX;
+ y = topLevelY;
+ } else if( null != parentWindow ) {
// child -> top
// put client to current parent+child position
final Point p = getLocationOnScreen(null);
x = p.getX();
y = p.getY();
+ } else {
+ x = oldX;
+ y = oldY;
}
// Case: Top Window
@@ -1264,18 +1279,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if ( ReparentOperation.ACTION_INVALID == operation ) {
throw new NativeWindowException("Internal Error: reparentAction not set");
}
-
+
+ if(DEBUG_IMPLEMENTATION) {
+ System.err.println("Window.reparent: ACTION ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", reparentAction "+operation+", pos/size "+x+"/"+y+" "+width+"x"+height+", visible "+wasVisible);
+ }
+
if( ReparentOperation.ACTION_NOP == operation ) {
- if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.reparent: NO CHANGE ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", visible "+wasVisible);
- }
return;
}
- if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.reparent: ACTION ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", reparentAction "+operation+", visible "+wasVisible);
- }
-
// rearrange window tree
if(null!=parentWindow && parentWindow instanceof Window) {
((Window)parentWindow).removeChild(WindowImpl.this);
@@ -1285,19 +1297,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
((Window)parentWindow).addChild(WindowImpl.this);
}
- if( ReparentOperation.ACTION_NATIVE_CREATION_PENDING == operation ) {
- // make size and position persistent for proper recreation
- definePosition(x, y);
- defineSize(width, height);
- return;
- }
-
if( ReparentOperation.ACTION_NATIVE_REPARENTING == operation ) {
final DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
- if(wasVisible) {
- setVisibleImpl(false, x, y, width, height);
+ // TOP -> CLIENT: !visible first (fixes X11 unsuccessful return to parent window)
+ if( null != parentWindow && wasVisible && NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true) ) {
+ setVisibleImpl(false, oldX, oldY, oldWidth, oldHeight);
WindowImpl.this.waitForVisible(false, false);
// FIXME: Some composite WM behave slacky .. give 'em chance to change state -> invisible,
// even though we do exactly that (KDE+Composite)
@@ -1337,7 +1343,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
ok = WindowImpl.this.waitForSize(width, height, false, TIMEOUT_NATIVEWINDOW);
}
if(ok) {
- requestFocusInt(false /* skipFocusAction */);
+ requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */);
display.dispatchMessagesNative(); // status up2date
}
}
@@ -1358,6 +1364,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
destroy( wasVisible );
operation = ReparentOperation.ACTION_NATIVE_CREATION ;
}
+ } else {
+ // Case
+ // ACTION_NATIVE_CREATION
+ // ACTION_NATIVE_CREATION_PENDING;
+
+ // make size and position persistent for proper [re]creation
+ definePosition(x, y);
+ defineSize(width, height);
}
if(DEBUG_IMPLEMENTATION) {
@@ -1398,7 +1412,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.reparentWindow: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow));
}
- setVisible(true); // native creation
+ setVisibleActionImpl(true); // native creation
+ requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */);
} finally {
_lock.unlock();
}
@@ -1408,11 +1423,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
@Override
public final ReparentOperation reparentWindow(NativeWindow newParent) {
- return reparentWindow(newParent, false);
+ return reparentWindow(newParent, -1, -1, false);
}
- public ReparentOperation reparentWindow(NativeWindow newParent, boolean forceDestroyCreate) {
- final ReparentAction reparentAction = new ReparentAction(newParent, forceDestroyCreate);
+ @Override
+ public ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, boolean forceDestroyCreate) {
+ final ReparentAction reparentAction = new ReparentAction(newParent, x, y, forceDestroyCreate);
runOnEDTIfAvail(true, reparentAction);
return reparentAction.getOp();
}
@@ -1800,7 +1816,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private void requestFocusInt(boolean skipFocusAction) {
if( skipFocusAction || !focusAction() ) {
if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.RequestFocusInt: forcing - ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
+ System.err.println("Window.RequestFocusInt: forcing - ("+getThreadName()+"): skipFocusAction "+skipFocusAction+", focus "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
}
requestFocusImpl(true);
}
@@ -1971,7 +1987,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// Lock parentWindow only during reparenting (attempt)
final NativeWindow parentWindowLocked;
if( null != parentWindow ) {
- if(wasVisible && !fullscreen) { // fullscreen-off -> !visible first (fixes unsuccessful return to parent window)
+ // fullscreen off: !visible first (fixes X11 unsuccessful return to parent window)
+ if( !fullscreen && wasVisible && NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true) ) {
setVisibleImpl(false, oldX, oldY, oldWidth, oldHeight);
WindowImpl.this.waitForVisible(false, false);
// FIXME: Some composite WM behave slacky .. give 'em chance to change state -> invisible,
@@ -2004,7 +2021,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
ok = WindowImpl.this.waitForSize(w, h, false, TIMEOUT_NATIVEWINDOW);
}
if(ok) {
- requestFocusInt(fullscreen /* skipFocusAction */);
+ requestFocusInt(fullscreen /* skipFocusAction if fullscreen */);
display.dispatchMessagesNative(); // status up2date
}
if(DEBUG_IMPLEMENTATION) {
@@ -2038,7 +2055,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// enable fullscreen on offscreen instance
if(null != parentWindow) {
nfs_parent = parentWindow;
- reparentWindow(null, true /* forceDestroyCreate */);
+ reparentWindow(null, -1, -1, true /* forceDestroyCreate */);
} else {
throw new InternalError("Offscreen instance w/o parent unhandled");
}
@@ -2048,13 +2065,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(!fullScreenAction.fsOn() && null != nfs_parent) {
// disable fullscreen on offscreen instance
- reparentWindow(nfs_parent, true /* forceDestroyCreate */);
+ reparentWindow(nfs_parent, -1, -1, true /* forceDestroyCreate */);
nfs_parent = null;
}
-
- if( isVisible() ) { // force focus
- requestFocus(true /* wait */, true /* skipFocusAction */, true /* force */);
- }
}
return this.fullscreen;
}
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c
index e6e300d2e..f195c5616 100644
--- a/src/newt/native/X11Window.c
+++ b/src/newt/native/X11Window.c
@@ -817,11 +817,15 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_WindowDriver_reconfigureWindo
if( TST_FLAG_IS_VISIBLE(flags) ) {
DBG_PRINT( "X11: reconfigureWindow0 VISIBLE ON\n");
XMapRaised(dpy, w);
+ XSync(dpy, False);
+ // WM may disregard pos/size XConfigureWindow requests for invisible windows!
+ DBG_PRINT( "X11: reconfigureWindow0 setPosSize.2 %d/%d %dx%d\n", x, y, width, height);
+ NewtWindows_setPosSize(dpy, w, x, y, width, height);
} else {
DBG_PRINT( "X11: reconfigureWindow0 VISIBLE OFF\n");
XUnmapWindow(dpy, w);
+ XSync(dpy, False);
}
- XSync(dpy, False);
}
if( fsEWMHFlags && ( ( TST_FLAG_CHANGE_FULLSCREEN(flags) && TST_FLAG_IS_FULLSCREEN(flags) ) ||
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
index cea104e2f..5335d858e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
@@ -162,7 +162,7 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
}
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1));
+ glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
frame1.setSize(frameSize0);
setupFrameAndShow(frame1, newtCanvasAWT1);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
index 3fc1eb61d..5d091bb6d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
@@ -42,8 +42,6 @@ import com.jogamp.newt.Display;
import com.jogamp.newt.NewtFactory;
import com.jogamp.newt.Screen;
import com.jogamp.newt.awt.NewtCanvasAWT;
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.opengl.GLWindow;
@@ -51,17 +49,14 @@ import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
-
import com.jogamp.opengl.util.Animator;
-
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
+import com.jogamp.opengl.test.junit.newt.parenting.NewtAWTReparentingKeyAdapter;
import javax.media.nativewindow.util.Dimension;
-import javax.media.nativewindow.util.InsetsImmutable;
import javax.media.nativewindow.util.Point;
import javax.media.nativewindow.util.PointImmutable;
import javax.media.nativewindow.util.DimensionImmutable;
-
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLProfile;
@@ -271,50 +266,8 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
}
});
- glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- if( !e.isPrintableKey() || e.isAutoRepeat() ) {
- return;
- }
- if(e.getKeyChar()=='f') {
- quitAdapter.enable(false);
- new Thread() {
- public void run() {
- final Thread t = glWindow.setExclusiveContextThread(null);
- System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
- glWindow.setFullscreen(!glWindow.isFullscreen());
- System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
- glWindow.setExclusiveContextThread(t);
- quitAdapter.clear();
- quitAdapter.enable(true);
- } }.start();
- } else if(e.getKeyChar()=='r') {
- quitAdapter.enable(false);
- if(glWindow.getParent()==null) {
- System.err.println("XXX glWin to home");
- glWindow.reparentWindow(newtCanvasAWT.getNativeWindow());
- } else {
- final InsetsImmutable nInsets = glWindow.getInsets();
- java.awt.Insets aInsets = frame.getInsets();
- System.err.println("XXX glWin to TOP - insets " + nInsets + ", " + aInsets);
- glWindow.reparentWindow(null);
- int dx, dy;
- if(nInsets.getTotalHeight()==0) {
- dx = aInsets.left;
- dy = aInsets.top;
- } else {
- dx = nInsets.getLeftWidth();
- dy = nInsets.getTopHeight();
- }
- glWindow.setPosition(frame.getX()+frame.getWidth()+dx, frame.getY()+dy);
- }
- glWindow.requestFocus();
- quitAdapter.clear();
- quitAdapter.enable(true);
- }
- }
- });
-
+ glWindow.addKeyListener(new NewtAWTReparentingKeyAdapter(frame, newtCanvasAWT, glWindow, quitAdapter));
+
if( useAnimator ) {
animator.add(glWindow);
animator.start();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
index 37172822b..adc2b23ae 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
@@ -36,23 +36,18 @@ import com.jogamp.newt.Display;
import com.jogamp.newt.NewtFactory;
import com.jogamp.newt.Screen;
import com.jogamp.newt.awt.NewtCanvasAWT;
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
-
import com.jogamp.opengl.util.Animator;
-
import com.jogamp.opengl.test.junit.jogl.demos.es2.LandscapeES2;
+import com.jogamp.opengl.test.junit.newt.parenting.NewtAWTReparentingKeyAdapter;
import javax.media.nativewindow.util.Dimension;
-import javax.media.nativewindow.util.InsetsImmutable;
import javax.media.nativewindow.util.DimensionImmutable;
-
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLProfile;
@@ -119,50 +114,8 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
}
});
- glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- if( !e.isPrintableKey() || e.isAutoRepeat() ) {
- return;
- }
- if(e.getKeyChar()=='f') {
- quitAdapter.enable(false);
- new Thread() {
- public void run() {
- final Thread t = glWindow.setExclusiveContextThread(null);
- System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
- glWindow.setFullscreen(!glWindow.isFullscreen());
- System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
- glWindow.setExclusiveContextThread(t);
- quitAdapter.clear();
- quitAdapter.enable(true);
- } }.start();
- } else if(e.getKeyChar()=='r') {
- quitAdapter.enable(false);
- if(glWindow.getParent()==null) {
- System.err.println("XXX glWin to home");
- glWindow.reparentWindow(newtCanvasAWT.getNativeWindow());
- } else {
- final InsetsImmutable nInsets = glWindow.getInsets();
- java.awt.Insets aInsets = frame.getInsets();
- System.err.println("XXX glWin to TOP - insets " + nInsets + ", " + aInsets);
- glWindow.reparentWindow(null);
- int dx, dy;
- if(nInsets.getTotalHeight()==0) {
- dx = aInsets.left;
- dy = aInsets.top;
- } else {
- dx = nInsets.getLeftWidth();
- dy = nInsets.getTopHeight();
- }
- glWindow.setPosition(frame.getX()+frame.getWidth()+dx, frame.getY()+dy);
- }
- glWindow.requestFocus();
- quitAdapter.clear();
- quitAdapter.enable(true);
- }
- }
- });
-
+ glWindow.addKeyListener(new NewtAWTReparentingKeyAdapter(frame, newtCanvasAWT, glWindow, quitAdapter));
+
if( useAnimator ) {
animator.add(glWindow);
animator.start();
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
index 9d08d8ff4..4bf1f95c3 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
@@ -35,33 +35,58 @@ import com.jogamp.newt.awt.NewtCanvasAWT;
import com.jogamp.newt.event.KeyAdapter;
import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.QuitAdapter;
public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
- Frame frame;
- NewtCanvasAWT newtCanvasAWT;
- GLWindow glWindow;
+ final Frame frame;
+ final NewtCanvasAWT newtCanvasAWT;
+ final GLWindow glWindow;
+ final QuitAdapter quitAdapter;
- public NewtAWTReparentingKeyAdapter(Frame frame, NewtCanvasAWT newtCanvasAWT, GLWindow glWindow) {
+ public NewtAWTReparentingKeyAdapter(Frame frame, NewtCanvasAWT newtCanvasAWT, GLWindow glWindow, QuitAdapter quitAdapter) {
this.frame = frame;
this.newtCanvasAWT = newtCanvasAWT;
this.glWindow = glWindow;
+ this.quitAdapter = quitAdapter;
}
public void keyReleased(KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
- if(e.getKeyChar()=='i') {
+ if( e.getKeySymbol() == KeyEvent.VK_I ) {
System.err.println(glWindow);
- } else if(e.getKeyChar()=='d') {
- glWindow.setUndecorated(!glWindow.isUndecorated());
- } else if(e.getKeyChar()=='f') {
- glWindow.setFullscreen(!glWindow.isFullscreen());
- } else if(e.getKeyChar()=='l') {
+ } else if( e.getKeySymbol() == KeyEvent.VK_L ) {
javax.media.nativewindow.util.Point p0 = newtCanvasAWT.getNativeWindow().getLocationOnScreen(null);
javax.media.nativewindow.util.Point p1 = glWindow.getLocationOnScreen(null);
System.err.println("NewtCanvasAWT position: "+p0+", "+p1);
- } else if(e.getKeyChar()=='p') {
+ } else if( e.getKeySymbol() == KeyEvent.VK_D ) {
+ glWindow.setUndecorated(!glWindow.isUndecorated());
+ } else if( e.getKeySymbol() == KeyEvent.VK_S ) {
+ if(glWindow.getParent()==null) {
+ System.err.println("XXX glWin to 100/100");
+ glWindow.setPosition(100, 100);
+ } else {
+ System.err.println("XXX glWin to 0/0");
+ glWindow.setPosition(0, 0);
+ }
+ } else if( e.getKeySymbol() == KeyEvent.VK_F ) {
+ if( null != quitAdapter ) {
+ quitAdapter.enable(false);
+ }
+ new Thread() {
+ public void run() {
+ final Thread t = glWindow.setExclusiveContextThread(null);
+ System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+ glWindow.setFullscreen(!glWindow.isFullscreen());
+ System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+ glWindow.setExclusiveContextThread(t);
+ if( null != quitAdapter ) {
+ quitAdapter.clear();
+ quitAdapter.enable(true);
+ }
+ } }.start();
+ } else if( e.getKeySymbol() == KeyEvent.VK_P ) {
new Thread() {
public void run() {
if(glWindow.getAnimator().isPaused()) {
@@ -71,34 +96,44 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
}
}
}.run();
- } else if(e.getKeyChar()=='r') {
- if(glWindow.getParent()==null) {
- System.err.println("XXX glWin to home");
- glWindow.reparentWindow(newtCanvasAWT.getNativeWindow());
- } else {
- final InsetsImmutable nInsets = glWindow.getInsets();
- java.awt.Insets aInsets = frame.getInsets();
- System.err.println("XXX glWin to TOP - insets " + nInsets + ", " + aInsets);
- glWindow.reparentWindow(null);
- int dx, dy;
- if(nInsets.getTotalHeight()==0) {
- dx = aInsets.left;
- dy = aInsets.top;
- } else {
- dx = nInsets.getLeftWidth();
- dy = nInsets.getTopHeight();
- }
- glWindow.setPosition(frame.getX()+frame.getWidth()+dx, frame.getY()+dy);
- }
- glWindow.requestFocus();
- } else if(e.getKeyChar()=='s') {
- if(glWindow.getParent()==null) {
- System.err.println("XXX glWin to 100/100");
- glWindow.setPosition(100, 100);
- } else {
- System.err.println("XXX glWin to 0/0");
- glWindow.setPosition(0, 0);
+ } else if( e.getKeySymbol() == KeyEvent.VK_R ) {
+ if( null != quitAdapter ) {
+ quitAdapter.enable(false);
}
+ new Thread() {
+ public void run() {
+ final Thread t = glWindow.setExclusiveContextThread(null);
+ if(glWindow.getParent()==null) {
+ System.err.println("XXX glWin to HOME");
+ glWindow.reparentWindow(newtCanvasAWT.getNativeWindow());
+ } else {
+ if( null != frame ) {
+ final InsetsImmutable nInsets = glWindow.getInsets();
+ final java.awt.Insets aInsets = frame.getInsets();
+ int dx, dy;
+ if( nInsets.getTotalHeight()==0 ) {
+ dx = aInsets.left;
+ dy = aInsets.top;
+ } else {
+ dx = nInsets.getLeftWidth();
+ dy = nInsets.getTopHeight();
+ }
+ final int topLevelX = frame.getX()+frame.getWidth()+dx;
+ final int topLevelY = frame.getY()+dy;
+ System.err.println("XXX glWin to TOP.1 "+topLevelX+"/"+topLevelY+" - insets " + nInsets + ", " + aInsets);
+ glWindow.reparentWindow(null, topLevelX, topLevelY, false);
+ } else {
+ System.err.println("XXX glWin to TOP.0");
+ glWindow.reparentWindow(null);
+ }
+ }
+ glWindow.requestFocus();
+ glWindow.setExclusiveContextThread(t);
+ if( null != quitAdapter ) {
+ quitAdapter.clear();
+ quitAdapter.enable(true);
+ }
+ } }.start();
}
}
}
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
index 41a6b77fa..1f19241d8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
@@ -379,7 +379,7 @@ public class TestParenting01NEWT extends UITestCase {
// glWindow2 -- child --> glWindow1: compatible
Assert.assertEquals(true, glWindow2.isVisible());
System.err.println("Frames(1) "+glWindow2.getTotalFPSFrames());
- reparentAction = glWindow2.reparentWindow(glWindow1, reparentRecreate);
+ reparentAction = glWindow2.reparentWindow(glWindow1, -1, -1, reparentRecreate);
System.err.println("Frames(2) "+glWindow2.getTotalFPSFrames());
Assert.assertTrue(Window.ReparentOperation.ACTION_INVALID != reparentAction);
Assert.assertEquals(true, glWindow2.isVisible());
@@ -405,7 +405,7 @@ public class TestParenting01NEWT extends UITestCase {
// glWindow2 --> top
Assert.assertEquals(true, glWindow2.isVisible());
- reparentAction = glWindow2.reparentWindow(null, reparentRecreate);
+ reparentAction = glWindow2.reparentWindow(null, -1, -1, reparentRecreate);
Assert.assertTrue(Window.ReparentOperation.ACTION_INVALID != reparentAction);
Assert.assertEquals(true, glWindow2.isVisible());
Assert.assertEquals(true, glWindow2.isNativeValid());
@@ -567,7 +567,7 @@ public class TestParenting01NEWT extends UITestCase {
switch(state) {
case 0:
Assert.assertEquals(true, glWindow2.isVisible());
- reparentAction = glWindow2.reparentWindow(null, reparentRecreate);
+ reparentAction = glWindow2.reparentWindow(null, -1, -1, reparentRecreate);
Assert.assertTrue(Window.ReparentOperation.ACTION_INVALID != reparentAction);
Assert.assertEquals(true, glWindow2.isVisible());
Assert.assertEquals(true, glWindow2.isNativeValid());
@@ -582,7 +582,7 @@ public class TestParenting01NEWT extends UITestCase {
break;
case 1:
Assert.assertEquals(true, glWindow2.isVisible());
- reparentAction = glWindow2.reparentWindow(glWindow1, reparentRecreate);
+ reparentAction = glWindow2.reparentWindow(glWindow1, -1, -1, reparentRecreate);
Assert.assertTrue(Window.ReparentOperation.ACTION_INVALID != reparentAction);
Assert.assertEquals(true, glWindow2.isVisible());
Assert.assertEquals(true, glWindow2.isNativeValid());
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
index 60c2b702c..30ee0f129 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
@@ -88,7 +88,7 @@ public class TestParenting03AWT extends UITestCase {
GLEventListener demo1 = new GearsES2(1);
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1));
+ glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
GLAnimatorControl animator1 = new Animator(glWindow1);
animator1.start();
@@ -104,7 +104,7 @@ public class TestParenting03AWT extends UITestCase {
GLEventListener demo2 = new GearsES2(1);
setDemoFields(demo2, glWindow2, false);
glWindow2.addGLEventListener(demo2);
- glWindow2.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT2, glWindow2));
+ glWindow2.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT2, glWindow2, null));
animator2 = new Animator(glWindow2);
animator2.start();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java
index 58dafba15..693dd1448 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java
@@ -147,7 +147,7 @@ public class TestParentingFocusTraversal01AWT extends UITestCase {
GLEventListener demo1 = new GearsES2(1);
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1));
+ glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
glWindow1.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
--
cgit v1.2.3
From a90bf31f8747dd38c61d518f8af4d4d4a64a8e90 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Thu, 17 Oct 2013 07:56:20 +0200
Subject: NEWT PointerEvent: Unify event processing in new doPointerEvent(..)
and consumePointerEvent(..) - Unifies native mouse and Android's pointer
event, ready for Win7 touch
Unify event processing in new doPointerEvent(..), which is also invoked from doMouseEvent(..),
and consumePointerEvent().
doPointerEvent(..): Validates and modifies event data and finally creates the event,
where consumePointerEvent(..) calls gesture handlers and may synthesize events.
Unifies native mouse and Android's pointer event, ready for Win7 touch.
AndroidNewtEventFactory calls doPointerEvent(..) directly.
Removed lots of duplicated pointer event handling code.
---
make/scripts/tests-win.bat | 4 +-
make/scripts/tests-x64-dbg.bat | 4 +-
make/scripts/tests.sh | 4 +-
.../classes/com/jogamp/newt/event/MouseEvent.java | 98 ++---
src/newt/classes/jogamp/newt/WindowImpl.java | 409 ++++++++++++---------
.../android/event/AndroidNewtEventFactory.java | 64 ++--
.../android/event/AndroidNewtEventTranslator.java | 14 +-
7 files changed, 303 insertions(+), 294 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index b3029f94c..099768f7c 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -58,14 +58,14 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledR
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering3GL2AWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT2 %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT2 %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestGearsES1NEWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 4000 -x 10 -y 10 -width 100 -height 100 -screen 0
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 40000 -width 100 -height 100 -screen 0 %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT -time 5000
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index c1a14c1a2..bab911e37 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -49,9 +49,9 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLC
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer" "-Djogl.debug.TileRenderer.PNG"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
-set D_ARGS="-Dnewt.debug.Window"
+REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
-REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
+set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
REM set D_ARGS="-Djogl.debug.GLDebugMessageHandler" "-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index a302666f7..129b0deab 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -301,7 +301,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
#testawtswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $*
@@ -333,7 +333,7 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering2GL2NEWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestRandomTiledRendering3GL2AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT $*
-testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsSwingAWT2 $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingNIOImageSwingAWT $*
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index fd5e27bdd..cb9e7a290 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -145,9 +145,17 @@ public class MouseEvent extends InputEvent
super(eventType, source, when, modifiers);
this.x = new int[]{x};
this.y = new int[]{y};
- this.pressure = constMousePressure;
+ switch(eventType) {
+ case EVENT_MOUSE_CLICKED:
+ case EVENT_MOUSE_PRESSED:
+ case EVENT_MOUSE_DRAGGED:
+ this.pressure = constMousePressure1;
+ break;
+ default:
+ this.pressure = constMousePressure0;
+ }
this.maxPressure= 1.0f;
- this.pointerID = constMousePointerIDs;
+ this.pointerID = new short[] { (short)(button - 1) };
this.clickCount=clickCount;
this.button=button;
this.rotationXYZ = rotationXYZ;
@@ -212,70 +220,6 @@ public class MouseEvent extends InputEvent
x, y, pressure, maxPressure, button, clickCount, rotationXYZ, rotationScale);
}
- /**
- * Factory for a multiple-pointer event.
- *
- * The index for the multiple-pointer fields representing the triggering pointer is passed via actionIdx.
- * If actionIdx is not 0
, all multiple-pointer fields values of index 0
- * and actionIdx are swapped so that the pointer-index 0 will represent the triggering pointer.
- *
- *
- * See details for multiple-pointer events.
- *
- *
- * @param eventType
- * @param source
- * @param when
- * @param modifiers
- * @param actionIdx index of multiple-pointer arrays representing the pointer which triggered the event
- * @param pointerType PointerType for each pointer (multiple pointer)
- * @param pointerID Pointer ID for each pointer (multiple pointer). IDs start w/ 0 and are consecutive numbers.
- * @param x X-axis for each pointer (multiple pointer)
- * @param y Y-axis for each pointer (multiple pointer)
- * @param pressure Pressure for each pointer (multiple pointer)
- * @param maxPressure Maximum pointer pressure for all pointer
- * @param button Corresponding mouse-button
- * @param clickCount Mouse-button click-count
- * @param rotationXYZ Rotation of all axis
- * @param rotationScale Rotation scale
- */
- public static MouseEvent create(short eventType, Object source, long when, int modifiers,
- int actionIdx, PointerType pointerType[], short[] pointerID,
- int[] x, int[] y, float[] pressure, float maxPressure,
- short button, short clickCount, float[] rotationXYZ, float rotationScale) {
- if( 0 <= actionIdx && actionIdx < pointerType.length) {
- if( 0 < actionIdx ) {
- {
- final PointerType aType = pointerType[actionIdx];
- pointerType[actionIdx] = pointerType[0];
- pointerType[0] = aType;
- }
- {
- final short s = pointerID[actionIdx];
- pointerID[actionIdx] = pointerID[0];
- pointerID[0] = s;
- }
- {
- int s = x[actionIdx];
- x[actionIdx] = x[0];
- x[0] = s;
- s = y[actionIdx];
- y[actionIdx] = y[0];
- y[0] = s;
- }
- {
- final float aPress = pressure[actionIdx];
- pressure[actionIdx] = pressure[0];
- pressure[0] = aPress;
- }
- }
- return new MouseEvent(eventType, source, when, modifiers,
- pointerType, pointerID, x, y, pressure, maxPressure,
- button, clickCount, rotationXYZ, rotationScale);
- }
- throw new IllegalArgumentException("actionIdx out of bounds [0.."+(pointerType.length-1)+"]");
- }
-
/**
* @return the count of pointers involved in this event
*/
@@ -528,15 +472,15 @@ public class MouseEvent extends InputEvent
public static String getEventTypeString(short type) {
switch(type) {
- case EVENT_MOUSE_CLICKED: return "EVENT_MOUSE_CLICKED";
- case EVENT_MOUSE_ENTERED: return "EVENT_MOUSE_ENTERED";
- case EVENT_MOUSE_EXITED: return "EVENT_MOUSE_EXITED";
- case EVENT_MOUSE_PRESSED: return "EVENT_MOUSE_PRESSED";
- case EVENT_MOUSE_RELEASED: return "EVENT_MOUSE_RELEASED";
- case EVENT_MOUSE_MOVED: return "EVENT_MOUSE_MOVED";
- case EVENT_MOUSE_DRAGGED: return "EVENT_MOUSE_DRAGGED";
- case EVENT_MOUSE_WHEEL_MOVED: return "EVENT_MOUSE_WHEEL_MOVED";
- default: return "unknown (" + type + ")";
+ case EVENT_MOUSE_CLICKED: return "EVENT_MOUSE_CLICKED";
+ case EVENT_MOUSE_ENTERED: return "EVENT_MOUSE_ENTERED";
+ case EVENT_MOUSE_EXITED: return "EVENT_MOUSE_EXITED";
+ case EVENT_MOUSE_PRESSED: return "EVENT_MOUSE_PRESSED";
+ case EVENT_MOUSE_RELEASED: return "EVENT_MOUSE_RELEASED";
+ case EVENT_MOUSE_MOVED: return "EVENT_MOUSE_MOVED";
+ case EVENT_MOUSE_DRAGGED: return "EVENT_MOUSE_DRAGGED";
+ case EVENT_MOUSE_WHEEL_MOVED: return "EVENT_MOUSE_WHEEL_MOVED";
+ default: return "unknown (" + type + ")";
}
}
@@ -558,8 +502,8 @@ public class MouseEvent extends InputEvent
private final float rotationScale;
private final float maxPressure;
- private static final float[] constMousePressure = new float[]{0f};
- private static final short[] constMousePointerIDs = new short[]{0};
+ private static final float[] constMousePressure0 = new float[]{0f};
+ private static final float[] constMousePressure1 = new float[]{1f};
private static final PointerType[] constMousePointerTypes = new PointerType[] { PointerType.Mouse };
public static final short EVENT_MOUSE_CLICKED = 200;
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 66ce46ed0..b0df2d894 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -135,6 +135,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
/** Timeout of queued events (repaint and resize) */
static final long QUEUED_EVENT_TO = 1200; // ms
+ private static final int[] constMousePointerTypes = new int[] { PointerType.Mouse.ordinal() };
+
//
// Volatile: Multithread Mutable Access
//
@@ -181,34 +183,50 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private ArrayList mouseListeners = new ArrayList();
+ /** from event passing: {@link WindowImpl#consumePointerEvent(MouseEvent)}. */
private static class PointerState0 {
- /** current pressed mouse button number */
- private short buttonPressed = (short)0;
- /** current pressed mouse button modifier mask */
- private int buttonModMask = 0;
- /** last time when a mouse button was pressed */
- private long lastButtonPressTime = 0;
- /** last mouse button click count */
- private short lastButtonClickCount = (short)0;
/** mouse entered window - is inside the window (may be synthetic) */
- private boolean insideWindow = false;
- /** last mouse-move position */
- private Point lastMovePosition = new Point();
- }
- private static class PointerState1 {
- /** current pressed mouse button number */
- private short buttonPressed = (short)0;
+ boolean insideWindow = false;
+
/** last time when a mouse button was pressed */
- private long lastButtonPressTime = 0;
- /** mouse entered window - is inside the window (may be synthetic) */
- private boolean insideWindow = false;
- /** last mouse-move position */
- private Point lastMovePosition = new Point();
+ long lastButtonPressTime = 0;
+
+ void clearButton() {
+ lastButtonPressTime = 0;
+ }
}
- /** doMouseEvent */
private PointerState0 pState0 = new PointerState0();
- /** consumeMouseEvent */
+
+ /** from direct input: {@link WindowImpl#doPointerEvent(boolean, boolean, int[], short, int, int, short[], int[], int[], float[], float, float[], float)}. */
+ private static class PointerState1 extends PointerState0 {
+ /** current pressed mouse button number */
+ short buttonPressed = (short)0;
+ /** current pressed mouse button modifier mask */
+ int buttonPressedMask = 0;
+ /** last mouse button click count */
+ short lastButtonClickCount = (short)0;
+
+ final void clearButton() {
+ super.clearButton();
+ lastButtonPressTime = 0;
+ lastButtonClickCount = (short)0;
+ buttonPressed = 0;
+ buttonPressedMask = 0;
+ }
+
+ /** last pointer-move position for 8 touch-down pointers */
+ final Point[] movePositions = new Point[] {
+ new Point(), new Point(), new Point(), new Point(),
+ new Point(), new Point(), new Point(), new Point() };
+ final Point getMovePosition(int id) {
+ if( 0 <= id && id < movePositions.length ) {
+ return movePositions[id];
+ }
+ return null;
+ }
+ }
private PointerState1 pState1 = new PointerState1();
+
private boolean defaultGestureHandlerEnabled = true;
private DoubleTapScrollGesture gesture2PtrTouchScroll = null;
private ArrayList pointerGestureHandler = new ArrayList();
@@ -2247,7 +2265,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public boolean consumeEvent(NEWTEvent e) {
+ public final boolean consumeEvent(NEWTEvent e) {
switch(e.getEventType()) {
// special repaint treatment
case WindowEvent.EVENT_WINDOW_REPAINT:
@@ -2288,7 +2306,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} else if(e instanceof KeyEvent) {
consumeKeyEvent((KeyEvent)e);
} else if(e instanceof MouseEvent) {
- consumeMouseEvent((MouseEvent)e);
+ consumePointerEvent((MouseEvent)e);
} else {
throw new NativeWindowException("Unexpected NEWTEvent type " + e);
}
@@ -2347,21 +2365,115 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
int x, int y, short button, float[] rotationXYZ, float rotationScale) {
doMouseEvent(true, wait, eventType, modifiers, x, y, button, rotationXYZ, rotationScale);
} */
+
+ /**
+ * Send mouse event (one-pointer) either to be directly consumed or to be enqueued
+ *
+ * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
+ * otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
+ * @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
+ */
protected void doMouseEvent(boolean enqueue, boolean wait, short eventType, int modifiers,
int x, int y, short button, float[] rotationXYZ, float rotationScale) {
- if( 0 > button || button > MouseEvent.BUTTON_NUMBER ) {
+ if( 0 > button || button > MouseEvent.BUTTON_COUNT ) {
throw new NativeWindowException("Invalid mouse button number" + button);
+ } else if( 0 == button ) {
+ button = 1;
+ }
+ doPointerEvent(enqueue, wait, constMousePointerTypes, eventType, modifiers,
+ 0 /*actionIdx*/, new short[] { (short)(button-1) },
+ new int[]{x}, new int[]{y}, new float[]{0f} /*pressure*/, 1f /*maxPressure*/,
+ rotationXYZ, rotationScale);
+ }
+
+ /**
+ * Send multiple-pointer event either to be directly consumed or to be enqueued
+ *
+ * The index for the element of multiple-pointer arrays represents the pointer which triggered the event
+ * is passed via actionIdx.
+ *
+ *
+ * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
+ * otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
+ * @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
+ * @param pTypesOrdinal {@link MouseEvent.PointerType#ordinal()} for each pointer (multiple pointer)
+ * @param eventType
+ * @param modifiers
+ * @param actionIdx index of multiple-pointer arrays representing the pointer which triggered the event
+ * @param pID Pointer ID for each pointer (multiple pointer), we assume pointerID's starts w/ 0
+ * @param pX X-axis for each pointer (multiple pointer)
+ * @param pY Y-axis for each pointer (multiple pointer)
+ * @param pPressure Pressure for each pointer (multiple pointer)
+ * @param maxPressure Maximum pointer pressure for all pointer
+ */
+ public void doPointerEvent(boolean enqueue, boolean wait,
+ int[] pTypesOrdinal, short eventType, int modifiers,
+ int actionIdx, short[] pID,
+ int[] pX, int[] pY, float[] pPressure, float maxPressure,
+ float[] rotationXYZ, float rotationScale) {
+ final long when = System.currentTimeMillis();
+ final int pointerCount = pTypesOrdinal.length;
+
+ if( 0 > actionIdx || actionIdx >= pointerCount) {
+ throw new IllegalArgumentException("actionIdx out of bounds [0.."+(pointerCount-1)+"]");
+ }
+ if( 0 < actionIdx ) {
+ // swap values to make idx 0 the triggering pointer
+ {
+ final int aType = pTypesOrdinal[actionIdx];
+ pTypesOrdinal[actionIdx] = pTypesOrdinal[0];
+ pTypesOrdinal[0] = aType;
+ }
+ {
+ final short s = pID[actionIdx];
+ pID[actionIdx] = pID[0];
+ pID[0] = s;
+ }
+ {
+ int s = pX[actionIdx];
+ pX[actionIdx] = pX[0];
+ pX[0] = s;
+ s = pY[actionIdx];
+ pY[actionIdx] = pY[0];
+ pY[0] = s;
+ }
+ {
+ final float aPress = pPressure[actionIdx];
+ pPressure[actionIdx] = pPressure[0];
+ pPressure[0] = aPress;
+ }
+ }
+ final PointerType[] pointerType = new PointerType[pointerCount];
+ for(int i=pointerCount-1; i>=0; i--) {
+ pointerType[i] = PointerType.valueOf(pTypesOrdinal[i]);
+ }
+ final short id = pID[0];
+ final short button;
+ {
+ final int b = id + 1;
+ if( com.jogamp.newt.event.MouseEvent.BUTTON1 <= b && b <= com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) {
+ button = (short)b;
+ } else {
+ button = com.jogamp.newt.event.MouseEvent.BUTTON1;
+ }
}
//
- // Remove redundant events, determine ENTERED state and reset states if applicable
+ // - Determine ENTERED/EXITED state
+ // - Remove redundant move/drag events
+ // - Reset states if applicable
//
- final long when = System.currentTimeMillis();
+ int x = pX[0];
+ int y = pY[0];
+ final Point movePositionP0 = pState1.getMovePosition(id);
switch( eventType ) {
case MouseEvent.EVENT_MOUSE_EXITED:
- if( x==-1 && y==-1 ) {
- x = pState0.lastMovePosition.getX();
- y = pState0.lastMovePosition.getY();
+ if( null != movePositionP0 ) {
+ if( x==-1 && y==-1 ) {
+ x = movePositionP0.getX();
+ y = movePositionP0.getY();
+ }
+ movePositionP0.set(0, 0);
}
// Fall through intended!
@@ -2369,54 +2481,46 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// clip coordinates to window dimension
x = Math.min(Math.max(x, 0), getWidth()-1);
y = Math.min(Math.max(y, 0), getHeight()-1);
- pState0.insideWindow = eventType == MouseEvent.EVENT_MOUSE_ENTERED;
- // clear states
- pState0.lastButtonPressTime = 0;
- pState0.lastButtonClickCount = (short)0;
- pState0.buttonPressed = 0;
- pState0.buttonModMask = 0;
+ pState1.insideWindow = eventType == MouseEvent.EVENT_MOUSE_ENTERED;
+ pState1.clearButton();
break;
case MouseEvent.EVENT_MOUSE_MOVED:
case MouseEvent.EVENT_MOUSE_DRAGGED:
- if( pState0.insideWindow && pState0.lastMovePosition.getX() == x && pState0.lastMovePosition.getY() == y ) {
- if(DEBUG_MOUSE_EVENT) {
- System.err.println("doMouseEvent: skip EVENT_MOUSE_MOVED w/ same position: "+pState0.lastMovePosition);
+ if( null != movePositionP0 ) {
+ if( pState1.insideWindow && movePositionP0.getX() == x && movePositionP0.getY() == y ) {
+ if(DEBUG_MOUSE_EVENT) {
+ System.err.println("doMouseEvent: skip "+MouseEvent.getEventTypeString(eventType)+" w/ same position: "+movePositionP0);
+ }
+ return; // skip same position
}
- return; // skip same position
+ movePositionP0.set(x, y);
}
- pState0.lastMovePosition.setX(x);
- pState0.lastMovePosition.setY(y);
// Fall through intended !
default:
- if(!pState0.insideWindow) {
- pState0.insideWindow = true;
-
- // clear states
- pState0.lastButtonPressTime = 0;
- pState0.lastButtonClickCount = (short)0;
- pState0.buttonPressed = 0;
- pState0.buttonModMask = 0;
+ if(!pState1.insideWindow) {
+ pState1.insideWindow = true;
+ pState1.clearButton();
}
}
if( x < 0 || y < 0 || x >= getWidth() || y >= getHeight() ) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("doMouseEvent: drop: "+MouseEvent.getEventTypeString(eventType)+
- ", mod "+modifiers+", pos "+x+"/"+y+", button "+button+", lastMousePosition: "+pState0.lastMovePosition);
+ ", mod "+modifiers+", pos "+x+"/"+y+", button "+button+", lastMousePosition: "+movePositionP0);
}
return; // .. invalid ..
}
if(DEBUG_MOUSE_EVENT) {
System.err.println("doMouseEvent: enqueue "+enqueue+", wait "+wait+", "+MouseEvent.getEventTypeString(eventType)+
- ", mod "+modifiers+", pos "+x+"/"+y+", button "+button+", lastMousePosition: "+pState0.lastMovePosition);
+ ", mod "+modifiers+", pos "+x+"/"+y+", button "+button+", lastMousePosition: "+movePositionP0);
}
-
- modifiers |= InputEvent.getButtonMask(button); // Always add current button to modifier mask (Bug 571)
- modifiers |= pState0.buttonModMask; // Always add currently pressed mouse buttons to modifier mask
+ modifiers |= InputEvent.getButtonMask(button); // Always add current button to modifier mask (Bug 571)
+ modifiers |= pState1.buttonPressedMask; // Always add currently pressed mouse buttons to modifier mask
+
if( isPointerConfined() ) {
modifiers |= InputEvent.CONFINED_MASK;
}
@@ -2424,78 +2528,79 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
modifiers |= InputEvent.INVISIBLE_MASK;
}
- final MouseEvent e;
-
+ pX[0] = x;
+ pY[0] = y;
+
+ //
+ // - Determine CLICK COUNT
+ // - Ignore sent CLICKED
+ // - Track buttonPressed incl. buttonPressedMask
+ // - Fix MOVED/DRAGGED event
+ //
+ final MouseEvent e;
switch( eventType ) {
+ case MouseEvent.EVENT_MOUSE_CLICKED:
+ e = null;
+ break;
+
case MouseEvent.EVENT_MOUSE_PRESSED:
- if( when - pState0.lastButtonPressTime < MouseEvent.getClickTimeout() ) {
- pState0.lastButtonClickCount++;
+ if( 0 >= pPressure[0] ) {
+ pPressure[0] = maxPressure;
+ }
+ pState1.buttonPressedMask |= InputEvent.getButtonMask(button);
+ if( 1 == pointerCount ) {
+ if( when - pState1.lastButtonPressTime < MouseEvent.getClickTimeout() ) {
+ pState1.lastButtonClickCount++;
+ } else {
+ pState1.lastButtonClickCount=(short)1;
+ }
+ pState1.lastButtonPressTime = when;
+ pState1.buttonPressed = button;
+ e = new MouseEvent(eventType, this, when, modifiers, pointerType, pID,
+ pX, pY, pPressure, maxPressure, button, pState1.lastButtonClickCount, rotationXYZ, rotationScale);
} else {
- pState0.lastButtonClickCount=(short)1;
+ e = new MouseEvent(eventType, this, when, modifiers, pointerType, pID,
+ pX, pY, pPressure, maxPressure, button, (short)1, rotationXYZ, rotationScale);
}
- pState0.lastButtonPressTime = when;
- pState0.buttonPressed = button;
- pState0.buttonModMask |= MouseEvent.getButtonMask(button);
- e = new MouseEvent(eventType, this, when,
- modifiers, x, y, pState0.lastButtonClickCount, button, rotationXYZ, rotationScale);
break;
case MouseEvent.EVENT_MOUSE_RELEASED:
- e = new MouseEvent(eventType, this, when,
- modifiers, x, y, pState0.lastButtonClickCount, button, rotationXYZ, rotationScale);
- if( when - pState0.lastButtonPressTime >= MouseEvent.getClickTimeout() ) {
- pState0.lastButtonClickCount = (short)0;
- pState0.lastButtonPressTime = 0;
- }
- pState0.buttonPressed = 0;
- pState0.buttonModMask &= ~MouseEvent.getButtonMask(button);
+ if( 1 == pointerCount ) {
+ e = new MouseEvent(eventType, this, when, modifiers, pointerType, pID,
+ pX, pY, pPressure, maxPressure, button, pState1.lastButtonClickCount, rotationXYZ, rotationScale);
+ if( when - pState1.lastButtonPressTime >= MouseEvent.getClickTimeout() ) {
+ pState1.lastButtonClickCount = (short)0;
+ pState1.lastButtonPressTime = 0;
+ }
+ pState1.buttonPressed = 0;
+ } else {
+ e = new MouseEvent(eventType, this, when, modifiers, pointerType, pID,
+ pX, pY, pPressure, maxPressure, button, (short)1, rotationXYZ, rotationScale);
+ }
+ pState1.buttonPressedMask &= ~InputEvent.getButtonMask(button);
+ if( null != movePositionP0 ) {
+ movePositionP0.set(0, 0);
+ }
break;
case MouseEvent.EVENT_MOUSE_MOVED:
- if ( pState0.buttonPressed > 0 ) {
- e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when,
- modifiers, x, y, (short)1, pState0.buttonPressed, rotationXYZ, rotationScale);
+ if ( 0 != pState1.buttonPressedMask ) { // any button or pointer move -> drag
+ e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when, modifiers, pointerType, pID,
+ pX, pY, pPressure, maxPressure, pState1.buttonPressed, (short)1, rotationXYZ, rotationScale);
} else {
- e = new MouseEvent(eventType, this, when,
- modifiers, x, y, (short)0, button, rotationXYZ, rotationScale);
+ e = new MouseEvent(eventType, this, when, modifiers, pointerType, pID,
+ pX, pY, pPressure, maxPressure, button, (short)0, rotationXYZ, rotationScale);
}
break;
+ case MouseEvent.EVENT_MOUSE_DRAGGED:
+ if( 0 >= pPressure[0] ) {
+ pPressure[0] = maxPressure;
+ }
+ // Fall through intended!
default:
- e = new MouseEvent(eventType, this, when, modifiers, x, y, (short)0, button, rotationXYZ, rotationScale);
+ e = new MouseEvent(eventType, this, when, modifiers, pointerType, pID,
+ pX, pY, pPressure, maxPressure, button, (short)0, rotationXYZ, rotationScale);
}
doEvent(enqueue, wait, e); // actual mouse event
}
-
- /**
- * Send multiple-pointer event directly to be consumed
- *
- * The index for the element of multiple-pointer arrays represents the pointer which triggered the event
- * is passed via actionIdx.
- *
- *
- * @param eventType
- * @param source
- * @param when
- * @param modifiers
- * @param actionIdx index of multiple-pointer arrays representing the pointer which triggered the event
- * @param pointerType PointerType for each pointer (multiple pointer)
- * @param pointerID Pointer ID for each pointer (multiple pointer)
- * @param x X-axis for each pointer (multiple pointer)
- * @param y Y-axis for each pointer (multiple pointer)
- * @param pressure Pressure for each pointer (multiple pointer)
- * @param maxPressure Maximum pointer pressure for all pointer
- * @param button Corresponding mouse-button
- * @param clickCount Mouse-button click-count
- * @param rotationXYZ Rotation of all axis
- * @param rotationScale Rotation scale
- */
- public void sendMouseEvent(short eventType, Object source, long when, int modifiers,
- int actionIdx, PointerType pointerType[], short[] pointerID,
- int[] x, int[] y, float[] pressure, float maxPressure,
- short button, short clickCount, float[] rotationXYZ, float rotationScale) {
- final MouseEvent pe = MouseEvent.create(eventType, source, when, modifiers, actionIdx,
- pointerType, pointerID, x, y, pressure, maxPressure, button, clickCount,
- rotationXYZ, rotationScale);
- consumeMouseEvent(pe);
- }
@Override
public final void addMouseListener(MouseListener l) {
@@ -2619,25 +2724,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* - dispatch event to listener
*
*/
- protected void consumeMouseEvent(MouseEvent pe) {
- final int x = pe.getX();
- final int y = pe.getY();
+ private final void consumePointerEvent(MouseEvent pe) {
+ int x = pe.getX();
+ int y = pe.getY();
- if( x < 0 || y < 0 || x >= getWidth() || y >= getHeight() ) {
- if(DEBUG_MOUSE_EVENT) {
- System.err.println("consumeMouseEvent.drop: "+pe);
- }
- return; // .. invalid ..
- }
if(DEBUG_MOUSE_EVENT) {
System.err.println("consumeMouseEvent.in: "+pe);
}
//
- // - Remove redundant events
// - Determine ENTERED/EXITED state
- // - synthesize ENTERED event
- // - fix MOVED/DRAGGED event
+ // - Synthesize ENTERED event
// - Reset states if applicable
//
final long when = pe.getWhen();
@@ -2646,36 +2743,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
switch( eventType ) {
case MouseEvent.EVENT_MOUSE_EXITED:
case MouseEvent.EVENT_MOUSE_ENTERED:
- pState1.insideWindow = eventType == MouseEvent.EVENT_MOUSE_ENTERED;
- // clear states
- pState1.lastButtonPressTime = 0;
- pState1.buttonPressed = 0;
+ // clip coordinates to window dimension
+ x = Math.min(Math.max(x, 0), getWidth()-1);
+ y = Math.min(Math.max(y, 0), getHeight()-1);
+ pState0.insideWindow = eventType == MouseEvent.EVENT_MOUSE_ENTERED;
+ pState0.clearButton();
eEntered = null;
break;
- case MouseEvent.EVENT_MOUSE_MOVED:
- if ( pState1.buttonPressed > 0 ) {
- pe = pe.createVariant(MouseEvent.EVENT_MOUSE_DRAGGED);
- eventType = pe.getEventType();
- }
- // Fall through intended !
- case MouseEvent.EVENT_MOUSE_DRAGGED:
- if( pState1.insideWindow && pState1.lastMovePosition.getX() == x && pState1.lastMovePosition.getY() == y ) {
- if(DEBUG_MOUSE_EVENT) {
- System.err.println("consumeMouseEvent: skip EVENT_MOUSE_MOVED w/ same position: "+pState1.lastMovePosition);
- }
- return; // skip same position
- }
- pState1.lastMovePosition.setX(x);
- pState1.lastMovePosition.setY(y);
- // Fall through intended !
default:
- if(!pState1.insideWindow) {
- pState1.insideWindow = true;
+ if(!pState0.insideWindow) {
+ pState0.insideWindow = true;
+ pState0.clearButton();
eEntered = pe.createVariant(MouseEvent.EVENT_MOUSE_ENTERED);
- // clear states
- pState1.lastButtonPressTime = 0;
- pState1.buttonPressed = 0;
} else {
eEntered = null;
}
@@ -2685,6 +2765,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
System.err.println("consumeMouseEvent.send.0: "+eEntered);
}
dispatchMouseEvent(eEntered);
+ } else if( x < 0 || y < 0 || x >= getWidth() || y >= getHeight() ) {
+ if(DEBUG_MOUSE_EVENT) {
+ System.err.println("consumeMouseEvent.drop: "+pe);
+ }
+ return; // .. invalid ..
}
//
@@ -2758,25 +2843,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
//
- // Synthesize mouse click
- //
+ // - Synthesize mouse CLICKED
+ // - Ignore sent CLICKED
+ //
final MouseEvent eClicked;
switch( eventType ) {
case MouseEvent.EVENT_MOUSE_PRESSED:
if( 1 == pe.getPointerCount() ) {
- pState1.lastButtonPressTime = when;
+ pState0.lastButtonPressTime = when;
}
- pState1.buttonPressed = pe.getButton();
eClicked = null;
break;
case MouseEvent.EVENT_MOUSE_RELEASED:
- if( 1 == pe.getPointerCount() && when - pState1.lastButtonPressTime < MouseEvent.getClickTimeout() ) {
+ if( 1 == pe.getPointerCount() && when - pState0.lastButtonPressTime < MouseEvent.getClickTimeout() ) {
eClicked = pe.createVariant(MouseEvent.EVENT_MOUSE_CLICKED);
} else {
eClicked = null;
- pState1.lastButtonPressTime = 0;
+ pState0.lastButtonPressTime = 0;
}
- pState1.buttonPressed = 0;
break;
case MouseEvent.EVENT_MOUSE_CLICKED:
// ignore - synthesized here ..
@@ -2874,12 +2958,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
// Always add currently pressed mouse buttons to modifier mask
- consumeKeyEvent( KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState0.buttonModMask, keyCode, keySym, keyChar) );
+ consumeKeyEvent( KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
}
public void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
// Always add currently pressed mouse buttons to modifier mask
- enqueueEvent(wait, KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState0.buttonModMask, keyCode, keySym, keyChar) );
+ enqueueEvent(wait, KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
}
@Override
@@ -2980,7 +3064,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return e.isConsumed();
}
- protected void consumeKeyEvent(KeyEvent e) {
+ private final void consumeKeyEvent(KeyEvent e) {
boolean consumedE = false;
if( null != keyboardFocusHandler && !e.isAutoRepeat() ) {
consumedE = propagateKeyEvent(e, keyboardFocusHandler);
@@ -3059,7 +3143,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return windowListeners.toArray(new WindowListener[windowListeners.size()]);
}
- protected void consumeWindowEvent(WindowEvent e) {
+ private final void consumeWindowEvent(WindowEvent e) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
}
@@ -3266,10 +3350,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} else if ( (left != insets.getLeftWidth() || right != insets.getRightWidth() ||
top != insets.getTopHeight() || bottom != insets.getBottomHeight() )
) {
- insets.setLeftWidth(left);
- insets.setRightWidth(right);
- insets.setTopHeight(top);
- insets.setBottomHeight(bottom);
+ insets.set(left, right, top, bottom);
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.insetsChanged: (defer: "+defer+") "+insets);
}
diff --git a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
index 0e76db374..23c32993f 100644
--- a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
@@ -252,22 +252,22 @@ public class AndroidNewtEventFactory {
}
}
- private static void collectPointerData(MotionEvent e, int eIdx, int dIdx, final int[] x, final int[] y, final float[] pressure, short[] pointerIds, final com.jogamp.newt.event.MouseEvent.PointerType[] pointerTypes) {
- x[dIdx] = (int)e.getX(eIdx);
- y[dIdx] = (int)e.getY(eIdx);
- pressure[dIdx] = e.getPressure(eIdx);
- pointerIds[dIdx] = (short)e.getPointerId(eIdx);
- if( pressure[dIdx] > maxPressure ) {
- maxPressure = pressure[dIdx];
+ private static void collectPointerData(MotionEvent e, int idx, final int[] x, final int[] y, final float[] pressure, short[] pointerIds, final int[] pointerTypes) {
+ x[idx] = (int)e.getX(idx);
+ y[idx] = (int)e.getY(idx);
+ pressure[idx] = e.getPressure(idx);
+ pointerIds[idx] = (short)e.getPointerId(idx);
+ if( pressure[idx] > maxPressure ) {
+ maxPressure = pressure[idx];
}
- pointerTypes[dIdx] = aToolType2PointerType( e.getToolType(eIdx) );
+ pointerTypes[idx] = aToolType2PointerType( e.getToolType(idx) ).ordinal();
if(DEBUG_MOUSE_EVENT) {
- System.err.println("createMouseEvent: ptr-data["+eIdx+" -> "+dIdx+"] "+x[dIdx]+"/"+y[dIdx]+", pressure "+pressure[dIdx]+", id "+pointerIds[dIdx]+", type "+pointerTypes[dIdx]);
+ System.err.println("createMouseEvent: ptr-data["+idx+"] "+x[idx]+"/"+y[idx]+", pressure "+pressure[idx]+", id "+pointerIds[idx]+", type "+pointerTypes[idx]);
}
}
- public com.jogamp.newt.event.MouseEvent createMouseEvents(boolean isOnTouchEvent,
- android.view.MotionEvent event, com.jogamp.newt.Window newtSource) {
+ public boolean sendPointerEvent(boolean enqueue, boolean wait, boolean setFocusOnDown, boolean isOnTouchEvent,
+ android.view.MotionEvent event, jogamp.newt.driver.android.WindowDriver newtSource) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("createMouseEvent: isOnTouchEvent "+isOnTouchEvent+", "+event);
}
@@ -285,7 +285,6 @@ public class AndroidNewtEventFactory {
final float[] rotationXYZ = new float[] { 0f, 0f, 0f };
if( (short)0 != nType ) {
- final short clickCount = 1;
int modifiers = 0;
//
@@ -298,7 +297,7 @@ public class AndroidNewtEventFactory {
case android.view.MotionEvent.ACTION_POINTER_UP: {
pIndex = event.getActionIndex();
final int b = event.getPointerId(pIndex) + 1; // FIXME: Assumption that Pointer-ID starts w/ 0 !
- if( com.jogamp.newt.event.MouseEvent.BUTTON1 <= b && b <= com.jogamp.newt.event.MouseEvent.BUTTON_NUMBER ) {
+ if( com.jogamp.newt.event.MouseEvent.BUTTON1 <= b && b <= com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) {
button = (short)b;
} else {
button = com.jogamp.newt.event.MouseEvent.BUTTON1;
@@ -328,6 +327,15 @@ public class AndroidNewtEventFactory {
}
final int pCount = event.getPointerCount(); // all
+ switch( aType ) {
+ case android.view.MotionEvent.ACTION_DOWN:
+ case android.view.MotionEvent.ACTION_POINTER_DOWN:
+ modifiers |= InputEvent.getButtonMask(button);
+ if( setFocusOnDown ) {
+ newtSource.focusChanged(false, true);
+ }
+ }
+
//
// Collect common data
//
@@ -335,38 +343,20 @@ public class AndroidNewtEventFactory {
final int[] y = new int[pCount];
final float[] pressure = new float[pCount];
final short[] pointerIds = new short[pCount];
- final com.jogamp.newt.event.MouseEvent.PointerType[] pointerTypes = new com.jogamp.newt.event.MouseEvent.PointerType[pCount];
+ final int[] pointerTypes = new int[pCount];
if( 0 < pCount ) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("createMouseEvent: collect ptr-data [0.."+(pCount-1)+", count "+pCount+", action "+pIndex+"], aType "+aType+", button "+button);
}
- int j = 0;
- // Always put action-pointer data at index 0
- collectPointerData(event, pIndex, j++, x, y, pressure, pointerIds, pointerTypes);
for(int i=0; i < pCount; i++) {
- if( pIndex != i ) {
- collectPointerData(event, i, j++, x, y, pressure, pointerIds, pointerTypes);
- }
+ collectPointerData(event, i, x, y, pressure, pointerIds, pointerTypes);
}
}
-
- if(null!=newtSource) {
- if(newtSource.isPointerConfined()) {
- modifiers |= InputEvent.CONFINED_MASK;
- }
- if(!newtSource.isPointerVisible()) {
- modifiers |= InputEvent.INVISIBLE_MASK;
- }
- }
-
- final Object src = (null==newtSource)?null:(Object)newtSource;
- final long unixTime = System.currentTimeMillis() + ( event.getEventTime() - android.os.SystemClock.uptimeMillis() );
-
- return new com.jogamp.newt.event.MouseEvent(nType, src, unixTime,
- modifiers, pointerTypes, pointerIds, x, y, pressure, maxPressure,
- button, clickCount, rotationXYZ, rotationScale);
+ newtSource.doPointerEvent(enqueue, wait, pointerTypes, nType, modifiers,
+ pIndex, pointerIds, x, y, pressure, maxPressure, rotationXYZ, rotationScale);
+ return true;
}
- return null; // no mapping ..
+ return false; // no mapping ..
}
}
diff --git a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
index df52208df..5a4743f73 100644
--- a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
+++ b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
@@ -13,16 +13,10 @@ public class AndroidNewtEventTranslator implements View.OnKeyListener, View.OnTo
}
private final boolean processTouchMotionEvents(View v, android.view.MotionEvent event, boolean isOnTouchEvent) {
- final com.jogamp.newt.event.MouseEvent newtEvent = factory.createMouseEvents(isOnTouchEvent, event, newtWindow);
- if(null != newtEvent) {
- switch( event.getActionMasked() ) {
- case android.view.MotionEvent.ACTION_DOWN:
- case android.view.MotionEvent.ACTION_POINTER_DOWN:
- newtWindow.focusChanged(false, true);
- break;
- }
- newtWindow.enqueueEvent(false, newtEvent);
- try { Thread.sleep((long) (100.0F/3.0F)); } // 33 ms
+ final boolean eventSent = factory.sendPointerEvent(true /*enqueue*/, false /*wait*/, true /*setFocusOnDown*/,
+ isOnTouchEvent, event, newtWindow);
+ if( eventSent ) {
+ try { Thread.sleep((long) (100.0F/3.0F)); } // 33 ms - FIXME ??
catch(InterruptedException e) { }
return true; // consumed/handled, further interest in events
}
--
cgit v1.2.3
From 47d73819a71b7d9c4d2182a4de5712435832c5a1 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Fri, 18 Oct 2013 07:36:38 +0200
Subject: Bump 7u45
---
make/scripts/make.jogl.all.win32.bat | 4 ++--
make/scripts/make.jogl.all.win64.bat | 4 ++--
make/scripts/tests-javaws-x64.bat | 2 +-
make/scripts/tests-win.bat | 2 +-
make/scripts/tests-x32-dbg.bat | 4 ++--
make/scripts/tests-x32.bat | 4 ++--
make/scripts/tests-x64-dbg.bat | 7 ++++---
make/scripts/tests-x64.bat | 7 ++++---
make/scripts/tests.sh | 6 +++---
9 files changed, 21 insertions(+), 19 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/make.jogl.all.win32.bat b/make/scripts/make.jogl.all.win32.bat
index 041d8c71f..3e84d01af 100755
--- a/make/scripts/make.jogl.all.win32.bat
+++ b/make/scripts/make.jogl.all.win32.bat
@@ -1,7 +1,7 @@
set THISDIR="C:\JOGL"
-set J2RE_HOME=c:\jre1.7.0_40_x32
-set JAVA_HOME=c:\jdk1.7.0_40_x32
+set J2RE_HOME=c:\jre1.7.0_45_x32
+set JAVA_HOME=c:\jdk1.7.0_45_x32
set ANT_PATH=C:\apache-ant-1.8.2
set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
diff --git a/make/scripts/make.jogl.all.win64.bat b/make/scripts/make.jogl.all.win64.bat
index d263f0c17..5e36c267a 100755
--- a/make/scripts/make.jogl.all.win64.bat
+++ b/make/scripts/make.jogl.all.win64.bat
@@ -1,7 +1,7 @@
set THISDIR="C:\JOGL"
-set J2RE_HOME=c:\jre1.7.0_40_x64
-set JAVA_HOME=c:\jdk1.7.0_40_x64
+set J2RE_HOME=c:\jre1.7.0_45_x64
+set JAVA_HOME=c:\jdk1.7.0_45_x64
set ANT_PATH=C:\apache-ant-1.8.2
set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw64\bin;%PATH%
diff --git a/make/scripts/tests-javaws-x64.bat b/make/scripts/tests-javaws-x64.bat
index 87cf52990..6186bc501 100755
--- a/make/scripts/tests-javaws-x64.bat
+++ b/make/scripts/tests-javaws-x64.bat
@@ -1,4 +1,4 @@
-set JRE_PATH=C:\jre1.7.0_40_x64\bin
+set JRE_PATH=C:\jre1.7.0_45_x64\bin
set LOG_PATH=%USERPROFILE%\AppData\LocalLow\Sun\Java\Deployment\log
%JRE_PATH%\javaws -uninstall
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index 9f7d7953e..c1da671b1 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -71,7 +71,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGe
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT -time 5000
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT %*
diff --git a/make/scripts/tests-x32-dbg.bat b/make/scripts/tests-x32-dbg.bat
index 261f621a2..93069c019 100755
--- a/make/scripts/tests-x32-dbg.bat
+++ b/make/scripts/tests-x32-dbg.bat
@@ -1,7 +1,7 @@
set BLD_SUB=build-win32
-set J2RE_HOME=c:\jre1.7.0_40_x32
-set JAVA_HOME=c:\jdk1.7.0_40_x32
+set J2RE_HOME=c:\jre1.7.0_45_x32
+set JAVA_HOME=c:\jdk1.7.0_45_x32
set ANT_PATH=C:\apache-ant-1.8.2
set PROJECT_ROOT=D:\projects\jogamp\jogl
diff --git a/make/scripts/tests-x32.bat b/make/scripts/tests-x32.bat
index 1f932a85b..c8ead0ad5 100755
--- a/make/scripts/tests-x32.bat
+++ b/make/scripts/tests-x32.bat
@@ -1,7 +1,7 @@
set BLD_SUB=build-win32
-set J2RE_HOME=c:\jre1.7.0_40_x32
-set JAVA_HOME=c:\jdk1.7.0_40_x32
+set J2RE_HOME=c:\jre1.7.0_45_x32
+set JAVA_HOME=c:\jdk1.7.0_45_x32
set ANT_PATH=C:\apache-ant-1.8.2
set PROJECT_ROOT=D:\projects\jogamp\jogl
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index bab911e37..f7ee7b995 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -1,14 +1,15 @@
set BLD_SUB=build-win64
-set J2RE_HOME=c:\jre1.7.0_40_x64
-set JAVA_HOME=c:\jdk1.7.0_40_x64
+set J2RE_HOME=c:\jre1.7.0_45_x64
+set JAVA_HOME=c:\jdk1.7.0_45_x64
set ANT_PATH=C:\apache-ant-1.8.2
set PROJECT_ROOT=D:\projects\jogamp\jogl
set BLD_DIR=..\%BLD_SUB%
REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc53_lavf53_lavu51-ffmpeg\x64
-set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg\x64
+REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg\x64
+set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg-2013-10-09\x64
REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc54_lavf54_lavu52_lavr01-libav\x64
REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat
index 6e132e5d7..ac74f4c94 100755
--- a/make/scripts/tests-x64.bat
+++ b/make/scripts/tests-x64.bat
@@ -1,11 +1,12 @@
set BLD_SUB=build-win64
-set J2RE_HOME=c:\jre1.7.0_40_x64
-set JAVA_HOME=c:\jdk1.7.0_40_x64
+set J2RE_HOME=c:\jre1.7.0_45_x64
+set JAVA_HOME=c:\jdk1.7.0_45_x64
set ANT_PATH=C:\apache-ant-1.8.2
REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc53_lavf53_lavu51-ffmpeg\x64
-set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg\x64
+REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg\x64
+set FFMPEG_LIB=C:\ffmpeg_libav\lavc55_lavf55_lavu52-ffmpeg-2013-10-09\x64
REM set FFMPEG_LIB=C:\ffmpeg_libav\lavc54_lavf54_lavu52_lavr01-libav\x64
REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PROJECT_ROOT%\make\lib\external\PVRVFrame\OGLES-2.0\Windows_x86_64;%PATH%
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 99c19c9ad..9ada56c45 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -187,7 +187,7 @@ function jrun() {
#D_ARGS="-Dnewt.debug.Window -Djogl.debug.Animator -Dnewt.debug.Screen"
#D_ARGS="-Dnativewindow.debug.JAWT -Dnewt.debug.Window"
#D_ARGS="-Dnewt.debug.Window.KeyEvent"
- D_ARGS="-Dnewt.debug.Window.MouseEvent"
+ #D_ARGS="-Dnewt.debug.Window.MouseEvent"
#D_ARGS="-Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent"
#D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug=all"
#D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug.JAWT -Djogl.debug.Animator"
@@ -323,7 +323,7 @@ function testawtswt() {
#
#testnoawt jogamp.opengl.openal.av.ALDummyUsage $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
#
# tile rendring / printing w/ & w/o AWT
@@ -523,7 +523,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyPressReleaseUnmaskRepeatAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodeModifiersAWT $*
-testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT $*
+#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersAWTCanvas $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasAWT $*
#testawtswt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasSWTAWT $*
--
cgit v1.2.3
From 34b35c5a0a379a6b4c0b23b9d347a0b1338f0239 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Sat, 19 Oct 2013 02:49:15 +0200
Subject: Fix Bug 862: Fix GL Version Validation / NVidia GTX550 driver 331.13
- 64bit Linux - No compatibility GLProfile (GL2, >= GL3bc)
Fix GL Version Validation:
We shall not rely on our known good versions when validating a queried GL context version,
but allow some 'room' for a higher version post JOGL release while still
cutting off 'odd versions'.
While GL version detection, we always iterate from the highest known version
down to the lowest. Hence 'GLContext.isValidGLVersion(..)' is satisfied
by validating the lowest version number but allowing a higher than known one.
Now we would return 'invalid' for a version >= 6.
It is enough to clip to the maximum known version when iterating,
allowing the highest unknown version to be available.
GLContext.isValidGLVersion(..):
Returns true, if the major.minor is not inferior to the lowest
valid version and does not exceed the highest known major number by more than one.
The minor version number is ignored by the upper limit validation
and the major version number may exceed by one.
The upper limit check is relaxed since we don't want to cut-off
unforseen new GL version since the release of JOGL.
Hence it is important to iterate through GL version from the upper limit
and 'decrementGLVersion(..)' until invalid.
Add GL Version 4.4 to valid known versions.
Remove ES3 desktop detection, which is impossible
Regression of commit 3a0d7703da32e9a5ddf08a334f18588a78038d88 (ES3 support)
---
make/scripts/tests-win.bat | 4 +-
make/scripts/tests-x64-dbg.bat | 3 +-
make/scripts/tests.sh | 9 +-
src/jogl/classes/javax/media/opengl/GLContext.java | 111 +++++++++++++++------
.../jogamp/opengl/ExtensionAvailabilityCache.java | 7 +-
src/jogl/classes/jogamp/opengl/GLContextImpl.java | 83 ++++++---------
6 files changed, 119 insertions(+), 98 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index c1da671b1..90226c28d 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -65,7 +65,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintin
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestGearsES1NEWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 4000 -x 10 -y 10 -width 100 -height 100 -screen 0
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 40000 -width 100 -height 100 -screen 0 %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT -time 5000
@@ -134,7 +134,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02aN
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.ManualScreenMode03sNEWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.TexCubeES2 %*
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index f7ee7b995..7c30d4db3 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -20,6 +20,7 @@ set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%
echo CP_ALL %CP_ALL%
+set D_ARGS="-Djogamp.debug=all"
REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.FBObject"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.QueryNativeTK"
@@ -52,7 +53,7 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.Til
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
-set D_ARGS="-Dnewt.debug.Window.MouseEvent"
+REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
REM set D_ARGS="-Djogl.debug.GLDebugMessageHandler" "-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 9ada56c45..ece235a60 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -153,10 +153,9 @@ function jrun() {
#D_ARGS="-Dnativewindow.debug.GraphicsConfiguration -Dnativewindow.debug.NativeWindow"
#D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Animator -Djogl.debug.GLDrawable -Djogl.debug.GLContext -Djogl.debug.GLContext.TraceSwitch"
#D_ARGS="-Djogl.debug.GLContext -Djogl.debug.ExtensionAvailabilityCache"
- ##D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable -Djogl.debug.EGLDisplayUtil"
- ##D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile"
+ #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable -Djogl.debug.EGLDisplayUtil"
#D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable"
- #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile"
+ D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile"
#D_ARGS="-Djogl.debug.GLProfile"
#D_ARGS="-Dnativewindow.debug.NativeWindow -Dnewt.debug.Window -Dnewt.debug.Screen -Dnewt.debug.Display"
#D_ARGS="-Djogl.debug.GLCanvas -Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT -Djogl.debug.Animator"
@@ -314,7 +313,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsGLJPanelAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsGLJPanelAWTBug450 $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestTeapotNEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT $*
@@ -323,7 +322,7 @@ function testawtswt() {
#
#testnoawt jogamp.opengl.openal.av.ALDummyUsage $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
-testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
#
# tile rendring / printing w/ & w/o AWT
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index bd6867359..9f2e96781 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -1362,7 +1362,7 @@ public abstract class GLContext {
/* 1.*/ { 0, 1, 2, 3, 4, 5 },
/* 2.*/ { 0, 1 },
/* 3.*/ { 0, 1, 2, 3 },
- /* 4.*/ { 0, 1, 2, 3 } };
+ /* 4.*/ { 0, 1, 2, 3, 4 } };
public static final int ES_VERSIONS[][] = {
/* 0.*/ { -1 },
@@ -1387,51 +1387,100 @@ public abstract class GLContext {
}
}
+ /**
+ * Returns true, if the major.minor is not inferior to the lowest
+ * valid version and does not exceed the highest known major number by more than one.
+ *
+ * The minor version number is ignored by the upper limit validation
+ * and the major version number may exceed by one.
+ *
+ *
+ * The upper limit check is relaxed since we don't want to cut-off
+ * unforseen new GL version since the release of JOGL.
+ *
+ *
+ * Hence it is important to iterate through GL version from the upper limit
+ * and {@link #decrementGLVersion(int, int[], int[])} until invalid.
+ *
+ */
public static final boolean isValidGLVersion(int ctxProfile, int major, int minor) {
if( 1>major || 0>minor ) {
return false;
}
- if( ( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) ) {
- if( major>=ES_VERSIONS.length) return false;
- if( minor>=ES_VERSIONS[major].length) return false;
+ if( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) {
+ if( major >= ES_VERSIONS.length + 1 ) return false;
} else {
- if( major>=GL_VERSIONS.length) return false;
- if( minor>=GL_VERSIONS[major].length) return false;
+ if( major>=GL_VERSIONS.length + 1 ) return false;
}
return true;
}
- public static final boolean decrementGLVersion(int ctxProfile, int major[], int minor[]) {
- if(null==major || major.length<1 ||null==minor || minor.length<1) {
- throw new GLException("invalid array arguments");
- }
- int m = major[0];
- int n = minor[0];
- if( !isValidGLVersion(ctxProfile, m, n) ) {
- return false;
+ /**
+ * Clip the given GL version to the maximum known valid version if exceeding.
+ * @return true if clipped, i.e. given value exceeds maximum, otherwise false.
+ */
+ public static final boolean clipGLVersion(int ctxProfile, int major[], int minor[]) {
+ final int m = major[0];
+ final int n = minor[0];
+
+ if( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) {
+ if( m >= ES_VERSIONS.length ) {
+ major[0] = ES_VERSIONS.length - 1;
+ minor[0] = ES_VERSIONS[major[0]].length - 1;
+ return true;
+ }
+ if( n >= ES_VERSIONS[m].length ) {
+ minor[0] = ES_VERSIONS[m].length - 1;
+ return true;
+ }
+ } else if( m >= GL_VERSIONS.length ) { // !isES
+ major[0] = GL_VERSIONS.length - 1;
+ minor[0] = GL_VERSIONS[major[0]].length - 1;
+ return true;
+ } else if( n >= GL_VERSIONS[m].length ) { // !isES
+ minor[0] = GL_VERSIONS[m].length - 1;
+ return true;
}
+ return false;
+ }
- // decrement ..
- n -= 1;
- if(n < 0) {
- if( ( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) ) {
- if( m >= 3) {
- m -= 1;
+ /**
+ * Decrement the given GL version by one
+ * and return true if still valid, otherwise false.
+ *
+ * If the given version exceeds the maximum known valid version,
+ * it is {@link #clipGLVersion(int, int[], int[]) clipped} and
+ * true is returned.
+ *
+ *
+ * @param ctxProfile
+ * @param major
+ * @param minor
+ * @return
+ */
+ public static final boolean decrementGLVersion(int ctxProfile, int major[], int minor[]) {
+ if( !clipGLVersion(ctxProfile, major, minor) ) {
+ int m = major[0];
+ int n = minor[0] - 1;
+ if(n < 0) {
+ if( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) {
+ if( m >= 3 ) {
+ m -= 1;
+ } else {
+ m = 0; // major decr [1,2] -> 0
+ }
+ n = ES_VERSIONS[m].length-1;
} else {
- m = 0; // major decr [1,2] -> 0
+ m -= 1;
+ n = GL_VERSIONS[m].length-1;
}
- n = ES_VERSIONS[m].length-1;
- } else {
- m -= 1;
- n = GL_VERSIONS[m].length-1;
}
+ if( !isValidGLVersion(ctxProfile, m, n) ) {
+ return false;
+ }
+ major[0]=m;
+ minor[0]=n;
}
- if( !isValidGLVersion(ctxProfile, m, n) ) {
- return false;
- }
- major[0]=m;
- minor[0]=n;
-
return true;
}
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
index b8bcd2e78..8d3d207ee 100644
--- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
+++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
@@ -223,14 +223,13 @@ final class ExtensionAvailabilityCache {
final VersionNumber version = context.getGLVersionNumber();
int major[] = new int[] { version.getMajor() };
int minor[] = new int[] { version.getMinor() };
- while (GLContext.isValidGLVersion(ctxOptions, major[0], minor[0])) {
+ do{
final String GL_XX_VERSION = ( context.isGLES() ? "GL_ES_VERSION_" : "GL_VERSION_" ) + major[0] + "_" + minor[0];
availableExtensionCache.add(GL_XX_VERSION);
if (DEBUG) {
System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Added "+GL_XX_VERSION+" to known extensions");
}
- if(!GLContext.decrementGLVersion(ctxOptions, major, minor)) break;
- }
+ } while( GLContext.decrementGLVersion(ctxOptions, major, minor) );
// put a dummy var in here so that the cache is no longer empty even if
// no extensions are in the GL_EXTENSIONS string
@@ -248,7 +247,7 @@ final class ExtensionAvailabilityCache {
private int glExtensionCount = 0;
private String glXExtensions = null;
private int glXExtensionCount = 0;
- private HashSet availableExtensionCache = new HashSet(50);
+ private final HashSet availableExtensionCache = new HashSet(50);
static String getThreadName() { return Thread.currentThread().getName(); }
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 5f487fa6d..911a4c2be 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -853,7 +853,6 @@ public abstract class GLContextImpl extends GLContext {
boolean hasGL2 = false;
boolean hasGL4 = false;
boolean hasGL3 = false;
- boolean hasES3 = false;
// Even w/ PROFILE_ALIASING, try to use true core GL profiles
// ensuring proper user behavior across platforms due to different feature sets!
@@ -922,13 +921,6 @@ public abstract class GLContextImpl extends GLContext {
resetStates(false); // clean this context states, since creation was temporary
}
}
- if(!hasES3) {
- hasES3 = createContextARBMapVersionsAvailable(3, CTX_PROFILE_ES); // ES3
- success |= hasES3;
- if(hasES3) {
- resetStates(false); // clean this context states, since creation was temporary
- }
- }
if(success) {
// only claim GL versions set [and hence detected] if ARB context creation was successful
GLContext.setAvailableGLVersionsSet(device);
@@ -1023,8 +1015,7 @@ public abstract class GLContextImpl extends GLContext {
minor[0]=minorMax;
long _context=0;
- while ( GLContext.isValidGLVersion(ctxOptionFlags, major[0], minor[0]) &&
- ( major[0]>majorMin || major[0]==majorMin && minor[0] >=minorMin ) ) {
+ do {
if (DEBUG) {
System.err.println(getThreadName() + ": createContextARBVersions: share "+share+", direct "+direct+", version "+major[0]+"."+minor[0]);
}
@@ -1039,10 +1030,8 @@ public abstract class GLContextImpl extends GLContext {
}
}
- if(!GLContext.decrementGLVersion(ctxOptionFlags, major, minor)) {
- break;
- }
- }
+ } while ( ( major[0]>majorMin || major[0]==majorMin && minor[0] >=minorMin ) &&
+ GLContext.decrementGLVersion(ctxOptionFlags, major, minor) );
return _context;
}
@@ -1059,10 +1048,6 @@ public abstract class GLContextImpl extends GLContext {
if ( 0 == ctp ) {
throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
}
-
- if (!GLContext.isValidGLVersion(ctp, major, minor)) {
- throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
- }
ctxVersion = new VersionNumber(major, minor, 0);
ctxVersionString = getGLVersion(major, minor, ctp, glVersion);
ctxVendorVersion = glVendorVersion;
@@ -1243,16 +1228,6 @@ public abstract class GLContextImpl extends GLContext {
}
}
- /**
- * We cannot promote a non ARB context to >= 3.1, reduce it to 3.0 then.
- */
- private static void limitNonARBContextVersion(int[] major, int[] minor, int ctp) {
- if ( 0 == (ctp & CTX_IS_ARB_CREATED) && ( major[0] > 3 || major[0] == 3 && minor[0] >= 1 ) ) {
- major[0] = 3;
- minor[0] = 0;
- }
- }
-
/**
* Returns null if version string is invalid, otherwise a valid instance.
*
@@ -1265,7 +1240,6 @@ public abstract class GLContextImpl extends GLContext {
if ( version.isValid() ) {
int[] major = new int[] { version.getMajor() };
int[] minor = new int[] { version.getMinor() };
- limitNonARBContextVersion(major, minor, ctp);
if ( GLContext.isValidGLVersion(ctp, major[0], minor[0]) ) {
return new VersionNumber(major[0], minor[0], 0);
}
@@ -1297,7 +1271,6 @@ public abstract class GLContextImpl extends GLContext {
} else {
glGetIntegervInt(GL2GL3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv);
glGetIntegervInt(GL2GL3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv);
- limitNonARBContextVersion(glIntMajor, glIntMinor, ctp);
return true;
}
}
@@ -1395,21 +1368,21 @@ public abstract class GLContextImpl extends GLContext {
}
}
if (DEBUG) {
- System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: version verification (Int): "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
+ System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Version verification (Int): "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
}
// Only validate if a valid int version was fetched, otherwise cont. w/ version-string method -> 3.0 > Version || Version > MAX!
if ( GLContext.isValidGLVersion(ctxProfileBits, glIntMajor[0], glIntMinor[0]) ) {
- if( glIntMajor[0] "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
- }
- return false;
+ // relaxed match for versions major < 3 requests, last resort!
+ if( strictMatch && major >= 3 && glIntMajor[0] "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
}
- major = glIntMajor[0];
- minor = glIntMinor[0];
+ return false;
}
+ // Use returned GL version!
+ major = glIntMajor[0];
+ minor = glIntMinor[0];
versionValidated = true;
} else {
versionGL3IntFailed = true;
@@ -1417,44 +1390,44 @@ public abstract class GLContextImpl extends GLContext {
}
if( !versionValidated ) {
// Validate the requested version w/ the GL-version from the version string.
- final VersionNumber setGLVersionNumber = new VersionNumber(major, minor, 0);
- final VersionNumber strGLVersionNumber = getGLVersionNumber(ctxProfileBits, glVersion);
+ final VersionNumber expGLVersionNumber = new VersionNumber(major, minor, 0);
+ final VersionNumber hasGLVersionNumber = getGLVersionNumber(ctxProfileBits, glVersion);
if (DEBUG) {
- System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: version verification (String): "+glVersion+", "+strGLVersionNumber);
+ System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Version verification (String): "+glVersion+", "+hasGLVersionNumber);
}
// Only validate if a valid string version was fetched -> MIN > Version || Version > MAX!
- if( null != strGLVersionNumber ) {
- if( strGLVersionNumber.compareTo(setGLVersionNumber) < 0 || 0 == major ) {
- if( strictMatch && 2 < major ) { // relaxed match for versions major < 3 requests, last resort!
- if(DEBUG) {
- System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (String): "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+strGLVersionNumber);
- }
- return false;
+ if( null != hasGLVersionNumber ) {
+ // relaxed match for versions major < 3 requests, last resort!
+ if( strictMatch && major >= 3 && hasGLVersionNumber.compareTo(expGLVersionNumber) < 0 ) {
+ if(DEBUG) {
+ System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (String): "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+hasGLVersionNumber);
}
- major = strGLVersionNumber.getMajor();
- minor = strGLVersionNumber.getMinor();
+ return false;
}
if( strictMatch && versionGL3IntFailed && major >= 3 ) {
if(DEBUG) {
- System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL3 version Int failed, String: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+strGLVersionNumber);
+ System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL3 version Int failed, String: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+hasGLVersionNumber);
}
return false;
}
+ // Use returned GL version!
+ major = hasGLVersionNumber.getMajor();
+ minor = hasGLVersionNumber.getMinor();
versionValidated = true;
}
}
- if( strictMatch && !versionValidated && 0 < major ) {
+ if( strictMatch && !versionValidated ) {
if(DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, No GL version validation possible: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion);
}
return false;
}
if (DEBUG) {
- System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: post version verification "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+", strictMatch "+strictMatch+", versionValidated "+versionValidated+", versionGL3IntFailed "+versionGL3IntFailed);
+ System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Post version verification "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+", strictMatch "+strictMatch+", versionValidated "+versionValidated+", versionGL3IntFailed "+versionGL3IntFailed);
}
- if( 2 > major ) { // there is no ES2/3-compat for a profile w/ major < 2
+ if( major < 2 ) { // there is no ES2/3-compat for a profile w/ major < 2
ctxProfileBits &= ~ ( GLContext.CTX_IMPL_ES2_COMPAT | GLContext.CTX_IMPL_ES3_COMPAT ) ;
}
--
cgit v1.2.3
From 0ba264e878993d8f24254257d39a189b4ebf3937 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Sat, 19 Oct 2013 03:40:31 +0200
Subject: PinchToZoomGesture: Add ctor arg 'allowMorePointer', should be false
to be more stable (i.e. only 2 pointer pressed)
---
make/scripts/tests-x64-dbg.bat | 4 +-
make/scripts/tests.sh | 6 +-
.../com/jogamp/newt/event/PinchToZoomGesture.java | 18 ++-
.../opengl/test/junit/jogl/demos/es2/GearsES2.java | 124 +++++++++++----------
4 files changed, 81 insertions(+), 71 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 7c30d4db3..726be54ba 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -20,7 +20,7 @@ set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%
echo CP_ALL %CP_ALL%
-set D_ARGS="-Djogamp.debug=all"
+REM set D_ARGS="-Djogamp.debug=all"
REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.FBObject"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.QueryNativeTK"
@@ -53,7 +53,7 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.Til
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
-REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
+set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
REM set D_ARGS="-Djogl.debug.GLDebugMessageHandler" "-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index ece235a60..fd79b028e 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -155,7 +155,7 @@ function jrun() {
#D_ARGS="-Djogl.debug.GLContext -Djogl.debug.ExtensionAvailabilityCache"
#D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable -Djogl.debug.EGLDisplayUtil"
#D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable"
- D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile"
+ #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile"
#D_ARGS="-Djogl.debug.GLProfile"
#D_ARGS="-Dnativewindow.debug.NativeWindow -Dnewt.debug.Window -Dnewt.debug.Screen -Dnewt.debug.Display"
#D_ARGS="-Djogl.debug.GLCanvas -Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT -Djogl.debug.Animator"
@@ -300,7 +300,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
#testawtswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $*
@@ -313,7 +313,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsGLJPanelAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsGLJPanelAWTBug450 $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper $*
-testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestTeapotNEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT $*
diff --git a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
index b4e1341da..42f006f08 100644
--- a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
@@ -62,16 +62,22 @@ public class PinchToZoomGesture implements GestureHandler {
}
private final NativeSurface surface;
+ private final boolean allowMorePointer;
private float zoom;
private int zoomLastEdgeDist;
private boolean zoomFirstTouch;
private boolean zoomMode;
private ZoomEvent zoomEvent;
- private short[] pIds = new short[] { -1, -1 };
+ private final short[] pIds = new short[] { -1, -1 };
- public PinchToZoomGesture(NativeSurface surface) {
+ /**
+ * @param surface the {@link NativeSurface}, which size is used to compute the relative zoom factor
+ * @param allowMorePointer if false, allow only 2 pressed pointers (safe and recommended), otherwise accept other pointer to be pressed.
+ */
+ public PinchToZoomGesture(NativeSurface surface, boolean allowMorePointer) {
clear(true);
this.surface = surface;
+ this.allowMorePointer = allowMorePointer;
this.zoom = 1f;
}
@@ -135,11 +141,13 @@ public class PinchToZoomGesture implements GestureHandler {
return true;
}
final MouseEvent pe = (MouseEvent)in;
- if( pe.getPointerType(0).getPointerClass() != MouseEvent.PointerClass.Onscreen ) {
+ final int pointerDownCount = pe.getPointerCount();
+
+ if( pe.getPointerType(0).getPointerClass() != MouseEvent.PointerClass.Onscreen ||
+ ( !allowMorePointer && pointerDownCount > 2 ) ) {
return false;
}
- final int pointerDownCount = pe.getPointerCount();
final int eventType = pe.getEventType();
final boolean useY = surface.getWidth() >= surface.getHeight(); // use smallest dimension
switch ( eventType ) {
@@ -190,7 +198,7 @@ public class PinchToZoomGesture implements GestureHandler {
final int d = Math.abs(edge0-edge1);
final int dd = d - zoomLastEdgeDist;
final float screenEdge = useY ? surface.getHeight() : surface.getWidth();
- final float incr = (float)dd / screenEdge; // [-1..1]
+ final float incr = dd / screenEdge; // [-1..1]
if(DEBUG) {
System.err.println("XXX2: id0 "+pIds[0]+" -> idx0 "+p0Idx+", id1 "+pIds[1]+" -> idx1 "+p1Idx);
System.err.println("XXX3: d "+d+", ld "+zoomLastEdgeDist+", dd "+dd+", screen "+screenEdge+" -> incr "+incr+", zoom "+zoom+" -> "+(zoom+incr));
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
index 53c813563..9817ea57f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
@@ -7,10 +7,10 @@
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -55,12 +55,14 @@ import javax.media.opengl.GLUniformData;
*/
public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererListener {
private final FloatBuffer lightPos = Buffers.newDirectFloatBuffer( new float[] { 5.0f, 5.0f, 10.0f } );
-
+
private ShaderState st = null;
private PMVMatrix pmvMatrix = null;
private GLUniformData pmvMatrixUniform = null;
private GLUniformData colorU = null;
- private float view_rotx = 20.0f, view_roty = 30.0f, view_rotz = 0.0f;
+ private float view_rotx = 20.0f, view_roty = 30.0f;
+
+ private final float view_rotz = 0.0f;
private float panX = 0.0f, panY = 0.0f, panZ=0.0f;
private GearsObjectES2 gear1=null, gear2=null, gear3=null;
private FloatBuffer gear1Color=GearsObject.red, gear2Color=GearsObject.green, gear3Color=GearsObject.blue;
@@ -68,7 +70,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
private int swapInterval = 0;
private boolean pmvUseBackingArray = true; // the default for PMVMatrix now, since it's faster
// private MouseListener gearsMouse = new TraceMouseAdapter(new GearsMouseAdapter());
- public MouseListener gearsMouse = new GearsMouseAdapter();
+ public MouseListener gearsMouse = new GearsMouseAdapter();
public KeyListener gearsKeys = new GearsKeyAdapter();
private TileRendererBase tileRendererInUse = null;
private boolean doRotateBeforePrinting;
@@ -78,7 +80,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
private float[] clearColor = null;
private boolean clearBuffers = true;
private boolean verbose = true;
-
+
private PinchToZoomGesture pinchToZoomGesture = null;
@@ -94,12 +96,12 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
public void addTileRendererNotify(TileRendererBase tr) {
tileRendererInUse = tr;
doRotateBeforePrinting = doRotate;
- setDoRotation(false);
+ setDoRotation(false);
}
@Override
public void removeTileRendererNotify(TileRendererBase tr) {
tileRendererInUse = null;
- setDoRotation(doRotateBeforePrinting);
+ setDoRotation(doRotateBeforePrinting);
}
@Override
public void startTileRendering(TileRendererBase tr) {
@@ -109,27 +111,27 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
public void endTileRendering(TileRendererBase tr) {
System.err.println("GearsES2.endTileRendering: "+tr);
}
-
+
public void setIgnoreFocus(boolean v) { ignoreFocus = v; }
public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
public void setClearBuffers(boolean v) { clearBuffers = v; }
public void setVerbose(boolean v) { verbose = v; }
-
+
public void setPMVUseBackingArray(boolean pmvUseBackingArray) {
this.pmvUseBackingArray = pmvUseBackingArray;
}
-
+
/** float[4] */
public void setClearColor(float[] clearColor) {
- this.clearColor = clearColor;
+ this.clearColor = clearColor;
}
-
+
public void setGearsColors(FloatBuffer gear1Color, FloatBuffer gear2Color, FloatBuffer gear3Color) {
this.gear1Color = gear1Color;
this.gear2Color = gear2Color;
this.gear3Color = gear3Color;
}
-
+
public void setGears(GearsObjectES2 g1, GearsObjectES2 g2, GearsObjectES2 g3) {
gear1 = g1;
gear2 = g2;
@@ -162,14 +164,14 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
System.err.println("Chosen GLCapabilities: " + drawable.getChosenGLCapabilities());
System.err.println("INIT GL IS: " + gl.getClass().getName());
System.err.println(JoglVersion.getGLStrings(gl, null, false).toString());
- }
+ }
if( !gl.hasGLSL() ) {
System.err.println("No GLSL available, no rendering.");
return;
}
gl.glEnable(GL.GL_DEPTH_TEST);
-
+
st = new ShaderState();
// st.setVerbose(true);
final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), "shader",
@@ -184,7 +186,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
st.attachShaderProgram(gl, sp0, true);
// Use debug pipeline
// drawable.setGL(new DebugGL(drawable.getGL()));
-
+
pmvMatrix = new PMVMatrix(pmvUseBackingArray);
st.attachObject("pmvMatrix", pmvMatrix);
pmvMatrixUniform = new GLUniformData("pmvMatrix", 4, 4, pmvMatrix.glGetPMvMvitMatrixf()); // P, Mv, Mvi and Mvit
@@ -210,7 +212,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
System.err.println("gear1 reused: "+gear1);
}
}
-
+
if(null == gear2) {
gear2 = new GearsObjectES2(st, gear2Color, 0.5f, 2.0f, 2.0f, 10, 0.7f, pmvMatrix, pmvMatrixUniform, colorU);
if(verbose) {
@@ -222,7 +224,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
System.err.println("gear2 reused: "+gear2);
}
}
-
+
if(null == gear3) {
gear3 = new GearsObjectES2(st, gear3Color, 1.3f, 2.0f, 0.5f, 10, 0.7f, pmvMatrix, pmvMatrixUniform, colorU);
if(verbose) {
@@ -234,31 +236,31 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
System.err.println("gear3 reused: "+gear3);
}
}
-
+
final Object upstreamWidget = drawable.getUpstreamWidget();
if (upstreamWidget instanceof Window) {
final Window window = (Window) upstreamWidget;
window.addMouseListener(gearsMouse);
window.addKeyListener(gearsKeys);
window.addGestureListener(pinchToZoomListener);
- pinchToZoomGesture = new PinchToZoomGesture(drawable.getNativeSurface());
+ pinchToZoomGesture = new PinchToZoomGesture(drawable.getNativeSurface(), false);
window.addGestureHandler(pinchToZoomGesture);
} else if (GLProfile.isAWTAvailable() && upstreamWidget instanceof java.awt.Component) {
final java.awt.Component comp = (java.awt.Component) upstreamWidget;
new com.jogamp.newt.event.awt.AWTMouseAdapter(gearsMouse).addTo(comp);
new com.jogamp.newt.event.awt.AWTKeyAdapter(gearsKeys).addTo(comp);
}
-
+
st.useProgram(gl, false);
-
+
System.err.println(Thread.currentThread()+" GearsES2.init FIN");
}
-
- private final GestureHandler.GestureListener pinchToZoomListener = new GestureHandler.GestureListener() {
+
+ private final GestureHandler.GestureListener pinchToZoomListener = new GestureHandler.GestureListener() {
@Override
public void gestureDetected(GestureEvent gh) {
final PinchToZoomGesture.ZoomEvent ze = (PinchToZoomGesture.ZoomEvent) gh;
- final float zoom = ze.getZoom() * ( ze.getTrigger().getPointerCount() - 1 );
+ final float zoom = ze.getZoom(); // * ( ze.getTrigger().getPointerCount() - 1 ); <- too much ..
panZ = zoom * 30f - 30f; // [0 .. 2] -> [-30f .. 30f]
}
};
@@ -266,35 +268,35 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
@Override
public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
- if(-1 != swapInterval) {
+ if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval);
}
reshapeImpl(gl, x, y, width, height, width, height);
}
-
+
@Override
public void reshapeTile(TileRendererBase tr,
- int tileX, int tileY, int tileWidth, int tileHeight,
+ int tileX, int tileY, int tileWidth, int tileHeight,
int imageWidth, int imageHeight) {
final GL2ES2 gl = tr.getAttachedDrawable().getGL().getGL2ES2();
gl.setSwapInterval(0);
reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
}
-
+
void reshapeImpl(GL2ES2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
System.err.println(Thread.currentThread()+" GearsES2.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", msaa "+msaa+", tileRendererInUse "+tileRendererInUse);
-
+
if( !gl.hasGLSL() ) {
return;
}
-
+
st.useProgram(gl, true);
pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
-
+
// compute projection parameters 'normal'
- float left, right, bottom, top;
+ float left, right, bottom, top;
if( imageHeight > imageWidth ) {
float a = (float)imageHeight / (float)imageWidth;
left = -1.0f;
@@ -310,27 +312,27 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
}
final float w = right - left;
final float h = top - bottom;
-
+
// compute projection parameters 'tiled'
final float l = left + tileX * w / imageWidth;
final float r = l + tileWidth * w / imageWidth;
final float b = bottom + tileY * h / imageHeight;
final float t = b + tileHeight * h / imageHeight;
-
+
final float _w = r - l;
final float _h = t - b;
if(verbose) {
System.err.println(">> angle "+angle+", [l "+left+", r "+right+", b "+bottom+", t "+top+"] "+w+"x"+h+" -> [l "+l+", r "+r+", b "+b+", t "+t+"] "+_w+"x"+_h);
}
-
+
pmvMatrix.glFrustumf(l, r, b, t, 5.0f, 200.0f);
-
+
pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0.0f, 0.0f, -40.0f);
st.uniform(gl, pmvMatrixUniform);
st.useProgram(gl, false);
-
+
// System.err.println(Thread.currentThread()+" GearsES2.reshape FIN");
}
// private boolean useAndroidDebug = false;
@@ -339,7 +341,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
public void dispose(GLAutoDrawable drawable) {
System.err.println(Thread.currentThread()+" GearsES2.dispose: tileRendererInUse "+tileRendererInUse);
final Object upstreamWidget = drawable.getUpstreamWidget();
- if (upstreamWidget instanceof Window) {
+ if (upstreamWidget instanceof Window) {
final Window window = (Window) upstreamWidget;
window.removeMouseListener(gearsMouse);
window.removeKeyListener(gearsKeys);
@@ -357,12 +359,12 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
gear2.destroy(gl);
gear2 = null;
gear3.destroy(gl);
- gear3 = null;
+ gear3 = null;
pmvMatrix = null;
- colorU = null;
+ colorU = null;
st.destroy(gl);
st = null;
-
+
System.err.println(Thread.currentThread()+" GearsES2.dispose FIN");
}
@@ -387,7 +389,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
} else {
hasFocus = true;
}
-
+
if( clearBuffers ) {
if( null != clearColor ) {
gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
@@ -400,7 +402,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
}
// Special handling for the case where the GLJPanel is translucent
// and wants to be composited with other Java 2D content
- if (GLProfile.isAWTAvailable() &&
+ if (GLProfile.isAWTAvailable() &&
(drawable instanceof javax.media.opengl.awt.GLJPanel) &&
!((javax.media.opengl.awt.GLJPanel) drawable).isOpaque() &&
((javax.media.opengl.awt.GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) {
@@ -408,13 +410,13 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
} else {
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
}
- }
+ }
if( !gl.hasGLSL() ) {
return;
}
gl.glEnable(GL.GL_CULL_FACE);
-
+
st.useProgram(gl, true);
pmvMatrix.glPushMatrix();
pmvMatrix.glTranslatef(panX, panY, panZ);
@@ -424,20 +426,20 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
gear1.draw(gl, -3.0f, -2.0f, 1f * angle - 0f);
gear2.draw(gl, 3.1f, -2.0f, -2f * angle - 9.0f);
- gear3.draw(gl, -3.1f, 4.2f, -2f * angle - 25.0f);
+ gear3.draw(gl, -3.1f, 4.2f, -2f * angle - 25.0f);
pmvMatrix.glPopMatrix();
st.useProgram(gl, false);
-
+
gl.glDisable(GL.GL_CULL_FACE);
}
-
+
boolean confinedFixedCenter = false;
-
+
public void setConfinedFixedCenter(boolean v) {
confinedFixedCenter = v;
}
-
- class GearsKeyAdapter extends KeyAdapter {
+
+ class GearsKeyAdapter extends KeyAdapter {
public void keyPressed(KeyEvent e) {
int kc = e.getKeyCode();
if(KeyEvent.VK_LEFT == kc) {
@@ -454,7 +456,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
class GearsMouseAdapter implements MouseListener{
private int prevMouseX, prevMouseY;
-
+
@Override
public void mouseClicked(MouseEvent e) {
}
@@ -476,12 +478,12 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
panZ += incr;
System.err.println("panZ.2: incr "+incr+", dblZoom "+e.isShiftDown()+" -> "+panZ);
} else {
- // panning
+ // panning
panX -= rot[0]; // positive -> left
panY += rot[1]; // positive -> up
}
}
-
+
public void mousePressed(MouseEvent e) {
if( e.getPointerCount()==1 ) {
prevMouseX = e.getX();
@@ -507,15 +509,15 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
prevMouseY = e.getY();
}
}
-
+
public void mouseDragged(MouseEvent e) {
navigate(e);
}
-
+
private void navigate(MouseEvent e) {
int x = e.getX();
int y = e.getY();
-
+
int width, height;
Object source = e.getSource();
Window window = null;
@@ -533,12 +535,12 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
height=comp.getHeight();
} else {
throw new RuntimeException("Event source neither Window nor Component: "+source);
- }
+ }
final float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
final float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
view_rotx += thetaX;
view_roty += thetaY;
- if(e.isConfined() && confinedFixedCenter && null!=window) {
+ if(e.isConfined() && confinedFixedCenter && null!=window) {
x=window.getWidth()/2;
y=window.getHeight()/2;
window.warpPointer(x, y);
--
cgit v1.2.3
From 10fee84d50d1085d977aab413dd446834798e009 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Wed, 6 Nov 2013 15:34:09 +0100
Subject: Bug 894 - GLJPanel: Expose 'initializeBackend(boolean offthread)'
allowing user to trigger backend initialization eagerly and offthread
(optional, !WINDOWS)
TestPerf001GLJPanelInit02AWT compares all variations: no-gl, glcanvas, gljpanel and gljpanel-initMT (offthread)
---
make/scripts/tests-win.bat | 1 +
make/scripts/tests-x64-dbg.bat | 4 +-
make/scripts/tests.sh | 2 +
.../classes/javax/media/opengl/awt/GLJPanel.java | 118 +++++++++---
.../jogl/perf/TestPerf001GLJPanelInit01AWT.java | 33 ++--
.../jogl/perf/TestPerf001GLJPanelInit02AWT.java | 148 ++++++++++++---
.../jogl/perf/TestPerf001GLWindowInit03NEWT.java | 203 +++++++++++++++++++++
7 files changed, 436 insertions(+), 73 deletions(-)
create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index 7e40967c2..94bc49c38 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -78,6 +78,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintin
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit01AWT %*
scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLWindowInit03NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 726be54ba..a42c79254 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -24,7 +24,7 @@ REM set D_ARGS="-Djogamp.debug=all"
REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.FBObject"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.QueryNativeTK"
-REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
+set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.GLContext" "-Djogl.debug.GLCanvas"
REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug=all" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.CapabilitiesChooser -Djogl.debug.GLProfile"
@@ -53,7 +53,7 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.Til
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
-set D_ARGS="-Dnewt.debug.Window.MouseEvent"
+REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
REM set D_ARGS="-Djogl.debug.GLDebugMessageHandler" "-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index f2231a0de..53e4e22cd 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -176,6 +176,7 @@ function jrun() {
#D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=3000 -Djogamp.debug.Lock -Dnativewindow.debug.ToolkitLock.TraceLock"
#D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock -Dnativewindow.debug.ToolkitLock.TraceLock"
#D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Dnativewindow.debug.X11Util"
+ #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Dnativewindow.debug.X11Util"
#D_ARGS="-Dnewt.debug.EDT -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator -Dnewt.debug.Display -Dnewt.debug.Screen"
#D_ARGS="-Dnewt.debug.Window -Djogamp.common.utils.locks.Lock.timeout=600000"
#D_ARGS="-Dnewt.debug=all -Djogamp.common.utils.locks.Lock.timeout=600000"
@@ -337,6 +338,7 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT $*
#testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit01AWT $*
testawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLJPanelInit02AWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.perf.TestPerf001GLWindowInit03NEWT $*
#
# tile rendring / printing w/ & w/o AWT
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 1adafaf87..2c805fa00 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -58,6 +58,7 @@ import java.util.List;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeWindowFactory;
import javax.media.nativewindow.WindowClosingProtocol;
import javax.media.opengl.DefaultGLCapabilitiesChooser;
import javax.media.opengl.GL;
@@ -338,6 +339,51 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
this.setFocusable(true); // allow keyboard input!
}
+ /**
+ * Attempts to initialize the backend, if not initialized yet.
+ *
+ * If backend is already initialized method returns true
.
+ *
+ *
+ * If offthread
is true
, initialization will kicked off
+ * on a short lived arbitrary thread and method returns immediately.
+ * If platform supports such arbitrary thread initialization method returns
+ * true
, otherwise false
.
+ *
+ *
+ * Due to threading restrictions, arbitrary thread initialization is not supported on:
+ *
+ * - {@link NativeWindowFactory.TYPE_WINDOWS}
+ *
+ *
+ *
+ * If offthread
is false
, initialization be performed
+ * on the current thread and method returns after initialization.
+ * Method returns true
if initialization was successful, otherwise false
.
+ *
+ * @param offthread
+ */
+ public final boolean initializeBackend(boolean offthread) {
+ if( offthread ) {
+ if( NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(true) ) {
+ return false;
+ }
+ new Thread(getThreadName()+"-GLJPanel_Init") {
+ public void run() {
+ if( !isInitialized ) {
+ initializeBackendImpl();
+ }
+ } }.start();
+ return true;
+ } else {
+ if( !isInitialized ) {
+ return initializeBackendImpl();
+ } else {
+ return true;
+ }
+ }
+ }
+
@Override
public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
helper.setSharedContext(this.getContext(), sharedContext);
@@ -457,8 +503,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
return;
}
- if (backend == null || !isInitialized) {
- createAndInitializeBackend();
+ if( !isInitialized ) {
+ initializeBackendImpl();
}
if (!isInitialized || printActive) {
@@ -552,8 +598,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private final Runnable setupPrintOnEDT = new Runnable() {
@Override
public void run() {
- if (backend == null || !isInitialized) {
- createAndInitializeBackend();
+ if( !isInitialized ) {
+ initializeBackendImpl();
}
if (!isInitialized) {
if(DEBUG) {
@@ -1020,35 +1066,47 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// Internals only below this point
//
- private void createAndInitializeBackend() {
- if ( 0 >= panelWidth || 0 >= panelHeight ) {
- // See whether we have a non-zero size yet and can go ahead with
- // initialization
- if (0 >= reshapeWidth || 0 >= reshapeHeight ) {
- return;
- }
+ private final Object initSync = new Object();
+ private boolean initializeBackendImpl() {
+ if( !isInitialized ) {
+ synchronized(initSync) {
+ if( !isInitialized ) {
+ if ( 0 >= panelWidth || 0 >= panelHeight ) {
+ // See whether we have a non-zero size yet and can go ahead with
+ // initialization
+ if (0 >= reshapeWidth || 0 >= reshapeHeight ) {
+ return false;
+ }
- if (DEBUG) {
- System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
- }
- // Pull down reshapeWidth and reshapeHeight into panelWidth and
- // panelHeight eagerly in order to complete initialization, and
- // force a reshape later
- panelWidth = reshapeWidth;
- panelHeight = reshapeHeight;
- }
+ if (DEBUG) {
+ System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
+ }
+ // Pull down reshapeWidth and reshapeHeight into panelWidth and
+ // panelHeight eagerly in order to complete initialization, and
+ // force a reshape later
+ panelWidth = reshapeWidth;
+ panelHeight = reshapeHeight;
+ }
- if ( null == backend ) {
- if ( oglPipelineUsable() ) {
- backend = new J2DOGLBackend();
- } else {
- backend = new OffscreenBackend(glProfile, customPixelBufferProvider);
- }
- isInitialized = false;
- }
+ if ( null == backend ) {
+ if ( oglPipelineUsable() ) {
+ backend = new J2DOGLBackend();
+ } else {
+ backend = new OffscreenBackend(glProfile, customPixelBufferProvider);
+ }
+ isInitialized = false;
+ }
- if (!isInitialized) {
- backend.initialize();
+ if (!isInitialized) {
+ backend.initialize();
+ }
+ return isInitialized;
+ } else {
+ return true;
+ }
+ }
+ } else {
+ return true;
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
index 24bd1b748..0472fdb31 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
@@ -34,6 +34,8 @@ import java.lang.reflect.InvocationTargetException;
import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
@@ -65,8 +67,8 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
GLProfile.initSingleton();
}
- public void test(final boolean useGears, final int width, final int height, final int rows, final int columns,
- final boolean useGLJPanel, final boolean useAnim) {
+ public void test(final GLCapabilitiesImmutable caps, final boolean useGears, final int width, final int height, final int rows,
+ final int columns, final boolean useGLJPanel, final boolean useAnim) {
final GLAnimatorControl animator = useAnim ? new Animator() : null;
final JFrame frame;
@@ -90,7 +92,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
public void run() {
t[0] = Platform.currentTimeMillis();
for(int i=0; i=width) {
+ x=32;
+ y+=eHeight+32;
+ }
+ }
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
// panel.setBounds(0, 0, width, height);
- final Dimension eSize = new Dimension(width, height);
- final GLAutoDrawable glad = useGLJPanel ? createGLJPanel(useGears, animator, eSize) : createGLCanvas(useGears, animator, eSize);
- glad.addGLEventListener(new GLEventListener() {
- @Override
- public void init(GLAutoDrawable drawable) {
- initCount++;
- }
- @Override
- public void dispose(GLAutoDrawable drawable) {}
- @Override
- public void display(GLAutoDrawable drawable) {}
- @Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
- });
- panel.add((Component)glad);
+ final Dimension eSize = new Dimension(eWidth, eHeight);
+ final GLAutoDrawable glad = useGLJPanel ? createGLJPanel(initMT, caps, useGears, animator, eSize) : ( useGLCanvas ? createGLCanvas(caps, useGears, animator, eSize) : null );
+ if( null != glad ) {
+ glad.addGLEventListener(new GLEventListener() {
+ @Override
+ public void init(GLAutoDrawable drawable) {
+ initCount++;
+ }
+ @Override
+ public void dispose(GLAutoDrawable drawable) {}
+ @Override
+ public void display(GLAutoDrawable drawable) {}
+ @Override
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ });
+ panel.add((Component)glad);
+ } else {
+ @SuppressWarnings("serial")
+ final JTextArea c = new JTextArea("area "+i) {
+ boolean initialized = false, added = false;
+ int reshapeWidth=0, reshapeHeight=0;
+ @Override
+ public void addNotify() {
+ added = true;
+ super.addNotify();
+ }
+ @SuppressWarnings("deprecation")
+ @Override
+ public void reshape(int x, int y, int width, int height) {
+ super.reshape(x, y, width, height);
+ reshapeWidth = width; reshapeHeight = height;
+ }
+ @Override
+ protected void paintComponent(final Graphics g) {
+ super.paintComponent(g);
+ if( !initialized && added && reshapeWidth > 0 && reshapeHeight > 0 && isDisplayable() ) {
+ initialized = true;
+ initCount++;
+ }
+ }
+ };
+ c.setEditable(false);
+ c.setSize(eSize);
+ c.setPreferredSize(eSize);
+ panel.add(c);
+ }
frame[i].getContentPane().add(panel);
// frame.validate();
@@ -124,9 +172,9 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
}
t[3] = Platform.currentTimeMillis();
final double panelCountF = frameCount;
- System.err.printf("P: %d %s:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n",
+ System.err.printf("P: %d %s%s:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n",
frameCount,
- useGLJPanel?"GLJPanel":"GLCanvas",
+ useGLJPanel?"GLJPanel":(useGLCanvas?"GLCanvas":"No_GL"), initMT?" (mt)":" (01)",
t[1]-t[0], (t[1]-t[0])/panelCountF,
t[3]-t[1], (t[3]-t[1])/panelCountF,
t[3]-t[0], (t[3]-t[0])/panelCountF);
@@ -160,8 +208,8 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
System.err.println("Total: "+(t[4]-t[0]));
}
- private GLAutoDrawable createGLCanvas(boolean useGears, GLAnimatorControl anim, Dimension size) {
- GLCanvas canvas = new GLCanvas();
+ private GLAutoDrawable createGLCanvas(GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
+ GLCanvas canvas = new GLCanvas(caps);
canvas.setSize(size);
canvas.setPreferredSize(size);
if( useGears ) {
@@ -172,8 +220,8 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
}
return canvas;
}
- private GLAutoDrawable createGLJPanel(boolean useGears, GLAnimatorControl anim, Dimension size) {
- GLJPanel canvas = new GLJPanel();
+ private GLAutoDrawable createGLJPanel(boolean initMT, GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
+ GLJPanel canvas = new GLJPanel(caps);
canvas.setSize(size);
canvas.setPreferredSize(size);
if( useGears ) {
@@ -182,17 +230,50 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
if( null != anim ) {
anim.add(canvas);
}
+ if( initMT ) {
+ canvas.initializeBackend(true /* offthread */);
+ }
return canvas;
}
+ static GLCapabilitiesImmutable caps = null;
+
+ @Test
+ public void test00NopNoGLDefGrid() throws InterruptedException, InvocationTargetException {
+ test(null, false /*useGears*/, width, height , frameCount, false /* initMT */, false /* useGLJPanel */,
+ false /* useGLCanvas */, false /*useAnim*/, false /* overlap */);
+ }
+
+ @Test
+ public void test01NopGLCanvasDefGrid() throws InterruptedException, InvocationTargetException {
+ test(new GLCapabilities(null), false /*useGears*/, width, height , frameCount, false /* initMT */, false /* useGLJPanel */,
+ true /* useGLCanvas */, false /*useAnim*/, false /* overlap */);
+ }
+
@Test
- public void test01NopGLJPanel() throws InterruptedException, InvocationTargetException {
- test(false /*useGears*/, width, height, frameCount , true /* useGLJPanel */, false /*useAnim*/);
+ public void test02NopGLJPanelDefGridSingle() throws InterruptedException, InvocationTargetException {
+ test(new GLCapabilities(null), false /*useGears*/, width, height , frameCount, false /* initMT */, true /* useGLJPanel */,
+ false /* useGLCanvas */, false /*useAnim*/, false /* overlap */);
}
@Test
- public void test02NopGLCanvas() throws InterruptedException, InvocationTargetException {
- test(false /*useGears*/, width, height, frameCount , false /* useGLJPanel */, false /*useAnim*/);
+ public void test03NopGLJPanelDefGridMT() throws InterruptedException, InvocationTargetException {
+ test(new GLCapabilities(null), false /*useGears*/, width, height , frameCount, true /* initMT */, true /* useGLJPanel */,
+ false /* useGLCanvas */, false /*useAnim*/, false /* overlap */);
+ }
+
+ // @Test
+ public void test04NopGLJPanelDefOverlapSingle() throws InterruptedException, InvocationTargetException {
+ test(new GLCapabilities(null), false /*useGears*/, width, height , frameCount, false /* initMT */, true /* useGLJPanel */,
+ false /* useGLCanvas */, false /*useAnim*/, true /* overlap */);
+ }
+
+ // @Test
+ public void test05NopGLJPanelBitmapGridSingle() throws InterruptedException, InvocationTargetException {
+ GLCapabilities caps = new GLCapabilities(null);
+ caps.setBitmap(true);
+ test(caps, false /*useGears*/, width, height , frameCount, false /* initMT */, true /* useGLJPanel */,
+ false /* useGLCanvas */, false /*useAnim*/, false);
}
static long duration = 0; // ms
@@ -202,7 +283,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
volatile int initCount = 0;
public static void main(String[] args) {
- boolean useGLJPanel = true, useGears = false, manual=false;
+ boolean useGLJPanel = true, initMT = false, useGLCanvas = false, useGears = false, manual=false;
boolean waitMain = false;
for(int i=0; i=width) {
+ x=32;
+ y+=eHeight+32;
+ }
+ frame[i].setSize(eWidth, eHeight);
+ if( useGears ) {
+ frame[i].addGLEventListener(new GearsES2());
+ }
+ frame[i].addGLEventListener(new GLEventListener() {
+ @Override
+ public void init(GLAutoDrawable drawable) {
+ initCount++;
+ }
+ @Override
+ public void dispose(GLAutoDrawable drawable) {}
+ @Override
+ public void display(GLAutoDrawable drawable) {}
+ @Override
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ });
+ }
+ t[1] = Platform.currentTimeMillis();
+ for(int i=0; i initCount ) {
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e1) {
+ e1.printStackTrace();
+ }
+ }
+ t[3] = Platform.currentTimeMillis();
+ final double panelCountF = frameCount;
+ System.err.printf("P: %d GLWindow:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n",
+ frameCount,
+ t[1]-t[0], (t[1]-t[0])/panelCountF,
+ t[3]-t[1], (t[3]-t[1])/panelCountF,
+ t[3]-t[0], (t[3]-t[0])/panelCountF);
+
+ System.err.println("INIT END: "+initCount);
+ if( wait ) {
+ UITestCase.waitForKey("Post-Init");
+ }
+ try {
+ Thread.sleep(duration);
+ } catch (InterruptedException e1) {
+ e1.printStackTrace();
+ }
+ t[4] = Platform.currentTimeMillis();
+ for(int i=0; i
Date: Mon, 18 Nov 2013 01:11:15 +0100
Subject: Fix Bug 879 Regression (2/2) - NewtCanvasAWT.FocusAction must take
focus when in offscreen-mode (OSX/CALayer)
NewtCanvasAWT.FocusAction must take focus when in offscreen-mode (OSX/CALayer)
since the NEWT window _is_ offscreen (no input events) and AWT events are translated to NEWT.
Regression of commit 0be87f241c0f0b2f5881d9a602ce12378b8e453d
---
make/scripts/tests-win.bat | 4 ++--
make/scripts/tests-x64-dbg.bat | 3 ++-
make/scripts/tests-x64.bat | 4 ----
src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 14 +++++++++++---
.../parenting/TestParentingFocus03KeyTraversalAWT.java | 10 +++++++++-
5 files changed, 24 insertions(+), 11 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index 8008e959f..17362185e 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -13,7 +13,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGea
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.DemoGLJPanelPerf02AWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT %*
@@ -139,7 +139,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestTranslu
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestParentingFocus01SwingAWTRobot %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestParentingFocus02SwingAWTRobot %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestParentingFocus03KeyTraversalAWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestParentingFocus03KeyTraversalAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor03AWTGLn %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTJOGLGLCanvas01GLn %*
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index a42c79254..822ad0e54 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -51,7 +51,8 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLC
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer" "-Djogl.debug.TileRenderer.PNG"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
-REM set D_ARGS="-Dnewt.debug.Window"
+REM set D_ARGS="-Djogl.gljpanel.noverticalflip"
+set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat
index 2227396d3..ac74f4c94 100755
--- a/make/scripts/tests-x64.bat
+++ b/make/scripts/tests-x64.bat
@@ -19,10 +19,6 @@ set LIB_DIR=
set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%BLD_SUB%\joal.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
echo CP_ALL %CP_ALL%
-REM set D_ARGS=""
-REM set D_ARGS="-Djogl.gljpanel.noverticalflip"
-set D_ARGS="-Dnewt.debug.Window.MouseEvent"
-
set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
scripts\tests-win.bat %*
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index 9611cc960..b8de1f596 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -190,9 +190,17 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
if(DEBUG) {
System.err.println("NewtCanvasAWT.FocusAction: "+Display.getThreadName()+", isOnscreen "+isOnscreen+", hasFocus "+hasFocus()+", isParent "+isParent+", isFS "+isFullscreen);
}
- if( isParent && !isFullscreen && isOnscreen ) {
- // Remove the AWT focus in favor of the native NEWT focus
- KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
+ if( isParent && !isFullscreen ) { // must be parent of newtChild _and_ newtChild not fullscreen
+ if( isOnscreen ) {
+ // Remove the AWT focus in favor of the native NEWT focus
+ KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
+ } else if( !isOnscreen ) {
+ // In offscreen mode we require the focus!
+ if( !hasFocus() ) {
+ // Newt-EDT -> AWT-EDT may freeze Window's native peer requestFocus.
+ NewtCanvasAWT.super.requestFocus();
+ }
+ }
}
return false; // NEWT shall proceed requesting the native focus
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocus03KeyTraversalAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocus03KeyTraversalAWT.java
index 1e6cf4a1d..e928b2a34 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocus03KeyTraversalAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocus03KeyTraversalAWT.java
@@ -283,7 +283,15 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
System.err.println("Test: Direct NEWT-Child request focus");
glWindow1.requestFocus();
- Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA));
+ {
+ // Short: Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA));
+ // More verbose:
+ final boolean ok = AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA);
+ System.err.println("glWindow hasFocus "+glWindow1.hasFocus());
+ System.err.println("glWindow1FA "+glWindow1FA);
+ System.err.println("bWestFA "+bWestFA);
+ Assert.assertTrue("Did not gain focus", ok);
+ }
Assert.assertEquals(true, glWindow1FA.focusGained());
Assert.assertEquals(true, bWestFA.focusLost());
Thread.sleep(durationPerTest/numFocus);
--
cgit v1.2.3
From eb9225c928b9a1a5660c865921fcd91f85cd1cd0 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Thu, 28 Nov 2013 13:43:32 +0100
Subject: Fix Bug 902: FFMPEGMediaPlayer uses IOUtil.decodeURIIfFilePath(uri)
to decode proper file-scheme if applicable - otherwise encoded ASCII URI.
---
make/scripts/tests-win.bat | 4 ++--
make/scripts/tests-x64-dbg.bat | 7 ++++---
make/scripts/tests.sh | 6 +++---
.../opengl/util/av/impl/FFMPEGMediaPlayer.java | 9 +++++++--
.../test/junit/jogl/demos/es2/av/MovieCube.java | 17 ++++++++++++----
.../test/junit/jogl/demos/es2/av/MovieSimple.java | 23 ++++++++++++++++++----
6 files changed, 48 insertions(+), 18 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index a8ef44cce..fb224c882 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -18,7 +18,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLa
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.TexCubeES2 %*
@@ -146,7 +146,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWT
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTBug628ResizeDeadlock %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTBug643AsyncExec %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestBug672NewtCanvasSWTSashForm %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestBug672NewtCanvasSWTSashForm %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestBug672NewtCanvasSWTSashFormComposite %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.TestWindows01NEWT
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 822ad0e54..851c1dbec 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -24,12 +24,13 @@ REM set D_ARGS="-Djogamp.debug=all"
REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.FBObject"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.QueryNativeTK"
-set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
+REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.GLContext" "-Djogl.debug.GLCanvas"
REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug=all" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.CapabilitiesChooser -Djogl.debug.GLProfile"
+REM set D_ARGS="-Djogamp.debug.IOUtil"
REM set D_ARGS="-Djogl.debug.GLSLCode" "-Djogl.debug.GLMediaPlayer"
-REM set D_ARGS="-Djogl.debug.GLMediaPlayer"
+set D_ARGS="-Djogl.debug.GLMediaPlayer"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.AudioSink"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.GLMediaPlayer.Native"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25" "-Djogl.debug.GLMediaPlayer"
@@ -52,7 +53,7 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLC
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer" "-Djogl.debug.TileRenderer.PNG"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.TileRenderer"
REM set D_ARGS="-Djogl.gljpanel.noverticalflip"
-set D_ARGS="-Dnewt.debug.Window"
+REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index a27def007..ce8005821 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -137,7 +137,7 @@ function jrun() {
#D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
#D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
#D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
- #D_ARGS="-Djogl.debug.GLMediaPlayer"
+ D_ARGS="-Djogl.debug.GLMediaPlayer"
#D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
#D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
#D_ARGS="-Djogl.debug.AudioSink"
@@ -345,7 +345,7 @@ function testawtswt() {
#
#testnoawt jogamp.opengl.openal.av.ALDummyUsage $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
#
# performance tests
@@ -542,7 +542,7 @@ function testawtswt() {
#
#testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTEclipseGLCanvas01GLn $*
#testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTJOGLGLCanvas01GLn $*
-testswt com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTGLn $*
+#testswt com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTGLn $*
#testswt com.jogamp.opengl.test.junit.jogl.swt.TestBug672NewtCanvasSWTSashForm $*
#testswt com.jogamp.opengl.test.junit.jogl.swt.TestBug672NewtCanvasSWTSashFormComposite $*
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
index d2ef026bd..034b9457e 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -232,7 +232,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
private int vBytesPerPixelPerPlane = 0;
private int texWidth, texHeight; // overall (stuffing planes in one texture)
private String singleTexComp = "r";
- private GLPixelStorageModes psm;
+ private final GLPixelStorageModes psm;
//
// Audio
@@ -280,7 +280,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
System.err.println("initStream: p1 "+this);
}
- final String streamLocS=IOUtil.decodeFromURI(streamLoc.toString());
+ final String streamLocS = IOUtil.decodeURIIfFilePath(streamLoc);
destroyAudioSink();
if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
audioSink = AudioSinkFactory.createNull();
@@ -331,6 +331,11 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
final int aMaxChannelCount = audioSink.getMaxSupportedChannels();
final int aPrefSampleRate = preferredAudioFormat.sampleRate;
// setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
+ if(DEBUG) {
+ System.err.println("initStream: p3 cameraPath "+cameraPath+", isCameraInput "+isCameraInput);
+ System.err.println("initStream: p3 stream "+streamLoc+" -> "+streamLocS+" -> "+resStreamLocS);
+ System.err.println("initStream: p3 vid "+vid+", sizes "+sizes+", reqVideo "+rw+"x"+rh+"@"+rr+", aid "+aid+", aMaxChannelCount "+aMaxChannelCount+", aPrefSampleRate "+aPrefSampleRate);
+ }
natives.setStream0(moviePtr, resStreamLocS, isCameraInput, vid, sizes, rw, rh, rr, aid, aMaxChannelCount, aPrefSampleRate);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index a7636fce4..8f27e19c4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -28,6 +28,7 @@
package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -39,6 +40,7 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
+import com.jogamp.common.util.IOUtil;
import com.jogamp.newt.Window;
import com.jogamp.newt.event.KeyAdapter;
import com.jogamp.newt.event.KeyEvent;
@@ -327,7 +329,7 @@ public class MovieCube implements GLEventListener {
int aid = GLMediaPlayer.STREAM_ID_AUTO;
final boolean origSize;
- String url_s=null;
+ String url_s=null, file_s=null;
{
boolean _origSize = false;
for(int i=0; i
Date: Fri, 29 Nov 2013 02:24:01 +0100
Subject: Bug 907 - Refine DummyDispatchThread (DDT) Handling: Proper OO
integration in RegisteredClass; Safe DDT Post/WaitForReady handling and error
cases ; ...
Proper OO integration of DDT in RegisteredClass
- DDT is optional to RegisteredClass[Factory],
i.e. NEWT without DDT and DummyWindow with DDT.
- Using native type DummyThreadContext per DDT
passed as DDT handle to java referenced in RegisteredClass
- Passing DDT handle to related native methods,
if not null use DDT - otherwise work on current thread.
The latter impacts CreateDummyWindow0 and DestroyWindow0.
Safe DDT Post/WaitForReady handling and error cases ; ...
- Wait until command it complete using a 3s timeout
- Terminate thread if errors occur and throw an exception
+++
Discussion: DDT Native Implementation
Due to original code, the DDT is implemented in native code.
Usually we should favor running the DDT from a java thread.
However, since it's main purpose is _not_ to interact w/ java
and the native implementation has less footprint (performance and memory)
we shall be OK w/ it for now - as long the implementation IS SAFE.
---
make/scripts/tests-win.bat | 4 +-
make/scripts/tests-x64-dbg.bat | 8 +-
make/scripts/tests.sh | 27 +-
.../jogamp/nativewindow/windows/GDIUtil.java | 21 +-
.../nativewindow/windows/RegisteredClass.java | 17 +-
.../windows/RegisteredClassFactory.java | 30 +-
src/nativewindow/native/NativewindowCommon.c | 7 +
src/nativewindow/native/NativewindowCommon.h | 3 +
src/nativewindow/native/win32/GDImisc.c | 446 ++++++++++++++-------
.../jogamp/newt/driver/windows/DisplayDriver.java | 2 +-
10 files changed, 373 insertions(+), 192 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index fb224c882..d95b0025f 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -6,7 +6,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestMainVersion
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestGearsES1NEWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 4000 -x 10 -y 10 -width 100 -height 100 -screen 0
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 40000 -width 100 -height 100 -screen 0 %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT -time 5000
@@ -18,7 +18,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLa
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.TexCubeES2 %*
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 851c1dbec..3e56a31a6 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -21,16 +21,18 @@ set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%
echo CP_ALL %CP_ALL%
REM set D_ARGS="-Djogamp.debug=all"
+set D_ARGS="-Djogl.debug=all" "-Dnativewindow.debug=all"
+REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
+REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug=all" "-Djogl.debug.EGLDrawableFactory.DontQuery"
+REM set D_ARGS="-Dnativewindow.debug.GDIUtil" "-Dnativewindow.debug.RegisteredClass"
REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.FBObject"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.QueryNativeTK"
-REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.GLContext" "-Djogl.debug.GLCanvas"
-REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug=all" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.CapabilitiesChooser -Djogl.debug.GLProfile"
REM set D_ARGS="-Djogamp.debug.IOUtil"
REM set D_ARGS="-Djogl.debug.GLSLCode" "-Djogl.debug.GLMediaPlayer"
-set D_ARGS="-Djogl.debug.GLMediaPlayer"
+REM set D_ARGS="-Djogl.debug.GLMediaPlayer"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.AudioSink"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.GLMediaPlayer.Native"
REM set D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25" "-Djogl.debug.GLMediaPlayer"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index ce8005821..56a07e768 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -84,6 +84,17 @@ function jrun() {
#D_ARGS="-Djogl.debug.DebugGL"
#D_ARGS="-Djogl.debug.TraceGL"
#D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL"
+
+ #D_ARGS="-Djogamp.debug=all"
+ #D_ARGS="-Dnativewindow.debug=all"
+ #D_ARGS="-Djogl.debug=all"
+ #D_ARGS="-Dnewt.debug=all"
+ #D_ARGS="-Djogl.debug=all -Dnewt.debug=all"
+ D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all"
+ #D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
+ #D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
+ #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all -Dnewt.debug=all -Djogamp.debug.Lock"
+
#D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_XCLOSEDISPLAY_BUG"
#D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_MULTITHREADING_BUG"
#D_ARGS="-Djogl.disable.opengles"
@@ -93,7 +104,7 @@ function jrun() {
#D_ARGS="-Djogl.debug.FBObject"
#D_ARGS="-Djogl.debug.GLSLCode"
#D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.DebugGL"
- #D_ARGS="-Djogl.debug=all -Dnewt.debug=all"
+ #D_ARGS="-Dnativewindow.debug.X11Util -Dnativewindow.debug.X11Util.TraceDisplayLifecycle -Djogl.debug.EGLDisplayUtil -Djogl.debug.GLDrawable"
#D_ARGS="-Djogl.debug.GLContext -Dnativewindow.debug.JAWT -Dnewt.debug.Window"
#D_ARGS="-Dnativewindow.debug.JAWT -Djogamp.debug.TaskBase.TraceSource"
#D_ARGS="-Djogl.debug.GLContext.TraceSwitch"
@@ -110,10 +121,6 @@ function jrun() {
#D_ARGS="-Dnativewindow.debug.GraphicsConfiguration"
#D_ARGS="-Djogl.debug.GLContext"
#D_ARGS="-Djogl.debug.GLContext.NoProfileAliasing"
- #D_ARGS="-Djogamp.debug=all"
- #D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
- #D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
- #D_ARGS="-Dnativewindow.debug.X11Util -Dnativewindow.debug.X11Util.TraceDisplayLifecycle -Djogl.debug.EGLDisplayUtil -Djogl.debug.GLDrawable"
#D_ARGS="-Djogl.debug.GLDrawable -Dnativewindow.debug.X11Util -Dnativewindow.debug.NativeWindow -Dnewt.debug.Display -Dnewt.debug.Screen -Dnewt.debug.Window"
#D_ARGS="-Djogl.debug.Animator -Djogl.debug.GLDrawable -Dnativewindow.debug.NativeWindow"
#D_ARGS="-Djogl.debug=all -Dnewt.debug=all"
@@ -122,8 +129,6 @@ function jrun() {
#D_ARGS="-Djogl.debug.GLDrawable"
#D_ARGS="-Djogl.debug.GLEventListenerState"
#D_ARGS="-Djogl.fbo.force.none"
- #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all -Dnewt.debug=all -Djogamp.debug.Lock"
- #D_ARGS="-Djogl.debug=all"
#D_ARGS="-Djogl.debug.EGLDrawableFactory.DontQuery -Djogl.debug.GLDrawable"
#D_ARGS="-Djogl.debug.EGLDrawableFactory.QueryNativeTK -Djogl.debug.GLDrawable"
#D_ARGS="-Djogl.debug.GLDebugMessageHandler"
@@ -137,7 +142,7 @@ function jrun() {
#D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
#D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.AudioSink"
#D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
- D_ARGS="-Djogl.debug.GLMediaPlayer"
+ #D_ARGS="-Djogl.debug.GLMediaPlayer"
#D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
#D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
#D_ARGS="-Djogl.debug.AudioSink"
@@ -201,7 +206,6 @@ function jrun() {
#D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent"
#D_ARGS="-Dnewt.debug.Window"
#D_ARGS="-Xprof"
- #D_ARGS="-Dnativewindow.debug=all"
#D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel"
#D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.gljpanel.noglsl"
#D_ARGS="-Djogl.debug.GLJPanel -Djogl.debug.DebugGL"
@@ -225,7 +229,6 @@ function jrun() {
#D_ARGS="-Dnewt.debug=all -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock"
#D_ARGS="-Djogl.debug.GLContext -Dnewt.debug=all -Djogamp.debug.Lock -Djogamp.common.utils.locks.Lock.timeout=10000"
#D_ARGS="-Djogl.debug.GLContext -Dnewt.debug=all"
- #D_ARGS="-Dnewt.debug=all"
#D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.GLJPanel -Djogl.debug.TileRenderer -Djogl.debug.TileRenderer.PNG"
#D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.GLJPanel -Djogl.debug.TileRenderer"
#D_ARGS="-Djogl.debug.PNGImage"
@@ -322,7 +325,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile00NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
#testawtswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
@@ -345,7 +348,7 @@ function testawtswt() {
#
#testnoawt jogamp.opengl.openal.av.ALDummyUsage $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
-testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
#
# performance tests
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
index bab4b5c6e..a872e63d8 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
@@ -59,7 +59,7 @@ public class GDIUtil implements ToolkitProperties {
if( !initIDs0() ) {
throw new NativeWindowException("GDI: Could not initialized native stub");
}
- dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0());
+ dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0(), true /* useDummyDispatchThread */);
if(DEBUG) {
System.out.println("GDI.initSingleton() dummyWindowClassFactory "+dummyWindowClassFactory);
}
@@ -98,8 +98,7 @@ public class GDIUtil implements ToolkitProperties {
System.out.println("GDI.CreateDummyWindow() dummyWindowClassFactory "+dummyWindowClassFactory);
System.out.println("GDI.CreateDummyWindow() dummyWindowClass "+dummyWindowClass);
}
- // FIXME return CreateDummyWindow0(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height);
- return CreateDummyWindowAndMessageLoop(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height);
+ return CreateDummyWindow0(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getHDispThreadContext(), dummyWindowClass.getName(), x, y, width, height);
}
}
@@ -109,8 +108,7 @@ public class GDIUtil implements ToolkitProperties {
if( null == dummyWindowClass ) {
throw new InternalError("GDI Error ("+dummyWindowClassFactory.getSharedRefCount()+"): SharedClass is null");
}
- // FIXME res = GDI.DestroyWindow(hwnd);
- res = SendCloseMessage(hwnd);
+ res = DestroyWindow0(dummyWindowClass.getHDispThreadContext(), hwnd);
dummyWindowClassFactory.releaseSharedClass();
}
return res;
@@ -128,8 +126,11 @@ public class GDIUtil implements ToolkitProperties {
return IsChild0(win);
}
- public static native boolean CreateWindowClass(long hInstance, String clazzName, long wndProc);
- public static native boolean DestroyWindowClass(long hInstance, String className);
+ private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI
+
+ static native boolean CreateWindowClass0(long hInstance, String clazzName, long wndProc);
+ static native boolean DestroyWindowClass0(long hInstance, String className, long dispThreadCtx);
+ static native long CreateDummyDispatchThread0();
private static native boolean initIDs0();
private static native long getDummyWndProc0();
@@ -137,8 +138,6 @@ public class GDIUtil implements ToolkitProperties {
private static native boolean IsChild0(long win);
private static native boolean IsUndecorated0(long win);
- private static native long CreateDummyWindow0(long hInstance, String className, String windowName, int x, int y, int width, int height);
-
- private static native long CreateDummyWindowAndMessageLoop(long hInstance, String className, String windowName, int x, int y, int width, int height);
- private static native boolean SendCloseMessage(long win);
+ private static native long CreateDummyWindow0(long hInstance, String className, long dispThreadCtx, String windowName, int x, int y, int width, int height);
+ private static native boolean DestroyWindow0(long dispThreadCtx, long win);
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
index 976693e3a..1f6cb7c05 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
@@ -29,12 +29,14 @@
package jogamp.nativewindow.windows;
public class RegisteredClass {
- long hInstance;
- String className;
+ private final long hInstance;
+ private final String className;
+ private final long hDDTCtx;
- RegisteredClass(long hInst, String name) {
- hInstance = hInst;
- className = name;
+ RegisteredClass(long hInst, String name, long hDispatchThreadCtx) {
+ this.hInstance = hInst;
+ this.className = name;
+ this.hDDTCtx = hDispatchThreadCtx;
}
/** Application handle, same as {@link RegisteredClassFactory#getHInstance()}. */
@@ -43,6 +45,9 @@ public class RegisteredClass {
/** Unique Window Class Name */
public final String getName() { return className; }
+ /** Unique associated dispatch thread context for this Window Class, or 0 for none. */
+ public final long getHDispThreadContext() { return hDDTCtx; }
+
@Override
- public final String toString() { return "RegisteredClass[handle 0x"+Long.toHexString(hInstance)+", "+className+"]"; }
+ public final String toString() { return "RegisteredClass[handle 0x"+Long.toHexString(hInstance)+", "+className+", dtx 0x"+Long.toHexString(hDDTCtx)+"]"; }
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
index 19a48d3bf..ee41fe192 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
@@ -49,6 +49,7 @@ public class RegisteredClassFactory {
private final String classBaseName;
private final long wndProc;
+ private final boolean useDummyDispatchThread;
private RegisteredClass sharedClass = null;
private int classIter = 0;
@@ -59,24 +60,29 @@ public class RegisteredClassFactory {
@Override
public final String toString() { return "RegisteredClassFactory[moduleHandle "+toHexString(hInstance)+", "+classBaseName+
- ", wndProc "+toHexString(wndProc)+", shared[refCount "+sharedRefCount+", class "+sharedClass+"]]"; }
+ ", wndProc "+toHexString(wndProc)+", useDDT "+useDummyDispatchThread+", shared[refCount "+sharedRefCount+", class "+sharedClass+"]]"; }
/**
* Release the {@link RegisteredClass} of all {@link RegisteredClassFactory}.
*/
public static void shutdownSharedClasses() {
synchronized(registeredFactories) {
+ if( DEBUG ) {
+ System.err.println("RegisteredClassFactory.shutdownSharedClasses: "+registeredFactories.size());
+ }
for(int j=0; j
+#include
static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException";
static jclass runtimeExceptionClz=NULL;
@@ -106,3 +107,9 @@ JNIEnv* NativewindowCommon_GetJNIEnv (JavaVM * jvmHandle, int jvmVersion, int as
return curEnv;
}
+int64_t NativewindowCommon_CurrentTimeMillis() {
+ struct timeval tv;
+ gettimeofday(&tv,NULL);
+ return (int64_t)tv.tv_sec * 1000 + tv.tv_usec / 1000;
+}
+
diff --git a/src/nativewindow/native/NativewindowCommon.h b/src/nativewindow/native/NativewindowCommon.h
index a2975f3fd..a23fad9fd 100644
--- a/src/nativewindow/native/NativewindowCommon.h
+++ b/src/nativewindow/native/NativewindowCommon.h
@@ -4,6 +4,7 @@
#include
#include
+#include
int NativewindowCommon_init(JNIEnv *env);
@@ -15,4 +16,6 @@ void NativewindowCommon_throwNewRuntimeException(JNIEnv *env, const char* msg, .
JNIEnv* NativewindowCommon_GetJNIEnv (JavaVM * jvmHandle, int jvmVersion, int asDaemon, int * shallBeDetached);
+int64_t NativewindowCommon_CurrentTimeMillis();
+
#endif
diff --git a/src/nativewindow/native/win32/GDImisc.c b/src/nativewindow/native/win32/GDImisc.c
index d3ac3873c..b55988c11 100644
--- a/src/nativewindow/native/win32/GDImisc.c
+++ b/src/nativewindow/native/win32/GDImisc.c
@@ -20,8 +20,10 @@
#ifdef VERBOSE_ON
#define DBG_PRINT(args...) fprintf(stderr, args);
+ #define DBG_PRINT_FLUSH(args...) fprintf(stderr, args); fflush(stderr);
#else
#define DBG_PRINT(args...)
+ #define DBG_PRINT_FLUSH(args...)
#endif
static const char * const ClazzNamePoint = "javax/media/nativewindow/util/Point";
@@ -30,12 +32,17 @@ static const char * const ClazzNamePointCstrSignature = "(II)V";
static jclass pointClz = NULL;
static jmethodID pointCstr = NULL;
+static jmethodID dumpStackID = NULL;
-static volatile DWORD threadid = 0;
+typedef struct {
+ HANDLE threadHandle;
+ DWORD threadId;
+ volatile BOOL threadReady;
+ volatile BOOL threadDead;
+} DummyThreadContext;
-typedef struct ThreadParam_s
-{
- jlong jHInstance;
+typedef struct {
+ HINSTANCE hInstance;
const TCHAR* wndClassName;
const TCHAR* wndName;
jint x;
@@ -44,17 +51,88 @@ typedef struct ThreadParam_s
jint height;
volatile HWND hWnd;
volatile BOOL threadReady;
-} ThreadParam;
+} DummyThreadCommand;
#define TM_OPENWIN WM_APP+1
#define TM_CLOSEWIN WM_APP+2
#define TM_STOP WM_APP+3
-DWORD WINAPI ThreadFunc(LPVOID param)
+static const char * sTM_OPENWIN = "TM_OPENWIN";
+static const char * sTM_CLOSEWIN = "TM_CLOSEWIN";
+static const char * sTM_STOP = "TM_STOP";
+
+/** 3s timeout */
+static const int64_t TIME_OUT = 3000000;
+
+static jboolean DDT_CheckAlive(JNIEnv *env, const char *msg, DummyThreadContext *ctx) {
+ if( ctx->threadDead ) {
+ NativewindowCommon_throwNewRuntimeException(env, "DDT is dead at %s", msg);
+ return JNI_FALSE;
+ } else {
+ DBG_PRINT_FLUSH("*** DDT-Check ALIVE @ %s\n", msg);
+ return JNI_TRUE;
+ }
+}
+
+static jboolean DDT_WaitUntilCreated(JNIEnv *env, DummyThreadContext *ctx, BOOL created) {
+ const int64_t t0 = NativewindowCommon_CurrentTimeMillis();
+ int64_t t1 = t0;
+ if( created ) {
+ while( !ctx->threadReady && t1-t0 < TIME_OUT ) {
+ t1 = NativewindowCommon_CurrentTimeMillis();
+ }
+ if( !ctx->threadReady ) {
+ NativewindowCommon_throwNewRuntimeException(env, "TIMEOUT (%d ms) while waiting for DDT CREATED", (int)(t1-t0));
+ return JNI_FALSE;
+ }
+ DBG_PRINT_FLUSH("*** DDT-Check CREATED\n");
+ } else {
+ while( !ctx->threadDead && t1-t0 < TIME_OUT ) {
+ t1 = NativewindowCommon_CurrentTimeMillis();
+ }
+ if( !ctx->threadDead ) {
+ NativewindowCommon_throwNewRuntimeException(env, "TIMEOUT (%d ms) while waiting for DDT DESTROYED", (int)(t1-t0));
+ return JNI_FALSE;
+ }
+ DBG_PRINT_FLUSH("*** DDT-Check DEAD\n");
+ }
+ return JNI_TRUE;
+}
+
+static jboolean DDT_WaitUntilReady(JNIEnv *env, const char *msg, DummyThreadCommand *cmd) {
+ const int64_t t0 = NativewindowCommon_CurrentTimeMillis();
+ int64_t t1 = t0;
+ while( !cmd->threadReady && t1-t0 < TIME_OUT ) {
+ t1 = NativewindowCommon_CurrentTimeMillis();
+ }
+ if( !cmd->threadReady ) {
+ NativewindowCommon_throwNewRuntimeException(env, "TIMEOUT (%d ms) while waiting for DDT %s", (int)(t1-t0), msg);
+ return JNI_FALSE;
+ }
+ DBG_PRINT_FLUSH("*** DDT-Check READY @ %s\n", msg);
+ return JNI_TRUE;
+}
+
+static HWND DummyWindowCreate
+ (HINSTANCE hInstance, const TCHAR* wndClassName, const TCHAR* wndName, jint x, jint y, jint width, jint height)
+{
+ DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
+ DWORD dwStyle = WS_OVERLAPPEDWINDOW;
+ HWND hWnd = CreateWindowEx( dwExStyle,
+ wndClassName,
+ wndName,
+ dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
+ x, y, width, height,
+ NULL, NULL, hInstance, NULL );
+ return hWnd;
+}
+
+static DWORD WINAPI DummyDispatchThreadFunc(LPVOID param)
{
MSG msg;
BOOL bRet;
- ThreadParam *startupThreadParam = (ThreadParam*)param;
+ BOOL bEOL=FALSE;
+ DummyThreadContext *threadContext = (DummyThreadContext*)param;
/* there can not be any messages for us now, as the creator waits for
threadReady before continuing, but we must use this PeekMessage() to
@@ -62,42 +140,40 @@ DWORD WINAPI ThreadFunc(LPVOID param)
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
/* now we can safely say: we have a qeue and are ready to receive messages */
- startupThreadParam->threadReady = TRUE;
-
- while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0) {
- if (bRet == -1) {
- return 0;
+ // threadContext->threadId = GetCurrentThreadId();
+ threadContext->threadDead = FALSE;
+ threadContext->threadReady = TRUE;
+
+ while( !bEOL && (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0 ) {
+ if ( -1 == bRet ) {
+ fprintf(stderr, "DummyDispatchThread (id %d): GetMessage Error %d, werr %d\n",
+ (int)threadContext->threadId, (int)bRet, (int)GetLastError());
+ fflush(stderr);
+ bEOL = TRUE;
+ break; // EOL
} else {
switch(msg.message) {
case TM_OPENWIN: {
- ThreadParam *tParam = (ThreadParam*)msg.wParam;
- HINSTANCE hInstance = (HINSTANCE) (intptr_t) tParam->jHInstance;
- DWORD dwExStyle;
- DWORD dwStyle;
-
- dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
- dwStyle = WS_OVERLAPPEDWINDOW;
-
- HWND hwnd = CreateWindowEx( dwExStyle,
- tParam->wndClassName,
- tParam->wndName,
- dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
- tParam->x, tParam->y, tParam->width, tParam->height,
- NULL, NULL, hInstance, NULL );
-
- tParam->hWnd = hwnd;
+ DummyThreadCommand *tParam = (DummyThreadCommand*)msg.wParam;
+ DBG_PRINT_FLUSH("*** DDT-Dispatch OPENWIN\n");
+ tParam->hWnd = DummyWindowCreate(tParam->hInstance, tParam->wndClassName, tParam->wndName, tParam->x, tParam->y, tParam->width, tParam->height);
tParam->threadReady = TRUE;
}
break;
case TM_CLOSEWIN: {
- ThreadParam *tParam = (ThreadParam*)msg.wParam;
- HWND hwnd = tParam->hWnd;
- DestroyWindow(hwnd);
+ DummyThreadCommand *tParam = (DummyThreadCommand*)msg.wParam;
+ DBG_PRINT_FLUSH("*** DDT-Dispatch CLOSEWIN\n");
+ DestroyWindow(tParam->hWnd);
tParam->threadReady = TRUE;
}
break;
- case TM_STOP:
- return 0;
+ case TM_STOP: {
+ DummyThreadCommand *tParam = (DummyThreadCommand*)msg.wParam;
+ DBG_PRINT_FLUSH("*** DDT-Dispatch STOP -> DEAD\n");
+ tParam->threadReady = TRUE;
+ bEOL = TRUE;
+ }
+ break; // EOL
default:
TranslateMessage(&msg);
DispatchMessage(&msg);
@@ -105,8 +181,12 @@ DWORD WINAPI ThreadFunc(LPVOID param)
}
}
}
+ /* dead */
+ DBG_PRINT_FLUSH("*** DDT-Dispatch DEAD\n");
+ threadContext->threadDead = TRUE;
+ ExitThread(0);
return 0;
-} /* ThreadFunc */
+}
HINSTANCE GetApplicationHandle() {
@@ -115,11 +195,48 @@ HINSTANCE GetApplicationHandle() {
/* Java->C glue code:
* Java package: jogamp.nativewindow.windows.GDIUtil
- * Java method: boolean CreateWindowClass(long hInstance, java.lang.String clazzName, long wndProc)
- * C function: BOOL CreateWindowClass(HANDLE hInstance, LPCSTR clazzName, HANDLE wndProc);
+ * Java method: long CreateDummyDispatchThread0()
+ */
+JNIEXPORT jlong JNICALL
+Java_jogamp_nativewindow_windows_GDIUtil_CreateDummyDispatchThread0
+ (JNIEnv *env, jclass _unused)
+{
+ DWORD threadId = 0;
+ DummyThreadContext * dispThreadCtx = calloc(1, sizeof(DummyThreadContext));
+
+ dispThreadCtx->threadHandle = CreateThread(NULL, 0, DummyDispatchThreadFunc, (LPVOID)dispThreadCtx, 0, &threadId);
+ if( NULL == dispThreadCtx->threadHandle || 0 == threadId ) {
+ const HANDLE threadHandle = dispThreadCtx->threadHandle;
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ NativewindowCommon_throwNewRuntimeException(env, "DDT CREATE failed handle %p, id %d, werr %d",
+ (void*)threadHandle, (int)threadId, (int)GetLastError());
+ return (jlong)0;
+ }
+ if( JNI_FALSE == DDT_WaitUntilCreated(env, dispThreadCtx, TRUE) ) {
+ const HANDLE threadHandle = dispThreadCtx->threadHandle;
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ NativewindowCommon_throwNewRuntimeException(env, "DDT CREATE (ack) failed handle %p, id %d, werr %d",
+ (void*)threadHandle, (int)threadId, (int)GetLastError());
+ return (jlong)0;
+ }
+ DBG_PRINT_FLUSH("*** DDT Created %d\n", (int)threadId);
+ dispThreadCtx->threadId = threadId;
+ return (jlong) (intptr_t) dispThreadCtx;
+}
+
+/* Java->C glue code:
+ * Java package: jogamp.nativewindow.windows.GDIUtil
+ * Java method: boolean CreateWindowClass0(long hInstance, java.lang.String clazzName, long wndProc)
+ * C function: BOOL CreateWindowClass0(HANDLE hInstance, LPCSTR clazzName, HANDLE wndProc);
*/
JNIEXPORT jboolean JNICALL
-Java_jogamp_nativewindow_windows_GDIUtil_CreateWindowClass
+Java_jogamp_nativewindow_windows_GDIUtil_CreateWindowClass0
(JNIEnv *env, jclass _unused, jlong jHInstance, jstring jClazzName, jlong wndProc)
{
HINSTANCE hInstance = (HINSTANCE) (intptr_t) jHInstance;
@@ -127,11 +244,6 @@ Java_jogamp_nativewindow_windows_GDIUtil_CreateWindowClass
WNDCLASS wc;
jboolean res;
- if( 0 != threadid ) {
- NativewindowCommon_throwNewRuntimeException(env, "Native threadid already created 0x%X", (int)threadid);
- return JNI_FALSE;
- }
-
#ifdef UNICODE
clazzName = NewtCommon_GetNullTerminatedStringChars(env, jClazzName);
#else
@@ -164,31 +276,20 @@ Java_jogamp_nativewindow_windows_GDIUtil_CreateWindowClass
(*env)->ReleaseStringUTFChars(env, jClazzName, clazzName);
#endif
- if( JNI_TRUE == res ) {
- ThreadParam tParam = {0};
-
- CreateThread(NULL, 0, ThreadFunc, (LPVOID)&tParam, 0, (DWORD *)&threadid);
- if(threadid) {
- while(!tParam.threadReady) { /* nop */ }
- } else {
- res = JNI_FALSE;
- }
- }
-
return res;
}
/* Java->C glue code:
* Java package: jogamp.nativewindow.windows.GDIUtil
- * Java method: boolean DestroyWindowClass(long hInstance, java.lang.String className)
- * C function: BOOL DestroyWindowClass(HANDLE hInstance, LPCSTR className);
+ * Java method: boolean DestroyWindowClass0(long hInstance, java.lang.String className, long dispThreadCtx)
*/
JNIEXPORT jboolean JNICALL
-Java_jogamp_nativewindow_windows_GDIUtil_DestroyWindowClass
- (JNIEnv *env, jclass _unused, jlong jHInstance, jstring jClazzName)
+Java_jogamp_nativewindow_windows_GDIUtil_DestroyWindowClass0
+ (JNIEnv *env, jclass gdiClazz, jlong jHInstance, jstring jClazzName, jlong jDispThreadCtx)
{
HINSTANCE hInstance = (HINSTANCE) (intptr_t) jHInstance;
const TCHAR* clazzName = NULL;
+ DummyThreadContext * dispThreadCtx = (DummyThreadContext *) (intptr_t) jDispThreadCtx;
jboolean res;
#ifdef UNICODE
@@ -205,39 +306,73 @@ Java_jogamp_nativewindow_windows_GDIUtil_DestroyWindowClass
(*env)->ReleaseStringUTFChars(env, jClazzName, clazzName);
#endif
- if( 0 == threadid ) {
- NativewindowCommon_throwNewRuntimeException(env, "Native threadid zero 0x%X", (int)threadid);
- return JNI_FALSE;
- }
+ if( NULL != dispThreadCtx) {
+ const HANDLE threadHandle = dispThreadCtx->threadHandle;
+ const DWORD threadId = dispThreadCtx->threadId;
+ DummyThreadCommand tParam = {0};
+ tParam.threadReady = FALSE;
+ DBG_PRINT_FLUSH("*** DDT Destroy %d\n", (int)threadId);
+#ifdef VERBOSE_ON
+ (*env)->CallStaticVoidMethod(env, gdiClazz, dumpStackID);
+#endif
- PostThreadMessage(threadid, TM_STOP, 0, 0);
+ if( JNI_FALSE == DDT_CheckAlive(env, sTM_STOP, dispThreadCtx) ) {
+ free(dispThreadCtx);
+ NativewindowCommon_throwNewRuntimeException(env, "DDT %s (alive) failed handle %p, id %d, werr %d",
+ sTM_STOP, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ return JNI_FALSE;
+ }
+ if ( 0 != PostThreadMessage(dispThreadCtx->threadId, TM_STOP, (WPARAM)&tParam, 0) ) {
+ if( JNI_FALSE == DDT_WaitUntilReady(env, sTM_STOP, &tParam) ) {
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ NativewindowCommon_throwNewRuntimeException(env, "DDT Post %s (ack) failed handle %p, id %d, werr %d",
+ sTM_STOP, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ return JNI_FALSE;
+ }
+ if( JNI_FALSE == DDT_WaitUntilCreated(env, dispThreadCtx, FALSE) ) {
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ NativewindowCommon_throwNewRuntimeException(env, "DDT KILL %s (ack) failed handle %p, id %d, werr %d",
+ sTM_STOP, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ return JNI_FALSE;
+ }
+ free(dispThreadCtx); // free after proper DDT shutdown!
+ } else {
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ NativewindowCommon_throwNewRuntimeException(env, "DDT Post %s failed handle %p, id %d, werr %d",
+ sTM_STOP, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ return JNI_FALSE;
+ }
+ }
return res;
}
/* Java->C glue code:
* Java package: jogamp.nativewindow.windows.GDIUtil
- * Java method: long CreateDummyWindowAndMessageLoop(long hInstance, java.lang.String className, java.lang.String windowName, int x, int y, int width, int height)
- * C function: HANDLE CreateDummyWindowAndMessageLoop(HANDLE hInstance, LPCSTR className, LPCSTR windowName, int x, int y, int width, int height);
+ * Java method: long CreateDummyWindow0(long hInstance, java.lang.String className, jlong dispThreadCtx, java.lang.String windowName, int x, int y, int width, int height)
*/
JNIEXPORT jlong JNICALL
-Java_jogamp_nativewindow_windows_GDIUtil_CreateDummyWindowAndMessageLoop
- (JNIEnv *env, jclass _unused, jlong jHInstance, jstring jWndClassName, jstring jWndName, jint x, jint y, jint width, jint height)
+Java_jogamp_nativewindow_windows_GDIUtil_CreateDummyWindow0
+ (JNIEnv *env, jclass _unused, jlong jHInstance, jstring jWndClassName, jlong jDispThreadCtx, jstring jWndName, jint x, jint y, jint width, jint height)
{
- volatile HWND hWnd = 0;
- ThreadParam tParam = {0};
-
- if( 0 == threadid ) {
- NativewindowCommon_throwNewRuntimeException(env, "Native threadid zero 0x%X", (int)threadid);
- return JNI_FALSE;
- }
+ DummyThreadContext * dispThreadCtx = (DummyThreadContext *) (intptr_t) jDispThreadCtx;
+ DummyThreadCommand tParam = {0};
- tParam.jHInstance = jHInstance;
+ tParam.hInstance = (HINSTANCE) (intptr_t) jHInstance;
tParam.x = x;
tParam.y = y;
tParam.width = width;
tParam.height = height;
- tParam.hWnd = hWnd;
+ tParam.hWnd = 0;
tParam.threadReady = FALSE;
#ifdef UNICODE
@@ -248,9 +383,37 @@ Java_jogamp_nativewindow_windows_GDIUtil_CreateDummyWindowAndMessageLoop
tParam.wndName = (*env)->GetStringUTFChars(env, jWndName, NULL);
#endif
- PostThreadMessage(threadid, TM_OPENWIN, (WPARAM)&tParam, 0);
-
- while(!tParam.threadReady) { /* nop */ }
+ if( NULL == dispThreadCtx ) {
+ tParam.hWnd = DummyWindowCreate(tParam.hInstance, tParam.wndClassName, tParam.wndName, tParam.x, tParam.y, tParam.width, tParam.height);
+ } else {
+ const HANDLE threadHandle = dispThreadCtx->threadHandle;
+ const DWORD threadId = dispThreadCtx->threadId;
+ if( JNI_FALSE == DDT_CheckAlive(env, sTM_OPENWIN, dispThreadCtx) ) {
+ free(dispThreadCtx);
+ NativewindowCommon_throwNewRuntimeException(env, "DDT %s (alive) failed handle %p, id %d, werr %d",
+ sTM_OPENWIN, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ } else {
+ if( 0 != PostThreadMessage(dispThreadCtx->threadId, TM_OPENWIN, (WPARAM)&tParam, 0) ) {
+ if( JNI_FALSE == DDT_WaitUntilReady(env, sTM_OPENWIN, &tParam) ) {
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ tParam.hWnd = 0;
+ NativewindowCommon_throwNewRuntimeException(env, "DDT Post %s (ack) failed handle %p, id %d, werr %d",
+ sTM_OPENWIN, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ }
+ } else {
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ tParam.hWnd = 0;
+ NativewindowCommon_throwNewRuntimeException(env, "DDT Post %s to handle %p, id %d failed, werr %d",
+ sTM_OPENWIN, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ }
+ }
+ }
#ifdef UNICODE
free((void*) tParam.wndClassName);
@@ -260,62 +423,66 @@ Java_jogamp_nativewindow_windows_GDIUtil_CreateDummyWindowAndMessageLoop
(*env)->ReleaseStringUTFChars(env, jWndName, tParam.wndName);
#endif
- return (jlong) (intptr_t) hWnd;
+ return (jlong) (intptr_t) tParam.hWnd;
}
-/* Java->C glue code:
- * Java package: jogamp.nativewindow.windows.GDIUtil
- * Java method: long CreateDummyWindow0(long hInstance, java.lang.String className, java.lang.String windowName, int x, int y, int width, int height)
- * C function: HANDLE CreateDummyWindow0(HANDLE hInstance, LPCSTR className, LPCSTR windowName, int x, int y, int width, int height);
+/*
+ * Class: jogamp_nativewindow_windows_GDIUtil
+ * Method: DestroyWindow0
*/
-JNIEXPORT jlong JNICALL
-Java_jogamp_nativewindow_windows_GDIUtil_CreateDummyWindow0
- (JNIEnv *env, jclass _unused, jlong jHInstance, jstring jWndClassName, jstring jWndName, jint x, jint y, jint width, jint height)
+JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_DestroyWindow0
+(JNIEnv *env, jclass unused, jlong jDispThreadCtx, jlong jwin)
{
- HINSTANCE hInstance = (HINSTANCE) (intptr_t) jHInstance;
- const TCHAR* wndClassName = NULL;
- const TCHAR* wndName = NULL;
- DWORD dwExStyle;
- DWORD dwStyle;
- HWND hWnd;
-
-#ifdef UNICODE
- wndClassName = NewtCommon_GetNullTerminatedStringChars(env, jWndClassName);
- wndName = NewtCommon_GetNullTerminatedStringChars(env, jWndName);
-#else
- wndClassName = (*env)->GetStringUTFChars(env, jWndClassName, NULL);
- wndName = (*env)->GetStringUTFChars(env, jWndName, NULL);
-#endif
-
- dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
- dwStyle = WS_OVERLAPPEDWINDOW;
-
- hWnd = CreateWindowEx( dwExStyle,
- wndClassName,
- wndName,
- dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
- x, y, width, height,
- NULL, NULL, hInstance, NULL );
+ jboolean res = JNI_TRUE;
+ DummyThreadContext * dispThreadCtx = (DummyThreadContext *) (intptr_t) jDispThreadCtx;
+ HWND hWnd = (HWND) (intptr_t) jwin;
+ if( NULL == dispThreadCtx ) {
+ DestroyWindow(hWnd);
+ } else {
+ const HANDLE threadHandle = dispThreadCtx->threadHandle;
+ const DWORD threadId = dispThreadCtx->threadId;
+ DummyThreadCommand tParam = {0};
-#ifdef UNICODE
- free((void*) wndClassName);
- free((void*) wndName);
-#else
- (*env)->ReleaseStringUTFChars(env, jWndClassName, wndClassName);
- (*env)->ReleaseStringUTFChars(env, jWndName, wndName);
-#endif
+ tParam.hWnd = hWnd;
+ tParam.threadReady = FALSE;
- return (jlong) (intptr_t) hWnd;
+ if( JNI_FALSE == DDT_CheckAlive(env, sTM_CLOSEWIN, dispThreadCtx) ) {
+ free(dispThreadCtx);
+ res = JNI_FALSE;
+ NativewindowCommon_throwNewRuntimeException(env, "DDT %s (alive) failed handle %p, id %d, werr %d",
+ sTM_CLOSEWIN, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ } else {
+ if ( 0 != PostThreadMessage(dispThreadCtx->threadId, TM_CLOSEWIN, (WPARAM)&tParam, 0) ) {
+ if( JNI_FALSE == DDT_WaitUntilReady(env, sTM_CLOSEWIN, &tParam) ) {
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ res = JNI_FALSE;
+ NativewindowCommon_throwNewRuntimeException(env, "DDT Post %s (ack) failed handle %p, id %d, werr %d",
+ sTM_CLOSEWIN, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ }
+ } else {
+ if( NULL != threadHandle ) {
+ TerminateThread(threadHandle, 0);
+ }
+ free(dispThreadCtx);
+ res = JNI_FALSE;
+ NativewindowCommon_throwNewRuntimeException(env, "DDT Post %s to handle %p, id %d failed, werr %d",
+ sTM_CLOSEWIN, (void*)threadHandle, (int)threadId, (int)GetLastError());
+ }
+ }
+ }
+ return res;
}
-
/*
* Class: jogamp_nativewindow_windows_GDIUtil
* Method: initIDs0
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_initIDs0
- (JNIEnv *env, jclass clazz)
+ (JNIEnv *env, jclass gdiClazz)
{
if(NativewindowCommon_init(env)) {
jclass c = (*env)->FindClass(env, ClazzNamePoint);
@@ -332,11 +499,15 @@ JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_initIDs0
NativewindowCommon_FatalError(env, "FatalError jogamp_nativewindow_windows_GDIUtil: can't fetch %s.%s %s",
ClazzNamePoint, ClazzAnyCstrName, ClazzNamePointCstrSignature);
}
+ dumpStackID = (*env)->GetStaticMethodID(env, gdiClazz, "dumpStack", "()V");
+ if(NULL==dumpStackID) {
+ NativewindowCommon_FatalError(env, "FatalError jogamp_nativewindow_windows_GDIUtil: can't get method dumpStack");
+ }
}
return JNI_TRUE;
}
-LRESULT CALLBACK DummyWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+static LRESULT CALLBACK DummyWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
@@ -379,8 +550,8 @@ JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_windows_GDIUtil_GetRelativeLo
JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_IsChild0
(JNIEnv *env, jclass unused, jlong jwin)
{
- HWND hwnd = (HWND) (intptr_t) jwin;
- LONG style = GetWindowLong(hwnd, GWL_STYLE);
+ HWND hWnd = (HWND) (intptr_t) jwin;
+ LONG style = GetWindowLong(hWnd, GWL_STYLE);
BOOL bIsChild = 0 != (style & WS_CHILD) ;
return bIsChild ? JNI_TRUE : JNI_FALSE;
}
@@ -392,34 +563,9 @@ JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_IsChild0
JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_IsUndecorated0
(JNIEnv *env, jclass unused, jlong jwin)
{
- HWND hwnd = (HWND) (intptr_t) jwin;
- LONG style = GetWindowLong(hwnd, GWL_STYLE);
+ HWND hWnd = (HWND) (intptr_t) jwin;
+ LONG style = GetWindowLong(hWnd, GWL_STYLE);
BOOL bIsUndecorated = 0 != (style & (WS_CHILD|WS_POPUP)) ;
return bIsUndecorated ? JNI_TRUE : JNI_FALSE;
}
-/*
- * Class: jogamp_nativewindow_windows_GDIUtil
- * Method: SendCloseMessage
- */
-JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_SendCloseMessage
-(JNIEnv *env, jclass unused, jlong jwin)
-{
- ThreadParam tParam = {0};
- volatile HWND hwnd = (HWND) (intptr_t) jwin;
-
- if( 0 == threadid ) {
- NativewindowCommon_throwNewRuntimeException(env, "Native threadid zero 0x%X", (int)threadid);
- return JNI_FALSE;
- }
-
- tParam.hWnd = hwnd;
- tParam.threadReady = FALSE;
-
- PostThreadMessage(threadid, TM_CLOSEWIN, (WPARAM)&tParam, 0);
-
- while(!tParam.threadReady) { /* nop */ }
-
- return JNI_TRUE;
-}
-
diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
index d8ff7ecb5..c4cfd98b3 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
@@ -51,7 +51,7 @@ public class DisplayDriver extends DisplayImpl {
static {
NEWTJNILibLoader.loadNEWT();
- sharedClassFactory = new RegisteredClassFactory(newtClassBaseName, WindowDriver.getNewtWndProc0());
+ sharedClassFactory = new RegisteredClassFactory(newtClassBaseName, WindowDriver.getNewtWndProc0(), false /* useDummyDispatchThread */);
if (!WindowDriver.initIDs0(RegisteredClassFactory.getHInstance())) {
throw new NativeWindowException("Failed to initialize WindowsWindow jmethodIDs");
--
cgit v1.2.3
From 8512777873461ee33d8ed913ee26bafc00a08a02 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Wed, 4 Dec 2013 07:51:30 +0100
Subject: Bug 919 - TestNewtKeyCodesAWT w/ NewtCanvasAWT Fails on Windows Due
to Clogged Key-Release Event by AWT Robot
Impact: Only unit test code
- TestNewtKeyCodesAWT:
Fix Bug 919 - Move mouse bacl/forth while waiting for events ..
- Use common wait for key timeout/polling using constants in NEWTKeyUtil
- InputEventCountAdapter:
'getQueued()' -> 'copyQueue()' - ensuring queue is copied while instance is locked.
---
make/scripts/tests-win.bat | 4 +-
make/scripts/tests-x64-dbg.bat | 3 +-
make/scripts/tests.sh | 6 +-
src/newt/native/WindowsWindow.c | 4 +-
.../junit/newt/event/BaseNewtEventModifiers.java | 204 ++++++++++-----------
.../newt/event/TestNewtKeyCodeModifiersAWT.java | 4 +-
.../test/junit/newt/event/TestNewtKeyCodesAWT.java | 81 ++++----
.../newt/event/TestNewtKeyEventAutoRepeatAWT.java | 107 ++++++-----
.../junit/newt/event/TestNewtKeyEventOrderAWT.java | 2 +-
.../opengl/test/junit/util/AWTKeyAdapter.java | 6 +-
.../opengl/test/junit/util/AWTMouseAdapter.java | 6 +-
.../opengl/test/junit/util/AWTRobotUtil.java | 32 ++--
.../test/junit/util/InputEventCountAdapter.java | 2 +-
.../opengl/test/junit/util/NEWTKeyAdapter.java | 8 +-
.../jogamp/opengl/test/junit/util/NEWTKeyUtil.java | 70 +++----
.../opengl/test/junit/util/NEWTMouseAdapter.java | 6 +-
16 files changed, 275 insertions(+), 270 deletions(-)
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index d95b0025f..157d06611 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -6,7 +6,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestMainVersion
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestGearsES1NEWT %*
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 4000 -x 10 -y 10 -width 100 -height 100 -screen 0
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 40000 -width 100 -height 100 -screen 0 %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT -time 5000
@@ -117,7 +117,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEven
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodeModifiersAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventAutoRepeatAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyPressReleaseUnmaskRepeatAWT %*
-REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersAWTCanvas %*
REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasAWT %*
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index 3e56a31a6..6e8407f3e 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -21,7 +21,7 @@ set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%
echo CP_ALL %CP_ALL%
REM set D_ARGS="-Djogamp.debug=all"
-set D_ARGS="-Djogl.debug=all" "-Dnativewindow.debug=all"
+REM set D_ARGS="-Djogl.debug=all" "-Dnativewindow.debug=all"
REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug=all" "-Djogl.debug.EGLDrawableFactory.DontQuery"
REM set D_ARGS="-Dnativewindow.debug.GDIUtil" "-Dnativewindow.debug.RegisteredClass"
@@ -57,6 +57,7 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.GLJPanel" "-Djogl.debug.Til
REM set D_ARGS="-Djogl.gljpanel.noverticalflip"
REM set D_ARGS="-Dnewt.debug.Window"
REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
+set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Window.KeyEvent" "-Dnewt.debug.EDT"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 915752bef..7c5fdbb89 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -196,7 +196,7 @@ function jrun() {
#D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT -Djogl.debug.GLContext"
#D_ARGS="-Dnewt.debug.Window -Djogl.debug.Animator -Dnewt.debug.Screen"
#D_ARGS="-Dnativewindow.debug.JAWT -Dnewt.debug.Window"
- #D_ARGS="-Dnewt.debug.Window.KeyEvent"
+ D_ARGS="-Dnewt.debug.Window.KeyEvent"
#D_ARGS="-Dnewt.debug.Window.MouseEvent"
#D_ARGS="-Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent"
#D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug=all"
@@ -325,7 +325,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $*
-testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile00NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
#testawtswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
@@ -569,7 +569,7 @@ testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventOrderAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventAutoRepeatAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyPressReleaseUnmaskRepeatAWT $*
-#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT $*
+testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodeModifiersAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersAWTCanvas $*
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index 18bff1997..dd0150e78 100644
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -487,8 +487,8 @@ static void ParseWmVKeyAndScanCode(USHORT winVKey, BYTE winScanCode, BYTE flags,
*outJavaVKeyXX = javaVKeyXX;
#ifdef DEBUG_KEYS
- STD_PRINT("*** WindowsWindow: ParseWmVKeyAndScanCode winVKey 0x%X, winScanCode 0x%X, winScanCodeExt 0x%X, flags 0x%X -> UTF(0x%X, %c, res %d, sizeof %d), vKeys( US(win 0x%X, java 0x%X), XX(win 0x%X, java 0x%X))\n",
- (int)winVKey, (int)winScanCode, winScanCodeExt, (int)flags,
+ STD_PRINT("*** WindowsWindow: ParseWmVKeyAndScanCode winVKey 0x%X, winScanCode 0x%X, flags 0x%X -> UTF(0x%X, %c, res %d, sizeof %d), vKeys( US(win 0x%X, java 0x%X), XX(win 0x%X, java 0x%X))\n",
+ (int)winVKey, (int)winScanCode, (int)flags,
*outUTF16Char, *outUTF16Char, nUniChars, sizeof(uniChars[0]),
winVKeyUS, javaVKeyUS, winVKey, javaVKeyXX);
#endif
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
index 44d6a2dec..a46e21b23 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event ;
import java.io.PrintStream ;
@@ -66,15 +66,15 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
protected static final int MS_ROBOT_KEY_PRESS_DELAY = 50 ;
protected static final int MS_ROBOT_KEY_RELEASE_DELAY = 50 ;
protected static final int MS_ROBOT_MOUSE_MOVE_DELAY = 200 ;
-
- protected static final int MS_ROBOT_AUTO_DELAY = 50 ;
+
+ protected static final int MS_ROBOT_AUTO_DELAY = 50 ;
protected static final int MS_ROBOT_POST_TEST_DELAY = 100;
-
+
protected static final boolean _debug = true ;
protected static PrintStream _debugPrintStream = System.err ;
-
+
////////////////////////////////////////////////////////////////////////////
-
+
static
{
GLProfile.initSingleton() ;
@@ -96,7 +96,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public synchronized boolean modifierCheckEnabled() {
return _modifierCheckEnabled ;
}
-
+
/**
* Sets the modifiers the listener should expect, and clears
* out any existing accumulated failures. Normally this kind
@@ -108,20 +108,20 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_expectedModifiers = value ;
clear();
}
-
+
public synchronized ArrayList clear() {
ArrayList old = _failures;
-
+
_eventCount = 0;
// Assume we will have a failure due to no event delivery.
// If an event is delivered and it's good this assumed
- // failure will get cleared out.
+ // failure will get cleared out.
_failures = new ArrayList();
_failures.add( NO_EVENT_DELIVERY );
return old;
}
-
+
public ArrayList getFailures(int waitEventCount) {
int j;
for(j=0; j < 20 && _eventCount < waitEventCount; j++) { // wait until events are collected
@@ -132,14 +132,14 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
}
return clear();
}
-
+
private synchronized void _checkModifiers( com.jogamp.newt.event.MouseEvent hasEvent ) {
if( _modifierCheckEnabled ) {
- final MouseEvent expEvent = new MouseEvent(hasEvent.getEventType(), hasEvent.getSource(), hasEvent.getWhen(), _expectedModifiers,
- hasEvent.getX(), hasEvent.getY(), hasEvent.getClickCount(), hasEvent.getButton(),
+ final MouseEvent expEvent = new MouseEvent(hasEvent.getEventType(), hasEvent.getSource(), hasEvent.getWhen(), _expectedModifiers,
+ hasEvent.getX(), hasEvent.getY(), hasEvent.getClickCount(), hasEvent.getButton(),
hasEvent.getRotation(), hasEvent.getRotationScale());
-
+
_checkModifierMask( expEvent, hasEvent, com.jogamp.newt.event.InputEvent.SHIFT_MASK, "shift" ) ;
_checkModifierMask( expEvent, hasEvent, com.jogamp.newt.event.InputEvent.CTRL_MASK, "ctrl" ) ;
_checkModifierMask( expEvent, hasEvent, com.jogamp.newt.event.InputEvent.META_MASK, "meta" ) ;
@@ -180,7 +180,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_eventCount++;
if( _debug ) {
_debugPrintStream.println( "MousePressed "+_eventCount+": "+event);
- }
+ }
_checkModifiers( event ) ;
}
@@ -188,7 +188,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseReleased "+_eventCount+": "+event);
- }
+ }
_checkModifiers( event ) ;
}
@@ -196,29 +196,29 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseDragged "+_eventCount+": "+event);
- }
+ }
_checkModifiers( event ) ;
}
//
- // IGNORED
- //
-
- public synchronized void mouseMoved( com.jogamp.newt.event.MouseEvent event ) {
+ // IGNORED
+ //
+
+ public synchronized void mouseMoved( com.jogamp.newt.event.MouseEvent event ) {
// Ignored, since mouse MOVE doesn't hold mouse button, we look for DRAGGED!
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseMoved ignored: "+event);
- }
+ }
// _checkModifiers( event ) ;
}
-
+
public synchronized void mouseClicked( com.jogamp.newt.event.MouseEvent event ) {
// Ignored, since we look for PRESS/RELEASE only!
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseClicked ignored: "+event);
- }
+ }
// _checkModifiers( event ) ;
}
@@ -226,23 +226,23 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseWheeleMoved ignored: "+event);
- }
+ }
// _checkModifiers( event ) ;
}
-
+
public synchronized void mouseEntered( com.jogamp.newt.event.MouseEvent event ) {
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseEntered ignored: "+event);
- }
+ }
// _checkModifiers( event ) ;
}
-
+
public synchronized void mouseExited( com.jogamp.newt.event.MouseEvent event ) {
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseExited ignored: "+event);
- }
+ }
// _checkModifiers( event ) ;
}
@@ -261,7 +261,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public static int getAWTButtonMask(int button) {
// Java7: java.awt.event.InputEvent.getMaskForButton( n + 1 ) ; -> using InputEvent.BUTTON1_DOWN_MASK .. etc
- // Java6: Only use BUTTON1_MASK, ..
+ // Java6: Only use BUTTON1_MASK, ..
int m;
switch(button) {
case 1 : m = java.awt.event.InputEvent.BUTTON1_MASK; break;
@@ -271,14 +271,14 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
}
return m;
}
-
+
@BeforeClass
public static void baseBeforeClass() throws Exception {
// Who know how many buttons the AWT will say exist on given platform.
// We'll test the smaller of what NEWT supports and what the
// AWT says is available.
- /** Java7:
+ /** Java7:
if( java.awt.Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled() ) {
_numButtonsToTest = java.awt.MouseInfo.getNumberOfButtons() ;
} else {
@@ -300,7 +300,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_numButtonsToTest = 3 ;
{
- if( _numButtonsToTest > com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) {
+ if( _numButtonsToTest > com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) {
_numButtonsToTest = com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ;
}
@@ -309,10 +309,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// either array.
_awtButtonMasks = new int[_numButtonsToTest] ;
-
+
for( int n = 0 ; n < _awtButtonMasks.length ; ++n ) {
_awtButtonMasks[n] = getAWTButtonMask( n + 1 );
- }
+ }
}
_robot = new java.awt.Robot() ;
@@ -326,23 +326,23 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// to run the SWT event dispatch on the TK thread - which must be the main thread on OSX.
// We spawn off the actual test-action into another thread,
// while dispatching the events until the test-action is completed.
- // YES: This is sort of ideal - NOT :)
-
- protected void eventDispatch() {
+ // YES: This is sort of ideal - NOT :)
+
+ protected void eventDispatch() {
try {
Thread.sleep(100);
- } catch (InterruptedException e) { }
+ } catch (InterruptedException e) { }
}
-
+
private void execOffThreadWithOnThreadEventDispatch(Runnable testAction) throws Exception {
- _testMouseListener.setModifierCheckEnabled( false ) ;
+ _testMouseListener.setModifierCheckEnabled( false ) ;
_robot.setAutoDelay( MS_ROBOT_AUTO_DELAY ) ;
- {
+ {
// Make sure all the buttons and modifier keys are released.
clearKeyboadAndMouse();
}
_testMouseListener.setModifierCheckEnabled( true ) ;
-
+
Throwable throwable = null;
// final Object sync = new Object();
final RunnableTask rt = new RunnableTask( testAction, null, true, System.err );
@@ -361,13 +361,13 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
throw new RuntimeException(throwable);
}
// }
- } finally {
+ } finally {
System.err.println("WAIT-till-done: DONE");
- _testMouseListener.setModifierCheckEnabled( false ) ;
+ _testMouseListener.setModifierCheckEnabled( false ) ;
clearKeyboadAndMouse();
}
}
-
+
////////////////////////////////////////////////////////////////////////////
// The approach on all these tests is to tell the test mouse listener what
@@ -390,59 +390,59 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
@Test(timeout=180000) // TO 3 min
public void testSingleButtonPressAndRelease() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
- _doSingleButtonPressAndRelease( 0, 0 );
- } catch (Exception e) { throw new RuntimeException(e); }
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
+ _doSingleButtonPressAndRelease( 0, 0 );
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
@Test(timeout=180000) // TO 3 min
public void testSingleButtonPressAndReleaseWithShift() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_SHIFT, java.awt.event.InputEvent.SHIFT_DOWN_MASK ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
@Test(timeout=180000) // TO 3 min
public void testSingleButtonPressAndReleaseWithCtrl() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_CONTROL, java.awt.event.InputEvent.CTRL_DOWN_MASK ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
/**
* The META and ALT tests get too tied up with functions of the window system on X11,
- * so it's probably best to leave them commented out.
+ * so it's probably best to leave them commented out.
@Test(timeout=180000) // TO 3 min
public void testSingleButtonPressAndReleaseWithMeta() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_META, java.awt.event.InputEvent.META_DOWN_MASK ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
-
+
@Test(timeout=180000) // TO 3 min
public void testSingleButtonPressAndReleaseWithAlt() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_ALT, java.awt.event.InputEvent.ALT_DOWN_MASK ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
*/
- /**
+ /**
* FIXME - not sure yet what's up with ALT_GRAPH. It appears that this
* modifier didn't make it through, so I had to disable this test else it would always fail.
*
@@ -450,11 +450,11 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
* enough to not let this modifier slip through (?).
@Test
public void testSingleButtonPressAndReleaseWithAltGraph() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.InputEvent.ALT_GRAPH_DOWN_MASK ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
*/
@@ -463,31 +463,31 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
@Test(timeout=180000) // TO 3 min
public void testHoldOneButtonAndPressAnother() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doHoldOneButtonAndPressAnother( 0, 0 ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
-
+
@Test(timeout=180000) // TO 3 min
public void testPressAllButtonsInSequence() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doPressAllButtonsInSequence( 0, 0 ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
@Test(timeout=180000) // TO 3 min
public void testSingleButtonClickAndDrag() throws Exception {
- execOffThreadWithOnThreadEventDispatch(new Runnable() {
- public void run() {
- try {
+ execOffThreadWithOnThreadEventDispatch(new Runnable() {
+ public void run() {
+ try {
_doSingleButtonClickAndDrag( 0, 0 ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
} } );
}
@@ -522,7 +522,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
private void _doHoldOneButtonAndPressAnother( final int keyCode, final int keyModifierMask ) throws Exception {
if( _debug ) { _debugPrintStream.println( "\n>>>> _doHoldOneButtonAndPressAnother" ) ; }
-
+
_doKeyPress( keyCode ) ;
for (int n = 0 ; n < _numButtonsToTest ; ++n) {
@@ -533,7 +533,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | awtButtonMask ) ) ;
_robot.mousePress( awtButtonMask ) ;
_checkFailures("mouse-press("+(n+1)+")", 1) ;
-
+
for (int m = 0 ; m < _numButtonsToTest ; ++m) {
if( n != m ) {
@@ -564,12 +564,12 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
private void _doPressAllButtonsInSequence( final int keyCode, final int keyModifierMask ) throws Exception {
if( _debug ) { _debugPrintStream.println( "\n>>>> _doPressAllButtonsInSequence" ) ; }
-
+
_doKeyPress( keyCode ) ;
{
int cumulativeAwtModifiers = 0 ;
-
+
for (int n = 0 ; n < _numButtonsToTest ; ++n) {
cumulativeAwtModifiers |= _awtButtonMasks[n] ;
@@ -586,7 +586,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | cumulativeAwtModifiers ) ) ;
_robot.mouseRelease( _awtButtonMasks[n] ) ;
_checkFailures("mouse-release("+(n+1)+")", 1) ;
-
+
cumulativeAwtModifiers &= ~_awtButtonMasks[n] ;
}
}
@@ -627,7 +627,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_testMouseListener.setModifierCheckEnabled( false ) ;
_robot.mouseMove( INITIAL_MOUSE_X, INITIAL_MOUSE_Y ) ;
- _robot.delay(MS_ROBOT_MOUSE_MOVE_DELAY);
+ _robot.delay(MS_ROBOT_MOUSE_MOVE_DELAY);
_testMouseListener.setModifierCheckEnabled( true ) ;
}
@@ -637,7 +637,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
////////////////////////////////////////////////////////////////////////////
private void _doKeyPress( int keyCode ) {
- AWTRobotUtil.validateAWTEDTIsAlive();
+ AWTRobotUtil.validateAWTEDTIsAlive();
if( keyCode != 0 ) {
boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
_testMouseListener.setModifierCheckEnabled( false ) ;
@@ -686,9 +686,9 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
eventDispatch(); eventDispatch(); eventDispatch();
Thread.sleep( MS_ROBOT_POST_TEST_DELAY ) ;
eventDispatch(); eventDispatch(); eventDispatch();
- _testMouseListener.clear();
+ _testMouseListener.clear();
}
-
+
public void clearKeyboadAndMouse() throws Exception {
// Make sure all modifiers are released, otherwise the user's
// desktop can get locked up (ask me how I know this).
@@ -745,7 +745,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
* @return
* The equivalent NEWT modifiers.
*/
-
+
private int _getNewtModifiersForAwtExtendedModifiers( int awtExtendedModifiers ) {
int mask = 0 ;
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
index 4be819261..2516fc536 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
@@ -186,7 +186,7 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
3 /* press-SI */, 3 /* release-SI */,
0 /* press-AR */, 0 /* release-AR */ );
- final List queue = keyAdapter.getQueued();
+ final List queue = keyAdapter.copyQueue();
int i=0;
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, 0, keyCode, keyCharOnly);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, 0, keyCode, keyCharOnly);
@@ -226,7 +226,7 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
4 /* press-SI */, 4 /* release-SI */,
0 /* press-AR */, 0 /* release-AR */ );
- final List queue = keyAdapter.getQueued();
+ final List queue = keyAdapter.copyQueue();
int i=0;
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, m1m, m1k, KeyEvent.NULL_CHAR);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, m1m|m2m, m2k, KeyEvent.NULL_CHAR);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
index 4778b4feb..71778c611 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event;
import org.junit.After;
@@ -60,7 +60,6 @@ import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
-
import com.jogamp.opengl.test.junit.util.*;
import com.jogamp.opengl.test.junit.util.NEWTKeyUtil.CodeSeg;
@@ -85,35 +84,35 @@ public class TestNewtKeyCodesAWT extends UITestCase {
@AfterClass
public static void release() {
}
-
+
@Before
- public void initTest() {
+ public void initTest() {
}
@After
- public void releaseTest() {
+ public void releaseTest() {
}
-
+
@Test(timeout=180000) // TO 3 min
public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
GLWindow glWindow = GLWindow.create(glCaps);
glWindow.setSize(width, height);
glWindow.setVisible(true);
-
+
testImpl(glWindow);
-
+
glWindow.destroy();
}
-
+
private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
GLWindow glWindow = GLWindow.create(glCaps);
-
+
// Wrap the window in a canvas.
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
if( !onscreen ) {
newtCanvasAWT.setShallUseOffscreenLayer(true);
}
-
+
// Add the canvas to a frame, and make it all visible.
final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -122,11 +121,11 @@ public class TestNewtKeyCodesAWT extends UITestCase {
frame1.setSize(width, height);
frame1.setVisible(true);
} } );
-
+
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame1, true));
-
+
testImpl(glWindow);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -136,10 +135,10 @@ public class TestNewtKeyCodesAWT extends UITestCase {
} catch( Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
glWindow.destroy();
}
-
+
@Test(timeout=180000) // TO 3 min
public void test02NewtCanvasAWT_Onscreen() throws AWTException, InterruptedException, InvocationTargetException {
if( JAWTUtil.isOffscreenLayerRequired() ) {
@@ -148,7 +147,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(true);
}
-
+
@Test(timeout=180000) // TO 3 min
public void test03NewtCanvasAWT_Offsccreen() throws AWTException, InterruptedException, InvocationTargetException {
if( !JAWTUtil.isOffscreenLayerSupported() ) {
@@ -157,7 +156,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(false);
}
-
+
/** Almost all keyCodes reachable w/o modifiers [shift, alt, ..] on US keyboard! */
static CodeSeg[] codeSegments = new CodeSeg[] {
// new CodeSeg(KeyEvent.VK_HOME, KeyEvent.VK_PRINTSCREEN, "home, end, final, prnt"),
@@ -188,16 +187,19 @@ public class TestNewtKeyCodesAWT extends UITestCase {
new CodeSeg(KeyEvent.VK_LEFT, KeyEvent.VK_DOWN, "cursor arrows"),
// new CodeSeg(KeyEvent.VK_WINDOWS, KeyEvent.VK_HELP, "windows, meta, hlp"),
};
-
- static void testKeyCodes(Robot robot, NEWTKeyAdapter keyAdapter) {
+
+ static void testKeyCodes(Robot robot, Object obj, NEWTKeyAdapter keyAdapter) throws InterruptedException, InvocationTargetException {
final List> cse = new ArrayList>();
-
+
+ keyAdapter.setVerbose(true); // FIXME
+ final int[] objCenter = AWTRobotUtil.getCenterLocation(obj, false /* onTitleBarIfWindow */);
+
for(int i=0; i events = new ArrayList(keyAdapter.getQueued());
- cse.add(events);
+ AWTRobotUtil.awtRobotMouseMove(robot, objCenter[0], objCenter[1]); // Bug 919: Reset mouse position
+ cse.add(keyAdapter.copyQueue());
}
- Assert.assertEquals("KeyCode impl. incomplete", true, NEWTKeyUtil.validateKeyCodes(codeSegments, cse, true));
+ Assert.assertEquals("KeyCode impl. incomplete", true, NEWTKeyUtil.validateKeyCodes(codeSegments, cse, true));
}
-
+
void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
@@ -238,20 +243,20 @@ public class TestNewtKeyCodesAWT extends UITestCase {
glWindow1KA.setVerbose(false);
glWindow.addKeyListener(glWindow1KA);
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
// Continuous animation ..
Animator animator = new Animator(glWindow);
animator.start();
Thread.sleep(durationPerTest); // manual testing
-
+
AWTRobotUtil.assertRequestFocusAndWait(null, glWindow, glWindow, null, null); // programmatic
AWTRobotUtil.requestFocus(robot, glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
- glWindow1KA.reset();
+ glWindow1KA.reset();
+
+ testKeyCodes(robot, glWindow, glWindow1KA);
- testKeyCodes(robot, glWindow1KA);
-
// Remove listeners to avoid logging during dispose/destroy.
glWindow.removeKeyListener(glWindow1KA);
@@ -276,7 +281,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine());
+ System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
String tstname = TestNewtKeyCodesAWT.class.getName();
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
index 34e81c033..3ef96edc2 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event;
import org.junit.After;
@@ -59,12 +59,11 @@ import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
-
import com.jogamp.opengl.test.junit.util.*;
/**
* Testing key event order incl. auto-repeat (Bug 601)
- *
+ *
*
* Note Event order:
*
@@ -102,33 +101,33 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
@AfterClass
public static void release() {
}
-
+
@Before
- public void initTest() {
+ public void initTest() {
}
@After
- public void releaseTest() {
+ public void releaseTest() {
}
-
+
@Test(timeout=180000) // TO 3 min
public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
GLWindow glWindow = GLWindow.create(glCaps);
glWindow.setSize(width, height);
glWindow.setVisible(true);
-
+
testImpl(glWindow);
-
+
glWindow.destroy();
}
-
+
@Test(timeout=180000) // TO 3 min
public void test02NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
GLWindow glWindow = GLWindow.create(glCaps);
-
+
// Wrap the window in a canvas.
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
-
+
// Add the canvas to a frame, and make it all visible.
final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -137,11 +136,11 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
public void run() {
frame1.setVisible(true);
} } );
-
+
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame1, true));
-
+
testImpl(glWindow);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -151,15 +150,15 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
} catch( Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
glWindow.destroy();
}
-
+
static void testKeyEventAutoRepeat(Robot robot, NEWTKeyAdapter keyAdapter, int loops, int pressDurationMS) {
System.err.println("KEY Event Auto-Repeat Test: "+loops);
EventObject[][] first = new EventObject[loops][2];
EventObject[][] last = new EventObject[loops][2];
-
+
keyAdapter.reset();
int firstIdx = 0;
for(int i=0; i keyEvents = keyAdapter.copyQueue();
+ Assert.assertTrue("AR Test didn't collect enough key events: required min "+minCodeCount+", received "+(keyAdapter.getQueueSize()-firstIdx)+", "+keyEvents,
keyAdapter.getQueueSize() >= minCodeCount );
- final List keyEvents = keyAdapter.getQueued();
- first[i][0] = (KeyEvent) keyEvents.get(firstIdx+0);
- first[i][1] = (KeyEvent) keyEvents.get(firstIdx+1);
+ first[i][0] = keyEvents.get(firstIdx+0);
+ first[i][1] = keyEvents.get(firstIdx+1);
firstIdx = keyEvents.size() - 2;
- last[i][0] = (KeyEvent) keyEvents.get(firstIdx+0);
- last[i][1] = (KeyEvent) keyEvents.get(firstIdx+1);
+ last[i][0] = keyEvents.get(firstIdx+0);
+ last[i][1] = keyEvents.get(firstIdx+1);
System.err.println("+++ KEY Event Auto-Repeat END Input Loop: "+i);
-
+
// add a pair of normal press/release in between auto-repeat!
firstIdx = keyEvents.size();
AWTRobotUtil.waitForIdle(robot);
AWTRobotUtil.keyPress(0, robot, true, java.awt.event.KeyEvent.VK_B, 10);
AWTRobotUtil.keyPress(0, robot, false, java.awt.event.KeyEvent.VK_B, 250);
AWTRobotUtil.waitForIdle(robot);
- for(int j=0; j < 20 && keyAdapter.getQueueSize() < firstIdx+3; j++) { // wait until events are collected
- robot.delay(100);
+ for(int j=0; j < NEWTKeyUtil.POLL_DIVIDER && keyAdapter.getQueueSize() < firstIdx+3; j++) { // wait until events are collected
+ robot.delay(NEWTKeyUtil.TIME_SLICE);
}
firstIdx = keyEvents.size();
}
// dumpKeyEvents(keyEvents);
- final List keyEvents = keyAdapter.getQueued();
+ final List keyEvents = keyAdapter.copyQueue();
NEWTKeyUtil.validateKeyEventOrder(keyEvents);
-
+
final boolean hasAR = 0 < keyAdapter.getKeyPressedCount(true) ;
-
+
{
final int perLoopSI = 2; // per loop: 1 non AR event and 1 for non AR 'B'
final int expSI, expAR;
@@ -208,48 +207,48 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
expAR = ( keyEvents.size() - expSI*2 ) / 2; // auto-repeat release
} else {
expSI = keyEvents.size() / 2; // all released events
- expAR = 0;
+ expAR = 0;
}
-
- NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
- expSI /* press-SI */, expSI /* release-SI */,
- expAR /* press-AR */, expAR /* release-AR */ );
+
+ NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
+ expSI /* press-SI */, expSI /* release-SI */,
+ expAR /* press-AR */, expAR /* release-AR */ );
}
-
+
if( !hasAR ) {
System.err.println("No AUTO-REPEAT triggered by AWT Robot .. aborting test analysis");
return;
}
-
+
for(int i=0; i getQueued() {
- return queue;
+ public synchronized List copyQueue() {
+ return new ArrayList(queue);
}
public synchronized int getQueueSize() {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
index f6cbd0a04..c1bec79f5 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
@@ -46,7 +46,7 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
reset();
}
- public synchronized void setVerbose(boolean v) { verbose = false; }
+ public synchronized void setVerbose(boolean v) { verbose = v; }
public synchronized boolean isPressed() {
return pressed;
@@ -60,8 +60,8 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
return consumed;
}
- public synchronized List getQueued() {
- return queue;
+ public synchronized List copyQueue() {
+ return new ArrayList(queue);
}
public synchronized int getQueueSize() {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
index 657936adc..cf58ae257 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
@@ -59,9 +59,6 @@ public class AWTRobotUtil {
public static final int TIME_SLICE = TIME_OUT / POLL_DIVIDER ;
public static Integer AWT_CLICK_TO = null;
- static Object awtEDTAliveSync = new Object();
- static volatile boolean awtEDTAliveFlag = false;
-
static class OurUncaughtExceptionHandler implements UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread t, Throwable e) {
@@ -82,12 +79,7 @@ public class AWTRobotUtil {
}
synchronized ( awtEDTAliveSync ) {
awtEDTAliveFlag = false;
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- awtEDTAliveFlag = true;
- }
- });
+ EventQueue.invokeLater(aliveRun);
for (int wait=0; wait getQueued();
+ public List copyQueue();
public int getQueueSize();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
index 5242da637..0e86afd93 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
@@ -51,7 +51,7 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
reset();
}
- public synchronized void setVerbose(boolean v) { verbose = false; }
+ public synchronized void setVerbose(boolean v) { verbose = v; }
public synchronized boolean isPressed() {
return pressed;
@@ -73,8 +73,8 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
return autoRepeatOnly ? keyReleasedAR: keyReleased;
}
- public synchronized List getQueued() {
- return queue;
+ public synchronized List copyQueue() {
+ return new ArrayList(queue);
}
public synchronized int getQueueSize() {
@@ -118,6 +118,6 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
}
}
- public String toString() { return prefix+"[pressed "+pressed+", keyReleased "+keyReleased+", consumed "+consumed+"]"; }
+ public String toString() { return prefix+"[pressed "+pressed+", keysPressed "+keyPressed+" (AR "+keyPressedAR+"), keyReleased "+keyReleased+" (AR "+keyReleasedAR+"), consumed "+consumed+"]"; }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
index 990930994..89bafbd8c 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -37,11 +37,15 @@ import com.jogamp.common.util.IntIntHashMap;
import com.jogamp.newt.event.KeyEvent;
public class NEWTKeyUtil {
+ public static final int TIME_OUT = 2000; // 2s
+ public static final int POLL_DIVIDER = 20; // TO/20
+ public static final int TIME_SLICE = TIME_OUT / POLL_DIVIDER ;
+
public static class CodeSeg {
public final short min;
public final short max;
public final String description;
-
+
public CodeSeg(int min, int max, String description) {
this.min = (short)min;
this.max = (short)max;
@@ -52,23 +56,23 @@ public class NEWTKeyUtil {
public final short code;
public final String description;
public final KeyEvent event;
-
+
public CodeEvent(short code, String description, KeyEvent event) {
this.code = code;
this.description = description;
this.event = event;
}
public String toString() {
- return "Code 0x"+Integer.toHexString( (int)code & 0x0000FFFF )+" != "+event+" // "+description;
+ return "Code 0x"+Integer.toHexString( code & 0x0000FFFF )+" != "+event+" // "+description;
}
}
-
+
public static void dumpKeyEvents(List keyEvents) {
for(int i=0; i> keyEventsList, boolean verbose) {
final List missCodes = new ArrayList();
int totalCodeCount = 0;
@@ -78,7 +82,7 @@ public class NEWTKeyUtil {
totalCodeCount += codeSeg.max - codeSeg.min + 1;
final List keyEvents = keyEventsList.get(i);
res &= validateKeyCodes(missCodes, codeSeg, keyEvents, verbose);
- }
+ }
if(verbose) {
System.err.println("*** Total KeyCode Misses "+missCodes.size()+" / "+totalCodeCount+", valid "+res);
for(int i=0; i keyEvents) {
- IntIntHashMap keyCode2NextEvent = new IntIntHashMap();
+ IntIntHashMap keyCode2NextEvent = new IntIntHashMap();
for(int i=0; i keyEvents = keyAdapter.getQueued();
-
+
+ final List keyEvents = keyAdapter.copyQueue();
+
Assert.assertEquals("Key pressRelease count failure (ALL) w/ list sum ", expPressReleaseCountALL, pressReleaseCountALL);
Assert.assertEquals("Key total count failure (ALL) w/ list size ", pressReleaseCountALL, keyEvents.size());
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
index 6850fcf47..22e241f71 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
@@ -49,7 +49,7 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
reset();
}
- public synchronized void setVerbose(boolean v) { verbose = false; }
+ public synchronized void setVerbose(boolean v) { verbose = v; }
public synchronized boolean isPressed() {
return pressed;
@@ -63,8 +63,8 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
return consumed;
}
- public synchronized List getQueued() {
- return queue;
+ public synchronized List copyQueue() {
+ return new ArrayList(queue);
}
public synchronized int getQueueSize() {
--
cgit v1.2.3
From e7ffa68bce9bb707005be72530b207c732f62c31 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Tue, 31 Dec 2013 08:14:21 +0100
Subject: Bug 934, Bug 935: NEWT: Add support for custom Application/Window and
Pointer Icons
- Utilizing JOGL's PNG decoder for all icons, if available.
- Application/window icons:
- Providing default application/window icons in 16x16 and 32x32 size
- NewtFactory.setWindowIcons(..) or property 'newt.window.icons' maybe used to override default icons.
- Using icons at application/window instantiation
- Display.PointerIcons:
- NativeWindow Win32 WindowClass no more references a default cursor
in favor of fine grained cursor control [in NEWT]
- Display provides create/destroy methods,
where display destruction also releases open PointerIcon references.
- Window.setPointerIcon(..) sets custom PointerIcon
- Implemented Platforms
- X11
- Windows
- OSX
- Manual Test: TestGearsES2NEWT (Press 'c')
---
make/build-jogl.xml | 2 +-
make/build-newt.xml | 12 +-
.../resources/assets-test/jogamp-pointer-64x64.png | Bin 0 -> 2843 bytes
make/resources/assets/newt/data/jogamp-16x16.png | Bin 0 -> 549 bytes
make/resources/assets/newt/data/jogamp-32x32.png | Bin 0 -> 1020 bytes
make/resources/misc/jogamp-48x48.png | Bin 0 -> 1278 bytes
make/resources/misc/jogamp-64x64.png | Bin 0 -> 1833 bytes
make/scripts/tests-win.bat | 4 +-
make/scripts/tests-x64-dbg.bat | 3 +-
make/scripts/tests.sh | 5 +-
src/nativewindow/native/win32/GDImisc.c | 2 +-
src/newt/classes/com/jogamp/newt/Display.java | 50 +++++++-
src/newt/classes/com/jogamp/newt/NewtFactory.java | 33 +++++
src/newt/classes/com/jogamp/newt/Window.java | 15 +++
.../classes/com/jogamp/newt/opengl/GLWindow.java | 11 ++
src/newt/classes/jogamp/newt/DisplayImpl.java | 68 +++++++++-
src/newt/classes/jogamp/newt/WindowImpl.java | 22 ++++
src/newt/classes/jogamp/newt/driver/PNGIcon.java | 102 +++++++++++++++
.../jogamp/newt/driver/macosx/DisplayDriver.java | 51 ++++++++
.../jogamp/newt/driver/macosx/WindowDriver.java | 11 ++
.../jogamp/newt/driver/opengl/JoglUtilPNGIcon.java | 139 +++++++++++++++++++++
.../jogamp/newt/driver/windows/DisplayDriver.java | 38 ++++++
.../jogamp/newt/driver/windows/WindowDriver.java | 56 +++++++--
.../jogamp/newt/driver/x11/DisplayDriver.java | 46 +++++++
.../jogamp/newt/driver/x11/WindowDriver.java | 51 +++++++-
src/newt/native/MacWindow.m | 73 ++++++++++-
src/newt/native/NewtMacWindow.h | 4 +-
src/newt/native/NewtMacWindow.m | 41 ++++--
src/newt/native/WindowsWindow.c | 115 ++++++++++++++++-
src/newt/native/X11Display.c | 52 ++++++++
src/newt/native/X11Window.c | 35 +++++-
.../jogl/demos/es2/newt/TestGearsES2NEWT.java | 29 ++++-
32 files changed, 1027 insertions(+), 43 deletions(-)
create mode 100644 make/resources/assets-test/jogamp-pointer-64x64.png
create mode 100644 make/resources/assets/newt/data/jogamp-16x16.png
create mode 100644 make/resources/assets/newt/data/jogamp-32x32.png
create mode 100644 make/resources/misc/jogamp-48x48.png
create mode 100644 make/resources/misc/jogamp-64x64.png
create mode 100644 src/newt/classes/jogamp/newt/driver/PNGIcon.java
create mode 100644 src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java
(limited to 'make/scripts/tests-x64-dbg.bat')
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index 28b738b10..4cdb93f4d 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -1833,7 +1833,7 @@
-
+
+ value="com/jogamp/newt/opengl/** jogamp/newt/driver/opengl/**"/>
@@ -277,12 +277,14 @@
+