diff -Nru openscenegraph-3.2.1/debian/changelog openscenegraph-3.2.3+dfsg1/debian/changelog --- openscenegraph-3.2.1/debian/changelog 2015-12-03 11:37:44.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/changelog 2017-11-05 14:55:22.000000000 +0000 @@ -1,88 +1,98 @@ -openscenegraph (3.2.1-7ubuntu4) xenial; urgency=medium +openscenegraph (3.2.3+dfsg1-1~xenial6) xenial; urgency=medium - * No-change rebuild for new gdal + * No change rebuild for GDAL 2.2.2 transition. - -- Iain Lane Thu, 03 Dec 2015 11:37:44 +0000 + -- Angelos Tzotsos Sun, 05 Nov 2017 15:00:00 +0200 -openscenegraph (3.2.1-7ubuntu3) xenial; urgency=medium +openscenegraph (3.2.3+dfsg1-1~xenial5) xenial; urgency=medium - * Build using giflib5. + * No change rebuild for GDAL 2.2.1 transition. - -- Matthias Klose Tue, 27 Oct 2015 05:06:12 +0000 + -- Angelos Tzotsos Tue, 25 Jul 2017 19:00:00 +0200 -openscenegraph (3.2.1-7ubuntu2) xenial; urgency=medium +openscenegraph (3.2.3+dfsg1-1~xenial4) xenial; urgency=medium - * No-change rebuild for giflib soname bump. + * No change rebuild for GDAL 2.2.0 transition. - -- Matthias Klose Tue, 27 Oct 2015 03:52:17 +0000 + -- Angelos Tzotsos Fri, 02 Jun 2017 19:00:00 +0200 -openscenegraph (3.2.1-7ubuntu1) wily; urgency=low +openscenegraph (3.2.3+dfsg1-1~xenial3) xenial; urgency=medium - [ Ubuntu Merge-o-Matic ] - * Merge from Debian unstable. Remaining changes: - - Add support for building on armhf by building with OpenGL ES 2.0. - - Backport part of a commit to not build osgframerenderer example. - - Add change-typedef.patch to fix conflicting typedefs for GLdouble with - OpenGL ES 2.0. - - Exclude freeglut3-dev from dependencies for armhf. - - Change Depends of libopenscenegraph-dev for armhf from libgl1-mesa- - dev to libgles2-mesa-dev. - - Re-add a copy of the xine_xmalloc_aligned function, removed in - newer upstream versions. - * Dropped changes, included in Debian: - - Rename libopenscenegraph100 to -v5 for gcc5 transition + * No change rebuild for libtiff5 transition. - -- Steve Langasek Tue, 01 Sep 2015 10:08:08 -0700 + -- Angelos Tzotsos Tue, 28 Mar 2017 20:00:00 +0200 -openscenegraph (3.2.1-7) unstable; urgency=medium +openscenegraph (3.2.3+dfsg1-1~xenial2) xenial; urgency=medium - [ Martin Pitt ] - * Rename libopenscenegraph100 to -v5 for gcc5 transition (Closes: #791231) - Note that libopenthreads20 can keep its name, its symbols don't change - under g++ 5. + * Rebuild for GDAL 2.1.3. - -- Manuel A. Fernandez Montecelo Sun, 30 Aug 2015 15:13:43 +0100 + -- Angelos Tzotsos Fri, 03 Feb 2017 14:00:00 +0200 -openscenegraph (3.2.1-6ubuntu5) wily; urgency=medium +openscenegraph (3.2.3+dfsg1-1~xenial1) xenial; urgency=medium - * No-change rebuild against libgdal1i + * Rebuild for GDAL 2.1.2. - -- Steve Langasek Sun, 23 Aug 2015 01:22:19 +0000 + -- Angelos Tzotsos Tue, 20 Dec 2016 21:00:00 +0200 -openscenegraph (3.2.1-6ubuntu4) wily; urgency=medium +openscenegraph (3.2.3+dfsg1-1~xenial0) xenial; urgency=medium - * No-change rebuild against libcoin80v5. + * Rebuild for GDAL 2.1.0. - -- Martin Pitt Wed, 12 Aug 2015 08:39:56 +0200 + -- Angelos Tzotsos Mon, 09 May 2016 23:04:00 +0200 -openscenegraph (3.2.1-6ubuntu3) wily; urgency=medium +openscenegraph (3.2.3+dfsg1-1) unstable; urgency=medium - * Rename libopenscenegraph100 to -v5 for gcc5 transition (Closes: #791231) - Note that libopenthreads20 can keep its name, its symbols don't change - under g++ 5. + * Remove jasper dependency (Closes: #818211). + * Fixed source retrieval rule when using DFSG versions. + * Imported Upstream version 3.2.3+dfsg1 + + -- Alberto Luaces Fernández Tue, 22 Mar 2016 16:25:39 +0100 - -- Martin Pitt Thu, 30 Jul 2015 16:46:56 +0200 +openscenegraph (3.2.2+dfsg1-1) unstable; urgency=medium -openscenegraph (3.2.1-6ubuntu2) wily; urgency=medium + * Updated to new stable release (Closes: #814555). + * Debug packages are now generated automatically (Closes: #775368). + * Fixed my name in uploaders so lintian no longer triggers a warning + about NMUs. + * Fix doxygen configuration when reading header files. + * De-embed copies of jquery.js found on doxygen configuration. + * Update Vcs-Browser URL in debian/control. + * Update debian/copyright file. + * Fix FTBFS with ffmpeg 2.9 (Closes: #803849). Thanks to Andreas + Cadhalpun. + -- Alberto Luaces Fernández Fri, 11 Mar 2016 21:12:21 +0000 + +openscenegraph (3.2.1-9) unstable; urgency=medium + + * Added a compatibility fix for building with giflib5. Thanks + Sebastiaan Couwenberg and Matthias Klose. (Closes: 803300) + + * Modified debian/rules to set HTML_TIMESTAMP=NO for doxygen to make the + package reproducible. Thanks to Maria Valentina Marin (Closes: + 789264) + + -- Alberto Luaces Fernández Sat, 19 Dec 2015 11:16:24 +0100 + +openscenegraph (3.2.1-8) unstable; urgency=medium + + * Adding upstream patch for GDAL 2.0 support, needed by upcoming + transition. Thanks to Bas Couwenberg. (Closes: 802266) + + [ Matthias Klose ] * Re-add a copy of the xine_xmalloc_aligned function, removed in - newer upstream versions. + newer upstream versions. (Closes: 792320) - -- Matthias Klose Mon, 13 Jul 2015 22:28:18 +0200 + -- Alberto Luaces Fernández Mon, 19 Oct 2015 13:51:23 +0200 -openscenegraph (3.2.1-6ubuntu1) wily; urgency=medium +openscenegraph (3.2.1-7) unstable; urgency=medium - * Merge with Debian; remaining changes: - - Add support for building on armhf by building with OpenGL ES 2.0. - - Backport part of a commit to not build osgframerenderer example. - - Add change-typedef.patch to fix conflicting typedefs for GLdouble with - OpenGL ES 2.0. - - Exclude freeglut3-dev from dependencies for armhf. - - Change Depends of libopenscenegraph-dev for armhf from libgl1-mesa- - dev to libgles2-mesa-dev. - * Build using GCC 5. + [ Martin Pitt ] + * Rename libopenscenegraph100 to -v5 for gcc5 transition (Closes: #791231) + Note that libopenthreads20 can keep its name, its symbols don't change + under g++ 5. - -- Matthias Klose Mon, 13 Jul 2015 20:49:12 +0200 + -- Manuel A. Fernandez Montecelo Sun, 30 Aug 2015 15:13:43 +0100 openscenegraph (3.2.1-6) unstable; urgency=medium @@ -93,25 +103,6 @@ -- Alberto Luaces Fernández Wed, 04 Feb 2015 18:27:21 +0100 -openscenegraph (3.2.1-5ubuntu2) vivid; urgency=medium - - * No-change rebuild for the libgdal-dev 1.11.2 transition. - - -- Adam Conrad Wed, 18 Mar 2015 01:06:09 -0600 - -openscenegraph (3.2.1-5ubuntu1) vivid; urgency=medium - - * Resynchronise with Debian. Remaining changes: - - Add support for building on armhf by building with OpenGL ES 2.0. - - Backport part of a commit to not build osgframerenderer example. - - Add change-typedef.patch to fix conflicting typedefs for GLdouble with - OpenGL ES 2.0. - - Exclude freeglut3-dev from dependencies for armhf. - - Change Depends of libopenscenegraph-dev for armhf from libgl1-mesa- - dev to libgles2-mesa-dev. - - -- Colin Watson Tue, 02 Dec 2014 16:00:21 +0000 - openscenegraph (3.2.1-5) unstable; urgency=medium * Update fix for correctly loading plugins on platforms other than amd64. @@ -157,30 +148,6 @@ -- Alberto Luaces Fernández Fri, 01 Aug 2014 20:41:55 +0200 -openscenegraph (3.2.0~rc1-5.1ubuntu3) utopic; urgency=medium - - * Rebuild against libav11. - - -- Colin Watson Fri, 05 Sep 2014 02:02:24 +0100 - -openscenegraph (3.2.0~rc1-5.1ubuntu2) utopic; urgency=low - - * Change Depends of libopenscenegraph-dev for armhf from libgl1-mesa- - dev to libgles2-mesa-dev (LP: #1363529) - - -- Saikrishna Arcot Sat, 30 Aug 2014 19:51:40 -0400 - -openscenegraph (3.2.0~rc1-5.1ubuntu1) utopic; urgency=low - - * Add support for building on armhf by building with OpenGL ES 2.0 - (LP: #1284190). - * Backport part of a commit to not build osgframerenderer example. - * Add change-typedef.patch to fix conflicting typedefs for GLdouble - with OpenGL ES 2.0 - * Exclude freeglut3-dev from dependencies for armhf - - -- Saikrishna Arcot Wed, 06 Aug 2014 17:41:46 -0500 - openscenegraph (3.2.0~rc1-5.1) unstable; urgency=low * Non-maintainer upload. diff -Nru openscenegraph-3.2.1/debian/control openscenegraph-3.2.3+dfsg1/debian/control --- openscenegraph-3.2.1/debian/control 2015-10-27 03:53:12.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/control 2016-03-22 16:18:20.000000000 +0000 @@ -1,10 +1,9 @@ Source: openscenegraph Section: devel Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Loic Dachary (OuoU) -Uploaders: Manuel A. Fernandez Montecelo , Alberto Luaces , Ola Lundqvist -Build-Depends: debhelper (>= 7.0.0), +Maintainer: Loic Dachary (OuoU) +Uploaders: Manuel A. Fernandez Montecelo , Alberto Luaces Fernández , Ola Lundqvist +Build-Depends: debhelper (>= 7.0.50), dpkg-dev (>= 1.16.1~), cmake, g++ (>= 3.3.0), @@ -17,14 +16,11 @@ libfreetype6-dev, libpng-dev, libcoin80-dev, - libjasper-dev, - libgdal-dev (>= 1.11.2+dfsg-3ubuntu4), + libgdal-dev, libx11-dev, libxmu-dev, - freeglut3-dev [!armhf], - libgl1-mesa-dev [!armhf] | libgl-dev [!armhf], - libegl1-mesa-dev [armhf], - libgles2-mesa-dev [armhf], + freeglut3-dev, + libgl1-mesa-dev | libgl-dev, libxine2-dev, libavcodec-dev, libswscale-dev, @@ -37,7 +33,7 @@ Standards-Version: 3.9.6 Homepage: http://www.openscenegraph.org/ Vcs-Git: https://alioth.debian.org/anonscm/git/pkg-osg/pkg-osg.git -Vcs-Browser: https://alioth.debian.org/scm/browser.php?group_id=100578 +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-osg/pkg-osg.git Package: libopenthreads-dev Section: libdevel @@ -69,8 +65,7 @@ Architecture: any Depends: ${misc:Depends}, libopenthreads-dev, - libgl1-mesa-dev [!armhf] | libgl-dev [!armhf], - libgles2-mesa-dev [armhf], + libgl1-mesa-dev | libgl-dev, libglu-dev, libopenscenegraph100v5 (= ${binary:Version}) Suggests: openscenegraph-doc, @@ -107,7 +102,7 @@ Package: openscenegraph-doc Section: doc Architecture: all -Depends: ${misc:Depends} +Depends: ${misc:Depends}, libjs-jquery Description: 3D scene graph, documentation A portable, high level graphics toolkit for the development of high performance graphics applications such as flight simulators, games, virtual reality or diff -Nru openscenegraph-3.2.1/debian/copyright openscenegraph-3.2.3+dfsg1/debian/copyright --- openscenegraph-3.2.1/debian/copyright 2015-09-01 00:16:09.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/copyright 2016-03-22 16:17:23.000000000 +0000 @@ -11,10 +11,211 @@ which provide a clear statement that distribution with proprietary applications is accepted. -Files: OpenSceneGraph/examples/osgAndroidExampleGLES2/src/osg/AndroidExample/EGLview.java +Files: OpenSceneGraph/examples/osgAndroidExampleGLES* Copyright: 2008, The Android Open Source Project License: Apache-2.0 +Files: OpenSceneGraph/src/osgUtil/tripstripper/* + OpenSceneGraph/src/osg/dxtctool.* + OpenSceneGraph/src/osgPlugins/zip/* + OpenSceneGraph/src/osgPlugins/txp/* +Copyright: 2002, Tanguy Fautré + 2009, Neil Hughes + 2002, Boris Bralo +License: zlib + +Files: OpenSceneGraph/src/osgPlugins/RestHttpDevice/* +Copyright: 2003-2011 Christopher M. Kohlhoff +License: BSL-1.0 + +Files: OpenSceneGraph/src/osg/GLStaticLibrary.h + OpenSceneGraph/src/osg/StateAttribute.cpp + OpenSceneGraph/src/osg/GLStaticLibrary.cpp + OpenSceneGraph/src/osg/Program.cpp + OpenSceneGraph/src/osg/GL2Extensions.cpp + OpenSceneGraph/src/osg/Uniform.cpp + OpenSceneGraph/src/osg/Shader.cpp + OpenSceneGraph/include/osgDB/PluginQuery + OpenSceneGraph/include/osg/Program + OpenSceneGraph/include/osg/Shader + OpenSceneGraph/include/osg/GL2Extensions + OpenSceneGraph/include/osg/Uniform + OpenSceneGraph/applications/osgarchive/osgarchive.cpp + OpenSceneGraph/applications/osgviewer/osgviewer.cpp + OpenSceneGraph/applications/osgfilecache/osgfilecache.cpp + OpenSceneGraph/examples/osgdatabaserevisions/osgdatabaserevisions.cpp + OpenSceneGraph/examples/osgscreencapture/osgscreencapture.cpp + OpenSceneGraph/examples/osgshadergen/osgshadergen.cpp + OpenSceneGraph/examples/osgatomiccounter/osgatomiccounter.cpp + OpenSceneGraph/examples/osguserstats/osguserstats.cpp +Copyright: 2015, Robert Osfield +License: Free_use + +Files: OpenSceneGraph/src/osgPlugins/cfg/FlexLexer.h +Copyright: 2007, Cedric Pinson +License: BSD + +Files: OpenSceneGraph/src/osgPlugins/xine/* + OpenSceneGraph/src/osgPlugins/cfg/* + OpenSceneGraph/src/osgPlugins/sdl/* + OpenSceneGraph/src/osgPlugins/quicktime/* + OpenSceneGraph/src/osgPlugins/md2/anorms.h + OpenSceneGraph/src/osgPlugins/vrml/* + OpenSceneGraph/src/osgPresentation/* + OpenSceneGraph/include/osgPresentation/* + OpenSceneGraph/applications/present3D/* + OpenSceneGraph/examples/osganimationviewer/* +Copyright: 2015, Robert Osfield +License: GPL-2 + +Files: OpenSceneGraph/src/osgPlugins/pov/* + OpenSceneGraph/src/osgPlugins/Inventor/* + OpenSceneGraph/examples/osgsimplegl3/* +License: public-domain for using and distributing for any purpose + +Files: OpenSceneGraph/src/osgPlugins/hdr/* + OpenSceneGraph/src/osgPlugins/ply/* + OpenSceneGraph/src/osgPlugins/lwo/* + OpenSceneGraph/src/osgPlugins/3ds/* + OpenSceneGraph/src/osgPlugins/x/* + OpenSceneGraph/include/osgAnimation/Vec3Packed +Copyright: 2004, Mekensleep + 2007, Tobias Wolf + 2005-2007, Stefan Eilemann + 1994, The Board of Trustees of The Leland Stanford + 2007, Tobias Wolf + 2002, Pavel Moloshtan + 2004, Marco Jez + 1996-2008, Jan Eric Kyprianidis + 2002, Ulrich Hertlein + 2001, 2002 Bruno 'Beosil' Heidelberger +License: LGPL + +Files: OpenSceneGraph/src/osgUtil/PerlinNoise.cpp + OpenSceneGraph/include/osgUtil/PerlinNoise + OpenSceneGraph/src/osgPlugins/osc/* + OpenSceneGraph/src/osg/glu/* + OpenSceneGraph/src/osgViewer/Keystone.cpp + OpenSceneGraph/examples/osgoscdevice/* + OpenSceneGraph/examples/osgfadetext/* + OpenSceneGraph/examples/osghud/* + OpenSceneGraph/examples/osgviewerSDL/* + OpenSceneGraph/examples/osgshape/* + OpenSceneGraph/examples/osgtext3D/* + OpenSceneGraph/examples/osgspacewarp/* + OpenSceneGraph/examples/osgkeystone/* + OpenSceneGraph/examples/osgprerender/* + OpenSceneGraph/examples/osgclip/* + OpenSceneGraph/examples/osgsimulation/* + OpenSceneGraph/examples/osgcubemap/* + OpenSceneGraph/examples/osgdepthpartition/* + OpenSceneGraph/examples/osgcatch/* + OpenSceneGraph/examples/osgcamera/* + OpenSceneGraph/examples/osgcluster/* + OpenSceneGraph/examples/osgpackeddepthstencil/* + OpenSceneGraph/examples/osgfxbrowser/* + OpenSceneGraph/examples/osgmultiviewpaging/* + OpenSceneGraph/examples/osgrobot/* + OpenSceneGraph/examples/osghangglide/* + OpenSceneGraph/examples/osglauncher/* + OpenSceneGraph/examples/osgstereoimage/* + OpenSceneGraph/examples/osgdelaunay/* + OpenSceneGraph/examples/osgshaders/* + OpenSceneGraph/examples/osgbillboard/* + OpenSceneGraph/examples/osgspheresegment/* + OpenSceneGraph/examples/osgpoints/* + OpenSceneGraph/examples/osggameoflife/* + OpenSceneGraph/examples/osgprecipitation/* + OpenSceneGraph/examples/osgparticle/* + OpenSceneGraph/examples/osgmultitexture/* + OpenSceneGraph/examples/osgshadow/terrain_* + OpenSceneGraph/examples/osgpointsprite/* + OpenSceneGraph/examples/osgintersection/* + OpenSceneGraph/examples/osgoccluder/* + OpenSceneGraph/examples/osgthreadedterrain/* + OpenSceneGraph/examples/osgvertexattributes/* + OpenSceneGraph/examples/osgqfont/* + OpenSceneGraph/examples/osgmultitexturecontrol/* + OpenSceneGraph/examples/osgblendequation/* + OpenSceneGraph/examples/osgreflect/* + OpenSceneGraph/examples/osgkeyboardmouse/* + OpenSceneGraph/examples/osgkdtree/* + OpenSceneGraph/examples/osglight/* + OpenSceneGraph/examples/osgsharedarray/* + OpenSceneGraph/examples/osgsidebyside/* + OpenSceneGraph/examples/osglogicop/* + OpenSceneGraph/examples/osgfpdepth/* + OpenSceneGraph/examples/osgmultitouch/* + OpenSceneGraph/examples/osggeometry/* + OpenSceneGraph/examples/osgmultiplerendertargets/* + OpenSceneGraph/examples/osgposter/* + OpenSceneGraph/examples/osgvolume/* + OpenSceneGraph/examples/osgimpostor/* + OpenSceneGraph/examples/osgscalarbar/* + OpenSceneGraph/examples/osgshadercomposition/* + OpenSceneGraph/examples/osggraphicscost/* + OpenSceneGraph/examples/osgmanipulator/* + OpenSceneGraph/examples/osgdistortion/* + OpenSceneGraph/examples/osgimagesequence/* + OpenSceneGraph/examples/osgparametric/* + OpenSceneGraph/examples/osganalysis/* + OpenSceneGraph/examples/osgpagedlod/* + OpenSceneGraph/examples/osgscribe/* + OpenSceneGraph/examples/osgcompositeviewer/* + OpenSceneGraph/examples/osgtexturerectangle/* + OpenSceneGraph/examples/osganimate/* + OpenSceneGraph/examples/osgmultiplemovies/* + OpenSceneGraph/examples/osgmotionblur/* + OpenSceneGraph/examples/osgcallback/* + OpenSceneGraph/examples/osgdrawinstanced/* + OpenSceneGraph/examples/osgoit/* + OpenSceneGraph/examples/osgtexturecompression/* + OpenSceneGraph/examples/osgteapot/* + OpenSceneGraph/examples/osgparticleshader/* + OpenSceneGraph/examples/osglogo/* + OpenSceneGraph/examples/osgsequence/* + OpenSceneGraph/examples/* + OpenSceneGraph/examples/osgocclusionquery/* + OpenSceneGraph/examples/osgphotoalbum/* + OpenSceneGraph/examples/osgviewerCocoa/* + OpenSceneGraph/examples/osggpx/* + OpenSceneGraph/examples/osgtexture2D/* + OpenSceneGraph/examples/osguserdata/* + OpenSceneGraph/examples/osgprerendercubemap/* + OpenSceneGraph/examples/osgmovie/* + OpenSceneGraph/examples/osgcopy/* + OpenSceneGraph/examples/osgtexture3D/* + OpenSceneGraph/examples/osgcomputeshaders/* + OpenSceneGraph/examples/osgviewerFLTK/* + OpenSceneGraph/examples/osglightpoint/* + OpenSceneGraph/examples/osgQtWidgets/* + OpenSceneGraph/examples/osgQtBrowser/* + OpenSceneGraph/examples/osgtext/* + OpenSceneGraph/examples/osgparticleeffects/* + OpenSceneGraph/examples/osgkeyboard/* + OpenSceneGraph/examples/osgvertexprogram/* + OpenSceneGraph/examples/osgautotransform/* + OpenSceneGraph/examples/osgpick/* + OpenSceneGraph/examples/osgslice/* + OpenSceneGraph/examples/osgsimplifier/* + OpenSceneGraph/examples/osgunittests/* + OpenSceneGraph/examples/osgspotlight/* + OpenSceneGraph/examples/osgtexture1D/* + OpenSceneGraph/examples/osgterrain/* + OpenSceneGraph/examples/osgshaderterrain/* + OpenSceneGraph/examples/osgsimpleshaders/* + OpenSceneGraph/examples/osgwindows/* + OpenSceneGraph/examples/osgmemorytest/* + OpenSceneGraph/examples/osgtessellate/* + OpenSceneGraph/examples/osgforest/* + OpenSceneGraph/examples/osgstereomatch/* +Copyright: 2002-2014, Robert Osfield +License: MIT + +Files: OpenSceneGraph/src/osgPlugins/dae/* +Copyright: 2006, Andrew Lorino and Mike Weiblen +License: SCEA Shared Source License 1.0 + License: OSGPL OpenSceneGraph Public License, Version 0.0 ========================================== @@ -61,8 +262,8 @@ . You should have received a copy of the GNU Library General Public Licence along with this software, usually in a file named COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA. + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. . EXCEPTION NOTICE . @@ -94,3 +295,198 @@ License: Apache-2.0 Found in /usr/share/common-licenses/Apache-2.0 + +License: SCEA Shared Source License 1.0 + SCEA SHARED SOURCE LICENSE 1.0 + . + TERMS AND CONDITIONS: + . + 1. DEFINITIONS: + . + "SOFTWARE" SHALL MEAN THE SOFTWARE AND RELATED DOCUMENTATION, WHETHER IN SOURCE OR OBJECT FORM, MADE AVAILABLE UNDER THIS SCEA SHARED SOURCE + LICENSE ("LICENSE"), THAT IS INDICATED BY A COPYRIGHT NOTICE FILE INCLUDED IN THE SOURCE FILES OR ATTACHED OR ACCOMPANYING THE SOURCE FILES. + . + "LICENSOR" SHALL MEAN SONY COMPUTER ENTERTAINMENT AMERICA, INC. (HEREIN "SCEA") + . + "OBJECT CODE" OR "OBJECT FORM" SHALL MEAN ANY FORM THAT RESULTS FROM TRANSLATION OR TRANSFORMATION OF SOURCE CODE, INCLUDING BUT NOT LIMITED + TO COMPILED OBJECT CODE OR CONVERSIONS TO OTHER FORMS INTENDED FOR MACHINE EXECUTION. + . + "SOURCE CODE" OR "SOURCE FORM" SHALL HAVE THE PLAIN MEANING GENERALLY ACCEPTED IN THE SOFTWARE INDUSTRY, INCLUDING BUT NOT LIMITED TO SOFTWARE + SOURCE CODE, DOCUMENTATION SOURCE, HEADER AND CONFIGURATION FILES. + . + "YOU" OR "YOUR" SHALL MEAN YOU AS AN INDIVIDUAL OR AS A COMPANY, OR WHICHEVER FORM UNDER WHICH YOU ARE EXERCISING RIGHTS UNDER THIS LICENSE. + . + 2. LICENSE GRANT. + . + LICENSOR HEREBY GRANTS TO YOU, FREE OF CHARGE SUBJECT TO THE TERMS AND CONDITIONS OF THIS LICENSE, AN IRREVOCABLE, NON-EXCLUSIVE, WORLDWIDE, + PERPETUAL, AND ROYALTY-FREE LICENSE TO USE, MODIFY, REPRODUCE, DISTRIBUTE, PUBLICLY PERFORM OR DISPLAY THE SOFTWARE IN OBJECT OR SOURCE FORM . + . + 3. NO RIGHT TO FILE FOR PATENT. + . + IN EXCHANGE FOR THE RIGHTS THAT ARE GRANTED TO YOU FREE OF CHARGE UNDER THIS LICENSE, YOU AGREE THAT YOU WILL NOT FILE FOR ANY PATENT + APPLICATION, SEEK COPYRIGHT PROTECTION OR TAKE ANY OTHER ACTION THAT MIGHT OTHERWISE IMPAIR THE OWNERSHIP RIGHTS IN AND TO THE SOFTWARE THAT + MAY BELONG TO SCEA OR ANY OF THE OTHER CONTRIBUTORS/AUTHORS OF THE SOFTWARE. + . + 4. CONTRIBUTIONS. + . + SCEA WELCOMES CONTRIBUTIONS IN FORM OF MODIFICATIONS, OPTIMIZATIONS, TOOLS OR DOCUMENTATION DESIGNED TO IMPROVE OR EXPAND THE PERFORMANCE AND + SCOPE OF THE SOFTWARE (COLLECTIVELY "CONTRIBUTIONS"). PER THE TERMS OF THIS LICENSE YOU ARE FREE TO MODIFY THE SOFTWARE AND THOSE + MODIFICATIONS WOULD BELONG TO YOU. YOU MAY HOWEVER WISH TO DONATE YOUR CONTRIBUTIONS TO SCEA FOR CONSIDERATION FOR INCLUSION INTO THE + SOFTWARE. FOR THE AVOIDANCE OF DOUBT, IF YOU ELECT TO SEND YOUR CONTRIBUTIONS TO SCEA, YOU ARE DOING SO VOLUNTARILY AND ARE GIVING THE + CONTRIBUTIONS TO SCEA AND ITS PARENT COMPANY SONY COMPUTER ENTERTAINMENT, INC., FREE OF CHARGE, TO USE, MODIFY OR DISTRIBUTE IN ANY FORM OR IN + ANY MANNER. SCEA ACKNOWLEDGES THAT IF YOU MAKE A DONATION OF YOUR CONTRIBUTIONS TO SCEA, SUCH CONTRIBUTIONS SHALL NOT EXCLUSIVELY BELONG TO + SCEA OR ITS PARENT COMPANY AND SUCH DONATION SHALL NOT BE TO YOUR EXCLUSION. SCEA, IN ITS SOLE DISCRETION, SHALL DETERMINE WHETHER OR NOT TO + INCLUDE YOUR DONATED CONTRIBUTIONS INTO THE SOFTWARE, IN WHOLE, IN PART, OR AS MODIFIED BY SCEA. SHOULD SCEA ELECT TO INCLUDE ANY SUCH + CONTRIBUTIONS INTO THE SOFTWARE, IT SHALL DO SO AT ITS OWN RISK AND MAY ELECT TO GIVE CREDIT OR SPECIAL THANKS TO ANY SUCH CONTRIBUTORS IN THE + ATTACHED COPYRIGHT NOTICE. HOWEVER, IF ANY OF YOUR CONTRIBUTIONS ARE INCLUDED INTO THE SOFTWARE, THEY WILL BECOME PART OF THE SOFTWARE AND + WILL BE DISTRIBUTED UNDER THE TERMS AND CONDITIONS OF THIS LICENSE. FURTHER, IF YOUR DONATED CONTRIBUTIONS ARE INTEGRATED INTO THE SOFTWARE + THEN SONY COMPUTER ENTERTAINMENT, INC. SHALL BECOME THE COPYRIGHT OWNER OF THE SOFTWARE NOW CONTAINING YOUR CONTRIBUTIONS AND SCEA WOULD BE + THE LICENSOR. + . + 5. REDISTRIBUTION IN SOURCE FORM + . + YOU MAY REDISTRIBUTE COPIES OF THE SOFTWARE, MODIFICATIONS OR DERIVATIVES THEREOF IN SOURCE CODE FORM, PROVIDED THAT YOU: + . + A. INCLUDE A COPY OF THIS LICENSE AND ANY COPYRIGHT NOTICES WITH SOURCE + . + B. IDENTIFY MODIFICATIONS IF ANY WERE MADE TO THE SOFTWARE + . + C. INCLUDE A COPY OF ALL DOCUMENTATION ACCOMPANYING THE SOFTWARE AND MODIFICATIONS MADE BY YOU + . + 6. REDISTRIBUTION IN OBJECT FORM + . + IF YOU REDISTRIBUTE COPIES OF THE SOFTWARE, MODIFICATIONS OR DERIVATIVES THEREOF IN OBJECT FORM ONLY (AS INCORPORATED INTO FINISHED GOODS, + I.E. END USER APPLICATIONS) THEN YOU WILL NOT HAVE A DUTY TO INCLUDE ANY COPIES OF THE CODE, THIS LICENSE, COPYRIGHT NOTICES, OTHER + ATTRIBUTIONS OR DOCUMENTATION. + . + 7. NO WARRANTY + . + THE SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT ANY REPRESENTATIONS OR WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY + RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, MODIFYING OR REDISTRIBUTING THE SOFTWARE AND ASSUME ANY RISKS ASSOCIATED WITH YOUR + EXERCISE OF PERMISSIONS UNDER THIS LICENSE. + . + 8. LIMITATION OF LIABILITY + . + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY WILL EITHER PARTY BE LIABLE TO THE OTHER PARTY OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, + CONSEQUENTIAL, SPECIAL, INCIDENTAL, OR EXEMPLARY DAMAGES WITH RESPECT TO ANY INJURY, LOSS, OR DAMAGE, ARISING UNDER OR IN CONNECTION WITH THIS + LETTER AGREEMENT, WHETHER FORESEEABLE OR UNFORESEEABLE, EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH INJURY, LOSS, OR + DAMAGE. THE LIMITATIONS OF LIABILITY SET FORTH IN THIS SECTION SHALL APPLY TO THE FULLEST EXTENT PERMISSIBLE AT LAW OR ANY GOVERMENTAL + REGULATIONS. + . + 9. GOVERNING LAW AND CONSENT TO JURISDICTION + . + THIS AGREEMENT SHALL BE GOVERNED BY AND INTERPRETED IN ACCORDANCE WITH THE LAWS OF THE STATE OF CALIFORNIA, EXCLUDING THAT BODY OF LAW RELATED + TO CHOICE OF LAWS, AND OF THE UNITED STATES OF AMERICA. ANY ACTION OR PROCEEDING BROUGHT TO ENFORCE THE TERMS OF THIS AGREEMENT OR TO + ADJUDICATE ANY DISPUTE ARISING HEREUNDER SHALL BE BROUGHT IN THE SUPERIOR COURT OF THE COUNTY OF SAN MATEO, STATE OF CALIFORNIA OR THE UNITED + STATES DISTRICT COURT FOR THE NORTHERN DISTRICT OF CALIFORNIA. EACH OF THE PARTIES HEREBY SUBMITS ITSELF TO THE EXCLUSIVE JURISDICTION AND + VENUE OF SUCH COURTS FOR PURPOSES OF ANY SUCH ACTION. IN ADDITION, EACH PARTY HEREBY WAIVES THE RIGHT TO A JURY TRIAL IN ANY ACTION OR + PROCEEDING RELATED TO THIS AGREEMENT. + . + 10. COPYRIGHT NOTICE FOR REDISTRIBUTION OF SOURCE CODE + . + COPYRIGHT 2005 SONY COMPUTER ENTERTAINMENT INC. + . + LICENSED UNDER THE SCEA SHARED SOURCE LICENSE, VERSION 1.0 (THE "LICENSE"); YOU MAY NOT USE THIS FILE EXCEPT IN COMPLIANCE WITH THE LICENSE. + YOU MAY OBTAIN A COPY OF THE LICENSE AT: + . + HTTP://RESEARCH.SCEA.COM/SCEA_SHARED_SOURCE_LICENSE.HTML + . + UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND + LIMITATIONS UNDER THE LICENSE. + +License: Free_use + This application is open source and may be redistributed and/or modified + freely and without restriction, both in commercial and non commercial applications, + as long as this copyright notice is maintained. + . + This application 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. + +License: zlib + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +License: BSL-1.0 + Boost Software License - Version 1.0 - August 17th, 2003 + . + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + . + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + . + 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +License: BSD + Copyright (c) 1993 The Regents of the University of California. + All rights reserved. + . + This code is derived from software contributed to Berkeley by + Kent Williams and Tom Epperly. + . + Redistribution and use in source and binary forms with or without + modification are permitted provided that: (1) source distributions retain + this entire copyright notice and comment, and (2) distributions including + binaries display the following acknowledgement: ``This product includes + software developed by the University of California, Berkeley and its + contributors'' in the documentation or other materials provided with the + distribution and in all advertising materials mentioning features or use + of this software. Neither the name of the University nor the names of + its contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation 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 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 THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +License: LGPL + Found in /usr/share/common-licenses/LGPL + +License: GPL-2 + Found in /usr/share/common-licenses/GPL-2 diff -Nru openscenegraph-3.2.1/debian/Doxyfile-openscenegraph openscenegraph-3.2.3+dfsg1/debian/Doxyfile-openscenegraph --- openscenegraph-3.2.1/debian/Doxyfile-openscenegraph 2015-09-01 00:16:09.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/Doxyfile-openscenegraph 2016-03-22 16:18:20.000000000 +0000 @@ -29,7 +29,7 @@ OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO -EXTENSION_MAPPING = +EXTENSION_MAPPING = no_extension=C++ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO @@ -128,7 +128,7 @@ HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = -HTML_TIMESTAMP = YES +HTML_TIMESTAMP = NO HTML_ALIGN_MEMBERS = YES HTML_DYNAMIC_SECTIONS = NO GENERATE_DOCSET = NO diff -Nru openscenegraph-3.2.1/debian/gbp.conf openscenegraph-3.2.3+dfsg1/debian/gbp.conf --- openscenegraph-3.2.1/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/gbp.conf 2016-03-22 16:17:23.000000000 +0000 @@ -0,0 +1,6 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter = OpenSceneGraph/src/osgPlugins/ZeroConfDevice/* +filter-pristine-tar = True diff -Nru openscenegraph-3.2.1/debian/patches/bug763818_fix_preprocessor_double_substitution openscenegraph-3.2.3+dfsg1/debian/patches/bug763818_fix_preprocessor_double_substitution --- openscenegraph-3.2.1/debian/patches/bug763818_fix_preprocessor_double_substitution 2015-09-01 00:16:09.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/bug763818_fix_preprocessor_double_substitution 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -Index: pkg-osg/OpenSceneGraph/src/osgDB/FileUtils.cpp -=================================================================== ---- pkg-osg.orig/OpenSceneGraph/src/osgDB/FileUtils.cpp -+++ pkg-osg/OpenSceneGraph/src/osgDB/FileUtils.cpp -@@ -505,7 +505,7 @@ static void appendInstallationLibraryFil - #ifdef OSG_DEFAULT_LIBRARY_PATH - - // Append the install prefix path to the library search path if configured -- filepath.push_back(ADDQUOTES(OSG_DEFAULT_LIBRARY_PATH)); -+ filepath.push_back(OSG_DEFAULT_LIBRARY_PATH); - #endif - } - -Index: pkg-osg/OpenSceneGraph/src/osgDB/CMakeLists.txt -=================================================================== ---- pkg-osg.orig/OpenSceneGraph/src/osgDB/CMakeLists.txt -+++ pkg-osg/OpenSceneGraph/src/osgDB/CMakeLists.txt -@@ -7,7 +7,7 @@ IF (DYNAMIC_OPENSCENEGRAPH) - - IF(OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS) - # Add a default plugin search path component -- ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS}) -+ ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS}\") - ENDIF() - - # Set the library extension according to what configuration is being built. diff -Nru openscenegraph-3.2.1/debian/patches/bug765855_removecallback_use_after_free openscenegraph-3.2.3+dfsg1/debian/patches/bug765855_removecallback_use_after_free --- openscenegraph-3.2.1/debian/patches/bug765855_removecallback_use_after_free 2015-09-01 00:16:09.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/bug765855_removecallback_use_after_free 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -Description: Fix use-after-free in Node::remove*Callback - -If the node holds the only reference to the callback (nc itself isn't -a ref_ptr so doesn't count), it will automatically be freed when -removed, and the following nc->setNestedCallback(0) is hence an -out of bounds access. - -Origin: upstream https://github.com/openscenegraph/osg/commit/49d560f4d9d0641c98df67264b7ace4733c6b9a9 -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765855 -===================================== ---- a/OpenSceneGraph/include/osg/Node -+++ b/OpenSceneGraph/include/osg/Node -@@ -203,8 +203,9 @@ class OSG_EXPORT Node : public Object - if (nc != NULL && _updateCallback.valid()) { - if (_updateCallback == nc) - { -- setUpdateCallback(nc->getNestedCallback()); // replace the callback by the nested one -+ ref_ptr new_nested_callback = nc->getNestedCallback(); - nc->setNestedCallback(0); -+ setUpdateCallback(new_nested_callback.get()); - } - else _updateCallback->removeNestedCallback(nc); - } -@@ -237,8 +238,9 @@ class OSG_EXPORT Node : public Object - if (nc != NULL && _eventCallback.valid()) { - if (_eventCallback == nc) - { -- setEventCallback(nc->getNestedCallback()); // replace the callback by the nested one -+ ref_ptr new_nested_callback = nc->getNestedCallback(); - nc->setNestedCallback(0); -+ setEventCallback(new_nested_callback.get()); // replace the callback by the nested one - } - else _eventCallback->removeNestedCallback(nc); - } -@@ -271,8 +273,9 @@ class OSG_EXPORT Node : public Object - if (nc != NULL && _cullCallback.valid()) { - if (_cullCallback == nc) - { -- setCullCallback(nc->getNestedCallback()); // replace the callback by the nested one -+ ref_ptr new_nested_callback = nc->getNestedCallback(); - nc->setNestedCallback(0); -+ setCullCallback(new_nested_callback.get()); // replace the callback by the nested one - } - else _cullCallback->removeNestedCallback(nc); - } - diff -Nru openscenegraph-3.2.1/debian/patches/change-typedef.patch openscenegraph-3.2.3+dfsg1/debian/patches/change-typedef.patch --- openscenegraph-3.2.1/debian/patches/change-typedef.patch 2014-12-02 15:52:16.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/change-typedef.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -Index: openscenegraph/OpenSceneGraph/include/osg/GL -=================================================================== ---- openscenegraph.orig/OpenSceneGraph/include/osg/GL 2014-08-05 16:58:36.000000000 -0500 -+++ openscenegraph/OpenSceneGraph/include/osg/GL 2014-08-06 06:45:29.857287930 -0500 -@@ -168,7 +168,7 @@ - // add defines for OpenGL targets that don't define them, just to ease compatibility across targets - #ifndef GL_DOUBLE - #define GL_DOUBLE 0x140A -- typedef double GLdouble; -+ #define GLdouble double - #endif - - #ifndef GL_INT diff -Nru openscenegraph-3.2.1/debian/patches/check__FreeBSD_kernel__ openscenegraph-3.2.3+dfsg1/debian/patches/check__FreeBSD_kernel__ --- openscenegraph-3.2.1/debian/patches/check__FreeBSD_kernel__ 2015-09-01 00:16:09.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/check__FreeBSD_kernel__ 2016-03-22 16:18:20.000000000 +0000 @@ -17,7 +17,7 @@ #if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \ - defined(__DragonFly__) + defined(__DragonFly__) || defined(__FreeBSD_kernel__) - socklen_t + socklen_t #else int Index: pkg-osg/OpenSceneGraph/examples/osgcluster/receiver.cpp diff -Nru openscenegraph-3.2.1/debian/patches/dont-build-osgframerenderer-on-gles.patch openscenegraph-3.2.3+dfsg1/debian/patches/dont-build-osgframerenderer-on-gles.patch --- openscenegraph-3.2.1/debian/patches/dont-build-osgframerenderer-on-gles.patch 2014-12-02 15:52:16.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/dont-build-osgframerenderer-on-gles.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Description: Don't build the osgframerenderer example if building for - OpenGL ES 1, OpenGL ES 2, or OpenGL 3. This is a portion of the full commit. -Origin: upstream, https://github.com/openscenegraph/osg/commit/3f812e42c7bb257e1e19604318becd359d21f469 - -Index: openscenegraph/OpenSceneGraph/examples/CMakeLists.txt -=================================================================== ---- openscenegraph.orig/OpenSceneGraph/examples/CMakeLists.txt 2014-07-26 08:49:44.583787000 -0500 -+++ openscenegraph/OpenSceneGraph/examples/CMakeLists.txt 2014-08-03 11:41:48.439983802 -0500 -@@ -46,7 +46,6 @@ - ADD_SUBDIRECTORY(osgfont) - ADD_SUBDIRECTORY(osgforest) - ADD_SUBDIRECTORY(osgfxbrowser) -- ADD_SUBDIRECTORY(osgframerenderer) - ADD_SUBDIRECTORY(osgoutline) - ADD_SUBDIRECTORY(osggameoflife) - ADD_SUBDIRECTORY(osggeometry) -@@ -173,6 +172,7 @@ - - IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE) - ADD_SUBDIRECTORY(osgscreencapture) -+ ADD_SUBDIRECTORY(osgframerenderer) - ADD_SUBDIRECTORY(osgmotionblur) - ADD_SUBDIRECTORY(osgteapot) - ENDIF() diff -Nru openscenegraph-3.2.1/debian/patches/ffmpeg_2.9.patch openscenegraph-3.2.3+dfsg1/debian/patches/ffmpeg_2.9.patch --- openscenegraph-3.2.1/debian/patches/ffmpeg_2.9.patch 1970-01-01 00:00:00.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/ffmpeg_2.9.patch 2016-03-22 16:17:23.000000000 +0000 @@ -0,0 +1,151 @@ +Description: Replace deprecated FFmpeg API +Author: Andreas Cadhalpun +Last-Update: <2015-11-02> + +Index: pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp +=================================================================== +--- pkg-osg.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp ++++ pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp +@@ -71,7 +71,7 @@ void FFmpegDecoderVideo::open(AVStream * + findAspectRatio(); + + // Find out whether we support Alpha channel +- m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P); ++ m_alpha_channel = (m_context->pix_fmt == AV_PIX_FMT_YUVA420P); + + // Find out the framerate + #if LIBAVCODEC_VERSION_MAJOR >= 56 +@@ -95,20 +95,19 @@ void FFmpegDecoderVideo::open(AVStream * + throw std::runtime_error("avcodec_open() failed"); + + // Allocate video frame +- m_frame.reset(avcodec_alloc_frame()); ++ m_frame.reset(av_frame_alloc()); + + // Allocate converted RGB frame +- m_frame_rgba.reset(avcodec_alloc_frame()); +- m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height())); ++ m_frame_rgba.reset(av_frame_alloc()); ++ m_buffer_rgba[0].resize(avpicture_get_size(AV_PIX_FMT_RGB24, width(), height())); + m_buffer_rgba[1].resize(m_buffer_rgba[0].size()); + + // Assign appropriate parts of the buffer to image planes in m_frame_rgba +- avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], PIX_FMT_RGB24, width(), height()); ++ avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height()); + + // Override get_buffer()/release_buffer() from codec context in order to retrieve the PTS of each frame. + m_context->opaque = this; +- m_context->get_buffer = getBuffer; +- m_context->release_buffer = releaseBuffer; ++ m_context->get_buffer2 = getBuffer; + } + + +@@ -267,8 +266,8 @@ int FFmpegDecoderVideo::convert(AVPictur + #ifdef USE_SWSCALE + if (m_swscale_ctx==0) + { +- m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt, +- src_width, src_height, (PixelFormat) dst_pix_fmt, ++ m_swscale_ctx = sws_getContext(src_width, src_height, (AVPixelFormat) src_pix_fmt, ++ src_width, src_height, (AVPixelFormat) dst_pix_fmt, + /*SWS_BILINEAR*/ SWS_BICUBIC, NULL, NULL, NULL); + } + +@@ -315,14 +314,14 @@ void FFmpegDecoderVideo::publishFrame(co + AVPicture * const dst = (AVPicture *) m_frame_rgba.get(); + + // Assign appropriate parts of the buffer to image planes in m_frame_rgba +- avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height()); ++ avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height()); + + // Convert YUVA420p (i.e. YUV420p plus alpha channel) using our own routine + +- if (m_context->pix_fmt == PIX_FMT_YUVA420P) ++ if (m_context->pix_fmt == AV_PIX_FMT_YUVA420P) + yuva420pToRgba(dst, src, width(), height()); + else +- convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height()); ++ convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height()); + + // Wait 'delay' seconds before publishing the picture. + int i_delay = static_cast(delay * 1000000 + 0.5); +@@ -349,7 +348,7 @@ void FFmpegDecoderVideo::publishFrame(co + + void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height) + { +- convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width, height); ++ convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width, height); + + const size_t bpp = 4; + +@@ -367,31 +366,28 @@ void FFmpegDecoderVideo::yuva420pToRgba( + } + } + +- +- +-int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture) ++int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture, int flags) + { ++ AVBufferRef *ref; + const FFmpegDecoderVideo * const this_ = reinterpret_cast(context->opaque); + +- const int result = avcodec_default_get_buffer(context, picture); ++ const int result = avcodec_default_get_buffer2(context, picture, flags); + int64_t * p_pts = reinterpret_cast( av_malloc(sizeof(int64_t)) ); + + *p_pts = this_->m_packet_pts; + picture->opaque = p_pts; + ++ ref = av_buffer_create((uint8_t *)picture->opaque, sizeof(int64_t), FFmpegDecoderVideo::freeBuffer, picture->buf[0], flags); ++ picture->buf[0] = ref; ++ + return result; + } + +- +- +-void FFmpegDecoderVideo::releaseBuffer(AVCodecContext * const context, AVFrame * const picture) ++void FFmpegDecoderVideo::freeBuffer(void *opaque, uint8_t *data) + { +- if (picture != 0) +- av_freep(&picture->opaque); +- +- avcodec_default_release_buffer(context, picture); ++ AVBufferRef *ref = (AVBufferRef *)opaque; ++ av_buffer_unref(&ref); ++ av_free(data); + } + +- +- + } // namespace osgFFmpeg +Index: pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp +=================================================================== +--- pkg-osg.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp ++++ pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp +@@ -94,8 +94,8 @@ private: + int src_pix_fmt, int src_width, int src_height); + + +- static int getBuffer(AVCodecContext * context, AVFrame * picture); +- static void releaseBuffer(AVCodecContext * context, AVFrame * picture); ++ static int getBuffer(AVCodecContext * context, AVFrame * picture, int flags); ++ static void freeBuffer(void * opaque, uint8_t *data); + + PacketQueue & m_packets; + FFmpegClocks & m_clocks; +Index: pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegParameters.cpp +=================================================================== +--- pkg-osg.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegParameters.cpp ++++ pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegParameters.cpp +@@ -19,7 +19,7 @@ extern "C" + #include + } + +-inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); } ++inline AVPixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); } + + + namespace osgFFmpeg { diff -Nru openscenegraph-3.2.1/debian/patches/giflib5.diff openscenegraph-3.2.3+dfsg1/debian/patches/giflib5.diff --- openscenegraph-3.2.1/debian/patches/giflib5.diff 2015-10-27 05:08:20.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/giflib5.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -Index: b/OpenSceneGraph/src/osgPlugins/gif/ReaderWriterGIF.cpp -=================================================================== ---- a/OpenSceneGraph/src/osgPlugins/gif/ReaderWriterGIF.cpp -+++ b/OpenSceneGraph/src/osgPlugins/gif/ReaderWriterGIF.cpp -@@ -561,7 +561,7 @@ GifImageStream** obj) - *width_ret = giffile->SWidth; - *height_ret = giffile->SHeight; - *numComponents_ret = 4; -- DGifCloseFile(giffile); -+ DGifCloseFile(giffile, NULL); - return buffer; - } - diff -Nru openscenegraph-3.2.1/debian/patches/libav10.patch openscenegraph-3.2.3+dfsg1/debian/patches/libav10.patch --- openscenegraph-3.2.1/debian/patches/libav10.patch 2015-09-01 00:16:09.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/libav10.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,238 +0,0 @@ -From: anton@khirnov.net -To: 739460@bugs.debian.org -Subject: Re: FTBFS with libav10 -Date: Mon, 03 Mar 2014 07:37:18 +0100 - -Updated by Reinhard Tartler at Wed Apr 2 21:58:34 EDT 2014: Link against libavresample - -Index: pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp -=================================================================== ---- pkg-osg.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp -+++ pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp -@@ -17,24 +17,16 @@ - - namespace osgFFmpeg { - --static int decode_audio(AVCodecContext *avctx, int16_t *samples, -- int *frame_size_ptr, -- const uint8_t *buf, int buf_size) -+static int decode_audio(AVCodecContext *avctx, AVFrame *frame, -+ const uint8_t *buf, int buf_size) - { --#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=32) -- -- // following code segment copied from ffmpeg's avcodec_decode_audio2() -- // implementation to avoid warnings about deprecated function usage. -+ int got_output; - AVPacket avpkt; - av_init_packet(&avpkt); - avpkt.data = const_cast(buf); - avpkt.size = buf_size; - -- return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt); --#else -- // fallback for older versions of ffmpeg that don't have avcodec_decode_audio3. -- return avcodec_decode_audio2(avctx, samples, frame_size_ptr, buf, buf_size); --#endif -+ return avcodec_decode_audio4(avctx, frame, &got_output, &avpkt); - } - - -@@ -45,12 +37,17 @@ FFmpegDecoderAudio::FFmpegDecoderAudio(P - m_context(0), - m_packet_data(0), - m_bytes_remaining(0), -- m_audio_buffer((AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2), -+ m_audio_buffer((192000 * 3) / 2), - m_audio_buf_size(0), - m_audio_buf_index(0), - m_end_of_stream(false), - m_paused(true), -- m_exit(false) -+ m_exit(false), -+ avr(NULL), -+ resample_format(-1), -+ resample_rate(0), -+ resample_layout(0), -+ frame(NULL) - { - - } -@@ -77,7 +74,7 @@ void FFmpegDecoderAudio::open(AVStream * - - m_frequency = m_context->sample_rate; - m_nb_channels = m_context->channels; -- switch (m_context->sample_fmt) -+ switch (av_get_planar_sample_fmt(m_context->sample_fmt)) - { - case AV_SAMPLE_FMT_NONE: - throw std::runtime_error("invalid audio format AV_SAMPLE_FMT_NONE"); -@@ -100,7 +97,7 @@ void FFmpegDecoderAudio::open(AVStream * - } - - // Check stream sanity -- if (m_context->codec_id == CODEC_ID_NONE) -+ if (m_context->codec_id == AV_CODEC_ID_NONE) - throw std::runtime_error("invalid audio codec");; - - // Find the decoder for the audio stream -@@ -116,6 +113,10 @@ void FFmpegDecoderAudio::open(AVStream * - // Open codec - if (avcodec_open2(m_context, p_codec, NULL) < 0) - throw std::runtime_error("avcodec_open() failed"); -+ -+ frame = av_frame_alloc(); -+ if (!frame) -+ throw std::runtime_error("av_frame_alloc() failed"); - } - - catch (...) -@@ -328,10 +329,9 @@ size_t FFmpegDecoderAudio::decodeFrame(v - - while (m_bytes_remaining > 0) - { -- int data_size = size; -- -- const int bytes_decoded = decode_audio(m_context, reinterpret_cast(buffer), &data_size, m_packet_data, m_bytes_remaining); -+ int ret; - -+ const int bytes_decoded = decode_audio(m_context, frame, m_packet_data, m_bytes_remaining); - if (bytes_decoded < 0) - { - // if error, skip frame -@@ -342,9 +342,42 @@ size_t FFmpegDecoderAudio::decodeFrame(v - m_bytes_remaining -= bytes_decoded; - m_packet_data += bytes_decoded; - -- // If we have some data, return it and come back for more later. -- if (data_size > 0) -- return data_size; -+ if (!frame->nb_samples) -+ continue; -+ -+ if (!avr || -+ frame->format != resample_format || -+ frame->sample_rate != resample_rate || -+ frame->channel_layout != resample_layout) { -+ avresample_free(&avr); -+ -+ avr = avresample_alloc_context(); -+ if (!avr) -+ return AVERROR(ENOMEM); -+ -+ av_opt_set_int(avr, "in_channel_layout", frame->channel_layout, 0); -+ av_opt_set_int(avr, "out_channel_layout", frame->channel_layout, 0); -+ av_opt_set_int(avr, "in_sample_rate", frame->sample_rate, 0); -+ av_opt_set_int(avr, "out_sample_rate", frame->sample_rate, 0); -+ av_opt_set_int(avr, "in_sample_fmt", frame->format, 0); -+ av_opt_set_int(avr, "out_sample_fmt", av_get_planar_sample_fmt((enum AVSampleFormat)frame->format), 0); -+ -+ ret = avresample_open(avr); -+ if (ret < 0) { -+ avresample_free(&avr); -+ return ret; -+ } -+ resample_format = frame->format; -+ resample_rate = frame->sample_rate; -+ resample_layout = frame->channel_layout; -+ } -+ -+ ret = avresample_convert(avr, (uint8_t**)&buffer, size, frame->nb_samples, -+ frame->extended_data, frame->linesize[0], frame->nb_samples); -+ if (ret < 0) -+ return ret; -+ -+ return ret * av_get_bytes_per_sample((enum AVSampleFormat)frame->format) * m_context->channels; - } - - // Get next packet -Index: pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp -=================================================================== ---- pkg-osg.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp -+++ pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp -@@ -13,6 +13,10 @@ - - #include "BoundedMessageQueue.hpp" - -+extern "C" { -+#include -+} -+ - - - -@@ -80,6 +84,12 @@ private: - bool m_end_of_stream; - bool m_paused; - volatile bool m_exit; -+ -+ AVAudioResampleContext *avr; -+ int resample_format; -+ int resample_rate; -+ uint64_t resample_layout; -+ AVFrame *frame; - }; - - -Index: pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp -=================================================================== ---- pkg-osg.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp -+++ pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp -@@ -74,7 +74,7 @@ void FFmpegDecoderVideo::open(AVStream * - m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P); - - // Find out the framerate -- m_frame_rate = av_q2d(stream->r_frame_rate); -+ m_frame_rate = av_q2d(stream->avg_frame_rate); - - // Find the decoder for the video stream - m_codec = avcodec_find_decoder(m_context->codec_id); -Index: pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp -=================================================================== ---- pkg-osg.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp -+++ pkg-osg/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp -@@ -16,6 +16,9 @@ extern "C" - #endif - - #include -+#include -+ -+#include - - #ifdef USE_SWSCALE - #include -Index: pkg-osg/OpenSceneGraph/CMakeModules/FindFFmpeg.cmake -=================================================================== ---- pkg-osg.orig/OpenSceneGraph/CMakeModules/FindFFmpeg.cmake -+++ pkg-osg/OpenSceneGraph/CMakeModules/FindFFmpeg.cmake -@@ -122,12 +122,13 @@ ENDIF() - FFMPEG_FIND(LIBAVFORMAT avformat avformat.h) - FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h) - FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h) -+FFMPEG_FIND(LIBAVRESAMPLE avresample avresample.h) - FFMPEG_FIND(LIBAVUTIL avutil avutil.h) - FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here. - - SET(FFMPEG_FOUND "NO") - # Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional. --IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK) -+IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVRESAMPLE_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK) - - SET(FFMPEG_FOUND "YES") - -@@ -135,6 +136,7 @@ IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPE - ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} - ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} - ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} -+ ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS} - ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} - ) - -@@ -154,6 +156,7 @@ IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPE - ${FFMPEG_LIBAVFORMAT_LIBRARIES} - ${FFMPEG_LIBAVDEVICE_LIBRARIES} - ${FFMPEG_LIBAVCODEC_LIBRARIES} -+ ${FFMPEG_LIBAVRESAMPLE_LIBRARIES} - ${FFMPEG_LIBAVUTIL_LIBRARIES}) - - ELSE () diff -Nru openscenegraph-3.2.1/debian/patches/series openscenegraph-3.2.3+dfsg1/debian/patches/series --- openscenegraph-3.2.1/debian/patches/series 2015-10-27 05:07:38.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/patches/series 2016-03-22 16:17:23.000000000 +0000 @@ -1,9 +1,4 @@ disable-zip-plugin-with-embedded-zlib.patch check__FreeBSD_kernel__ -libav10.patch -bug763818_fix_preprocessor_double_substitution -bug765855_removecallback_use_after_free -dont-build-osgframerenderer-on-gles.patch -change-typedef.patch no-xine-malloc-aligned.diff -giflib5.diff +ffmpeg_2.9.patch diff -Nru openscenegraph-3.2.1/debian/rules openscenegraph-3.2.3+dfsg1/debian/rules --- openscenegraph-3.2.1/debian/rules 2015-09-01 00:16:09.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/debian/rules 2016-03-22 16:18:20.000000000 +0000 @@ -66,16 +66,6 @@ LDFLAGS += -Wl,--as-needed -ifeq (armhf,$(DEB_HOST_ARCH)) -EGL_LDFLAGS=$(shell pkg-config egl --libs) -OPENGLES_LDFLAGS=$(shell pkg-config glesv2 --libs) -ARMHF_DEFINES=-D OSG_GL1_AVAILABLE:BOOL=OFF \ - -D OSG_GL2_AVAILABLE:BOOL=OFF \ - -D OSG_GLES2_AVAILABLE:BOOL=ON \ - -D OPENGL_gl_LIBRARY:STRING="${OPENGLES_LDFLAGS}" \ - -D OPENGL_egl_LIBRARY:STRING="${EGL_LDFLAGS}" -endif - # # Shared libraries version numbers # @@ -166,7 +156,7 @@ OPENTHREADS_SOVERSION=20 OPENSCENEGRAPH_SOVERSION=100 -GRAB_VERSION_COMMAND := sed -n '1s~[^(]*(\(.*\)-.*).*~\1~p' debian/changelog | sed 's~-dfsg~~' +GRAB_VERSION_COMMAND := sed -n '1s~[^(]*(\(.*\)-.*).*~\1~p' debian/changelog | sed 's~+dfsg.*~~' VERSION := $(shell $(GRAB_VERSION_COMMAND)) TMPDIR := $(shell mktemp -d) TARBALL_NAME := openscenegraph_$(VERSION).orig.tar.gz @@ -187,6 +177,7 @@ rm -fr build rm -f ${MANPAGES} rm -fr html + rm -f doxygen_sqlite3.db dh_clean @@ -419,6 +410,9 @@ doc-stamp: mkdir -p html doxygen debian/Doxyfile-openscenegraph +# Use Debian's jquery.js + rm html/openscenegraph/jquery.js + find html -name "*.html" -print0 | xargs -0 perl -i -pe 's|src="jquery.js"|src="/usr/share/javascript/jquery/jquery.js"|' touch doc-stamp build-arch: build-stamp @@ -433,7 +427,6 @@ -D CMAKE_INSTALL_PREFIX:PATH=/usr \ -D BUILD_OSG_EXAMPLES:BOOL=ON \ -D LIB_POSTFIX="/${DEB_HOST_MULTIARCH}" \ - ${ARMHF_DEFINES} \ ../../${OSG} ${MAKE} ${PARALLEL_OPTIONS} VERBOSE=1 -C build/osg diff -Nru openscenegraph-3.2.1/OpenSceneGraph/applications/osgversion/Contributors.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/applications/osgversion/Contributors.cpp --- openscenegraph-3.2.1/OpenSceneGraph/applications/osgversion/Contributors.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/applications/osgversion/Contributors.cpp 2015-08-12 06:50:35.000000000 +0000 @@ -259,7 +259,9 @@ "VolumeTile", "PushStackValueVisitor", "RayIntersector", - "OpenSceneGraph-Data" + "OpenSceneGraph-Data", + "Node", + "AlphaFunc" }; @@ -352,6 +354,7 @@ {"Krulthof", "Kruithof"}, {"Lagrade", "Lagarde"}, {"Largade", "Lagarde"}, + {"Largarde", "Lagarde"}, {"Larshkari", "Lashkari"}, {"Lashakari", "Lashkari"}, {"Lashari", "Lashkari"}, @@ -468,7 +471,20 @@ {"Blessing","Blissing"}, {"Dannahuer","Dannhauer"}, {"Chebeav", "Chebaev"}, - {"Messershmidt","Messerschmidt"} + {"Messershmidt","Messerschmidt"}, + {"Auelien","Aurelien"}, + {"Aurélien","Aurélien"}, + {"McDonnel","Mc Donnell"}, + {"McDonnell","Mc Donnell"}, + {"Delallée","Delallée"}, + {"Gjøl","Gjøl"}, + {"RavÅ¡elj","Rav¨elj"}, + {"Ravsel", "Rav¨elj"}, + {"Ravselj", "Rav¨elj"}, + {"Janik", "Jannik"}, + {"Viganò", "Viganò"}, + {"Vigano", "Viganò"}, + {"Frashud", "Farshid"} }; @@ -576,6 +592,8 @@ "Melchior", "Franz"}, {"Glen", "Waldon", "Glenn", "Waldron"}, + {"Glen", "Waldron", + "Glenn", "Waldron"}, {"Ralf", "Karn", "Ralf", "Kern"}, {"Donny", "Cipperly", @@ -637,7 +655,25 @@ {"Ricard", "Schmidt", "Richard", "Schmidt"}, {"Matthias", "Helsing", - "Mattias", "Helsing"} + "Mattias", "Helsing"}, + {"Clement", "Boesch", + "Clément", "B½sch"}, + {"Lauren", "Voerman", + "Laurens", "Voerman"}, + {"Pjotr", "Sventachov", + "Pjotr", "Svetachov"}, + {"Bradley", "Baker", + "Bradley", "Baker Searles"}, + {"PawelKsiezopolski", "", + "Pawel", "Ksiezopolski"}, + {"Albert", "Luaces", + "Alberto","Luaces"}, + {"KOS", "", + "Konstantin","Matveyev"}, + {"WeSee", "", + "Alois", "Wismer"}, + {"We", "See", + "Alois", "Wismer"} }; @@ -969,7 +1005,9 @@ cout << "-------------------------" << endl; for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr) { - cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl; + cout << sitr->first << "\t" << sitr->second.first; + if (!sitr->second.second.empty()) cout << " " << sitr->second.second; + cout << endl; } } else @@ -978,7 +1016,9 @@ cout << "-----------------" << endl; for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr) { - cout << sitr->second.first << " " << sitr->second.second << endl; + cout << sitr->second.first; + if (!sitr->second.second.empty()) cout << " " << sitr->second.second; + cout << endl; } } } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/applications/present3D/Cluster.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/applications/present3D/Cluster.cpp --- openscenegraph-3.2.1/OpenSceneGraph/applications/present3D/Cluster.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/applications/present3D/Cluster.cpp 2014-11-26 17:07:07.000000000 +0000 @@ -1,12 +1,12 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under + * This software is open source and may be redistributed and/or modified under * the terms of the GNU General Public License (GPL) version 2.0. * The full license is in LICENSE.txt file included with this distribution,. - * + * * This software 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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * include LICENSE.txt for more details. */ @@ -39,9 +39,9 @@ #elif defined(__sgi) #include #include -#elif defined(__CYGWIN__) +#elif defined(__CYGWIN__) #include -#elif defined(__sun) +#elif defined(__sun) #include #include #elif defined (__APPLE__) @@ -249,7 +249,7 @@ ////////////////////////////////////////////////////////////////////////////// // -// Reciever +// Reciever // Receiver::Receiver( void ) { @@ -338,7 +338,7 @@ #if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \ defined(__DragonFly__) - socklen_t + socklen_t #else int #endif @@ -381,7 +381,7 @@ ////////////////////////////////////////////////////////////////////////////// // -// Broadcaster +// Broadcaster // Broadcaster::Broadcaster( void ) { diff -Nru openscenegraph-3.2.1/OpenSceneGraph/applications/present3D/Cluster.h openscenegraph-3.2.3+dfsg1/OpenSceneGraph/applications/present3D/Cluster.h --- openscenegraph-3.2.1/OpenSceneGraph/applications/present3D/Cluster.h 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/applications/present3D/Cluster.h 2014-11-26 17:07:51.000000000 +0000 @@ -1,12 +1,12 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under + * This software is open source and may be redistributed and/or modified under * the terms of the GNU General Public License (GPL) version 2.0. * The full license is in LICENSE.txt file included with this distribution,. - * + * * This software 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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * include LICENSE.txt for more details. */ @@ -29,7 +29,7 @@ // // Class definition for the recipient of a broadcasted message // -class Receiver +class Receiver { public : @@ -68,7 +68,7 @@ // // Class definition for broadcasting a buffer to a LAN // -class Broadcaster +class Broadcaster { public : @@ -84,7 +84,7 @@ // Set a recipient host. If this is used, the Broadcaster // no longer broadcasts, but rather directs UDP packets at // host. - void setHost( const char *hostname ); + void setHost( const char *hostname ); // Sync broadcasts the buffer void sync( void ); @@ -112,15 +112,15 @@ class CameraPacket { public: - + static const unsigned int MAX_NUM_EVENTS; static const unsigned int SWAP_BYTES_COMPARE; - - CameraPacket():_masterKilled(false) + + CameraPacket():_masterKilled(false) { _byte_order = SWAP_BYTES_COMPARE; } - + void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp) { _matrix = matrix; @@ -129,20 +129,20 @@ _frameStamp = *frameStamp; } } - + void getModelView(osg::Matrix& matrix,float angle_offset=0.0f) { - + matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f); } - + void readEventQueue(osgViewer::Viewer& viewer); - + void writeEventQueue(osgViewer::Viewer& viewer); void setMasterKilled(const bool flag) { _masterKilled = flag; } const bool getMasterKilled() const { return _masterKilled; } - + unsigned int _byte_order; bool _masterKilled; osg::Matrix _matrix; @@ -150,11 +150,11 @@ // note don't use a ref_ptr as used elsewhere for FrameStamp // since we don't want to copy the pointer - but the memory. // FrameStamp doesn't have a private destructor to allow - // us to do this, even though its a reference counted object. + // us to do this, even though its a reference counted object. osg::FrameStamp _frameStamp; - + osgGA::EventQueue::Events _events; - + }; class DataConverter @@ -186,22 +186,22 @@ { if (_currentPtr+1>=_endPtr) return; - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr); } inline void read1(char* ptr) { if (_currentPtr+1>=_endPtr) return; - *(ptr) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } inline void write2(char* ptr) { if (_currentPtr+2>=_endPtr) return; - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr); } inline void read2(char* ptr) @@ -210,13 +210,13 @@ if (_swapBytes) { - *(ptr+1) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr+1) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } else { - *(ptr++) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } } @@ -224,10 +224,10 @@ { if (_currentPtr+4>=_endPtr) return; - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr); } inline void read4(char* ptr) @@ -236,17 +236,17 @@ if (_swapBytes) { - *(ptr+3) = *(_currentPtr++); - *(ptr+2) = *(_currentPtr++); - *(ptr+1) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr+3) = *(_currentPtr++); + *(ptr+2) = *(_currentPtr++); + *(ptr+1) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } else { - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } } @@ -254,15 +254,15 @@ { if (_currentPtr+8>=_endPtr) return; - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr); } inline void read8(char* ptr) @@ -272,27 +272,27 @@ if (_swapBytes) { - *(ptr+7) = *(_currentPtr++); - *(ptr+6) = *(_currentPtr++); - *(ptr+5) = *(_currentPtr++); - *(ptr+4) = *(_currentPtr++); - - *(ptr+3) = *(_currentPtr++); - *(ptr+2) = *(_currentPtr++); - *(ptr+1) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr+7) = *(_currentPtr++); + *(ptr+6) = *(_currentPtr++); + *(ptr+5) = *(_currentPtr++); + *(ptr+4) = *(_currentPtr++); + + *(ptr+3) = *(_currentPtr++); + *(ptr+2) = *(_currentPtr++); + *(ptr+1) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } else { - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } } @@ -305,14 +305,14 @@ inline void writeFloat(float c) { write4((char*)&c); } inline void writeDouble(double c) { write8((char*)&c); } - inline char readChar() { char c; read1(&c); return c; } - inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; } - inline short readShort() { short c; read2((char*)&c); return c; } - inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; } - inline int readInt() { int c; read4((char*)&c); return c; } - inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; } - inline float readFloat() { float c; read4((char*)&c); return c; } - inline double readDouble() { double c; read8((char*)&c); return c; } + inline char readChar() { char c=0; read1(&c); return c; } + inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; } + inline short readShort() { short c=0; read2((char*)&c); return c; } + inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; } + inline int readInt() { int c=0; read4((char*)&c); return c; } + inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; } + inline float readFloat() { float c=0.0f; read4((char*)&c); return c; } + inline double readDouble() { double c=0.0; read8((char*)&c); return c; } void write(const osg::FrameStamp& fs); void read(osg::FrameStamp& fs); @@ -322,13 +322,13 @@ void write(const osgGA::GUIEventAdapter& event); void read(osgGA::GUIEventAdapter& event); - + void write(CameraPacket& cameraPacket); void read(CameraPacket& cameraPacket); char* startPtr() { return _startPtr; } unsigned int numBytes() { return _numBytes; } - + protected: char* _startPtr; @@ -341,4 +341,4 @@ -#endif +#endif diff -Nru openscenegraph-3.2.1/OpenSceneGraph/AUTHORS.txt openscenegraph-3.2.3+dfsg1/OpenSceneGraph/AUTHORS.txt --- openscenegraph-3.2.1/OpenSceneGraph/AUTHORS.txt 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/AUTHORS.txt 2015-08-12 07:37:39.000000000 +0000 @@ -1,6 +1,6 @@ -OpenSceneGraph Library 3.2.1 +OpenSceneGraph Library 3.2.2 -519 Contributors: +529 Contributors: Firstname Surname ----------------- @@ -15,8 +15,8 @@ Jean-Sébastien Guay Ulrich Hertlein Mike Weiblen +Sukender Eric Wing -Sukender Cedric Pinson Brede Johansen Bob Kuehne @@ -30,18 +30,18 @@ Trajce Nikolov Tim Moore Martin Lavery -Tree +Tree Luigi Calori Mike Wittman Jason Beverage Chris Hanson Roland Smeenk Roger James +Mattias Helsing Jeremy Moles Jan Peciva -Mattias Helsing -J.P. Delport Alberto Luaces +J.P. Delport Magnus Kessler David Fries Andy Skinner @@ -58,23 +58,23 @@ Philip Lowman Per Fahlberg Norman Vine +Lionel Lagarde Terry Welsh Serge Lages Romano José Magacho da Silva -Lionel Lagarde +Pjotr Svetachov Chris Denham Alberto Farre Torben Dannhauer Sherman Wilcox Robert Michael Mourad Boufarguine +Glenn Waldron André Garneau Adrian Egli Ruben Lopez Randall Hopper -Pjotr Svetachov Jan Ciger -Glenn Waldron Gideon May Don Tidrow Stephane Lamoliatte @@ -91,6 +91,7 @@ Melchior Franz Johannes Baeuerle Thomas Hogarth +Sebastian Messerschmidt Rafa Gaitan Neil Hughes Martin Beckett @@ -105,7 +106,6 @@ Yefei He Sondra Iverson Simon Julier -Sebastian Messerschmidt Rune Schmidt Jensen Rainer Oder Nico Kruithof @@ -129,6 +129,7 @@ Jordi Torres John Shue Brad Colbert +Björn Blissing Alexander Sinditskiy Vivek Rajan Uwe Woessner @@ -137,6 +138,7 @@ Tatsuhiro Nishioka Tanguy Fautré Sean Spicer +Ryan Kawicki Richard Schmidt Peter Hrenka Paul de Repentigny @@ -145,6 +147,7 @@ Mihai Radu Michael Hartman Martins Innus +Marc Helbling Maciej Krol Lilin Xiong Leandro Motta Barros @@ -153,16 +156,15 @@ Donn Mielcarek Corbin Holtz Blasius Czink -Björn Blissing Alexander Irion Toshiyuki Takahei Sebastien Grignard -Ryan Kawicki Rudolf Wiedemann Robert Milharcic Maria Ten Liang Aibin Kristofer Tingdahl +Konstantin Matveyev Katharina Plugge John Vidar Larring John Kelso @@ -229,7 +231,7 @@ Wee See Warren Macchi Vincent Bourdier -Terrex +Terrex Tassilo Glander Sylvain Marie Steve Lunsford @@ -245,6 +247,7 @@ Pawel Ksiezopolski Paul Palumbo Paul Obermeier +Patrick Neary Nguyen Van Truong Nathan Cournia Morten Haukness @@ -263,9 +266,9 @@ Marcin Hajder Marcel Pursche Lilith Bryant -Konstantin Matveyev Kevin Moiule Keith Steffen +Julien Valentin Julen Garcia Joseph Winston John Aughey @@ -273,6 +276,8 @@ Joachim Pouderoux Jean-Christophe Lombardo Javier Taibo +Jannik Heller +Jan Klimke James Moliere Jaap Glas Igor Kravtchenko @@ -291,7 +296,7 @@ Eduardo Poyart Edgar Ellis Dimi Christopoulos -Diane Delallée +Diane Delallée David Longest David Ergo Daniel Trstenjak @@ -299,6 +304,7 @@ Claus Scheiblauer Christophe Loustaunau Christian Ruzicka +Bradley Baker Searles Brad Anderegg Björn Hein Aric Aumann @@ -327,6 +333,7 @@ Todd Furlong Tobias Ottenweller Tino Schwarze +Tim George Thorsten Brehm Thomas Weidner Tan Dunning @@ -384,13 +391,14 @@ Nick Black Mojtaba Fathi Mirko Viviani -Mikkel Gjøl +Mikkel Gjøl Mike Krus Mike Garrity -Miha Ravsel +Miha Rav¨elj Michael Schanne Michael Polak Michael Morrison +Michael Mc Donnell Michael Logan Michael Kapelko Michael Bach Jensen @@ -411,7 +419,6 @@ Mario Guimaraes Marco Sciabica Marco Lehmann -Marc Helbling Maik Keller Lukas Diduch Louis Hamilton @@ -443,7 +450,6 @@ Jay Zuckerman Jason Howlett Jason Ballenger -Jan Klimke James Turner James Killian James Athey @@ -486,7 +492,9 @@ Dan Minor César L. B. Silveira Cyril Brulebois +Clément B½sch Clay Fowler +Claus Steuer Chuck Sembroski Christopher Blaesius Christopher Baker @@ -508,6 +516,7 @@ Ben van Basten Bart Gallet Axel Volley +Arjun Ramamurthy Anthousis Andreadis Anish Thomas Andy Preece @@ -522,4 +531,5 @@ Alan Ott Alan Harris Adrien Grandemange +Adrian Clark Adam Richard diff -Nru openscenegraph-3.2.1/OpenSceneGraph/ChangeLog openscenegraph-3.2.3+dfsg1/OpenSceneGraph/ChangeLog --- openscenegraph-3.2.1/OpenSceneGraph/ChangeLog 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/ChangeLog 2015-08-12 07:41:40.000000000 +0000 @@ -1,3 +1,811 @@ +2015-08-12 07:38 robert + + * CMakeLists.txt: Updated version number for 3.2.3 release + +2015-08-12 07:37 robert + + * AUTHORS.txt, ChangeLog, README.txt: Updated AUTHORS, ChangeLog + and README for 3.2.3 release + +2015-08-12 06:50 robert + + * applications/osgversion/Contributors.cpp: Merged Contributors + list from svn/trunk. + +2015-08-08 08:49 robert + + * src/osgPlugins/zip/ZipArchive.cpp: From Glenn Waldron, fix error + in ZIP plugin handling of memory buffer + +2015-08-06 10:09 robert + + * src/osgVolume/Shaders/volume_frag.cpp, + src/osgVolume/Shaders/volume_iso_frag.cpp, + src/osgVolume/Shaders/volume_lit_frag.cpp, + src/osgVolume/Shaders/volume_lit_tf_frag.cpp, + src/osgVolume/Shaders/volume_mip_frag.cpp, + src/osgVolume/Shaders/volume_tf_frag.cpp, + src/osgVolume/Shaders/volume_tf_iso_frag.cpp, + src/osgVolume/Shaders/volume_tf_mip_frag.cpp: Updated + RayTracedTechnique shaders from svn/trunk. + +2015-08-04 15:52 robert + + * CMakeLists.txt, NEWS.txt: Updated version and NEWS for 3.2.2 + stable release + +2015-08-04 10:37 robert + + * NEWS.txt: Update NEWS to online Contributors list. + +2015-08-04 10:26 robert + + * AUTHORS.txt: Updated AUTHORS + +2015-08-04 10:25 robert + + * ChangeLog, NEWS.txt: Updated ChangeLog and NEWS for 3.2.2 release + +2015-08-04 10:11 robert + + * CMakeLists.txt: Upated rc number to 4 + +2015-08-04 09:35 robert + + * include/osg/GL: Build fix for Mingw + +2015-07-23 14:42 robert + + * include/osgViewer/ViewerBase: From Pjotr Svetachov, buid fixes + for VS2015. + +2015-07-21 14:22 robert + + * src/osgPlugins/OpenFlight/PaletteRecords.cpp: Added check for + validity of OpenFlight shininess value. + +2015-07-21 13:42 robert + + * include/osg/BoundsChecking: Fixed typo + +2015-07-19 09:51 robert + + * src/osgPlugins/tiff/ReaderWriterTIFF.cpp: Reinstated the + TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + +2015-07-17 09:15 robert + + * CMakeLists.txt: Updated release candidate nubmer + +2015-07-17 09:03 robert + + * AUTHORS.txt, ChangeLog: Updated ChangeLog and AURHORS + +2015-07-17 08:35 robert + + * AUTHORS.txt, ChangeLog: Updated ChangeLog and AUTHORS file + +2015-07-17 08:17 robert + + * CMakeLists.txt: Added cmake_policy setting for cmake-3.x to avoid + warning with Qt usage. + +2015-07-17 08:13 robert + + * src/osgPlugins/tiff/ReaderWriterTIFF.cpp: From Patrick Neary, "To + the tiff plugin, add the capability to write tiff images with + unsigned short data" + +2015-07-16 19:19 robert + + * src/osg/Image.cpp: From Patrick Neary, "Added some lesser used + tokens that we use from GL_ARB_texture_rg to + computeFormatDataType(), and computeNumComponents() in + src/osg/Image.cpp" + +2015-06-30 08:38 robert + + * src/osgPlugins/ogr/ReaderWriterOGR.cpp: Build fix for GLDAL>=2.0 + +2015-06-19 09:54 robert + + * src/osgUtil/RenderStage.cpp: From Jannik Heller, fix to + clearReferencesToDependentCameras(). + +2015-06-12 08:04 robert + + * src/osgText/TextBase.cpp: From Farshid Lashkari, "I've modified + some setter methods of TextBase to avoid unnecessary calls to + computeGlyphRepresentation() if the value has not changed." + +2015-06-10 10:02 robert + + * src/osgGA/NodeTrackerManipulator.cpp: Philippe Renon, "Fixed + potential divide by zero in NodeTrackerManipulator : The divide + by zero happens when throwing a NodeTrackerManipulator. + The infinite result trickles down and later causes NaN in + culling. + + The fix was to use getThrowScale() as done everywhere else." + +2015-06-07 11:13 robert + + * src/osgViewer/CompositeViewer.cpp, src/osgViewer/Viewer.cpp: + Fixed setReferenceTime() bug where a * eather than the correct / + was being used. Bug and fix suggested Benjamin Richter. + +2015-05-21 14:11 robert + + * src/osgText/Text3D.cpp: Fixed memory error associated with + reading over the end of container due to an unbounded while loop. + +2015-05-05 11:04 robert + + * CMakeLists.txt: Changed the CMP0020 check to > 2.8.10 + +2015-04-20 10:43 robert + + * src/osgViewer/GraphicsWindowX11.cpp: Merged correction to + coordinates from svn/trunk + +2015-04-20 10:42 robert + + * applications/osgversion/Contributors.cpp: Updated contributor + fixes + +2015-04-20 09:38 robert + + * src/osg/State.cpp: Moved uniform substitution to infront of + vertex attribute substituion to make sure gl_Vertex usage is + replaced when required. + +2015-04-01 09:37 robert + + * src/osg/Image.cpp: From Lionel Largarde, "fix for the + Image::computeNumberOfMipmapLevels method. The method did use the + float version of the log function and the / operator. + It works for most of the input sizes, but fails for 8192, + 32768... + For 8192, the method returns 13 instead of 14." + +2015-03-17 09:10 robert + + * src/osgWrappers/serializers/osg/LibraryWrapper.cpp: Removed + unimplemented ComputeBoundingBoxCallback and + ComputeBoundingSphereCallback + +2015-03-17 08:26 robert + + * src/osgWrappers/serializers/osg/LibraryWrapper.cpp: Added missing + references for static build + +2015-03-16 10:30 robert + + * src/osgAnimation/Animation.cpp: From Konstantin Matveyev, "Last + update in the osgAnimation::Animation ONCE mode bug fix" + +2015-03-13 08:13 robert + + * src/osgWrappers/serializers/osg/LibraryWrapper.cpp: Reverted + merged from svn/trunk. + +2015-03-13 08:12 robert + + * src/osgWrappers/serializers/osg/LibraryWrapper.cpp: From + Konstantin Matveyev, "Small fix for OSG 3.3.6.119 in the + attachment. + + One line added in osg/LibraryWrapper.cpp + + USE_SERIALIZER_WRAPPER(Callback) + " + +2015-03-12 15:12 robert + + * CMakeModules/FindFBX.cmake: From Laurens Voerman, "attached is a + zip with a modified version of: + OpenSceneGraph\CMakeModules\FindFBX.cmake + + This version can find fbx sdk 2015.1 and will prefer it over + older versions. + + Tested with Visual Studio Express 2013 on 64bit windows 7" + +2015-03-11 17:47 robert + + * src/osgPlugins/exr/ReaderWriterEXR.cpp: Warning fixes + +2015-03-11 17:37 robert + + * src/osgPlugins/sdl/JoystickDevice.cpp: From Laurens Voerman, "The + current version will not compile with SDL version 2, error + OpenSceneGraph\src\osgPlugins\sdl\JoystickDevice.cpp(42): error + C2664: 'const char *SDL_JoystickName(SDL_Joystick *)' : cannot + convert argument 1 from 'int' to 'SDL_Joystick *' + due to changes in the SDL api. + + Tested with Visual Studio Express 2013; SDL 2.0.1" + +2015-03-05 18:00 robert + + * CMakeLists.txt: Updated RC to 2. + +2015-03-05 18:00 robert + + * AUTHORS.txt, ChangeLog, applications/osgversion/Contributors.cpp: + Updated AUTHORS file for next release candidate + +2015-03-03 12:56 robert + + * src/osgUtil/Optimizer.cpp: Restructed the checks in the + CollectLowestTransformsVisitor::removeTransforms() to avoid + benign case being flagged as warning. + +2015-03-03 12:00 robert + + * src/osg/PolygonMode.cpp: Re-organized the #ifdef's to avoid usage + of glPolyginMode under GLES + +2015-03-02 11:08 robert + + * examples/osgtessellationshaders/osgtessellationshaders.cpp: From + Michael McDonnell, Merged enchancements to osgtesselationshader + example from OSG-svn/trunk to OSG-3.2 branch. + +2015-03-01 11:08 robert + + * src/osgGA/OrbitManipulator.cpp, + src/osgGA/StandardManipulator.cpp: From Jannik Heller, "I noticed + the rotation in the OrbitManipulator depends on the framerate. To + reproduce this issue, start the osganimate example, rotate the + model with the left mouse button, then let go of the mouse button + while still moving. You will notice that with V-Sync enabled, the + model rotates slower. + + The OrbitManipulator calculates a scale to counteract the + framerate dependency, but it turns out this scale wasn't used for + the rotation yet." + +2015-02-27 10:15 robert + + * AUTHORS.txt, CMakeLists.txt, ChangeLog, + applications/osgversion/Contributors.cpp: Updated AUTHROS, + Controbitors and rc number in prep for the 3.2.2-rc1 + +2015-02-26 20:06 robert + + * AUTHORS.txt, ChangeLog, applications/osgversion/Contributors.cpp: + Updated AUTHORS + +2015-02-26 19:13 robert + + * src/osg/Image.cpp: From Bradley Baker Searles, "We had someone + replace a DDS texture with a GL_RGB/GL_UNSIGNED_SHORT_5_6_6 + image, which would trigger a crash in Image.cpp while flipping + the mipmap chain. The code was trying to flip the mipmaps using + the rowStep for the full-size image (we have "dds_flip" set in + the osgDB::ReaderWriter::Options in the osgDB::Registry)." + +2015-02-26 18:07 robert + + * src/osgPlugins/dds/ReaderWriterDDS.cpp: From Bradley Baker + Searles, "Small patch attached to handle DDS flip when s=4. + Currently it will omit flipping and generate a warning: "Vertical + flip was skipped. Image dimensions have to be multiple of 4."." + +2015-02-26 14:16 robert + + * src/osgPlugins/tiff/ReaderWriterTIFF.cpp: Fixed typo + +2015-02-23 20:28 robert + + * src/osg/TransferFunction.cpp: Fixed image allocation operations. + +2015-02-23 11:07 robert + + * src/osgViewer/StatsHandler.cpp: From Arjun Ramamurthy, fix for + StatsHandler when being used in multiple view/windows + +2015-02-18 10:23 robert + + * src/osgPlugins/dds/ReaderWriterDDS.cpp: From Sebastian + Messerschmidt,"Attached you find a version of the ReaderWriterDDS + with info outputs set to OSG_INFO instead of OSG_NOTICE. The old + version spams the console for each loaded DDS file." + +2015-01-06 15:10 robert + + * ChangeLog: Updated ChangeLog + +2015-01-06 14:55 robert + + * src/osgVolume/Property.cpp: From Julien Valentin, added missing + initializer + +2015-01-06 14:41 robert + + * src/osgWrappers/serializers/osgVolume/VolumeTechnique.cpp: From + Julien Valentin, typo fix + +2014-12-22 10:35 robert + + * CMakeLists.txt: Added comment about using + -DCMAKE_DISABLE_FINDPACKAGE_* command line. + +2014-12-22 09:50 robert + + * include/osg/ref_ptr: Added doxygen comment for + ref_ptr<>::release(). + +2014-12-18 15:59 robert + + * CMakeLists.txt: From Mattias Helsing, "CMake have release 3.0 and + 3.1 and we have some bad checks for cmake + major version when settings cmake policies in CMakeLists.txt. + This fixes it" + +2014-12-18 11:37 robert + + * applications/osgversion/Contributors.cpp: Updated AUTHORS + +2014-12-18 09:20 robert + + * PlatformSpecifics/Android/Application.mk.master.in: From Adrian + Clark, "Recently I tried compiling version 3.x of OpenSceneGraph + for Android, using a recent Android NDK, only to run into + problems with missing dependencies when trying to link my android + project against the generated libraries. + + + + After some exploration, I found the problem is because the + APP_PLATFORM variable in Application.mk is set to a platform + number which is no longer compatible with the Android NDK by the + OSG CMake toolchain. This causes the Android to compile it using + the most recent Android platform libraries which (for reasons I + don't know) no longer provide functions which OSG relies (in + particular rand and stat64). + + + + This bug affects the current SVN repos for OSG 3.3.1, OSG 3.3.0, + OSG 3.2.1 and OSG 3.2.0 (and possibly earlier). + + + + I posted a longer discussion of what the problem is in this forum + thread: + + http://forum.openscenegraph.org/viewtopic.php?p=62012#62012 + + + + + + But essentially the fix is to change one line in + OSG/PlatformSpecifics/Android/Application.mk.master.in from: + + + + APP_PLATFORM := ${ANDROID_PLATFORM} + + + + To + + + + APP_PLATFORM := android-${ANDROID_PLATFORM} + + + + + + The attached file will fix the bug in the 3.2.0 - 3.3.1 SVN repos + for OSG. + + " + +2014-12-10 11:30 robert + + * src/osgPlugins/dae/daeRMaterials.cpp: From Farshid Lashkari, "The + Collada loader would crash while processing textures on certain + files. I've attached the fix." + +2014-12-08 11:08 robert + + * src/osgUtil/CullVisitor.cpp: Fixed memory leak in + RenderStageCache. + +2014-11-26 17:07 robert + + * applications/present3D/Cluster.h: Fixed warnigns + +2014-11-26 17:07 robert + + * applications/present3D/Cluster.cpp, + applications/present3D/Cluster.h: Removed redundent line endings + +2014-11-26 16:29 robert + + * src/osgPlugins/ffmpeg/CMakeLists.txt: Fixed deprecated warnings + +2014-11-26 16:15 robert + + * src/osgPlugins/pdf/CMakeLists.txt: Fixed warning + +2014-11-26 16:07 robert + + * examples/osgcluster/osgcluster.cpp: Fixed warnings + +2014-11-26 16:06 robert + + * examples/osgcluster/osgcluster.cpp: Removed redudent spaces + +2014-11-26 16:02 robert + + * src/osgPlugins/lwo/Object.cpp: Fixed warning + +2014-11-24 15:24 robert + + * CMakeLists.txt, CMakeModules/FindAVFoundation.cmake, + CMakeModules/FindQuickTime.cmake, + src/osgViewer/PixelBufferCocoa.mm: From Jan Klimke, "i noticed, + that there are a couple of additional flaws when building osg for + Mac OS X 10.10 Yosemite. + + The mac os sdk version is recognized by the current CMAKE script + as 10.1 instead of 10.10 since it cuts the version string from + the 4th place. I introduced a more reliable version checking + based on splitting the returned version code into MAJOR MINOR and + PATCH parts and reassemble the OSG sdk version afterwards. + + I replaced the existing CMake code against the following + (returning now version 10.10 as expected): + + # Determine the canonical name of the selected Platform SDK + EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion" + OUTPUT_VARIABLE OSG_OSX_SDK_NAME + OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME}) + LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR) + LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR) + LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH) + + SET(OSG_OSX_SDK_NAME + "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}") + + Also i added the check for the new Version to some more find + scripts. + + Additionally the nil object in Objective C now seems to be + equivalent with a null_ptr that cannot be passed as GLInt + anymore. So i switched this in the PixelBufferCocoa.mm to pass a + zero instead of nil. + " + +2014-11-24 14:10 robert + + * examples/osgsimplegl3/osgsimplegl3.cpp: Fixed handling of + viewer's Camera + +2014-11-21 20:16 robert + + * src/osgDB/CMakeLists.txt, src/osgDB/FileUtils.cpp: From Alberto + Luaces,"the current code uses the preprocessor for generating the + plugin path in + a way that when CMAKE_INSTALL_PREFIX contains something along the + lines + of + + /usr/x86_64-linux-gnu/ + + it gets substituted as + + /usr/x86_64-1-gnu/ + + that is, the string is preprocessed again, thereby making changes + to + anything that matches any defined symbol, as "linux" in this + example + (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763816). + + Quoting that path directly in CMake scripts solves that problem. + " + +2014-11-21 10:21 robert + + * CMakeModules/CheckAtomicOps.cmake: From Björn Blissing, fix for + ambiguous defines in Atomic.cpp when compiling with MinGW and GCC + +2014-11-21 09:28 robert + + * applications/osgversion/Contributors.cpp: Copied Contributors + file from svn/trunk. + +2014-11-20 17:37 robert + + * include/osg/Texture: From Claus Steuer, "XCode 6, IOs 8.1 SDK + Compile fix : There are some undefined texture formats when + compiling osg for IOs 8.1 with XCode 6 and OpenGLES2 enabled." + +2014-11-20 16:38 robert + + * src/osgPlugins/obj/ReaderWriterOBJ.cpp: From Farshid Lashkari, + "The obj loader was overriding the existing database path list + with the file path of the model, instead of prepending the file + path to the path list. The latter seems to be more common + behavior for most of the existing loader plugins. Also, the local + options weren't actually being used when processing the scene + graph for textures. I've attached the fix for both issues." + +2014-11-20 10:52 robert + + * src/osgPlugins/Inventor/ConvertFromInventor.cpp: From Marc + Helbling, "here is a trivial fix in the Inventor plugin. In one + code path, the pointer validity is checked after dereferencing a + pointer that can be null (image->valid()) instead of calling + ref_ptr::valid (image.valid())." + +2014-11-20 10:45 robert + + * src/osgUtil/MeshOptimizers.cpp: From Marc Helbling, "I've come + across scenes that contains geometries with initialized but empty + vertex arrays and primitives and that would make some optimizers + crash. + + The submission therefore only contains a test on the size of the + vertex array for the VertexCacheMissVisitor and the + VertexAccessOrderVisitor visitors." + +2014-11-20 09:55 robert + + * src/osgPlugins/3ds/ReaderWriter3DS.cpp: From Sukender, "Fix for + 3DS reader, which may read wrong triangles. Actually, indices may + suffer a 'short int' overflow, in two places." + +2014-11-20 09:41 robert + + * src/osg/Texture2DArray.cpp: Fixed segfalt in Texture2DArray copy + constructor where it would apply images to an uninitialzed + vector. + +2014-11-20 09:32 robert + + * src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp, + src/osgPlugins/fbx/fbxMaterialToOsgStateSet.h, + src/osgPlugins/fbx/fbxRMesh.cpp: From Marc Helbling, "patch + adding support for ambient material in the FBX plugin. It's a + straightfoward adaptation of the emissive support and has been + tested on a proprietary model." + +2014-11-20 09:31 robert + + * CMakeLists.txt: Added default setting of build type to Release + +2014-11-20 09:21 robert + + * src/osgPlugins/gif/ReaderWriterGIF.cpp: From Pjotr Svetachov, fix + for build breakage with giflib 5.0. + +2014-11-19 17:31 robert + + * applications/osgversion/Contributors.cpp: Fixed contributors + names + +2014-11-19 17:31 robert + + * src/osgPlugins/gif/ReaderWriterGIF.cpp: From Clement Boesch, "Fix + remaining bit of Giflib5 usage" + +2014-11-19 11:37 robert + + * src/osgWrappers/deprecated-dotosg/osg/ProxyNode.cpp: From Laurens + Voerman, "I found a new way to crach the osgviewer: + osgviewer "ProxyNode { FileNameList { cow.osgt } num_children 1 + }".osgs + + The proxy node reader wrongly assumes options to be non NULL. + + fixed in attached zip: + src\osgWrappers\deprecated-dotosg\osg\ProxyNode.cpp + + applies to both the 3.2 branch and svn trunk" + +2014-11-04 16:29 robert + + * src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp, + src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: Build fixes for + ffmpeg LIBAVCODEC_VERSION_MAJOR >= 56 + +2014-08-19 09:27 robert + + * src/osgPlugins/md2/ReaderWriterMD2.cpp: Fixed MD2 danglng pointer + crash. + +2014-08-08 16:42 robert + + * src/osgPlugins/txp/ReaderWriterTXP.cpp: From Ryan Kawicki, "There + is an issue where the model insets of a terrex terrain are being + removed during the loading process. The issue is described below. + + - the issue here is that the plugin is removing group nodes if + that group node only has one child. becuase transforms are also + group nodes, there were cases when the transform would have only + one child under it and would cause it to remove the translation + portion. this would cause all the vertex data to be loaded around + the last matrix operation, which in our case was the origin + (0,0,0). + + We work off of OSG 2.8.1 but see that this has not been addressed + on latest yet. I’ve tested this against 2.8.1 and have cleanly + applied it to my local repository off of latest." + +2014-08-08 16:34 robert + + * src/osgUtil/RenderStage.cpp: From Tim George, "Currently there is + a problem with using a camera with a viewport with a non 0 offset + and also using an FBO. The problem is that only area made up of + the viewports width and height is drawn based on an offset of 0,0 + instead of using the viewports offset. + + It is caused by line 991 in RenderStage.cpp: + + + Code: + fbo_ext->glBlitFramebuffer( + 0, 0, static_cast(_viewport->width()), + static_cast(_viewport->height()), + 0, 0, static_cast(_viewport->width()), + static_cast(_viewport->height()), + blitMask, GL_NEAREST); + + + + which is not taking into account the viewport x and y when + performing the blit. It probably should be: + + + Code: + fbo_ext->glBlitFramebuffer( + static_cast(_viewport->x()), + static_cast(_viewport->y()), + static_cast(_viewport->width()) + + static_cast(_viewport->x()), + static_cast(_viewport->height()) + + static_cast(_viewport->y()), + static_cast(_viewport->x()), + static_cast(_viewport->y()), + static_cast(_viewport->width()) + + static_cast(_viewport->x()), + static_cast(_viewport->height()) + + static_cast(_viewport->y()), + blitMask, GL_NEAREST); + " + + Note from Robert Osfield, made small tweak to above on merge, + changing the width+x to x+width to make it read more naturally. + +2014-08-08 16:09 robert + + * src/osgUtil/MeshOptimizers.cpp: From Marc Helbling, "please find + a fix for the vertex pretransform visitor + (VertexAccessOrderVisitor). + The issue with current code is that arrays are collected *before* + duplicating shared arrays which leads to arrays that are + correctly duplicated but that are not reordered. + + Also the submitted patch contains a small cleaning in + GeometryArrayGathrer as the _useDrawElements variable is not + used; it is only set in the GeometryArrayGathrer constructor and + VertexAccessOrderVisitor already checks that primitives have + indexed type." + +2014-08-08 15:45 robert + + * include/osg/Node: Applied fix to + Node::remove*Callback(NodeCallback*) inspired by fix from Glen + Waldron that was applied to svn/trunk. + +2014-07-29 15:47 robert + + * src/osgUtil/Optimizer.cpp: Added catch for NULL Transform + pointers getting into the _transformMap. + +2014-07-22 16:35 robert + + * include/osg/State, src/osg/State.cpp: Removed usage of + _appliedProgramObjectSet as it's no longer used by OSG + applications and was causing a threading crash. + +2014-07-22 16:34 robert + + * CMakeLists.txt, include/osg/Version: Updated version to 3.2.2 + +2014-07-21 13:45 robert + + * src/osgText/Glyph.cpp: Added setting of glPixelStore before + glTexSubImage2D call. + +2014-07-21 13:43 robert + + * src/osgText/Glyph.cpp: I want to submit a bugfix for a crash + occurring in osgText/Glyph.cpp if + the scene tree contains (large) 2D textures from images with + STRIDE. + + ============================================================================ + #0 0x00007fffe8ea4350 in __memmove_ssse3 () from /lib64/libc.so.6 + #1 0x00007fffe52ced76 in ?? () from + /usr/lib64/libnvidia-glcore.so.310.44 + #2 0x00007fffe52d8e86 in ?? () from + /usr/lib64/libnvidia-glcore.so.310.44 + #3 0x00007fffe53dd8be in ?? () from + /usr/lib64/libnvidia-glcore.so.310.44 + #4 0x00007fffe53c2643 in ?? () from + /usr/lib64/libnvidia-glcore.so.310.44 + #5 0x00007fffe53c7fdd in ?? () from + /usr/lib64/libnvidia-glcore.so.310.44 + #6 0x00007fffe53cbabf in ?? () from + /usr/lib64/libnvidia-glcore.so.310.44 + #7 0x00007fffe53cc1fa in ?? () from + /usr/lib64/libnvidia-glcore.so.310.44 + #8 0x00007ffff30092fd in osgText::GlyphTexture::apply + (this=0x1bb8cf0, state= + ...) + at + /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/src/osgText/Glyph.cpp:234 + #9 0x00007ffff56c30b6 in osg::State::applyAttributeOnTexUnit + (this=0x125f180, + unit=0, attribute=0x1bb8cf0, as=...) + at + /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:1713 + #10 0x00007ffff56c2f3f in osg::State::applyTextureAttribute + (this=0x125f180, + unit=0, attribute=0x1bb8cf0) + at + /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:411 + #11 0x00007ffff30204da in osgText::Text::drawTextWithBackdrop + (this=0x1baed70, + state=..., colorMultiplier=...) + ============================================================================== + + The crash disappears if I either (1) disable the use of images + with stride + in the (public) osgGeo-library, or (2) add the following bugfix + to Glyph.cpp. + This combination gives me the confidence that I understand where + this problem + originates from, without trying to understand the full OpenGL + details. + + =============================================================================== + @@ -221,7 +223,12 @@ + imageData[i] = 0; + } + + + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + + + #if !defined(OSG_GLES1_AVAILABLE) && + !defined(OSG_GLES2_AVAILABLE) + + glPixelStorei(GL_UNPACK_ROW_LENGTH,getTextureWidth()); + + #endif + + + // allocate the texture memory. + glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA, + getTextureWidth(), getTextureHeight(), 0, + ================================================================================ + + I have copied (and adapted) the added lines above from the same + source file, + where they were used in front of a similar call to + glTexSubImage2D(.) around + line 515." + +2014-07-04 11:34 robert + + * ChangeLog, README.txt: Updated ChangeLog and README for release + 2014-07-04 11:29 robert * CMakeLists.txt: Updated version number to 3.2.1 for release diff -Nru openscenegraph-3.2.1/OpenSceneGraph/CMakeLists.txt openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeLists.txt --- openscenegraph-3.2.1/OpenSceneGraph/CMakeLists.txt 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeLists.txt 2015-08-12 07:38:17.000000000 +0000 @@ -22,25 +22,30 @@ # tell CMake to prefer CMake's own CMake modules when available # only available from cmake-2.8.4 - if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3) + if(${CMAKE_MAJOR_VERSION} GREATER 2 OR + (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR + (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)) cmake_policy(SET CMP0017 NEW) endif() # cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names # quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below." - if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0) + if(${CMAKE_MAJOR_VERSION} GREATER 2 OR + (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 6) OR + (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6 AND ${CMAKE_PATCH_VERSION} GREATER 0)) cmake_policy(SET CMP0008 OLD) endif() # disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1) - if((${CMAKE_MAJOR_VERSION} EQUAL 2 OR ${CMAKE_MAJOR_VERSION} GREATER 2) AND - (${CMAKE_MINOR_VERSION} EQUAL 8 OR ${CMAKE_MINOR_VERSION} GREATER 8) AND - ${CMAKE_PATCH_VERSION} GREATER 10) + if(${CMAKE_MAJOR_VERSION} GREATER 2 OR + (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR + (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 10)) cmake_policy(SET CMP0020 OLD) endif() # nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements? #if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10) - + # or even easier (available in cmake-2.6) + #if(POLICY CMPxyzw) endif() @@ -48,7 +53,7 @@ SET(OPENSCENEGRAPH_MAJOR_VERSION 3) SET(OPENSCENEGRAPH_MINOR_VERSION 2) -SET(OPENSCENEGRAPH_PATCH_VERSION 1) +SET(OPENSCENEGRAPH_PATCH_VERSION 3) SET(OPENSCENEGRAPH_SOVERSION 100) # set to 0 when not a release candidate, non zero means that any generated @@ -80,6 +85,13 @@ # Maybe this can be used override existing behavior if needed? SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") + +# Change the default build type to Release +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) +ENDIF(NOT CMAKE_BUILD_TYPE) + + ## Option to enable Android build using AndroidNDK OPTION(OSG_BUILD_PLATFORM_ANDROID OFF) IF(OSG_BUILD_PLATFORM_ANDROID) @@ -234,8 +246,12 @@ EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion" OUTPUT_VARIABLE OSG_OSX_SDK_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(SUBSTRING "${OSG_OSX_SDK_NAME}" 0 4 OSG_OSX_SDK_NAME) - SET(OSG_OSX_SDK_NAME "macosx${OSG_OSX_SDK_NAME}") + STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME}) + LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR) + LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR) + LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH) + + SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}") # Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working # Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below @@ -511,6 +527,12 @@ INCLUDE(Find3rdPartyDependencies) ENDIF() +# +# If you want to prevent CMake from picking up on any of the following optional 3rd Party dependencies in CMake 2.8 onwards +# you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) : +# cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 . +# + IF(ANDROID) ANDROID_3RD_PARTY() ELSE() @@ -596,6 +618,13 @@ #If we have found Qt5, let's try to top off by getting the webkit as well IF ( Qt5Widgets_FOUND ) FIND_PACKAGE(Qt5WebKitWidgets QUIET) + + IF(COMMAND cmake_policy) + IF(${CMAKE_MAJOR_VERSION} GREATER 2) + # Qt5 qt5_use_modules usage was causing "Policy CMP0043 is not set: Ignore COMPILE_DEFINITIONS_ properties." warnings + cmake_policy(SET CMP0043 NEW) + ENDIF() + ENDIF() ENDIF() ENDIF() @@ -918,7 +947,7 @@ # FORCE is used because the options are not reflected in the UI otherwise. # Seems like a good place to add version specific compiler flags too. IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) - IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9") + IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10") SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE) # 64 Bit Works, i386,ppc is not supported any more SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE) diff -Nru openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/CheckAtomicOps.cmake openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/CheckAtomicOps.cmake --- openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/CheckAtomicOps.cmake 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/CheckAtomicOps.cmake 2014-11-21 10:21:44.000000000 +0000 @@ -143,6 +143,15 @@ NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC) SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1) ENDIF() + + + # MinGW can set both WIN32_INTERLOCKED and GCC_BUILTINS to true which results in compliation errors + IF (_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED) + # In this case we prefer the GCC_BUILTINS + SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 1) + SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0) + ENDIF() + ENDIF() ENDIF() diff -Nru openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/FindAVFoundation.cmake openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/FindAVFoundation.cmake --- openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/FindAVFoundation.cmake 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/FindAVFoundation.cmake 2014-11-24 15:24:31.000000000 +0000 @@ -30,7 +30,7 @@ # AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG # so check the SDK-setting - IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9") + IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10") # nothing special here ;-) ELSE() MESSAGE("AVFoundation disabled for SDK < 10.8") diff -Nru openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/FindFBX.cmake openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/FindFBX.cmake --- openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/FindFBX.cmake 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/FindFBX.cmake 2015-03-12 15:12:57.000000000 +0000 @@ -18,8 +18,10 @@ SET(FBX_LIBDIR "vs2008") ELSEIF(MSVC10) SET(FBX_LIBDIR "vs2010") -ELSEIF(MSVC11 OR MSVC_VERSION>1700) +ELSEIF(MSVC11) SET(FBX_LIBDIR "vs2012") +ELSEIF(MSVC12 OR MSVC_VERSION>1800) + SET(FBX_LIBDIR "vs2013") ENDIF() IF(APPLE) @@ -32,6 +34,8 @@ SET(FBX_LIBDIR ${FBX_LIBDIR}/x86) ENDIF() +#try to use 2015.1 or 2014.2 version + IF(APPLE) SET(FBX_LIBNAME "libfbxsdk") ELSEIF(CMAKE_COMPILER_IS_GNUCXX) @@ -44,10 +48,15 @@ SET( FBX_SEARCH_PATHS $ENV{FBX_DIR} - "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1" - "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1" + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1" + /Applications/Autodesk/FBXSDK20151 + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2" + /Applications/Autodesk/FBXSDK20142 /Applications/Autodesk/FBXSDK20141 ) +#I think the last line in the search path is an old typo, but let's search for 2014.1 anyway - LV # search for headers & debug/release libraries FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h" @@ -74,6 +83,44 @@ ENDIF() IF(NOT FBX_FOUND) +#try to use 2014.1 version + IF(APPLE) + SET(FBX_LIBNAME "fbxsdk-2014.1") + ELSEIF(CMAKE_COMPILER_IS_GNUCXX) + SET(FBX_LIBNAME "fbxsdk-2014.1") + ELSE() + SET(FBX_LIBNAME "fbxsdk-2014.1") + ENDIF() + + SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d) + + SET( FBX_SEARCH_PATHS + $ENV{FBX_DIR} + $ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1 + $ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1 + /Applications/Autodesk/FBXSDK20141 + ) + + # search for headers & debug/release libraries + FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h" + PATHS ${FBX_SEARCH_PATHS} + PATH_SUFFIXES "include") + FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME} + PATHS ${FBX_SEARCH_PATHS} + PATH_SUFFIXES "lib/${FBX_LIBDIR}") + + FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG} + PATHS ${FBX_SEARCH_PATHS} + PATH_SUFFIXES "lib/${FBX_LIBDIR}") + IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR) + SET(FBX_FOUND "YES") + ELSE() + SET(FBX_FOUND "NO") + ENDIF() + +ENDIF() + +IF(NOT FBX_FOUND) #try to use 2013.3 version IF(APPLE) SET(FBX_LIBNAME "fbxsdk-2013.3-static") @@ -89,7 +136,7 @@ $ENV{FBX_DIR} $ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3 $ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3 - /Applications/Autodesk/FBXSDK20141 + /Applications/Autodesk/FBXSDK20133 ) # search for headers & debug/release libraries diff -Nru openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/FindQuickTime.cmake openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/FindQuickTime.cmake --- openscenegraph-3.2.1/OpenSceneGraph/CMakeModules/FindQuickTime.cmake 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/CMakeModules/FindQuickTime.cmake 2014-11-24 15:24:31.000000000 +0000 @@ -63,8 +63,8 @@ ENDIF() ENDIF() # Disable quicktime for >= 10.7, as it's officially deprecated - - IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9") + + IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10") MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}") SET(QUICKTIME_FOUND "NO") ENDIF() diff -Nru openscenegraph-3.2.1/OpenSceneGraph/examples/osgcluster/osgcluster.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/examples/osgcluster/osgcluster.cpp --- openscenegraph-3.2.1/OpenSceneGraph/examples/osgcluster/osgcluster.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/examples/osgcluster/osgcluster.cpp 2014-11-26 16:07:46.000000000 +0000 @@ -48,13 +48,13 @@ const unsigned int SWAP_BYTES_COMPARE = 0x12345678; class CameraPacket { public: - - - CameraPacket():_masterKilled(false) + + + CameraPacket():_masterKilled(false) { _byte_order = SWAP_BYTES_COMPARE; } - + void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp) { _matrix = matrix; @@ -63,20 +63,20 @@ _frameStamp = *frameStamp; } } - + void getModelView(osg::Matrix& matrix,float angle_offset=0.0f) { - + matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f); } - + void readEventQueue(osgViewer::Viewer& viewer); - + void writeEventQueue(osgViewer::Viewer& viewer); void setMasterKilled(const bool flag) { _masterKilled = flag; } const bool getMasterKilled() const { return _masterKilled; } - + unsigned int _byte_order; bool _masterKilled; osg::Matrix _matrix; @@ -84,11 +84,11 @@ // note don't use a ref_ptr as used elsewhere for FrameStamp // since we don't want to copy the pointer - but the memory. // FrameStamp doesn't have a private destructor to allow - // us to do this, even though its a reference counted object. + // us to do this, even though its a reference counted object. osg::FrameStamp _frameStamp; - + osgGA::EventQueue::Events _events; - + }; class DataConverter @@ -112,7 +112,7 @@ bool _swapBytes; char* _currentPtr; - + void reset() { _currentPtr = _startPtr; @@ -122,22 +122,22 @@ { if (_currentPtr+1>=_endPtr) return; - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr); } inline void read1(char* ptr) { if (_currentPtr+1>=_endPtr) return; - *(ptr) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } inline void write2(char* ptr) { if (_currentPtr+2>=_endPtr) return; - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr); } inline void read2(char* ptr) @@ -146,13 +146,13 @@ if (_swapBytes) { - *(ptr+1) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr+1) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } else { - *(ptr++) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } } @@ -160,10 +160,10 @@ { if (_currentPtr+4>=_endPtr) return; - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr); } inline void read4(char* ptr) @@ -172,17 +172,17 @@ if (_swapBytes) { - *(ptr+3) = *(_currentPtr++); - *(ptr+2) = *(_currentPtr++); - *(ptr+1) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr+3) = *(_currentPtr++); + *(ptr+2) = *(_currentPtr++); + *(ptr+1) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } else { - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } } @@ -190,15 +190,15 @@ { if (_currentPtr+8>=_endPtr) return; - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr++); - *(_currentPtr++) = *(ptr); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr++); + *(_currentPtr++) = *(ptr); } inline void read8(char* ptr) @@ -208,27 +208,27 @@ if (_swapBytes) { - *(ptr+7) = *(_currentPtr++); - *(ptr+6) = *(_currentPtr++); - *(ptr+5) = *(_currentPtr++); - *(ptr+4) = *(_currentPtr++); - - *(ptr+3) = *(_currentPtr++); - *(ptr+2) = *(_currentPtr++); - *(ptr+1) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr+7) = *(_currentPtr++); + *(ptr+6) = *(_currentPtr++); + *(ptr+5) = *(_currentPtr++); + *(ptr+4) = *(_currentPtr++); + + *(ptr+3) = *(_currentPtr++); + *(ptr+2) = *(_currentPtr++); + *(ptr+1) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } else { - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr++) = *(_currentPtr++); - *(ptr) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr++) = *(_currentPtr++); + *(ptr) = *(_currentPtr++); } } @@ -241,14 +241,14 @@ inline void writeFloat(float c) { write4((char*)&c); } inline void writeDouble(double c) { write8((char*)&c); } - inline char readChar() { char c; read1(&c); return c; } - inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; } - inline short readShort() { short c; read2((char*)&c); return c; } - inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; } - inline int readInt() { int c; read4((char*)&c); return c; } - inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; } - inline float readFloat() { float c; read4((char*)&c); return c; } - inline double readDouble() { double c; read8((char*)&c); return c; } + inline char readChar() { char c=0; read1(&c); return c; } + inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; } + inline short readShort() { short c=0; read2((char*)&c); return c; } + inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; } + inline int readInt() { int c=0; read4((char*)&c); return c; } + inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; } + inline float readFloat() { float c=0.0f; read4((char*)&c); return c; } + inline double readDouble() { double c=0.0; read8((char*)&c); return c; } void write(const osg::FrameStamp& fs) { @@ -361,16 +361,16 @@ event.setModKeyMask(readUInt()); event.setTime(readDouble()); } - + void write(CameraPacket& cameraPacket) { writeUInt(cameraPacket._byte_order); - + writeUInt(cameraPacket._masterKilled); - + write(cameraPacket._matrix); write(cameraPacket._frameStamp); - + writeUInt(cameraPacket._events.size()); for(osgGA::EventQueue::Events::iterator itr = cameraPacket._events.begin(); itr != cameraPacket._events.end(); @@ -387,12 +387,12 @@ { _swapBytes = !_swapBytes; } - + cameraPacket._masterKilled = readUInt()!=0; - + read(cameraPacket._matrix); read(cameraPacket._frameStamp); - + cameraPacket._events.clear(); unsigned int numEvents = readUInt(); for(unsigned int i=0;icopyEvents(_events); osg::notify(osg::INFO)<<"written events = "<<_events.size()<setDescription(arguments.getApplicationName()+" is the example which demonstrates how to approach implementation of clustering."); arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); @@ -459,7 +459,7 @@ arguments.getApplicationUsage()->addCommandLineOption("-n ","Socket number to transmit packets"); arguments.getApplicationUsage()->addCommandLineOption("-f ","Field of view of camera"); arguments.getApplicationUsage()->addCommandLineOption("-o ","Offset angle of camera"); - + // construct the viewer. osgViewer::Viewer viewer; @@ -468,12 +468,12 @@ ViewerMode viewerMode = STAND_ALONE; while (arguments.read("-m")) viewerMode = MASTER; while (arguments.read("-s")) viewerMode = SLAVE; - + int socketNumber=8100; while (arguments.read("-n",socketNumber)) ; float camera_fov=-1.0f; - while (arguments.read("-f",camera_fov)) + while (arguments.read("-f",camera_fov)) { } @@ -497,7 +497,7 @@ arguments.writeErrorMessages(std::cout); return 1; } - + if (arguments.argc()<=1) { arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); @@ -514,13 +514,13 @@ { double fovy, aspectRatio, zNear, zFar; viewer.getCamera()->getProjectionMatrixAsPerspective(fovy, aspectRatio,zNear, zFar); - + double original_fov = atan(tan(osg::DegreesToRadians(fovy)*0.5)*aspectRatio)*2.0; std::cout << "setting lens perspective : original "<setProjectionMatrixAsPerspective(fovy, aspectRatio,zNear, zFar); - + viewer.getCamera()->getProjectionMatrixAsPerspective(fovy, aspectRatio,zNear, zFar); original_fov = atan(tan(osg::DegreesToRadians(fovy)*0.5)*aspectRatio)*2.0; std::cout << "setting lens perspective : new "<(socketNumber)); bool masterKilled = false; - + DataConverter scratchPad(1024); while( !viewer.done() && !masterKilled ) { osg::Timer_t startTick = osg::Timer::instance()->tick(); - + viewer.advance(); // special handling for working as a cluster. @@ -563,12 +563,12 @@ { case(MASTER): { - + // take camera zero as the guide. osg::Matrix modelview(viewer.getCamera()->getViewMatrix()); - + cp->setPacket(modelview,viewer.getFrameStamp()); - + cp->readEventQueue(viewer); scratchPad.reset(); @@ -578,11 +578,11 @@ scratchPad.read(*cp); bc.setBuffer(scratchPad._startPtr, scratchPad._numBytes); - + std::cout << "bc.sync()"<writeEventQueue(viewer); - if (cp->getMasterKilled()) + if (cp->getMasterKilled()) { std::cout << "Received master killed."<tick(); - + osg::notify(osg::INFO)<<"Time to do cluster sync "<delta_m(startTick,endTick)<getModelView(modelview,camera_offset); - + viewer.getCamera()->setViewMatrix(modelview); } // fire off the cull and draw traversals of the scene. if(!masterKilled) viewer.renderingTraversals(); - + } // if we are master clean up by telling all slaves that we're going down. @@ -638,7 +638,7 @@ { // need to broadcast my death. cp->setPacket(osg::Matrix::identity(),viewer.getFrameStamp()); - cp->setMasterKilled(true); + cp->setMasterKilled(true); scratchPad.reset(); scratchPad.write(*cp); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/examples/osgsimplegl3/osgsimplegl3.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/examples/osgsimplegl3/osgsimplegl3.cpp --- openscenegraph-3.2.1/OpenSceneGraph/examples/osgsimplegl3/osgsimplegl3.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/examples/osgsimplegl3/osgsimplegl3.cpp 2014-11-24 14:10:40.000000000 +0000 @@ -20,7 +20,7 @@ void configureShaders( osg::StateSet* stateSet ) { - const std::string vertexSource = + const std::string vertexSource = "#version 140 \n" " \n" "uniform mat4 osg_ModelViewProjectionMatrix; \n" @@ -41,7 +41,7 @@ "} \n"; osg::Shader* vShader = new osg::Shader( osg::Shader::VERTEX, vertexSource ); - const std::string fragmentSource = + const std::string fragmentSource = "#version 140 \n" " \n" "in vec4 color; \n" @@ -90,16 +90,16 @@ return( 1 ); } + osgViewer::Viewer viewer; + // Create a Camera that uses the above OpenGL context. - osg::Camera* cam = new osg::Camera; + osg::Camera* cam = viewer.getCamera(); cam->setGraphicsContext( gc.get() ); // Must set perspective projection for fovy and aspect. cam->setProjectionMatrix( osg::Matrix::perspective( 30., (double)width/(double)height, 1., 100. ) ); // Unlike OpenGL, OSG viewport does *not* default to window dimensions. cam->setViewport( new osg::Viewport( 0, 0, width, height ) ); - osgViewer::Viewer viewer; - viewer.setCamera( cam ); viewer.setSceneData( root ); // for non GL3/GL4 and non GLES2 platforms we need enable the osg_ uniforms that the shaders will use, @@ -118,7 +118,7 @@ necessary configuration steps. Get the draft gl3.h header file from OpenGL.org and put it in a folder called -“GL3” somewhere on your hard drive. OSG includes this header as . Get +GL3 somewhere on your hard drive. OSG includes this header as . Get gl3.h from here: http://www.opengl.org/registry/ @@ -128,7 +128,7 @@ * Add the path to to the CMake compiler flags, CMAKE_CXX_FLAGS and CMAKE_CXX_FLAGS_DEBUG (for release and debug builds; others if you use other build configurations). The text to add should look something like this: - /I “C:\GLHeader” + /I C:\GLHeader The folder GLHeader should contain a subfolder GL3, which in turn contains gl3.h. diff -Nru openscenegraph-3.2.1/OpenSceneGraph/examples/osgtessellationshaders/osgtessellationshaders.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/examples/osgtessellationshaders/osgtessellationshaders.cpp --- openscenegraph-3.2.1/OpenSceneGraph/examples/osgtessellationshaders/osgtessellationshaders.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/examples/osgtessellationshaders/osgtessellationshaders.cpp 2015-03-02 11:08:59.000000000 +0000 @@ -1,6 +1,13 @@ /* A demonstration of Tessellation Shaders in OpenScenegraph. + * + * Instructions: + * Press plus to increase tesselation and minus to decrease it. + * Press right arrow to increase inner tesselation and left arrow to decrease it. + * Press up arrow to increase outer tesselation and down arrow to decrease it. + * * Original code by Philip Rideout * Adapted to OpenScenegraph by John Kaniarz + * Additional work by Michael Mc Donnell */ #include @@ -113,7 +120,8 @@ "}\n" }; -osg::ref_ptr CreateIcosahedron(osg::Program *program){ +osg::ref_ptr CreateIcosahedron(osg::Program *program) +{ osg::Geode *geode=new osg::Geode(); osg::Geometry *geometry = new osg::Geometry(); const unsigned int Faces[] = { @@ -163,10 +171,16 @@ geometry->setVertexArray(vertices); geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::PATCHES,IndexCount,Faces)); + // Expand the bounding box, otherwise the geometry is clipped in front when tessellating. + osg::BoundingBox bbox(osg::Vec3(-1.0f, -1.9f, -1.0f), osg::Vec3(1.0f, 1.0f, 1.0f)); + geometry->setInitialBound(bbox); + geode->addDrawable(geometry); return geode; } -osg::ref_ptr createProgram(){ + +osg::ref_ptr createProgram() +{ osg::Program *program = new osg::Program(); program->addShader(new osg::Shader(osg::Shader::VERTEX,vertSource)); program->addShader(new osg::Shader(osg::Shader::TESSCONTROL,tessControlSource)); @@ -179,38 +193,74 @@ return program; } -float tessInner=1.0f; -float tessOuter=1.0f; -osg::ref_ptr tessInnerU = new osg::Uniform("TessLevelInner",tessInner); -osg::ref_ptr tessOuterU = new osg::Uniform("TessLevelOuter",tessOuter); - -class KeyboardEventHandler : public osgGA::GUIEventHandler { +class KeyboardEventHandler : public osgGA::GUIEventHandler +{ public: - KeyboardEventHandler():osgGA::GUIEventHandler(){} - virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& gaa){ + KeyboardEventHandler(osg::ref_ptr tessInnerU, osg::ref_ptr tessOuterU): + _tessInnerU(tessInnerU), + _tessOuterU(tessOuterU) + { + tessInnerU->get(_tessInner); + tessOuterU->get(_tessOuter); + } + + virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& gaa) + { if(ea.getEventType()==osgGA::GUIEventAdapter::KEYDOWN){ switch (ea.getKey()){ case osgGA::GUIEventAdapter::KEY_Up: - tessOuter++; - tessOuterU->set(tessOuter); + increaseOuterTesselation(); return true; case osgGA::GUIEventAdapter::KEY_Down: - tessOuter--; - tessOuter=std::max(1.0f,tessOuter); - tessOuterU->set(tessOuter); + decreaseOuterTesselation(); return true; case osgGA::GUIEventAdapter::KEY_Left: - tessInner--; - tessInner=std::max(1.0f,tessInner); - tessInnerU->set(tessInner); + decreaseInnerTesselation(); return true; case osgGA::GUIEventAdapter::KEY_Right: - tessInner++; - tessInnerU->set(tessInner); + increaseInnerTesselation(); + return true; + case osgGA::GUIEventAdapter::KEY_Plus: + case osgGA::GUIEventAdapter::KEY_KP_Add: + increaseInnerTesselation(); + increaseOuterTesselation(); + return true; + case osgGA::GUIEventAdapter::KEY_Minus: + case osgGA::GUIEventAdapter::KEY_KP_Subtract: + decreaseInnerTesselation(); + decreaseOuterTesselation(); return true; } } - return osgGA::GUIEventHandler::handle(ea,gaa); + return osgGA::GUIEventHandler::handle(ea, gaa); + } + +private: + osg::ref_ptr _tessInnerU; + osg::ref_ptr _tessOuterU; + float _tessInner; + float _tessOuter; + + void increaseInnerTesselation() + { + _tessInnerU->set(++_tessInner); + } + + void decreaseInnerTesselation() + { + _tessInner = std::max(1.0f, _tessInner-1.0f); + _tessInnerU->set(_tessInner); + } + + void increaseOuterTesselation() + { + _tessOuterU->set(++_tessOuter); + } + + void decreaseOuterTesselation() + { + _tessOuter = std::max(1.0f, _tessOuter-1.0f); + _tessOuterU->set(_tessOuter); } }; @@ -220,6 +270,9 @@ viewer.setUpViewInWindow(100,100,800,600); osg::ref_ptr program = createProgram(); osg::ref_ptr geode = CreateIcosahedron(program.get()); + osg::ref_ptr tessInnerU = new osg::Uniform("TessLevelInner", 1.0f); + osg::ref_ptr tessOuterU = new osg::Uniform("TessLevelOuter", 1.0f); + osg::StateSet *state; state = geode->getOrCreateStateSet(); state->addUniform(new osg::Uniform("AmbientMaterial",osg::Vec3(0.04f, 0.04f, 0.04f))); @@ -229,7 +282,7 @@ state->addUniform(tessOuterU.get()); state->setAttribute(new osg::PatchParameter(3)); state->setAttribute(program.get()); - + // switch on the uniforms that track the modelview and projection matrices osgViewer::Viewer::Windows windows; viewer.getWindows(windows); @@ -241,8 +294,8 @@ s->setUseModelViewAndProjectionUniforms(true); s->setUseVertexAttributeAliasing(true); } - - viewer.addEventHandler(new KeyboardEventHandler()); + + viewer.addEventHandler(new KeyboardEventHandler(tessInnerU, tessOuterU)); viewer.setSceneData(geode.get()); return viewer.run(); } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/include/osg/BoundsChecking openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/BoundsChecking --- openscenegraph-3.2.1/OpenSceneGraph/include/osg/BoundsChecking 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/BoundsChecking 2015-07-21 13:42:07.000000000 +0000 @@ -27,7 +27,7 @@ { if (valuemaxValue) { - notify(WARN) << "Warning: "<maxValue) { - notify(WARN) << "Warning: "<maxValue) { - notify(WARN) << "Warning: "<maxValue) { - notify(WARN) << "Warning: "< - #if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&((__GNUC__ == 3)||(__GNUC__ == 4))) + #if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&(__GNUC__ >2)) typedef unsigned short wchar_t; #define _WCHAR_T_DEFINED #endif diff -Nru openscenegraph-3.2.1/OpenSceneGraph/include/osg/Node openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/Node --- openscenegraph-3.2.1/OpenSceneGraph/include/osg/Node 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/Node 2014-08-08 15:45:48.000000000 +0000 @@ -203,8 +203,9 @@ if (nc != NULL && _updateCallback.valid()) { if (_updateCallback == nc) { - setUpdateCallback(nc->getNestedCallback()); // replace the callback by the nested one + ref_ptr new_nested_callback = nc->getNestedCallback(); nc->setNestedCallback(0); + setUpdateCallback(new_nested_callback.get()); } else _updateCallback->removeNestedCallback(nc); } @@ -237,8 +238,9 @@ if (nc != NULL && _eventCallback.valid()) { if (_eventCallback == nc) { - setEventCallback(nc->getNestedCallback()); // replace the callback by the nested one + ref_ptr new_nested_callback = nc->getNestedCallback(); nc->setNestedCallback(0); + setEventCallback(new_nested_callback.get()); // replace the callback by the nested one } else _eventCallback->removeNestedCallback(nc); } @@ -271,8 +273,9 @@ if (nc != NULL && _cullCallback.valid()) { if (_cullCallback == nc) { - setCullCallback(nc->getNestedCallback()); // replace the callback by the nested one + ref_ptr new_nested_callback = nc->getNestedCallback(); nc->setNestedCallback(0); + setCullCallback(new_nested_callback.get()); // replace the callback by the nested one } else _cullCallback->removeNestedCallback(nc); } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/include/osg/ref_ptr openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/ref_ptr --- openscenegraph-3.2.1/OpenSceneGraph/include/osg/ref_ptr 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/ref_ptr 2014-12-22 09:50:08.000000000 +0000 @@ -94,6 +94,10 @@ bool operator!() const { return _ptr==0; } // not required bool valid() const { return _ptr!=0; } + /** release the pointer from ownership by this ref_ptr<>, decrementing the objects refencedCount() via unref_nodelete() to prevent the Object + * object from being deleted even if the reference count goes to zero. Use when using a local ref_ptr<> to an Object that you want to return + * from a function/method via a C pointer, whilst preventing the normal ref_ptr<> destructor from cleaning up the object. When using release() + * you are implicitly expecting other code to take over managment of the object, otherwise a memory leak will result. */ T* release() { T* tmp=_ptr; if (_ptr) _ptr->unref_nodelete(); _ptr=0; return tmp; } void swap(ref_ptr& rp) { T* tmp=_ptr; _ptr=rp._ptr; rp._ptr=tmp; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/include/osg/State openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/State --- openscenegraph-3.2.1/OpenSceneGraph/include/osg/State 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/State 2014-07-22 16:35:28.000000000 +0000 @@ -1336,11 +1336,6 @@ if (_lastAppliedProgramObject!=program) { _lastAppliedProgramObject = program; - if (program && _appliedProgramObjectSet.count(program)==0) - { - _appliedProgramObjectSet.insert(program); - program->addObserver(this); - } } } inline const Program::PerContextProgram* getLastAppliedProgramObject() const { return _lastAppliedProgramObject; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/include/osg/Texture openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/Texture --- openscenegraph-3.2.1/OpenSceneGraph/include/osg/Texture 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/Texture 2014-11-20 17:37:50.000000000 +0000 @@ -305,6 +305,25 @@ #define GL_RGBA_INTEGER_MODE_EXT 0x8D9E #endif +#ifndef GL_VERSION_1_1 +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + #ifndef GL_ARB_texture_rg #define GL_RG 0x8227 #define GL_RG_INTEGER 0x8228 diff -Nru openscenegraph-3.2.1/OpenSceneGraph/include/osg/Version openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/Version --- openscenegraph-3.2.1/OpenSceneGraph/include/osg/Version 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osg/Version 2015-08-12 07:41:40.000000000 +0000 @@ -20,7 +20,7 @@ #define OPENSCENEGRAPH_MAJOR_VERSION 3 #define OPENSCENEGRAPH_MINOR_VERSION 2 -#define OPENSCENEGRAPH_PATCH_VERSION 1 +#define OPENSCENEGRAPH_PATCH_VERSION 3 #define OPENSCENEGRAPH_SOVERSION 100 /* Convenience macro that can be used to decide whether a feature is present or not i.e. diff -Nru openscenegraph-3.2.1/OpenSceneGraph/include/osgViewer/ViewerBase openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osgViewer/ViewerBase --- openscenegraph-3.2.1/OpenSceneGraph/include/osgViewer/ViewerBase 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/include/osgViewer/ViewerBase 2015-07-23 14:42:39.000000000 +0000 @@ -335,6 +335,12 @@ osg::ref_ptr _incrementalCompileOperation; osg::observer_ptr _currentContext; + + private: + + // Define private copy constructor + // otherwsie VS2015 will construct it's own which will call the private copy operator from osg::Object resulting in an compile error. + ViewerBase& operator = (const ViewerBase&) { return *this; } }; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/NEWS.txt openscenegraph-3.2.3+dfsg1/OpenSceneGraph/NEWS.txt --- openscenegraph-3.2.1/OpenSceneGraph/NEWS.txt 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/NEWS.txt 2015-08-04 15:52:28.000000000 +0000 @@ -1,6 +1,34 @@ OSG News ======== + += OpenSceneGraph 3.2.2 maintance release provides a number of bug and build fixes over the 3.2.1 stable release + +PERTHSHIRE, Scotland - 4th August 2015 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.2.2 is written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.2.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. + +=== Open-source development delivers industry-leading features and performance === +The OpenSceneGraph 3.2.2 stable release is the culmination of 16 years of work by the open-source community that has grown up around the project. This point release is fully binary compatible with the 3.2.0 and 3.2.1 stable releases. The changes made are focused on addressing bugs and improving build support for latest compilers, OS updates and 3rd changes to Party Libraries. + +=== Downloads and Licensing === +OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/index.php/download-section/stable-releases Downloads] section of the openscenegraph.org website. + +OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software. + +=== Professional support and services === +OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.alphapixel.com AlphaPixel] based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include: + + * Confidential Professional Support + * Bespoke development + * Consultancy + * Training + +=== Community support and contributions === +The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists. + +The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/index.php/about/197-contributors-to-openscenegraph-3-2-2 individuals] from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base. + + + = OpenSceneGraph 3.2.1 stable release provides a number of bug and build fixes to the 3.2.0 stable release PERTHSHIRE, Scotland - 4th July 2014 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.2.1, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. diff -Nru openscenegraph-3.2.1/OpenSceneGraph/PlatformSpecifics/Android/Application.mk.master.in openscenegraph-3.2.3+dfsg1/OpenSceneGraph/PlatformSpecifics/Android/Application.mk.master.in --- openscenegraph-3.2.1/OpenSceneGraph/PlatformSpecifics/Android/Application.mk.master.in 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/PlatformSpecifics/Android/Application.mk.master.in 2014-12-18 09:20:40.000000000 +0000 @@ -4,7 +4,7 @@ APP_OPTIM := ${ANDROID_RELEASE_OPTIM} -APP_PLATFORM := ${ANDROID_PLATFORM} +APP_PLATFORM := android-${ANDROID_PLATFORM} APP_STL := ${ANDROID_STL} APP_CPPFLAGS := -fexceptions -frtti #APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums diff -Nru openscenegraph-3.2.1/OpenSceneGraph/README.txt openscenegraph-3.2.3+dfsg1/OpenSceneGraph/README.txt --- openscenegraph-3.2.1/OpenSceneGraph/README.txt 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/README.txt 2015-08-12 07:37:39.000000000 +0000 @@ -23,7 +23,7 @@ Robert Osfield. Project Lead. -4th July 2014. +12th August 2015. -- diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osg/Image.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osg/Image.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osg/Image.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osg/Image.cpp 2015-07-16 19:19:29.000000000 +0000 @@ -425,6 +425,8 @@ { switch (pixelFormat) { + case GL_R32F: + case GL_RG32F: case GL_LUMINANCE32F_ARB: case GL_LUMINANCE16F_ARB: case GL_LUMINANCE_ALPHA32F_ARB: @@ -466,6 +468,8 @@ case GL_RGBA: case GL_RGB: + case GL_RED: + case GL_RG: case GL_LUMINANCE: case GL_LUMINANCE_ALPHA: case GL_ALPHA: return GL_UNSIGNED_BYTE; @@ -515,6 +519,9 @@ case(GL_ALPHA32UI_EXT): return 1; case(GL_ALPHA16F_ARB): return 1; case(GL_ALPHA32F_ARB): return 1; + case(GL_R32F): return 1; + case(GL_RG): return 2; + case(GL_RG32F): return 2; case(GL_RGB): return 3; case(GL_BGR): return 3; case(GL_RGB8I_EXT): return 3; @@ -799,7 +806,11 @@ { int w = maximum(s, t); w = maximum(w, r); - return 1 + static_cast(floor(logf(w)/logf(2.0f))); + + int n = 0; + while (w >>= 1) + ++n; + return n+1; } bool Image::isCompressed() const @@ -1510,16 +1521,18 @@ { if (!dxtc_tool::VerticalFlip(s,t,_pixelFormat,_data+_mipmapData[i])) { - OSG_NOTICE << "Notice Image::flipVertical(): Vertical flip do not succeed" << std::endl; + OSG_NOTICE << "Notice Image::flipVertical(): Vertical flip did not succeed" << std::endl; } } else { - // its not a compressed image, so implement flip oursleves. + // it's not a compressed image, so implement flip ourselves. + unsigned int mipRowSize = computeRowWidthInBytes(s, _pixelFormat, _dataType, _packing); + unsigned int mipRowStep = mipRowSize; unsigned char* top = _data+_mipmapData[i]; - unsigned char* bottom = top + (t-1)*rowStep; + unsigned char* bottom = top + (t-1)*mipRowStep; - flipImageVertical(top, bottom, rowSize, rowStep); + flipImageVertical(top, bottom, mipRowSize, mipRowStep); } } } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osg/PolygonMode.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osg/PolygonMode.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osg/PolygonMode.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osg/PolygonMode.cpp 2015-03-03 12:00:22.000000000 +0000 @@ -68,18 +68,22 @@ void PolygonMode::apply(State&) const { -#ifdef OSG_GL1_AVAILABLE +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) if (_modeFront==_modeBack) { glPolygonMode(GL_FRONT_AND_BACK,(GLenum)_modeFront); } else { - glPolygonMode(GL_FRONT,(GLenum)_modeFront); - glPolygonMode(GL_BACK,(GLenum)_modeBack); + #ifdef OSG_GL1_AVAILABLE + glPolygonMode(GL_FRONT,(GLenum)_modeFront); + glPolygonMode(GL_BACK,(GLenum)_modeBack); + #else + OSG_NOTICE << "Warning: PolygonMode::apply(State&) - only GL_FRONT_AND_BACK is supported." << std::endl; + #endif } #else - OSG_NOTICE<<"Warning: PolygonMode::apply(State&) - not supported."<removeObserver(this); - } } void State::objectDeleted(void* object) { - const Program::PerContextProgram* ppcp = reinterpret_cast(object); - AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.find(ppcp); - if (itr != _appliedProgramObjectSet.end()) - { - // OSG_NOTICE<<"Removing _appliedProgramObjectSet entry "<resetAppliedUniforms(); - (*apitr)->removeObserver(this); - } - - _appliedProgramObjectSet.clear(); - - // what about uniforms??? need to clear them too... // go through all active Unfirom's, setting to change to force update, // the idea is to leave only the global defaults left. @@ -1386,6 +1360,18 @@ declPos = 0; } + if (_useModelViewAndProjectionUniforms) + { + // replace ftransform as it only works with built-ins + State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex"); + + // replace built in uniform + State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewMatrix", "osg_ModelViewMatrix", "uniform mat4 "); + State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix", "uniform mat4 "); + State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 "); + State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 "); + } + if (_useVertexAttributeAliasing) { State_Utils::replaceAndInsertDeclaration(source, declPos, _vertexAlias._glName, _vertexAlias._osgName, _vertexAlias._declaration); @@ -1400,18 +1386,6 @@ } } - if (_useModelViewAndProjectionUniforms) - { - // replace ftransform as it only works with built-ins - State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex"); - - // replace built in uniform - State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewMatrix", "osg_ModelViewMatrix", "uniform mat4 "); - State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix", "uniform mat4 "); - State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 "); - State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 "); - } - OSG_INFO<<"-------- Converted source "<allocateImage(numX,1,1,GL_RGBA, GL_FLOAT); - if (!_colorMap.empty()) assign(_colorMap); + + updateImage(); } void TransferFunction1D::clear(const osg::Vec4& color) @@ -177,7 +178,7 @@ void TransferFunction1D::assign(const ColorMap& newColours) { - _colorMap = newColours; + if (&_colorMap != &newColours) _colorMap = newColours; updateImage(); } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgAnimation/Animation.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgAnimation/Animation.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgAnimation/Animation.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgAnimation/Animation.cpp 2015-03-16 10:30:51.000000000 +0000 @@ -107,7 +107,13 @@ { case ONCE: if (t > _originalDuration) + { + for (ChannelList::const_iterator chan = _channels.begin(); + chan != _channels.end(); ++chan) + (*chan)->update(_originalDuration, _weight, priority); + return false; + } break; case STAY: if (t > _originalDuration) diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgDB/CMakeLists.txt openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgDB/CMakeLists.txt --- openscenegraph-3.2.1/OpenSceneGraph/src/osgDB/CMakeLists.txt 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgDB/CMakeLists.txt 2014-11-21 20:16:13.000000000 +0000 @@ -7,7 +7,7 @@ IF(OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS) # Add a default plugin search path component - ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS}) + ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS}\") ENDIF() # Set the library extension according to what configuration is being built. diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgDB/FileUtils.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgDB/FileUtils.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgDB/FileUtils.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgDB/FileUtils.cpp 2014-11-21 20:16:13.000000000 +0000 @@ -505,7 +505,7 @@ #ifdef OSG_DEFAULT_LIBRARY_PATH // Append the install prefix path to the library search path if configured - filepath.push_back(ADDQUOTES(OSG_DEFAULT_LIBRARY_PATH)); + filepath.push_back(OSG_DEFAULT_LIBRARY_PATH); #endif } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgGA/NodeTrackerManipulator.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgGA/NodeTrackerManipulator.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgGA/NodeTrackerManipulator.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgGA/NodeTrackerManipulator.cpp 2015-06-10 10:02:22.000000000 +0000 @@ -275,7 +275,7 @@ } else rotateTrackball( _ga_t0->getXnormalized(), _ga_t0->getYnormalized(), _ga_t1->getXnormalized(), _ga_t1->getYnormalized(), - _thrown ? float( _delta_frame_time / eventTimeDelta ) : 1.f ); + getThrowScale( eventTimeDelta ) ); return true; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgGA/OrbitManipulator.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgGA/OrbitManipulator.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgGA/OrbitManipulator.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgGA/OrbitManipulator.cpp 2015-03-01 11:08:51.000000000 +0000 @@ -379,12 +379,12 @@ Scale parameter is useful, for example, when manipulator is thrown. It scales the amount of rotation based, for example, on the current frame time.*/ void OrbitManipulator::rotateTrackball( const float px0, const float py0, - const float px1, const float py1, const float /*scale*/ ) + const float px1, const float py1, const float scale ) { osg::Vec3d axis; float angle; - trackball( axis, angle, px1, py1, px0, py0 ); + trackball( axis, angle, px0 + (px1-px0)*scale, py0 + (py1-py0)*scale, px0, py0 ); Quat new_rotate; new_rotate.makeRotate( angle, axis ); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgGA/StandardManipulator.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgGA/StandardManipulator.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgGA/StandardManipulator.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgGA/StandardManipulator.cpp 2015-03-01 11:08:51.000000000 +0000 @@ -154,6 +154,8 @@ /// Finishes the animation by performing a step that moves it to its final position. void StandardManipulator::finishAnimation() { + _thrown = false; + if( !isAnimating() ) return; @@ -586,7 +588,12 @@ events that started the animation.*/ float StandardManipulator::getThrowScale( const double eventTimeDelta ) const { - if( _thrown ) return float( _delta_frame_time / eventTimeDelta ); + if( _thrown ) + { + if (eventTimeDelta == 0.f) + return 0.f; + return float( _delta_frame_time / eventTimeDelta ); + } else return 1.f; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/3ds/ReaderWriter3DS.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/3ds/ReaderWriter3DS.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/3ds/ReaderWriter3DS.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/3ds/ReaderWriter3DS.cpp 2014-11-20 09:55:48.000000000 +0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include using namespace std; @@ -238,6 +239,7 @@ //supportsOption("OutputTextureFiles","Write out the texture images to file"); //supportsOption("flipTexture", "flip texture upside-down"); supportsOption("extended3dsFilePaths", "(Write option) Keeps long texture filenames (not 8.3) when exporting 3DS, but can lead to compatibility problems."); + supportsOption("preserveMaterialNames", "(Write option) Preserve original material names, up to 64 characters. This can lead to compatibility problems."); supportsOption("noMatrixTransforms", "(Read option) Set the plugin to apply matrices into the mesh vertices (\"old behaviour\") instead of restoring them (\"new behaviour\"). You may use this option to avoid a few rounding errors."); supportsOption("checkForEspilonIdentityMatrices", "(Read option) If not set, then consider \"almost identity\" matrices to be identity ones (in case of rounding errors)."); supportsOption("restoreMatrixTransformsNoMeshes", "(Read option) Makes an exception to the behaviour when 'noMatrixTransforms' is not set for mesh instances. When a mesh instance has a transform on it, the reader creates a MatrixTransform above the Geode. If you don't want the hierarchy to be modified, then you can use this option to merge the transform into vertices."); @@ -863,7 +865,7 @@ { Lib3dsFace* face; // Original face definition. osg::Vec3f normal; - unsigned short index[3]; // Indices to OSG vertex/normal/texcoord arrays. + unsigned int index[3]; // Indices to OSG vertex/normal/texcoord arrays. }; struct VertexParams @@ -883,6 +885,14 @@ face->index[2] < mesh->nvertices; } +bool isNumber(float x) +{ + // This looks like it should always be true, + // but it's false if x is a NaN. + return (x == x); +} + + /* ChrisD: addVertex handles the averaging of normals and spltting of vertices required to implement normals for smoothing groups. When a shared vertex is encountered when smoothing is required, normals are added @@ -895,7 +905,7 @@ static void addVertex( const Lib3dsMesh* mesh, RemappedFace& remappedFace, - unsigned short int i, + unsigned int i, osg::Geometry* geometry, std::vector& origToNewMapping, std::vector& splitVertexChain, @@ -905,7 +915,7 @@ osg::Vec3Array* normals = (osg::Vec3Array*)geometry->getNormalArray(); osg::Vec2Array* texCoords = (osg::Vec2Array*)geometry->getTexCoordArray(0); - unsigned short int index = remappedFace.face->index[i]; + unsigned int index = remappedFace.face->index[i]; if (origToNewMapping[index] == -1) { int newIndex = vertices->size(); @@ -926,6 +936,10 @@ osg::Vec2f texCoord(mesh->texcos[index][0], mesh->texcos[index][1]); texCoord = componentMultiply(texCoord, params.scaleUV); texCoord += params.offsetUV; + if (!isNumber(texCoord.x()) || !isNumber(texCoord.y())) { + OSG_WARN << "NaN found in texcoord" << std::endl; + texCoord.set(0,0); + } texCoords->push_back(texCoord); } @@ -1002,6 +1016,25 @@ } } +template +void fillTriangles(osg::Geometry & geom, const std::vector & remappedFaces, unsigned int numIndices) { + //if (m->nvertices < std::numeric_limits::max()) { + osg::ref_ptr elements( new Prim(osg::PrimitiveSet::TRIANGLES, numIndices) ); + typename Prim::iterator index_itr( elements->begin() ); + for (unsigned int i = 0; i < remappedFaces.size(); ++i) + { + const RemappedFace& remappedFace = remappedFaces[i]; + if (remappedFace.face != NULL) + { + *(index_itr++) = remappedFace.index[0]; + *(index_itr++) = remappedFace.index[1]; + *(index_itr++) = remappedFace.index[2]; + } + } + geom.addPrimitiveSet(elements.get()); +} + + /** use matrix to pretransform geometry, or NULL to do nothing */ @@ -1058,21 +1091,27 @@ unsigned int faceIndex = 0; unsigned int faceCount = 0; + unsigned int maxVertexIndex = 0; for (FaceList::iterator itr = faceList.begin(); itr != faceList.end(); ++itr, ++faceIndex) { - osg::Vec3 normal = copyLib3dsVec3ToOsgVec3(normals[*itr]); + osg::Vec3f normal(copyLib3dsVec3ToOsgVec3(normals[*itr])); if (matrix) normal = osg::Matrix::transform3x3(normal, *(params.matrix)); normal.normalize(); Lib3dsFace& face = m->faces[*itr]; - remappedFaces[faceIndex].face = &face; - remappedFaces[faceIndex].normal = normal; - if (addFace(m, remappedFaces[faceIndex], geom, origToNewMapping, splitVertexChain, params)) + RemappedFace & rf = remappedFaces[faceIndex]; + rf.face = &face; + rf.normal = normal; + if (addFace(m, rf, geom, origToNewMapping, splitVertexChain, params)) { ++faceCount; } + // Get the highest index + maxVertexIndex = osg::maximum(maxVertexIndex, rf.index[0]); + maxVertexIndex = osg::maximum(maxVertexIndex, rf.index[1]); + maxVertexIndex = osg::maximum(maxVertexIndex, rf.index[2]); } // 'Shrink to fit' all vertex arrays because potentially faceList refers to fewer vertices than the whole mesh. @@ -1087,23 +1126,12 @@ geom->setColorArray(osg_colors.get(), osg::Array::BIND_OVERALL); // Create triangle primitives. - int numIndices = faceCount * 3; - osg::ref_ptr elements = new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLES, numIndices); - DrawElementsUShort::iterator index_itr = elements->begin(); - - for (unsigned int i = 0; i < remappedFaces.size(); ++i) - { - RemappedFace& remappedFace = remappedFaces[i]; - if (remappedFace.face != NULL) - { - *(index_itr++) = remappedFace.index[0]; - *(index_itr++) = remappedFace.index[1]; - *(index_itr++) = remappedFace.index[2]; - } - } - - geom->addPrimitiveSet(elements.get()); - + // Remapping may create additional vertices, thus creating indices over USHORT_MAX + if (maxVertexIndex < std::numeric_limits::max()) { + fillTriangles(*geom, remappedFaces, faceCount * 3); + } else { + fillTriangles (*geom, remappedFaces, faceCount * 3); + } #if 0 osgUtil::TriStripVisitor tsv; tsv.stripify(*geom); @@ -1177,7 +1205,7 @@ osg_texture->setImage(osg_image.get()); osg_texture->setName(texture->name); // does the texture support transparancy? - //transparency = ((texture->flags)&LIB3DS_TEXTURE_ALPHA_SOURCE)!=0; + transparency = ((texture->flags)&LIB3DS_TEXTURE_ALPHA_SOURCE)!=0; // what is the wrap mode of the texture. osg::Texture2D::WrapMode wm = ((texture->flags)&LIB3DS_TEXTURE_NO_TILE) ? @@ -1220,6 +1248,7 @@ osg::Texture2D* texture1_map = createTexture(&(mat->texture1_map),"texture1_map",textureTransparency); if (texture1_map) { + if(textureTransparency) transparency = true; stateset->setTextureAttributeAndModes(unit, texture1_map, osg::StateAttribute::ON); double factor = mat->texture1_map.percent; @@ -1300,7 +1329,7 @@ if ((alpha < 1.0f) || transparency) { - //stateset->setAttributeAndModes(new osg::BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + stateset->setAttributeAndModes(new osg::BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); stateset->setMode(GL_BLEND,osg::StateAttribute::ON); stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/dae/daeRMaterials.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/dae/daeRMaterials.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/dae/daeRMaterials.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/dae/daeRMaterials.cpp 2014-12-10 11:30:02.000000000 +0000 @@ -1047,7 +1047,7 @@ return NULL; } - if (sampler->getSource() == NULL ) + if (sampler->getSource() == NULL || sampler->getSource()->getValue() == NULL) { OSG_WARN << "Could not locate source for sampler2D" << std::endl; return NULL; diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/dds/ReaderWriterDDS.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/dds/ReaderWriterDDS.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/dds/ReaderWriterDDS.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/dds/ReaderWriterDDS.cpp 2015-02-26 18:07:25.000000000 +0000 @@ -264,7 +264,7 @@ */ #define FOURCC_DX10 (MAKEFOURCC('D','X','1','0')) -typedef enum OSG_DXGI_FORMAT { +typedef enum OSG_DXGI_FORMAT { OSG_DXGI_FORMAT_UNKNOWN = 0, OSG_DXGI_FORMAT_R32G32B32A32_TYPELESS = 1, OSG_DXGI_FORMAT_R32G32B32A32_FLOAT = 2, @@ -384,7 +384,7 @@ OSG_DXGI_FORMAT_FORCE_UINT = 0xffffffffUL } OSG_DXGI_FORMAT; -typedef enum OSG_D3D10_RESOURCE_DIMENSION { +typedef enum OSG_D3D10_RESOURCE_DIMENSION { OSG_D3D10_RESOURCE_DIMENSION_UNKNOWN = 0, OSG_D3D10_RESOURCE_DIMENSION_BUFFER = 1, OSG_D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2, @@ -407,7 +407,7 @@ if( width < 1 ) width = 1; if( height < 1 ) height = 1; if( depth < 1 ) depth = 1; - + return osg::Image::computeImageSizeInBytes(width, height, depth, pixelFormat, pixelType, packing, slice_packing, image_packing); } @@ -982,6 +982,8 @@ } } + OSG_INFO<<"ReadDDS, dataType = 0x"<setOrigin(osg::Image::BOTTOM_LEFT); - if (!isDXTC || ((s>4 && s%4==0 && t>4 && t%4==0) || s<4)) // Flip may crash (access violation) or fail for non %4 dimensions (except for s<4). Tested with revision trunk 2013-02-22. + if (!isDXTC || ((s>4 && s%4==0 && t>4 && t%4==0) || s<=4)) // Flip may crash (access violation) or fail for non %4 dimensions (except for s<4). Tested with revision trunk 2013-02-22. { + OSG_INFO<<"Flipping dds on load"<flipVertical(); } else @@ -1061,7 +1064,9 @@ unsigned int pixelSize = osg::Image::computePixelSizeInBits(pixelFormat, dataType); unsigned int imageSize = img->getTotalSizeInBytes(); - // Check that theorical image size (computation taking into account DXTC blocks) is not bigger than actual image size. + OSG_INFO<<"WriteDDS, dataType = 0x"< source; if (autoFlipDDSWrite && img->getOrigin() == osg::Image::BOTTOM_LEFT) { + OSG_INFO<<"Flipping dds image on write"< copy( new osg::Image(*img,osg::CopyOp::DEEP_COPY_ALL) ); const int s(copy->s()); const int t(copy->t()); - if (!isDXTC || ((s>4 && s%4==0 && t>4 && t%4==0) || s<4)) // Flip may crash (access violation) or fail for non %4 dimensions (except for s<4). Tested with revision trunk 2013-02-22. + if (!isDXTC || ((s>4 && s%4==0 && t>4 && t%4==0) || s<=4)) // Flip may crash (access violation) or fail for non %4 dimensions (except for s<4). Tested with revision trunk 2013-02-22. { copy->flipVertical(); } @@ -1283,7 +1290,7 @@ OSG_WARN << "WriteDDSFile warning: Vertical flip was skipped. Image dimensions have to be multiple of 4." << std::endl; } source = copy; - } + } else { source = img; @@ -1361,7 +1368,7 @@ if (options) { std::istringstream iss(options->getOptionString()); - std::string opt; + std::string opt; while (iss >> opt) { if (opt == "dds_flip") dds_flip = true; diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/exr/ReaderWriterEXR.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/exr/ReaderWriterEXR.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/exr/ReaderWriterEXR.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/exr/ReaderWriterEXR.cpp 2015-03-11 17:47:30.000000000 +0000 @@ -24,7 +24,7 @@ /**************************************************************************** * * Follows is code written by FOI (www.foi.se) - * it is a wraper of openEXR(www.openexr.com) + * it is a wrapper of openEXR(www.openexr.com) * to add suport of exr images into osg * * Ported to a OSG-plugin, Ragnar Hammarqvist. @@ -92,7 +92,7 @@ unsigned char *buffer=NULL; // returned to sender & as read from the disk bool inputError = false; Array2D pixels; - int width,height,numComponents; + int width=0,height=0,numComponents; try { @@ -111,6 +111,7 @@ rgbafile.readPixels(dw.min.y, dw.max.y); } catch( char * str ) { + OSG_WARN << "exr_load error : " << str << std::endl; inputError = true; } @@ -335,6 +336,7 @@ } catch( char * str ) { + OSG_WARN << "writeEXRStream error : " << str << std::endl; writeOK = false; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp 2014-11-20 09:32:40.000000000 +0000 @@ -127,6 +127,27 @@ } } + // ambient map... + const FbxProperty lAmbientProperty = pFbxMat->FindProperty(FbxSurfaceMaterial::sAmbient); + if (lAmbientProperty.IsValid()) + { + int lNbTex = lAmbientProperty.GetSrcObjectCount(); + for (int lTextureIndex = 0; lTextureIndex < lNbTex; lTextureIndex++) + { + FbxFileTexture* lTexture = FbxCast(lAmbientProperty.GetSrcObject(lTextureIndex)); + if (lTexture) + { + result.ambientTexture = fbxTextureToOsgTexture(lTexture); + result.ambientChannel = lTexture->UVSet.Get(); + result.ambientScaleU = lTexture->GetScaleU(); + result.ambientScaleV = lTexture->GetScaleV(); + } + + //For now only allow 1 texture + break; + } + } + if (pFbxLambert) { FbxDouble3 color = pFbxLambert->Diffuse.Get(); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.h openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.h --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.h 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.h 2014-11-20 09:32:40.000000000 +0000 @@ -22,7 +22,8 @@ StateSetContent() : diffuseFactor(1.0), reflectionFactor(1.0), - emissiveFactor(1.0) + emissiveFactor(1.0), + ambientFactor(1.0) { } @@ -33,6 +34,7 @@ osg::ref_ptr opacityTexture; osg::ref_ptr reflectionTexture; osg::ref_ptr emissiveTexture; + osg::ref_ptr ambientTexture; // more textures types here... // textures maps channels names... @@ -40,12 +42,14 @@ std::string opacityChannel; std::string reflectionChannel; std::string emissiveChannel; + std::string ambientChannel; // more channels names here... // combining factors... double diffuseFactor; double reflectionFactor; double emissiveFactor; + double ambientFactor; // more combining factors here... double diffuseScaleU; @@ -54,6 +58,8 @@ double opacityScaleV; double emissiveScaleU; double emissiveScaleV; + double ambientScaleU; + double ambientScaleV; // texture units (eventually used for each texture map)... enum TextureUnit @@ -61,7 +67,8 @@ DIFFUSE_TEXTURE_UNIT = 0, OPACITY_TEXTURE_UNIT, REFLECTION_TEXTURE_UNIT, - EMISSIVE_TEXTURE_UNIT + EMISSIVE_TEXTURE_UNIT, + AMBIENT_TEXTURE_UNIT // more texture units here... }; }; diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp 2014-11-20 09:32:40.000000000 +0000 @@ -154,6 +154,7 @@ bool useDiffuseMap, bool useOpacityMap, bool useEmissiveMap, + bool useAmbientMap, // more here... bool bColor, const osgDB::Options& options, @@ -188,6 +189,8 @@ pGeometry->setTexCoordArray(StateSetContent::OPACITY_TEXTURE_UNIT, createVec2Array((precision & osgDB::Options::DOUBLE_PRECISION_TEX_COORD) != 0), osg::Array::BIND_PER_VERTEX); if (useEmissiveMap) pGeometry->setTexCoordArray(StateSetContent::EMISSIVE_TEXTURE_UNIT, createVec2Array((precision & osgDB::Options::DOUBLE_PRECISION_TEX_COORD) != 0), osg::Array::BIND_PER_VERTEX); + if (useAmbientMap) + pGeometry->setTexCoordArray(StateSetContent::AMBIENT_TEXTURE_UNIT, createVec2Array((precision & osgDB::Options::DOUBLE_PRECISION_TEX_COORD) != 0), osg::Array::BIND_PER_VERTEX); // create more textures coordinates here... if (bColor) pGeometry->setColorArray(createVec4Array((precision & osgDB::Options::DOUBLE_PRECISION_COLOR) != 0), osg::Array::BIND_PER_VERTEX); @@ -301,6 +304,22 @@ stateSet->setTextureAttributeAndModes(StateSetContent::EMISSIVE_TEXTURE_UNIT, ssc.emissiveTexture.get()); } + // ambient texture map + if (ssc.ambientTexture) + { + if (ssc.ambientScaleU != 1.0 || ssc.ambientScaleV != 1.0) + { + // set UV scaling... + osg::ref_ptr texmat = new osg::TexMat(); + osg::Matrix uvScaling; + uvScaling.makeScale(osg::Vec3(ssc.ambientScaleU, ssc.ambientScaleV, 1.0)); + texmat->setMatrix(uvScaling); + stateSet->setTextureAttributeAndModes(StateSetContent::AMBIENT_TEXTURE_UNIT, texmat.get(), osg::StateAttribute::ON); + } + + stateSet->setTextureAttributeAndModes(StateSetContent::AMBIENT_TEXTURE_UNIT, ssc.ambientTexture.get()); + } + // add more texture maps here... if (transparent) @@ -483,6 +502,8 @@ return stateSetList[i].reflectionChannel; if (0 == strcmp(pName, FbxSurfaceMaterial::sEmissive)) return stateSetList[i].emissiveChannel; + if (0 == strcmp(pName, FbxSurfaceMaterial::sAmbient)) + return stateSetList[i].ambientChannel; // more here... } @@ -536,6 +557,7 @@ const FbxLayerElementUV* pFbxUVs_diffuse, const FbxLayerElementUV* pFbxUVs_opacity, const FbxLayerElementUV* pFbxUVs_emissive, + const FbxLayerElementUV* pFbxUVs_ambient, const FbxLayerElementVertexColor* pFbxColors, osg::Geometry* pGeometry, osg::Array* pVertices, @@ -543,6 +565,7 @@ osg::Array* pTexCoords_diffuse, osg::Array* pTexCoords_opacity, osg::Array* pTexCoords_emissive, + osg::Array* pTexCoords_ambient, osg::Array* pColors) { int v0 = fbxMesh->GetPolygonVertex(i, posInPoly0), @@ -594,6 +617,12 @@ addVec2ArrayElement(*pTexCoords_emissive, getElement(pFbxUVs_emissive, fbxMesh, i, posInPoly1, meshVertex1)); addVec2ArrayElement(*pTexCoords_emissive, getElement(pFbxUVs_emissive, fbxMesh, i, posInPoly2, meshVertex2)); } + if (pTexCoords_ambient && (pTexCoords_ambient != pTexCoords_opacity) && (pTexCoords_ambient != pTexCoords_diffuse) && (pTexCoords_ambient != pTexCoords_emissive)) + { + addVec2ArrayElement(*pTexCoords_ambient, getElement(pFbxUVs_ambient, fbxMesh, i, posInPoly0, meshVertex0)); + addVec2ArrayElement(*pTexCoords_ambient, getElement(pFbxUVs_ambient, fbxMesh, i, posInPoly1, meshVertex1)); + addVec2ArrayElement(*pTexCoords_ambient, getElement(pFbxUVs_ambient, fbxMesh, i, posInPoly2, meshVertex2)); + } // add more texture maps here... if (pColors) @@ -695,12 +724,14 @@ std::string diffuseChannel = getUVChannelForTextureMap(stateSetList, FbxSurfaceMaterial::sDiffuse); std::string opacityChannel = getUVChannelForTextureMap(stateSetList, FbxSurfaceMaterial::sTransparentColor); std::string emissiveChannel = getUVChannelForTextureMap(stateSetList, FbxSurfaceMaterial::sEmissive); + std::string ambientChannel = getUVChannelForTextureMap(stateSetList, FbxSurfaceMaterial::sAmbient); // look for more UV elements here... // UV elements... const FbxLayerElementUV* pFbxUVs_diffuse = getUVElementForChannel(diffuseChannel, FbxLayerElement::eTextureDiffuse, fbxMesh); const FbxLayerElementUV* pFbxUVs_opacity = getUVElementForChannel(opacityChannel, FbxLayerElement::eTextureTransparency, fbxMesh); const FbxLayerElementUV* pFbxUVs_emissive = getUVElementForChannel(emissiveChannel, FbxLayerElement::eTextureEmissive, fbxMesh); + const FbxLayerElementUV* pFbxUVs_ambient = getUVElementForChannel(ambientChannel, FbxLayerElement::eTextureAmbient, fbxMesh); // more UV elements here... // check elements validity... @@ -710,6 +741,7 @@ if (!layerElementValid(pFbxUVs_diffuse)) pFbxUVs_diffuse = 0; if (!layerElementValid(pFbxUVs_opacity)) pFbxUVs_opacity = 0; if (!layerElementValid(pFbxUVs_emissive)) pFbxUVs_emissive = 0; + if (!layerElementValid(pFbxUVs_ambient)) pFbxUVs_ambient = 0; // more here... int nPolys = fbxMesh->GetPolygonCount(); @@ -750,6 +782,7 @@ pFbxUVs_diffuse != 0, pFbxUVs_opacity != 0, pFbxUVs_emissive != 0, + pFbxUVs_ambient != 0, // more UV elements here... pFbxColors != 0, options, @@ -762,6 +795,7 @@ osg::Array* pTexCoords_diffuse = pGeometry->getTexCoordArray(StateSetContent::DIFFUSE_TEXTURE_UNIT); osg::Array* pTexCoords_opacity = pGeometry->getTexCoordArray(StateSetContent::OPACITY_TEXTURE_UNIT); osg::Array* pTexCoords_emissive = pGeometry->getTexCoordArray(StateSetContent::EMISSIVE_TEXTURE_UNIT); + osg::Array* pTexCoords_ambient = pGeometry->getTexCoordArray(StateSetContent::AMBIENT_TEXTURE_UNIT); // more texture coordinates here... osg::Array* pColors = pGeometry->getColorArray(); @@ -773,9 +807,9 @@ 0, 1, 2, nVertex, nVertex+1, nVertex+2, fbxToOsgVertMap, osgToFbxNormMap, - pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxColors, + pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxUVs_ambient, pFbxColors, pGeometry, - pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pColors); + pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pTexCoords_ambient, pColors); nVertex += 3; } else if (lPolygonSize == 4) @@ -790,16 +824,16 @@ 0, 1, p02, nVertex, nVertex+1, nVertex+p02, fbxToOsgVertMap, osgToFbxNormMap, - pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxColors, + pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxUVs_ambient, pFbxColors, pGeometry, - pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pColors); + pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pTexCoords_ambient, pColors); readMeshTriangle(fbxMesh, i, p10, 2, 3, nVertex+p10, nVertex+2, nVertex+3, fbxToOsgVertMap, osgToFbxNormMap, - pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxColors, + pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxUVs_ambient, pFbxColors, pGeometry, - pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pColors); + pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pTexCoords_ambient, pColors); nVertex += 4; } else if (tessellatePolygons) @@ -819,9 +853,9 @@ 0, j - 1, j, nVertex0, nVertex - 1, nVertex, fbxToOsgVertMap, osgToFbxNormMap, - pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxColors, + pFbxVertices, pFbxNormals, pFbxUVs_diffuse, pFbxUVs_opacity, pFbxUVs_emissive, pFbxUVs_ambient, pFbxColors, pGeometry, - pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pColors); + pVertices, pNormals, pTexCoords_diffuse, pTexCoords_opacity, pTexCoords_emissive, pTexCoords_ambient, pColors); } } } @@ -851,6 +885,7 @@ osg::Array* pTexCoords_diffuse = pGeometry->getTexCoordArray(StateSetContent::DIFFUSE_TEXTURE_UNIT); osg::Array* pTexCoords_opacity = pGeometry->getTexCoordArray(StateSetContent::OPACITY_TEXTURE_UNIT); osg::Array* pTexCoords_emissive = pGeometry->getTexCoordArray(StateSetContent::EMISSIVE_TEXTURE_UNIT); + osg::Array* pTexCoords_ambient = pGeometry->getTexCoordArray(StateSetContent::AMBIENT_TEXTURE_UNIT); osg::Array* pColors = pGeometry->getColorArray(); // Index of the 1st vertex of the polygon in the geometry int osgVertex0 = pVertices->getNumElements(); @@ -883,6 +918,10 @@ { addVec2ArrayElement(*pTexCoords_emissive, getElement(pFbxUVs_emissive, fbxMesh, i, j, nVertex)); } + if (pTexCoords_ambient && (pTexCoords_ambient != pTexCoords_opacity) && (pTexCoords_ambient != pTexCoords_diffuse)) + { + addVec2ArrayElement(*pTexCoords_ambient, getElement(pFbxUVs_ambient, fbxMesh, i, j, nVertex)); + } // add more texture maps here... if (pColors) diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/CMakeLists.txt openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ffmpeg/CMakeLists.txt --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/CMakeLists.txt 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ffmpeg/CMakeLists.txt 2014-11-26 16:29:43.000000000 +0000 @@ -21,7 +21,7 @@ # MESSAGE("FFMPEG_LIBAVUTIL_INCLUDE_DIRS = " ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ) # MESSAGE("FFMPEG_LIBRARIES = " ${FFMPEG_LIBRARIES} ) -SET(TARGET_SRC +SET(TARGET_SRC FFmpegClocks.cpp FFmpegDecoderAudio.cpp FFmpegDecoder.cpp @@ -46,9 +46,8 @@ MessageQueue.hpp ) -IF(CMAKE_COMPILER_IS_GNUCXX) - # Remove -pedantic flag as it barfs on ffmoeg headers - STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") ENDIF() #### end var setup ### diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp 2014-11-04 16:29:37.000000000 +0000 @@ -14,6 +14,9 @@ #endif +#if LIBAVCODEC_VERSION_MAJOR < 56 + #define AV_CODEC_ID_NONE CODEC_ID_NONE +#endif namespace osgFFmpeg { @@ -21,7 +24,54 @@ int *frame_size_ptr, const uint8_t *buf, int buf_size) { -#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=32) +#if LIBAVCODEC_VERSION_MAJOR >= 56 + + AVFrame *frame = av_frame_alloc(); + + if (!frame) return AVERROR(ENOMEM); + + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = const_cast(buf); + avpkt.size = buf_size; + + int got_frame = 0; + int result = avcodec_decode_audio4(avctx, frame, &got_frame, &avpkt); + + if (result>=0 && got_frame) + { + int ch, plane_size; + int planar = av_sample_fmt_is_planar(avctx->sample_fmt); + int data_size = av_samples_get_buffer_size(&plane_size, avctx->channels, frame->nb_samples, avctx->sample_fmt, 1); + if (*frame_size_ptr < data_size) + { + av_log(avctx, AV_LOG_ERROR, "output buffer size is too small for " + "the current frame (%d < %d)\n", *frame_size_ptr, data_size); + av_frame_free(&frame); + return AVERROR(EINVAL); + } + memcpy(samples, frame->extended_data[0], plane_size); + if (planar && avctx->channels > 1) + { + uint8_t *out = ((uint8_t *)samples) + plane_size; + for (ch = 1; ch < avctx->channels; ch++) + { + memcpy(out, frame->extended_data[ch], plane_size); + out += plane_size; + } + } + *frame_size_ptr = data_size; + } + else + { + *frame_size_ptr = 0; + } + + av_frame_free(&frame); + + return result; + +#elif LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=32) // following code segment copied from ffmpeg's avcodec_decode_audio2() // implementation to avoid warnings about deprecated function usage. @@ -77,6 +127,10 @@ m_frequency = m_context->sample_rate; m_nb_channels = m_context->channels; + + OSG_NOTICE<<"FFmpegDecoderAudio::open(..), m_nb_channels="<sample_fmt="<sample_fmt<sample_fmt) { case AV_SAMPLE_FMT_NONE: @@ -100,7 +154,7 @@ } // Check stream sanity - if (m_context->codec_id == CODEC_ID_NONE) + if (m_context->codec_id == AV_CODEC_ID_NONE) throw std::runtime_error("invalid audio codec");; // Find the decoder for the audio stream diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp 2014-11-04 16:29:37.000000000 +0000 @@ -10,7 +10,7 @@ // TODO - add support for using RGB or RGBA pixel format. // Note from Jason Daly in a osg-submissions thread, "The pix_fmt field of AVCodecContext will indicate the pixel format of the decoded video" - + FFmpegDecoderVideo::FFmpegDecoderVideo(PacketQueue & packets, FFmpegClocks & clocks) : m_packets(packets), @@ -74,7 +74,11 @@ m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P); // Find out the framerate + #if LIBAVCODEC_VERSION_MAJOR >= 56 + m_frame_rate = av_q2d(stream->avg_frame_rate); + #else m_frame_rate = av_q2d(stream->r_frame_rate); + #endif // Find the decoder for the video stream m_codec = avcodec_find_decoder(m_context->codec_id); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/gif/ReaderWriterGIF.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/gif/ReaderWriterGIF.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/gif/ReaderWriterGIF.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/gif/ReaderWriterGIF.cpp 2014-11-20 09:21:48.000000000 +0000 @@ -561,7 +561,11 @@ *width_ret = giffile->SWidth; *height_ret = giffile->SHeight; *numComponents_ret = 4; +#if (GIFLIB_MAJOR >= 5&& !(GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)) + DGifCloseFile(giffile, &Error); +#else DGifCloseFile(giffile); +#endif return buffer; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/Inventor/ConvertFromInventor.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/Inventor/ConvertFromInventor.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/Inventor/ConvertFromInventor.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/Inventor/ConvertFromInventor.cpp 2014-11-20 10:52:20.000000000 +0000 @@ -1268,7 +1268,7 @@ if (url.getNum() && url[0].getLength()) { osg::ref_ptr image = loadImage(url[0].getString(), options); - if (!image->valid()) + if (!image.valid()) { OSG_WARN << "Could not read texture file: " << url[0].getString() << std::endl; this->setReadStatus(FALSE); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/lwo/Object.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/lwo/Object.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/lwo/Object.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/lwo/Object.cpp 2014-11-26 16:02:06.000000000 +0000 @@ -18,6 +18,7 @@ namespace { +#if 0 bool triangle_is_clockwise(const osg::Vec3Array *points, int a, int b, int c) { const osg::Vec3 &A = (*points)[a]; @@ -29,6 +30,7 @@ area2 += C.x() * A.y() - A.x() * C.y(); return area2 < 0; } +#endif float cylindrical_angle(float x, float y) { diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/md2/ReaderWriterMD2.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/md2/ReaderWriterMD2.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/md2/ReaderWriterMD2.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/md2/ReaderWriterMD2.cpp 2014-08-19 09:27:44.000000000 +0000 @@ -208,12 +208,12 @@ // read in the frame info into a vector const char *last_frame_name = NULL; - osg::Vec3Array *vertexCoords = NULL; - osg::Vec2Array *texCoords = NULL; - osg::UIntArray *vertexIndices = NULL; - osg::UIntArray *texIndices = NULL; - osg::Vec3Array *normalCoords = NULL; - osg::UIntArray *normalIndices = NULL; + osg::ref_ptr vertexCoords = NULL; + osg::ref_ptr texCoords = NULL; + osg::ref_ptr vertexIndices = NULL; + osg::ref_ptr texIndices = NULL; + osg::ref_ptr normalCoords = NULL; + osg::ref_ptr normalIndices = NULL; // load the texture skins @@ -375,24 +375,24 @@ } } - deprecated_osg::Geometry *geom = new deprecated_osg::Geometry; + osg::ref_ptr geom = new deprecated_osg::Geometry; - geom->setVertexArray (vertexCoords); - geom->setVertexIndices (vertexIndices); + geom->setVertexArray (vertexCoords.get()); + geom->setVertexIndices (vertexIndices.get()); - geom->setTexCoordArray (0, texCoords); - geom->setTexCoordIndices (0, texIndices); + geom->setTexCoordArray (0, texCoords.get()); + geom->setTexCoordIndices (0, texIndices.get()); - geom->setNormalArray (normalCoords); - geom->setNormalIndices (normalIndices); + geom->setNormalArray (normalCoords.get()); + geom->setNormalIndices (normalIndices.get()); geom->setNormalBinding (deprecated_osg::Geometry::BIND_PER_VERTEX); geom->addPrimitiveSet (new osg::DrawArrays (osg::PrimitiveSet::TRIANGLES, 0, vertexIndices->size ())); - osg::Geode *geode = new osg::Geode; - geode->addDrawable (geom); + osg::ref_ptr geode = new osg::Geode; + geode->addDrawable (geom.get()); - current_sequence->addChild (geode); + current_sequence->addChild (geode.get()); current_sequence->setTime (sequence_frame, 0.2f); sequence_frame++; diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/obj/ReaderWriterOBJ.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/obj/ReaderWriterOBJ.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/obj/ReaderWriterOBJ.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/obj/ReaderWriterOBJ.cpp 2014-11-20 16:38:17.000000000 +0000 @@ -867,7 +867,7 @@ // code for setting up the database path so that internally referenced file are searched for on relative paths. osg::ref_ptr local_opt = options ? static_cast(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; - local_opt->setDatabasePath(osgDB::getFilePath(fileName)); + local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName)); obj::Model model; model.setDatabasePath(osgDB::getFilePath(fileName.c_str())); @@ -875,7 +875,7 @@ ObjOptionsStruct localOptions = parseOptions(options); - osg::Node* node = convertModelToSceneGraph(model, localOptions, options); + osg::Node* node = convertModelToSceneGraph(model, localOptions, local_opt.get()); return node; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ogr/ReaderWriterOGR.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ogr/ReaderWriterOGR.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ogr/ReaderWriterOGR.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ogr/ReaderWriterOGR.cpp 2015-06-30 08:38:53.000000000 +0000 @@ -134,11 +134,20 @@ virtual ReadResult readFile(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const { +#if GDAL_VERSION_MAJOR<2 if (OGRSFDriverRegistrar::GetRegistrar()->GetDriverCount() == 0) OGRRegisterAll(); // Try to open data source OGRDataSource* file = OGRSFDriverRegistrar::Open(fileName.c_str()); +#else + if (GDALGetDriverCount() == 0) + GDALAllRegister(); + + // Try to open data source + GDALDataset* file = (GDALDataset*) GDALOpenEx( fileName.c_str(), GDAL_OF_VECTOR, NULL, NULL, NULL ); +#endif + if (!file) return 0; @@ -156,6 +165,7 @@ osg::Group* group = new osg::Group; +#if GDAL_VERSION_MAJOR<2 for (int i = 0; i < file->GetLayerCount(); i++) { osg::Group* node = readLayer(file->GetLayer(i), file->GetName(), useRandomColorByFeature, addGroupPerFeature); @@ -163,6 +173,17 @@ group->addChild( node ); } OGRDataSource::DestroyDataSource( file ); +#else + for (int i = 0; i < GDALDatasetGetLayerCount(file); i++) + { + OGRLayer* layer = (OGRLayer *)GDALDatasetGetLayer(file, i); + osg::Group* node = readLayer(layer, layer->GetName(), useRandomColorByFeature, addGroupPerFeature); + if (node) + group->addChild( node ); + } + GDALClose( file ); +#endif + return group; } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/OpenFlight/PaletteRecords.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/OpenFlight/PaletteRecords.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/OpenFlight/PaletteRecords.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/OpenFlight/PaletteRecords.cpp 2015-07-21 14:22:12.000000000 +0000 @@ -220,7 +220,15 @@ material->setDiffuse (osg::Material::FRONT_AND_BACK,osg::Vec4(diffuse,alpha)); material->setSpecular(osg::Material::FRONT_AND_BACK,osg::Vec4(specular,alpha)); material->setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4(emissive,alpha)); - material->setShininess(osg::Material::FRONT_AND_BACK,shininess); + + if (shininess>=0.0f) + { + material->setShininess(osg::Material::FRONT_AND_BACK,shininess); + } + else + { + OSG_INFO<<"Warning: OpenFlight shininess value out of range: "<setDiffuse (osg::Material::FRONT_AND_BACK,osg::Vec4(diffuse,alpha)); material->setSpecular(osg::Material::FRONT_AND_BACK,osg::Vec4(specular,alpha)); material->setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4(emissive,alpha)); - material->setShininess(osg::Material::FRONT_AND_BACK,shininess); + + if (shininess>=0.0f) + { + material->setShininess(osg::Material::FRONT_AND_BACK,shininess); + } + else + { + OSG_INFO<<"Warning: OpenFlight shininess value out of range: "<getTileContent(x,y,lod,realMinRange,realMaxRange,usedMaxRange,tileCenter, childrenLoc); // if group has only one child, then simply use its child. - while (tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup()) + // if the node is a transform, then stop processing so as to not loose the transformation + while (tileGroup && !tileGroup->asTransform() && + tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup()) { tileGroup = tileGroup->getChild(0)->asGroup(); } @@ -882,7 +884,7 @@ doSeam = (lod < (archive->getNumLODs() - 1)); // Handle seams - if (doSeam) + if (tileGroup && doSeam) { SeamFinder sfv(x,y,lod,info,archive); tileGroup->accept(sfv); @@ -906,13 +908,15 @@ osg::Group* tileGroup = archive->getTileContent(loc,realMinRange,realMaxRange,usedMaxRange,tileCenter, childrenLoc); // if group has only one child, then simply use its child. - while (tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup()) + // if the node is a transform, then stop processing so as to not loose the transformation + while (tileGroup && !tileGroup->asTransform() && + tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup()) { tileGroup = tileGroup->getChild(0)->asGroup(); } // Handle seams - if (childrenLoc.size() > 0) + if (tileGroup && childrenLoc.size() > 0) { SeamFinder sfv(loc.x, loc.y, loc.lod, info, archive); tileGroup->accept(sfv); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.h openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.h --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.h 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * AutoDiscoveryBonjourImpl.h - * cefix_alterable - * - * Created by Stephan Huber on 10.09.11. - * Copyright 2011 Digital Mind. All rights reserved. - * - */ - -#pragma once - -#include -#include -#include -#include - -#ifdef __OBJC__ -@class ServerController; -@class ClientController; -#else -class ServerController; -class ClientController; -#endif - -class DiscoveredServicesCallback; - - -class AutoDiscoveryServerImpl { - -public: - AutoDiscoveryServerImpl(const std::string& type, unsigned int port); - ~AutoDiscoveryServerImpl(); - - bool needsTimer() const { return false; } - void update() {} -private: - ServerController* _controller; - -}; - -class AutoDiscoveryClientImpl { -public: - typedef std::pair< std::string, unsigned int> Address; - typedef std::vector
AddressVector; - typedef std::map AddressMap; - - AutoDiscoveryClientImpl(const std::string& type, DiscoveredServicesCallback* cb); - ~AutoDiscoveryClientImpl(); - DiscoveredServicesCallback* getCallback() { return _cb.get(); } - - void serviceAdded(void* key, const std::string& address, unsigned int port, bool is_ip6); - void servicesRemoved(void* key); - bool needsTimer() const { return false; } - void update() {} -private: - ClientController* _controller; - osg::ref_ptr _cb; - AddressMap _addresses; - -}; \ No newline at end of file diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.mm openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.mm --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.mm 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryBonjourImpl.mm 1970-01-01 00:00:00.000000000 +0000 @@ -1,219 +0,0 @@ -/* - * AutoDiscoveryBonjourImpl.cpp - * cefix_alterable - * - * Created by Stephan Huber on 10.09.11. - * Copyright 2011 Digital Mind. All rights reserved. - * - */ - -#include "AutoDiscoveryBonjourImpl.h" -#import "TargetConditionals.h" -#if (TARGET_OS_IPHONE) -#import -#else -#import -#endif - -#include "AutoDiscovery.h" -#include - -@interface ServerController : NSObject { - NSNetService *netService; -} - --(void)startServiceWithType: (NSString*) type withPort: (unsigned int) port; --(void)stopService; - -@end - - -@implementation ServerController - - --(void)startServiceWithType:(NSString*) type withPort: (unsigned int) port; -{ - netService = [[NSNetService alloc] initWithDomain:@"" type: type - name:@"" port:port]; - netService.delegate = self; - [netService publish]; -} - --(void)stopService { - [netService stop]; - [netService release]; - netService = nil; -} - --(void)dealloc { - [self stopService]; - [super dealloc]; -} - -#pragma mark Net Service Delegate Methods --(void)netService:(NSNetService *)aNetService didNotPublish:(NSDictionary *)dict { - NSLog(@"Failed to publish: %@", dict); -} - -@end - -@interface ClientController : NSObject { - BOOL isConnected; - NSNetServiceBrowser *browser; - NSNetService *connectedService; - NSMutableArray *services; - NSString* type; - AutoDiscoveryClientImpl* impl; -} - -@property (readonly, retain) NSMutableArray *services; -@property (readwrite, retain) NSString *type; - -@property (readwrite, retain) NSNetServiceBrowser *browser; - -@end - -@implementation ClientController - -@synthesize browser; -@synthesize type; -@synthesize services; - --(id)initWithType: (NSString*) in_type withImpl:(AutoDiscoveryClientImpl*) in_impl { - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - services = [NSMutableArray new]; - self.browser = [[NSNetServiceBrowser new] init]; - self.browser.delegate = self; - self.type = in_type; - impl = in_impl; - [self.browser searchForServicesOfType:in_type inDomain:@""]; - [pool release]; - return [super init]; -} - --(void)dealloc { - - [self.browser stop]; - self.browser.delegate = nil; - - self.browser = nil; - [services makeObjectsPerformSelector:@selector(setDelegate:) withObject:nil]; - [services makeObjectsPerformSelector:@selector(stop)]; - [services release]; - - [super dealloc]; -} - - - -#pragma mark Net Service Browser Delegate Methods - --(void)netServiceBrowser:(NSNetServiceBrowser *)aBrowser didFindService:(NSNetService *)aService moreComing:(BOOL)more -{ - [services addObject:aService]; - aService.delegate = self; - [aService resolveWithTimeout:0]; -} - --(void)netServiceBrowser:(NSNetServiceBrowser *)aBrowser didRemoveService:(NSNetService *)aService moreComing:(BOOL)more -{ - int ndx = [services indexOfObject: aService]; - impl->servicesRemoved([services objectAtIndex: ndx]); - aService.delegate = nil; - [services removeObject:aService]; -} - --(void)netServiceDidResolveAddress:(NSNetService *)service { - - //NSLog(@"hostname: %@", [service hostName]); - - for (NSData* data in [service addresses]) { - - char addressBuffer[100]; - struct sockaddr_in* socketAddress = (struct sockaddr_in*) [data bytes]; - - int sockFamily = socketAddress->sin_family; - if (sockFamily == AF_INET || sockFamily == AF_INET6) { - - const char* addressStr = inet_ntop(sockFamily, - &(socketAddress->sin_addr), addressBuffer, - sizeof(addressBuffer)); - - int port = ntohs(socketAddress->sin_port); - - if (addressStr && port) - { - impl->serviceAdded(service, addressStr, port, sockFamily == AF_INET6); - } - } - - } -} - - --(void)netService:(NSNetService *)service didNotResolve:(NSDictionary *)errorDict { - NSLog(@"Could not resolve: %@", errorDict); -} - -@end - - - -AutoDiscoveryServerImpl::AutoDiscoveryServerImpl(const std::string& type, unsigned int port) -{ - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - - OSG_INFO <<"AutoDiscoveryServerImpl :: registering service " << type << " port: " << port << std::endl; - - _controller = [[ServerController alloc] init]; - [_controller startServiceWithType: [NSString stringWithUTF8String: type.c_str()] withPort: port]; - [pool release]; -} - -AutoDiscoveryServerImpl::~AutoDiscoveryServerImpl() -{ - [_controller release]; -} - - -AutoDiscoveryClientImpl::AutoDiscoveryClientImpl(const std::string& type, DiscoveredServicesCallback* cb) -{ - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - _cb = cb; - _controller = [[ClientController alloc] initWithType: [NSString stringWithUTF8String: type.c_str()] withImpl: this]; - - [pool release]; -} - - -void AutoDiscoveryClientImpl::serviceAdded(void* key, const std::string& address, unsigned int port, bool is_ip6) -{ - if (getCallback()) - { - if ((!is_ip6) || (is_ip6 && !getCallback()->ignoreIP6Addresses())) - { - _addresses[key].push_back(std::make_pair(address, port)); - getCallback()->serviceAdded(address, port); - } - } -} - - -void AutoDiscoveryClientImpl::servicesRemoved(void* key) -{ - if (!getCallback()) return; - - AddressMap::iterator itr = _addresses.find(key); - if (itr != _addresses.end()) { - AddressVector& addresses = itr->second; - for(AddressVector::iterator i = addresses.begin(); i != addresses.end(); ++i) - { - getCallback()->serviceRemoved(i->first, i->second); - } - } -} - -AutoDiscoveryClientImpl::~AutoDiscoveryClientImpl() -{ - [_controller release]; -} diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* - * AutoDiscovery.cpp - * cefix_alterable - * - * Created by Stephan Huber on 10.09.11. - * Copyright 2011 Digital Mind. All rights reserved. - * - */ - -#include "AutoDiscovery.h" - -#ifdef __APPLE__ -#include "AutoDiscoveryBonjourImpl.h" -#else -#include "AutoDiscoveryWinImpl.h" -#endif - - - - - - -DiscoveredServicesCallback::DiscoveredServicesCallback() -: osg::Referenced() -{ -} - - -AutoDiscovery::~AutoDiscovery() -{ - if (_clientImpl) { - delete _clientImpl; - _clientImpl = NULL; - } - deregisterServices(); -} - - -void AutoDiscovery::registerService(const std::string& type, unsigned int port) -{ - deregisterServices(); - _serverImpl = new AutoDiscoveryServerImpl(type, port); -} - -void AutoDiscovery::deregisterServices() -{ - if (_serverImpl) { - delete _serverImpl; - _serverImpl = NULL; - } -} - - - -void AutoDiscovery::update() -{ - if (_serverImpl) - _serverImpl->update(); - if (_clientImpl) - _clientImpl->update(); -} - -void AutoDiscovery::discoverServices(const std::string& type, DiscoveredServicesCallback* cb) -{ - _clientImpl = new AutoDiscoveryClientImpl(type, cb); -} - -bool AutoDiscovery::needsContinuousUpdate() const -{ - return (((_clientImpl) && _clientImpl->needsTimer()) || ((_serverImpl) && _serverImpl->needsTimer())); -} diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.h openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.h --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.h 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscovery.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * AutoDiscovery.h - * cefix_alterable - * - * Created by Stephan Huber on 10.09.11. - * Copyright 2011 Digital Mind. All rights reserved. - * - */ - -#pragma once - -#include -#include - - -class AutoDiscoveryServerImpl; -class AutoDiscoveryClientImpl; - - -class DiscoveredServicesCallback : public osg::Referenced { -public: - DiscoveredServicesCallback(); - virtual bool ignoreIP6Addresses() { return false; } - virtual void serviceAdded(const std::string& host, unsigned int port) = 0; - virtual void serviceRemoved(const std::string& host, unsigned int port) = 0; -}; - -class AutoDiscovery : public osg::Referenced { -public: - AutoDiscovery() : _serverImpl(NULL), _clientImpl(NULL) {}; - - void registerService(const std::string& type, unsigned int port); - void deregisterServices(); - void discoverServices(const std::string& type, DiscoveredServicesCallback* cb); - - ~AutoDiscovery(); - - void update(); - - bool needsContinuousUpdate() const; - -private: - - AutoDiscoveryServerImpl* _serverImpl; - AutoDiscoveryClientImpl* _clientImpl; - -}; diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,306 +0,0 @@ -#include "AutoDiscoveryWinImpl.h" -#include "Autodiscovery.h" -#include "dns_sd.h" -#include - -typedef union { unsigned char b[2]; unsigned short NotAnInteger; } Opaque16; - -#ifndef HeapEnableTerminationOnCorruption -# define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1 -#endif - -static void DNSSD_API reg_reply(DNSServiceRef sdref, const DNSServiceFlags flags, DNSServiceErrorType errorCode, - const char *name, const char *regtype, const char *domain, void *context) -{ - if (context) { - AutoDiscoveryServerImpl* impl = static_cast(context); - - if (errorCode == kDNSServiceErr_NoError) - { - if (flags & kDNSServiceFlagsAdd) impl->serviceAdded(); - else impl->serviceRemoved(); - } - - else if (errorCode == kDNSServiceErr_NameConflict) - { - OSG_WARN << "AutoDiscoveryServerImpl :: Name conflict" << std::endl; - impl->errorOccured(); - } - else { - OSG_WARN << "AutoDiscoveryServerImpl :: error " << errorCode << std::endl; - impl->errorOccured(); - } - } -} - -static DNSServiceErrorType RegisterService(DNSServiceRef *sdref, - const char *nam, const char *typ, const char *dom, const char *host, const char *port, AutoDiscoveryServerImpl* context) - { - DNSServiceFlags flags = 0; - uint16_t PortAsNumber = atoi(port); - Opaque16 registerPort = { { PortAsNumber >> 8, PortAsNumber & 0xFF } }; - unsigned char txt[2048] = ""; - unsigned char *ptr = txt; - - if (nam[0] == '.' && nam[1] == 0) nam = ""; // We allow '.' on the command line as a synonym for empty string - if (dom[0] == '.' && dom[1] == 0) dom = ""; // We allow '.' on the command line as a synonym for empty string - - OSG_INFO << "AutoDiscoveryImpl :: Registering Service " << (nam[0] ? nam : "<>") << " " << typ << " " << (dom[0] ? "." : "", dom) << std::endl; - if (host && *host) { - OSG_INFO << "AutoDiscoveryImpl :: host " << host << " port " << port << std::endl; - } - - // printf("\n"); - - //flags |= kDNSServiceFlagsAllowRemoteQuery; - //flags |= kDNSServiceFlagsNoAutoRename; - - return(DNSServiceRegister(sdref, flags, kDNSServiceInterfaceIndexAny, nam, typ, dom, host, registerPort.NotAnInteger, (uint16_t) (ptr-txt), txt, reg_reply, context)); -} - - -AutoDiscoveryServerImpl::AutoDiscoveryServerImpl(const std::string& type, unsigned int port) -{ - HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); - std::ostringstream ss; - ss << port; - DNSServiceErrorType err = RegisterService(&client, "", type.c_str(), "", NULL, ss.str().c_str(), this); - if (!client || err != kDNSServiceErr_NoError) { - OSG_WARN << "AutoDiscoveryImpl :: DNSService call failed " << (long int)err << std::endl; - } -} - -void AutoDiscoveryServerImpl::update() -{ - int dns_sd_fd = client ? DNSServiceRefSockFD(client ) : -1; - int nfds = dns_sd_fd + 1; - fd_set readfds; - struct timeval tv; - int result; - -// (dns_sd_fd2 > dns_sd_fd) nfds = dns_sd_fd2 + 1; - - // 1. Set up the fd_set as usual here. - // This example client has no file descriptors of its own, - // but a real application would call FD_SET to add them to the set here - FD_ZERO(&readfds); - - // 2. Add the fd for our client(s) to the fd_set - if (client ) FD_SET(dns_sd_fd , &readfds); - //if (client_pa) FD_SET(dns_sd_fd2, &readfds); - - // 3. Set up the timeout. - tv.tv_sec = 0; - tv.tv_usec = 0; - - result = select(nfds, &readfds, (fd_set*)NULL, (fd_set*)NULL, &tv); - if (result > 0) - { - DNSServiceErrorType err = kDNSServiceErr_NoError; - if (client && FD_ISSET(dns_sd_fd , &readfds)) err = DNSServiceProcessResult(client ); -// else if (client_pa && FD_ISSET(dns_sd_fd2, &readfds)) err = DNSServiceProcessResult(client_pa); -// if (err) { fprintf(stderr, "DNSServiceProcessResult returned %d\n", err); stopNow = 1; } - } -} - -void AutoDiscoveryServerImpl::serviceAdded() -{ - OSG_INFO << "AutoDiscoveryImpl :: Service added" << std::endl; -} -void AutoDiscoveryServerImpl::serviceRemoved() -{ - OSG_INFO << "AutoDiscoveryImpl :: Service removed" << std::endl; -} - -struct ContextDNSServiceRefPair { - DNSServiceRef ref; - AutoDiscoveryClientImpl* context; -}; - -static void DNSSD_API zonedata_resolve(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode, - const char *fullname, const char *hosttarget, uint16_t opaqueport, uint16_t txtLen, const unsigned char *txt, void *context) - { - union { uint16_t s; u_char b[2]; } port = { opaqueport }; - uint16_t PortAsNumber = ((uint16_t)port.b[0]) << 8 | port.b[1]; - - ContextDNSServiceRefPair* ref_pair = static_cast(context); - if (!ref_pair) return; - if (errorCode) { - OSG_WARN << "AutoDiscoveryImpl :: Error code " << errorCode << std::endl; - return; - } - ref_pair->context->serviceAdded(fullname, hosttarget, PortAsNumber); - /* - const char *p = fullname; - char n[kDNSServiceMaxDomainName]; - char t[kDNSServiceMaxDomainName]; - - const unsigned char *max = txt + txtLen; - - (void)sdref; // Unused - (void)ifIndex; // Unused - (void)context; // Unused - - //if (!(flags & kDNSServiceFlagsAdd)) return; - if (errorCode) { printf("Error code %d\n", errorCode); return; } - - if (CopyLabels(n, n + kDNSServiceMaxDomainName, &p, 3)) return; // Fetch name+type - p = fullname; - if (CopyLabels(t, t + kDNSServiceMaxDomainName, &p, 1)) return; // Skip first label - if (CopyLabels(t, t + kDNSServiceMaxDomainName, &p, 2)) return; // Fetch next two labels (service type) - - if (num_printed++ == 0) - { - printf("\n"); - printf("; To direct clients to browse a different domain, substitute that domain in place of '@'\n"); - printf("%-47s PTR %s\n", "lb._dns-sd._udp", "@"); - printf("\n"); - printf("; In the list of services below, the SRV records will typically reference dot-local Multicast DNS names.\n"); - printf("; When transferring this zone file data to your unicast DNS server, you'll need to replace those dot-local\n"); - printf("; names with the correct fully-qualified (unicast) domain name of the target host offering the service.\n"); - } - - printf("\n"); - printf("%-47s PTR %s\n", t, n); - printf("%-47s SRV 0 0 %d %s ; Replace with unicast FQDN of target host\n", n, PortAsNumber, hosttarget); - printf("%-47s TXT ", n); - - while (txt < max) - { - const unsigned char *const end = txt + 1 + txt[0]; - txt++; // Skip over length byte - printf(" \""); - while (txtcontext->removeRef(ref_pair->ref); - DNSServiceRefDeallocate(ref_pair->ref); - free(ref_pair); -} - - -static void DNSSD_API browse_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode, - const char *replyName, const char *replyType, const char *replyDomain, void *context) -{ - if (errorCode) { - OSG_WARN << "AutoDiscoveryImpl :: Error code " << errorCode << std::endl; - return; - } - - AutoDiscoveryClientImpl* impl = static_cast(context); - if(!impl) return; - - if (!(flags & kDNSServiceFlagsAdd)) { - impl->serviceRemoved(replyName, replyType, replyDomain); - return; - } - ContextDNSServiceRefPair* ref_pair = new ContextDNSServiceRefPair(); - - ref_pair->context = static_cast(context); - DNSServiceErrorType err = DNSServiceResolve(&ref_pair->ref, 0, ifIndex, replyName, replyType, replyDomain, zonedata_resolve, ref_pair); - if (!ref_pair->ref || err != kDNSServiceErr_NoError) { - OSG_WARN << "AutoDiscoveryImpl :: DNSServiceResolve call failed " << (long int)err << std::endl; - } else - impl->addRef(ref_pair->ref); -} - - -AutoDiscoveryServerImpl::~AutoDiscoveryServerImpl() -{ - if (client) DNSServiceRefDeallocate(client); -} - - -AutoDiscoveryClientImpl::AutoDiscoveryClientImpl(const std::string& type, DiscoveredServicesCallback* cb) -{ - _cb = cb; - DNSServiceErrorType err = DNSServiceBrowse(&client, 0, kDNSServiceInterfaceIndexAny, type.c_str(), "", browse_reply, this); - if (!client || err != kDNSServiceErr_NoError) { - OSG_WARN << "AutoDiscoveryImpl :: DNSServiceBrowse call failed " << (long int)err << std::endl; - } -} -void AutoDiscoveryClientImpl::update() -{ - updateRef(client); - for(std::list::iterator i = resolveRefs.begin(); i != resolveRefs.end(); ++i) { - updateRef(*i); - } - for(std::list::iterator i = resolveRefsToDelete.begin(); i != resolveRefsToDelete.end(); ++i) { - resolveRefs.remove(*i); - } - resolveRefsToDelete.clear(); -} - -void AutoDiscoveryClientImpl::updateRef(DNSServiceRef& ref) -{ - int dns_sd_fd = ref ? DNSServiceRefSockFD(ref ) : -1; - int nfds = dns_sd_fd + 1; - fd_set readfds; - struct timeval tv; - int result; - -// (dns_sd_fd2 > dns_sd_fd) nfds = dns_sd_fd2 + 1; - - // 1. Set up the fd_set as usual here. - // This example client has no file descriptors of its own, - // but a real application would call FD_SET to add them to the set here - FD_ZERO(&readfds); - - // 2. Add the fd for our client(s) to the fd_set - if (ref ) FD_SET(dns_sd_fd , &readfds); - //if (client_pa) FD_SET(dns_sd_fd2, &readfds); - - // 3. Set up the timeout. - tv.tv_sec = 0; - tv.tv_usec = 0; - - result = select(nfds, &readfds, (fd_set*)NULL, (fd_set*)NULL, &tv); - if (result > 0) - { - DNSServiceErrorType err = kDNSServiceErr_NoError; - if (client && FD_ISSET(dns_sd_fd , &readfds)) err = DNSServiceProcessResult(ref ); -// else if (client_pa && FD_ISSET(dns_sd_fd2, &readfds)) err = DNSServiceProcessResult(client_pa); -// if (err) { fprintf(stderr, "DNSServiceProcessResult returned %d\n", err); stopNow = 1; } - } -} - -AutoDiscoveryClientImpl::~AutoDiscoveryClientImpl() -{ - if (client) DNSServiceRefDeallocate(client); -} - - -void AutoDiscoveryClientImpl::serviceRemoved(const std::string& replyName, const std::string& replyType, const std::string& replyDomain) -{ - // TODO - std::string full_name = replyName+"."+replyType+"."+replyDomain; - // TODO full_name = cefix::strReplaceAll(full_name, "..", "."); - AddressMap::iterator itr = _addresses.find(full_name); - if (itr == _addresses.end()) { - OSG_INFO << "AutoDiscoveryImpl :: no services found to remove? " << full_name << std::endl; - return; - } - if (!_cb.valid()) - return; - - for(AddressVector::iterator i = itr->second.begin(); i != itr->second.end(); ++i) { - _cb->serviceRemoved(i->first, i->second); - } - _addresses.erase(itr); -} - - -void AutoDiscoveryClientImpl::serviceAdded(const std::string& fullname, const std::string& host, unsigned int port) -{ - if (_cb.valid()) { - _addresses[fullname].push_back(std::make_pair(host, port)); - _cb->serviceAdded(host, port); - } - -} \ No newline at end of file diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.h openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.h --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.h 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/AutoDiscoveryWinImpl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -#pragma once - - -#include -#include -#include -#include -#include "dns_sd.h" -#include "AutoDiscovery.h" -#include - -class DiscoveredServicesCallback; - -class AutoDiscoveryServerImpl { - -public: - AutoDiscoveryServerImpl(const std::string& type, unsigned int port); - ~AutoDiscoveryServerImpl(); - bool needsTimer() const { return true; } - void update(); - void errorOccured() {} - void serviceAdded(); - void serviceRemoved(); - -private: - DNSServiceRef client; - -}; - -class AutoDiscoveryClientImpl { -public: - typedef std::pair< std::string, unsigned int> Address; - typedef std::vector
AddressVector; - typedef std::map AddressMap; - - - AutoDiscoveryClientImpl(const std::string& type, DiscoveredServicesCallback* cb); - ~AutoDiscoveryClientImpl(); - void update(); - void updateRef(DNSServiceRef& ref); - bool needsTimer() const { return true; } - - void serviceRemoved(const std::string& replyName, const std::string& replyType, const std::string& replyDomain); - void serviceAdded(const std::string& fullname, const std::string& host, unsigned int port); - DNSServiceRef getClient() { return client; } - - void addRef(DNSServiceRef ref) { resolveRefs.push_back(ref); } - void removeRef(DNSServiceRef ref) {resolveRefsToDelete.push_back(ref); } -private: - DNSServiceRef client; - osg::observer_ptr _cb; - std::list resolveRefs, resolveRefsToDelete; - AddressMap _addresses; -}; \ No newline at end of file diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/CMakeLists.txt openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/CMakeLists.txt --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/CMakeLists.txt 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ - -SET(TARGET_SRC - AutoDiscovery.cpp - ReaderWriterZeroConfDevice.cpp -) - -SET(TARGET_H - AutoDiscovery.h -) - -IF(WIN32) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/mdns_win) - SET(TARGET_SRC - ${TARGET_SRC} - AutoDiscoveryWinImpl.cpp - AutoDiscoveryWinImpl.h - mdns_win/ClientCommon.c - mdns_win/ClientCommon.h - mdns_win/dns_sd.h - mdns_win/dns-sd.c - ) - SET(TARGET_EXTERNAL_LIBRARIES "${TARGET_EXTERNAL_LIBRARIES};Ws2_32.lib;winmm") - SET(TARGET_LIBRARIES_VARS ZEROCONF_LIBRARY) - ADD_DEFINITIONS(-DNOT_HAVE_GETOPT) - ADD_DEFINITIONS(-DNOT_HAVE_SETLINEBUF) -ELSE() - IF(APPLE) - SET(TARGET_SRC - ${TARGET_SRC} - AutoDiscoveryBonjourImpl.h - AutoDiscoveryBonjourImpl.mm - ) - SET(TARGET_LIBRARIES_VARS COCOA_LIBRARY ) - ENDIF(APPLE) -ENDIF(WIN32) - -SET(TARGET_ADDED_LIBRARIES osgGA ) - -#### end var setup ### -SETUP_PLUGIN(zeroconf) diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.c openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.c --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.c 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -/* -*- Mode: C; tab-width: 4 -*- - * - * Copyright (c) 2008 Apple Inc. All rights reserved. - * - * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. - * ("Apple") in consideration of your agreement to the following terms, and your - * use, installation, modification or redistribution of this Apple software - * constitutes acceptance of these terms. If you do not agree with these terms, - * please do not use, install, modify or redistribute this Apple software. - * - * In consideration of your agreement to abide by the following terms, and subject - * to these terms, Apple grants you a personal, non-exclusive license, under Apple's - * copyrights in this original Apple software (the "Apple Software"), to use, - * reproduce, modify and redistribute the Apple Software, with or without - * modifications, in source and/or binary forms; provided that if you redistribute - * the Apple Software in its entirety and without modifications, you must retain - * this notice and the following text and disclaimers in all such redistributions of - * the Apple Software. Neither the name, trademarks, service marks or logos of - * Apple Computer, Inc. may be used to endorse or promote products derived from the - * Apple Software without specific prior written permission from Apple. Except as - * expressly stated in this notice, no other rights or licenses, express or implied, - * are granted by Apple herein, including but not limited to any patent rights that - * may be infringed by your derivative works or by other works in which the Apple - * Software may be incorporated. - * - * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - * COMBINATION WITH YOUR PRODUCTS. - * - * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION - * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT - * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Change History (most recent first): - -$Log: ClientCommon.c,v $ -Revision 1.2 2008/05/08 00:42:03 cheshire -Removed some unnecessary header files - -Revision 1.1 2008/05/08 00:25:48 cheshire - GetNextLabel insufficiently defensive - - -*/ - -#include -#include // For stdout, stderr - -#include "ClientCommon.h" - -const char *GetNextLabel(const char *cstr, char label[64]) - { - char *ptr = label; - while (*cstr && *cstr != '.') // While we have characters in the label... - { - char c = *cstr++; - if (c == '\\' && *cstr) // If we have a backslash, and it's not the last character of the string - { - c = *cstr++; - if (isdigit(cstr[-1]) && isdigit(cstr[0]) && isdigit(cstr[1])) - { - int v0 = cstr[-1] - '0'; // then interpret as three-digit decimal - int v1 = cstr[ 0] - '0'; - int v2 = cstr[ 1] - '0'; - int val = v0 * 100 + v1 * 10 + v2; - // If valid three-digit decimal value, use it - // Note that although ascii nuls are possible in DNS labels - // we're building a C string here so we have no way to represent that - if (val == 0) val = '-'; - if (val <= 255) { c = (char)val; cstr += 2; } - } - } - *ptr++ = c; - if (ptr >= label+64) { label[63] = 0; return(NULL); } // Illegal label more than 63 bytes - } - *ptr = 0; // Null-terminate label text - if (ptr == label) return(NULL); // Illegal empty label - if (*cstr) cstr++; // Skip over the trailing dot (if present) - return(cstr); - } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.h openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.h --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.h 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/ClientCommon.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 4 -*- - * - * Copyright (c) 2008 Apple Inc. All rights reserved. - * - * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. - * ("Apple") in consideration of your agreement to the following terms, and your - * use, installation, modification or redistribution of this Apple software - * constitutes acceptance of these terms. If you do not agree with these terms, - * please do not use, install, modify or redistribute this Apple software. - * - * In consideration of your agreement to abide by the following terms, and subject - * to these terms, Apple grants you a personal, non-exclusive license, under Apple's - * copyrights in this original Apple software (the "Apple Software"), to use, - * reproduce, modify and redistribute the Apple Software, with or without - * modifications, in source and/or binary forms; provided that if you redistribute - * the Apple Software in its entirety and without modifications, you must retain - * this notice and the following text and disclaimers in all such redistributions of - * the Apple Software. Neither the name, trademarks, service marks or logos of - * Apple Computer, Inc. may be used to endorse or promote products derived from the - * Apple Software without specific prior written permission from Apple. Except as - * expressly stated in this notice, no other rights or licenses, express or implied, - * are granted by Apple herein, including but not limited to any patent rights that - * may be infringed by your derivative works or by other works in which the Apple - * Software may be incorporated. - * - * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - * COMBINATION WITH YOUR PRODUCTS. - * - * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION - * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT - * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Change History (most recent first): - -$Log: ClientCommon.h,v $ -Revision 1.1 2008/05/08 00:25:48 cheshire - GetNextLabel insufficiently defensive - - -*/ - -extern const char *GetNextLabel(const char *cstr, char label[64]); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns-sd.c openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns-sd.c --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns-sd.c 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns-sd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,783 +0,0 @@ -/* -*- Mode: C; tab-width: 4 -*- - * - * Copyright (c) 2002-2008 Apple Inc. All rights reserved. - * - * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. - * ("Apple") in consideration of your agreement to the following terms, and your - * use, installation, modification or redistribution of this Apple software - * constitutes acceptance of these terms. If you do not agree with these terms, - * please do not use, install, modify or redistribute this Apple software. - * - * In consideration of your agreement to abide by the following terms, and subject - * to these terms, Apple grants you a personal, non-exclusive license, under Apple's - * copyrights in this original Apple software (the "Apple Software"), to use, - * reproduce, modify and redistribute the Apple Software, with or without - * modifications, in source and/or binary forms; provided that if you redistribute - * the Apple Software in its entirety and without modifications, you must retain - * this notice and the following text and disclaimers in all such redistributions of - * the Apple Software. Neither the name, trademarks, service marks or logos of - * Apple Computer, Inc. may be used to endorse or promote products derived from the - * Apple Software without specific prior written permission from Apple. Except as - * expressly stated in this notice, no other rights or licenses, express or implied, - * are granted by Apple herein, including but not limited to any patent rights that - * may be infringed by your derivative works or by other works in which the Apple - * Software may be incorporated. - * - * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - * COMBINATION WITH YOUR PRODUCTS. - * - * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION - * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT - * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Formatting notes: - * This code follows the "Whitesmiths style" C indentation rules. Plenty of discussion - * on C indentation can be found on the web, such as , - * but for the sake of brevity here I will say just this: Curly braces are not syntactially - * part of an "if" statement; they are the beginning and ending markers of a compound statement; - * therefore common sense dictates that if they are part of a compound statement then they - * should be indented to the same level as everything else in that compound statement. - * Indenting curly braces at the same level as the "if" implies that curly braces are - * part of the "if", which is false. (This is as misleading as people who write "char* x,y;" - * thinking that variables x and y are both of type "char*" -- and anyone who doesn't - * understand why variable y is not of type "char*" just proves the point that poor code - * layout leads people to unfortunate misunderstandings about how the C language really works.) - -To build this tool, copy and paste the following into a command line: - -OS X: -gcc dns-sd.c -o dns-sd - -POSIX systems: -gcc dns-sd.c -o dns-sd -I../mDNSShared -ldns_sd - -Windows: -cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Release\dnssd.lib -(may require that you run a Visual Studio script such as vsvars32.bat first) -*/ - -// For testing changes to dnssd_clientstub.c, uncomment this line and the code will be compiled -// with an embedded copy of the client stub instead of linking the system library version at runtime. -// This also useful to work around link errors when you're working on an older version of Mac OS X, -// and trying to build a newer version of the "dns-sd" command which uses new API entry points that -// aren't in the system's /usr/lib/libSystem.dylib. -//#define TEST_NEW_CLIENTSTUB 1 - -// When building mDNSResponder for Mac OS X 10.4 and earlier, /usr/lib/libSystem.dylib is built using its own private -// copy of dnssd_clientstub.c, which is old and doesn't have all the entry points defined in the latest version, so -// when we're building dns-sd.c on Mac OS X 10.4 or earlier, we automatically set TEST_NEW_CLIENTSTUB so that we'll -// embed a copy of the latest dnssd_clientstub.c instead of trying to link to the incomplete version in libSystem.dylib -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1040 -#define TEST_NEW_CLIENTSTUB 1 -#endif - -#include -#include // For stdout, stderr -#include // For exit() -#include // For strlen(), strcpy() -#include // For errno, EINTR -#include -#include // For u_char - -#ifdef _WIN32 - #include - #include - #include - #include - typedef int pid_t; - #define getpid _getpid - #define strcasecmp _stricmp - #define snprintf _snprintf - static const char kFilePathSep = '\\'; - #ifndef HeapEnableTerminationOnCorruption - # define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1 - #endif - #if !defined(IFNAMSIZ) - #define IFNAMSIZ 16 - #endif - #define if_nametoindex if_nametoindex_win - #define if_indextoname if_indextoname_win - - typedef PCHAR (WINAPI * if_indextoname_funcptr_t)(ULONG index, PCHAR name); - typedef ULONG (WINAPI * if_nametoindex_funcptr_t)(PCSTR name); - - unsigned if_nametoindex_win(const char *ifname) - { - HMODULE library; - unsigned index = 0; - - // Try and load the IP helper library dll - if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL ) - { - if_nametoindex_funcptr_t if_nametoindex_funcptr; - - // On Vista and above there is a Posix like implementation of if_nametoindex - if ((if_nametoindex_funcptr = (if_nametoindex_funcptr_t) GetProcAddress(library, "if_nametoindex")) != NULL ) - { - index = if_nametoindex_funcptr(ifname); - } - - FreeLibrary(library); - } - - return index; - } - - char * if_indextoname_win( unsigned ifindex, char *ifname) - { - HMODULE library; - char * name = NULL; - - // Try and load the IP helper library dll - if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL ) - { - if_indextoname_funcptr_t if_indextoname_funcptr; - - // On Vista and above there is a Posix like implementation of if_indextoname - if ((if_indextoname_funcptr = (if_indextoname_funcptr_t) GetProcAddress(library, "if_indextoname")) != NULL ) - { - name = if_indextoname_funcptr(ifindex, ifname); - } - - FreeLibrary(library); - } - - return name; - } - -#else - #include // For getopt() and optind - #include // For getaddrinfo() - #include // For struct timeval - #include // For AF_INET - #include // For struct sockaddr_in() - #include // For inet_addr() - #include // For if_nametoindex() - static const char kFilePathSep = '/'; -#endif - -#if (TEST_NEW_CLIENTSTUB && !defined(__APPLE_API_PRIVATE)) -#define __APPLE_API_PRIVATE 1 -#endif - -#include "dns_sd.h" - -#include "ClientCommon.h" - -#if TEST_NEW_CLIENTSTUB -#include "../mDNSShared/dnssd_ipc.c" -#include "../mDNSShared/dnssd_clientlib.c" -#include "../mDNSShared/dnssd_clientstub.c" -#endif - -// The "+0" is to cope with the case where _DNS_SD_H is defined but empty (e.g. on Mac OS X 10.4 and earlier) -#if _DNS_SD_H+0 >= 116 -#define HAS_NAT_PMP_API 1 -#define HAS_ADDRINFO_API 1 -#else -#define kDNSServiceFlagsReturnIntermediates 0 -#endif - -//************************************************************************************************************* -// Globals - -typedef union { unsigned char b[2]; unsigned short NotAnInteger; } Opaque16; - -static int operation; -static uint32_t opinterface = kDNSServiceInterfaceIndexAny; -static DNSServiceRef client = NULL; -static DNSServiceRef client_pa = NULL; // DNSServiceRef for RegisterProxyAddressRecord -static DNSServiceRef sc1, sc2, sc3; // DNSServiceRefs for kDNSServiceFlagsShareConnection testing - -static int num_printed; -static char addtest = 0; -static DNSRecordRef record = NULL; -static char myhinfoW[14] = "\002PC\012Windows XP"; -static char myhinfoX[ 9] = "\003Mac\004OS X"; -static char updatetest[3] = "\002AA"; -static char bigNULL[8192]; // 8K is maximum rdata we support - -// Note: the select() implementation on Windows (Winsock2) fails with any timeout much larger than this -#define LONG_TIME 100000000 - -static volatile int stopNow = 0; -static volatile int timeOut = LONG_TIME; - -//************************************************************************************************************* -// Supporting Utility Functions - -static uint16_t GetRRType(const char *s) - { - if (!strcasecmp(s, "A" )) return(kDNSServiceType_A); - else if (!strcasecmp(s, "NS" )) return(kDNSServiceType_NS); - else if (!strcasecmp(s, "MD" )) return(kDNSServiceType_MD); - else if (!strcasecmp(s, "MF" )) return(kDNSServiceType_MF); - else if (!strcasecmp(s, "CNAME" )) return(kDNSServiceType_CNAME); - else if (!strcasecmp(s, "SOA" )) return(kDNSServiceType_SOA); - else if (!strcasecmp(s, "MB" )) return(kDNSServiceType_MB); - else if (!strcasecmp(s, "MG" )) return(kDNSServiceType_MG); - else if (!strcasecmp(s, "MR" )) return(kDNSServiceType_MR); - else if (!strcasecmp(s, "NULL" )) return(kDNSServiceType_NULL); - else if (!strcasecmp(s, "WKS" )) return(kDNSServiceType_WKS); - else if (!strcasecmp(s, "PTR" )) return(kDNSServiceType_PTR); - else if (!strcasecmp(s, "HINFO" )) return(kDNSServiceType_HINFO); - else if (!strcasecmp(s, "MINFO" )) return(kDNSServiceType_MINFO); - else if (!strcasecmp(s, "MX" )) return(kDNSServiceType_MX); - else if (!strcasecmp(s, "TXT" )) return(kDNSServiceType_TXT); - else if (!strcasecmp(s, "RP" )) return(kDNSServiceType_RP); - else if (!strcasecmp(s, "AFSDB" )) return(kDNSServiceType_AFSDB); - else if (!strcasecmp(s, "X25" )) return(kDNSServiceType_X25); - else if (!strcasecmp(s, "ISDN" )) return(kDNSServiceType_ISDN); - else if (!strcasecmp(s, "RT" )) return(kDNSServiceType_RT); - else if (!strcasecmp(s, "NSAP" )) return(kDNSServiceType_NSAP); - else if (!strcasecmp(s, "NSAP_PTR")) return(kDNSServiceType_NSAP_PTR); - else if (!strcasecmp(s, "SIG" )) return(kDNSServiceType_SIG); - else if (!strcasecmp(s, "KEY" )) return(kDNSServiceType_KEY); - else if (!strcasecmp(s, "PX" )) return(kDNSServiceType_PX); - else if (!strcasecmp(s, "GPOS" )) return(kDNSServiceType_GPOS); - else if (!strcasecmp(s, "AAAA" )) return(kDNSServiceType_AAAA); - else if (!strcasecmp(s, "LOC" )) return(kDNSServiceType_LOC); - else if (!strcasecmp(s, "NXT" )) return(kDNSServiceType_NXT); - else if (!strcasecmp(s, "EID" )) return(kDNSServiceType_EID); - else if (!strcasecmp(s, "NIMLOC" )) return(kDNSServiceType_NIMLOC); - else if (!strcasecmp(s, "SRV" )) return(kDNSServiceType_SRV); - else if (!strcasecmp(s, "ATMA" )) return(kDNSServiceType_ATMA); - else if (!strcasecmp(s, "NAPTR" )) return(kDNSServiceType_NAPTR); - else if (!strcasecmp(s, "KX" )) return(kDNSServiceType_KX); - else if (!strcasecmp(s, "CERT" )) return(kDNSServiceType_CERT); - else if (!strcasecmp(s, "A6" )) return(kDNSServiceType_A6); - else if (!strcasecmp(s, "DNAME" )) return(kDNSServiceType_DNAME); - else if (!strcasecmp(s, "SINK" )) return(kDNSServiceType_SINK); - else if (!strcasecmp(s, "OPT" )) return(kDNSServiceType_OPT); - else if (!strcasecmp(s, "TKEY" )) return(kDNSServiceType_TKEY); - else if (!strcasecmp(s, "TSIG" )) return(kDNSServiceType_TSIG); - else if (!strcasecmp(s, "IXFR" )) return(kDNSServiceType_IXFR); - else if (!strcasecmp(s, "AXFR" )) return(kDNSServiceType_AXFR); - else if (!strcasecmp(s, "MAILB" )) return(kDNSServiceType_MAILB); - else if (!strcasecmp(s, "MAILA" )) return(kDNSServiceType_MAILA); - else if (!strcasecmp(s, "ANY" )) return(kDNSServiceType_ANY); - else return(atoi(s)); - } - -#if HAS_NAT_PMP_API | HAS_ADDRINFO_API -static DNSServiceProtocol GetProtocol(const char *s) - { - if (!strcasecmp(s, "v4" )) return(kDNSServiceProtocol_IPv4); - else if (!strcasecmp(s, "v6" )) return(kDNSServiceProtocol_IPv6); - else if (!strcasecmp(s, "v4v6" )) return(kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6); - else if (!strcasecmp(s, "v6v4" )) return(kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6); - else if (!strcasecmp(s, "udp" )) return(kDNSServiceProtocol_UDP); - else if (!strcasecmp(s, "tcp" )) return(kDNSServiceProtocol_TCP); - else if (!strcasecmp(s, "udptcp" )) return(kDNSServiceProtocol_UDP | kDNSServiceProtocol_TCP); - else if (!strcasecmp(s, "tcpudp" )) return(kDNSServiceProtocol_UDP | kDNSServiceProtocol_TCP); - else return(atoi(s)); - } -#endif - -//************************************************************************************************************* -// Sample callback functions for each of the operation types - -static void printtimestamp(void) - { - struct tm tm; - int ms; -#ifdef _WIN32 - SYSTEMTIME sysTime; - time_t uct = time(NULL); - tm = *localtime(&uct); - GetLocalTime(&sysTime); - ms = sysTime.wMilliseconds; -#else - struct timeval tv; - gettimeofday(&tv, NULL); - localtime_r((time_t*)&tv.tv_sec, &tm); - ms = tv.tv_usec/1000; -#endif - printf("%2d:%02d:%02d.%03d ", tm.tm_hour, tm.tm_min, tm.tm_sec, ms); - } - -#define DomainMsg(X) (((X) & kDNSServiceFlagsDefault) ? "(Default)" : \ - ((X) & kDNSServiceFlagsAdd) ? "Added" : "Removed") - -#define MAX_LABELS 128 - -static void DNSSD_API enum_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, - DNSServiceErrorType errorCode, const char *replyDomain, void *context) - { - DNSServiceFlags partialflags = flags & ~(kDNSServiceFlagsMoreComing | kDNSServiceFlagsAdd | kDNSServiceFlagsDefault); - int labels = 0, depth = 0, i, initial = 0; - char text[64]; - const char *label[MAX_LABELS]; - - (void)sdref; // Unused - (void)ifIndex; // Unused - (void)context; // Unused - - // 1. Print the header - if (num_printed++ == 0) printf("Timestamp Recommended %s domain\n", operation == 'E' ? "Registration" : "Browsing"); - printtimestamp(); - if (errorCode) - printf("Error code %d\n", errorCode); - else if (!*replyDomain) - printf("Error: No reply domain\n"); - else - { - printf("%-10s", DomainMsg(flags)); - printf("%-8s", (flags & kDNSServiceFlagsMoreComing) ? "(More)" : ""); - if (partialflags) printf("Flags: %4X ", partialflags); - else printf(" "); - - // 2. Count the labels - while (replyDomain && *replyDomain && labels < MAX_LABELS) - { - label[labels++] = replyDomain; - replyDomain = GetNextLabel(replyDomain, text); - } - - // 3. Decide if we're going to clump the last two or three labels (e.g. "apple.com", or "nicta.com.au") - if (labels >= 3 && replyDomain - label[labels-1] <= 3 && label[labels-1] - label[labels-2] <= 4) initial = 3; - else if (labels >= 2 && replyDomain - label[labels-1] <= 4) initial = 2; - else initial = 1; - labels -= initial; - - // 4. Print the initial one-, two- or three-label clump - for (i=0; i0) printf("."); - printf("%s", text); - } - printf("\n"); - - // 5. Print the remainder of the hierarchy - for (depth=0; depth %s\n", text); - } - } - - if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout); - } - -static int CopyLabels(char *dst, const char *lim, const char **srcp, int labels) - { - const char *src = *srcp; - while (*src != '.' || --labels > 0) - { - if (*src == '\\') *dst++ = *src++; // Make sure "\." doesn't confuse us - if (!*src || dst >= lim) return -1; - *dst++ = *src++; - if (!*src || dst >= lim) return -1; - } - *dst++ = 0; - *srcp = src + 1; // skip over final dot - return 0; - } - - - - -static void ShowTXTRecord(uint16_t txtLen, const unsigned char *txtRecord) - { - const unsigned char *ptr = txtRecord; - const unsigned char *max = txtRecord + txtLen; - while (ptr < max) - { - const unsigned char *const end = ptr + 1 + ptr[0]; - if (end > max) { printf("<< invalid data >>"); break; } - if (++ptr < end) printf(" "); // As long as string is non-empty, begin with a space - while (ptr^()[]{}$", *ptr)) printf("\\"); - if (*ptr == '\\') printf("\\\\\\\\"); - else if (*ptr >= ' ' ) printf("%c", *ptr); - else printf("\\\\x%02X", *ptr); - ptr++; - } - } - } - -static void DNSSD_API resolve_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode, - const char *fullname, const char *hosttarget, uint16_t opaqueport, uint16_t txtLen, const unsigned char *txtRecord, void *context) - { - union { uint16_t s; u_char b[2]; } port = { opaqueport }; - uint16_t PortAsNumber = ((uint16_t)port.b[0]) << 8 | port.b[1]; - - (void)sdref; // Unused - (void)ifIndex; // Unused - (void)context; // Unused - - printtimestamp(); - if (errorCode) printf("Error code %d\n", errorCode); - else - { - printf("%s can be reached at %s:%u (interface %d)", fullname, hosttarget, PortAsNumber, ifIndex); - if (flags) printf(" Flags: %X", flags); - // Don't show degenerate TXT records containing nothing but a single empty string - if (txtLen > 1) { printf("\n"); ShowTXTRecord(txtLen, txtRecord); } - printf("\n"); - } - - if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout); - } - -static void myTimerCallBack(void) - { - DNSServiceErrorType err = kDNSServiceErr_Unknown; - - switch (operation) - { - case 'A': - { - switch (addtest) - { - case 0: printf("Adding Test HINFO record\n"); - err = DNSServiceAddRecord(client, &record, 0, kDNSServiceType_HINFO, sizeof(myhinfoW), &myhinfoW[0], 0); - addtest = 1; - break; - case 1: printf("Updating Test HINFO record\n"); - err = DNSServiceUpdateRecord(client, record, 0, sizeof(myhinfoX), &myhinfoX[0], 0); - addtest = 2; - break; - case 2: printf("Removing Test HINFO record\n"); - err = DNSServiceRemoveRecord(client, record, 0); - addtest = 0; - break; - } - } - break; - - case 'U': - { - if (updatetest[1] != 'Z') updatetest[1]++; - else updatetest[1] = 'A'; - updatetest[0] = 3 - updatetest[0]; - updatetest[2] = updatetest[1]; - printtimestamp(); - printf("Updating Test TXT record to %c\n", updatetest[1]); - err = DNSServiceUpdateRecord(client, NULL, 0, 1+updatetest[0], &updatetest[0], 0); - } - break; - - case 'N': - { - printf("Adding big NULL record\n"); - err = DNSServiceAddRecord(client, &record, 0, kDNSServiceType_NULL, sizeof(bigNULL), &bigNULL[0], 0); - if (err) printf("Failed: %d\n", err); else printf("Succeeded\n"); - timeOut = LONG_TIME; - } - break; - } - - if (err != kDNSServiceErr_NoError) - { - fprintf(stderr, "DNSService add/update/remove failed %ld\n", (long int)err); - stopNow = 1; - } - } - - - -// Output the wire-format domainname pointed to by rd -static int snprintd(char *p, int max, const unsigned char **rd) - { - const char *const buf = p; - const char *const end = p + max; - while (**rd) { p += snprintf(p, end-p, "%.*s.", **rd, *rd+1); *rd += 1 + **rd; } - *rd += 1; // Advance over the final zero byte - return(p-buf); - } - -static void DNSSD_API qr_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode, - const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context) - { - char *op = (flags & kDNSServiceFlagsAdd) ? "Add" : "Rmv"; - const unsigned char *rd = rdata; - const unsigned char *end = (const unsigned char *) rdata + rdlen; - char rdb[1000] = "", *p = rdb; - int unknowntype = 0; - - (void)sdref; // Unused - (void)flags; // Unused - (void)ifIndex; // Unused - (void)ttl; // Unused - (void)context; // Unused - - if (num_printed++ == 0) printf("Timestamp A/R Flags if %-30s%4s%4s Rdata\n", "Name", "T", "C"); - printtimestamp(); - - if (!errorCode) - { - switch (rrtype) - { - case kDNSServiceType_A: - snprintf(rdb, sizeof(rdb), "%d.%d.%d.%d", rd[0], rd[1], rd[2], rd[3]); - break; - - case kDNSServiceType_NS: - case kDNSServiceType_CNAME: - case kDNSServiceType_PTR: - case kDNSServiceType_DNAME: - p += snprintd(p, sizeof(rdb), &rd); - break; - - case kDNSServiceType_SOA: - p += snprintd(p, rdb + sizeof(rdb) - p, &rd); // mname - p += snprintf(p, rdb + sizeof(rdb) - p, " "); - p += snprintd(p, rdb + sizeof(rdb) - p, &rd); // rname - p += snprintf(p, rdb + sizeof(rdb) - p, " Ser %d Ref %d Ret %d Exp %d Min %d", - ntohl(((uint32_t*)rd)[0]), ntohl(((uint32_t*)rd)[1]), ntohl(((uint32_t*)rd)[2]), ntohl(((uint32_t*)rd)[3]), ntohl(((uint32_t*)rd)[4])); - break; - - case kDNSServiceType_AAAA: - snprintf(rdb, sizeof(rdb), "%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X", - rd[0x0], rd[0x1], rd[0x2], rd[0x3], rd[0x4], rd[0x5], rd[0x6], rd[0x7], - rd[0x8], rd[0x9], rd[0xA], rd[0xB], rd[0xC], rd[0xD], rd[0xE], rd[0xF]); - break; - - case kDNSServiceType_SRV: - p += snprintf(p, rdb + sizeof(rdb) - p, "%d %d %d ", // priority, weight, port - ntohs(*(unsigned short*)rd), ntohs(*(unsigned short*)(rd+2)), ntohs(*(unsigned short*)(rd+4))); - rd += 6; - p += snprintd(p, rdb + sizeof(rdb) - p, &rd); // target host - break; - - default : snprintf(rdb, sizeof(rdb), "%d bytes%s", rdlen, rdlen ? ":" : ""); unknowntype = 1; break; - } - } - - printf("%s%6X%3d %-30s%4d%4d %s", op, flags, ifIndex, fullname, rrtype, rrclass, rdb); - if (unknowntype) while (rd < end) printf(" %02X", *rd++); - if (errorCode) - { - if (errorCode == kDNSServiceErr_NoSuchRecord) printf("No Such Record"); - else printf("Error code %d", errorCode); - } - printf("\n"); - - if (operation == 'C') - if (flags & kDNSServiceFlagsAdd) - DNSServiceReconfirmRecord(flags, ifIndex, fullname, rrtype, rrclass, rdlen, rdata); - - if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout); - } - -#if HAS_NAT_PMP_API -static void DNSSD_API port_mapping_create_reply(DNSServiceRef sdref, DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode, uint32_t publicAddress, uint32_t protocol, uint16_t privatePort, uint16_t publicPort, uint32_t ttl, void *context) - { - (void)sdref; // Unused - (void)context; // Unused - (void)flags; // Unused - - if (num_printed++ == 0) printf("Timestamp if %-20s %-15s %-15s %-15s %-6s\n", "External Address", "Protocol", "Internal Port", "External Port", "TTL"); - printtimestamp(); - if (errorCode && errorCode != kDNSServiceErr_DoubleNAT) printf("Error code %d\n", errorCode); - else - { - const unsigned char *digits = (const unsigned char *)&publicAddress; - char addr[256]; - - snprintf(addr, sizeof(addr), "%d.%d.%d.%d", digits[0], digits[1], digits[2], digits[3]); - printf("%-4d %-20s %-15d %-15d %-15d %-6d%s\n", ifIndex, addr, protocol, ntohs(privatePort), ntohs(publicPort), ttl, errorCode == kDNSServiceErr_DoubleNAT ? " Double NAT" : ""); - } - fflush(stdout); - } -#endif - -#if HAS_ADDRINFO_API -static void DNSSD_API addrinfo_reply(DNSServiceRef sdref, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *hostname, const struct sockaddr *address, uint32_t ttl, void *context) - { - char *op = (flags & kDNSServiceFlagsAdd) ? "Add" : "Rmv"; - char addr[256] = ""; - (void) sdref; - (void) context; - - if (num_printed++ == 0) printf("Timestamp A/R Flags if %-25s %-44s %s\n", "Hostname", "Address", "TTL"); - printtimestamp(); - - if (address && address->sa_family == AF_INET) - { - const unsigned char *b = (const unsigned char *) &((struct sockaddr_in *)address)->sin_addr; - snprintf(addr, sizeof(addr), "%d.%d.%d.%d", b[0], b[1], b[2], b[3]); - } - else if (address && address->sa_family == AF_INET6) - { - char if_name[IFNAMSIZ]; // Older Linux distributions don't define IF_NAMESIZE - const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *)address; - const unsigned char *b = (const unsigned char * )&s6->sin6_addr; - if (!if_indextoname(s6->sin6_scope_id, if_name)) - snprintf(if_name, sizeof(if_name), "<%d>", s6->sin6_scope_id); - snprintf(addr, sizeof(addr), "%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X%%%s", - b[0x0], b[0x1], b[0x2], b[0x3], b[0x4], b[0x5], b[0x6], b[0x7], - b[0x8], b[0x9], b[0xA], b[0xB], b[0xC], b[0xD], b[0xE], b[0xF], if_name); - } - - printf("%s%6X%3d %-25s %-44s %d", op, flags, interfaceIndex, hostname, addr, ttl); - if (errorCode) - { - if (errorCode == kDNSServiceErr_NoSuchRecord) printf(" No Such Record"); - else printf(" Error code %d", errorCode); - } - printf("\n"); - - if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout); - } -#endif - -//************************************************************************************************************* -// The main test function - -static void HandleEvents(void) - { - int dns_sd_fd = client ? DNSServiceRefSockFD(client ) : -1; - int dns_sd_fd2 = client_pa ? DNSServiceRefSockFD(client_pa) : -1; - int nfds = dns_sd_fd + 1; - fd_set readfds; - struct timeval tv; - int result; - - if (dns_sd_fd2 > dns_sd_fd) nfds = dns_sd_fd2 + 1; - - while (!stopNow) - { - // 1. Set up the fd_set as usual here. - // This example client has no file descriptors of its own, - // but a real application would call FD_SET to add them to the set here - FD_ZERO(&readfds); - - // 2. Add the fd for our client(s) to the fd_set - if (client ) FD_SET(dns_sd_fd , &readfds); - if (client_pa) FD_SET(dns_sd_fd2, &readfds); - - // 3. Set up the timeout. - tv.tv_sec = timeOut; - tv.tv_usec = 0; - - result = select(nfds, &readfds, (fd_set*)NULL, (fd_set*)NULL, &tv); - if (result > 0) - { - DNSServiceErrorType err = kDNSServiceErr_NoError; - if (client && FD_ISSET(dns_sd_fd , &readfds)) err = DNSServiceProcessResult(client ); - else if (client_pa && FD_ISSET(dns_sd_fd2, &readfds)) err = DNSServiceProcessResult(client_pa); - if (err) { fprintf(stderr, "DNSServiceProcessResult returned %d\n", err); stopNow = 1; } - } - else if (result == 0) - myTimerCallBack(); - else - { - printf("select() returned %d errno %d %s\n", result, errno, strerror(errno)); - if (errno != EINTR) stopNow = 1; - } - } - } - -static int getfirstoption(int argc, char **argv, const char *optstr, int *pOptInd) -// Return the recognized option in optstr and the option index of the next arg. -#if NOT_HAVE_GETOPT - { - int i; - for (i=1; i < argc; i++) - { - if (argv[i][0] == '-' && &argv[i][1] && - NULL != strchr(optstr, argv[i][1])) - { - *pOptInd = i + 1; - return argv[i][1]; - } - } - return -1; - } -#else - { - int o = getopt(argc, (char *const *)argv, optstr); - *pOptInd = optind; - return o; - } -#endif - -static void DNSSD_API MyRegisterRecordCallback(DNSServiceRef service, DNSRecordRef rec, const DNSServiceFlags flags, - DNSServiceErrorType errorCode, void *context) - { - char *name = (char *)context; - - (void)service; // Unused - (void)rec; // Unused - (void)flags; // Unused - - printtimestamp(); - printf("Got a reply for record %s: ", name); - - switch (errorCode) - { - case kDNSServiceErr_NoError: printf("Name now registered and active\n"); break; - case kDNSServiceErr_NameConflict: printf("Name in use, please choose another\n"); exit(-1); - default: printf("Error %d\n", errorCode); break; - } - if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout); - // DNSServiceRemoveRecord(service, rec, 0); to test record removal - } - -static unsigned long getip(const char *const name) - { - unsigned long ip = 0; - struct addrinfo hints; - struct addrinfo *addrs = NULL; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_INET; - - if (getaddrinfo(name, NULL, &hints, &addrs) == 0) - { - ip = ((struct sockaddr_in*) addrs->ai_addr)->sin_addr.s_addr; - } - - if (addrs) - { - freeaddrinfo(addrs); - } - - return(ip); - } - -static DNSServiceErrorType RegisterProxyAddressRecord(DNSServiceRef sdref, const char *host, const char *ip) - { - // Call getip() after the call DNSServiceCreateConnection(). - // On the Win32 platform, WinSock must be initialized for getip() to succeed. - // Any DNSService* call will initialize WinSock for us, so we make sure - // DNSServiceCreateConnection() is called before getip() is. - unsigned long addr = getip(ip); - return(DNSServiceRegisterRecord(sdref, &record, kDNSServiceFlagsUnique, opinterface, host, - kDNSServiceType_A, kDNSServiceClass_IN, sizeof(addr), &addr, 240, MyRegisterRecordCallback, (void*)host)); - // Note, should probably add support for creating proxy AAAA records too, one day - } - -#define HexVal(X) ( ((X) >= '0' && (X) <= '9') ? ((X) - '0' ) : \ - ((X) >= 'A' && (X) <= 'F') ? ((X) - 'A' + 10) : \ - ((X) >= 'a' && (X) <= 'f') ? ((X) - 'a' + 10) : 0) - -#define HexPair(P) ((HexVal((P)[0]) << 4) | HexVal((P)[1])) - diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns_sd.h openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns_sd.h --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns_sd.h 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/mdns_win/dns_sd.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,2358 +0,0 @@ -/* -*- Mode: C; tab-width: 4 -*- - * - * Copyright (c) 2003-2004, Apple Computer, Inc. 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS 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. - */ - - -/*! @header DNS Service Discovery - * - * @discussion This section describes the functions, callbacks, and data structures - * that make up the DNS Service Discovery API. - * - * The DNS Service Discovery API is part of Bonjour, Apple's implementation - * of zero-configuration networking (ZEROCONF). - * - * Bonjour allows you to register a network service, such as a - * printer or file server, so that it can be found by name or browsed - * for by service type and domain. Using Bonjour, applications can - * discover what services are available on the network, along with - * all the information -- such as name, IP address, and port -- - * necessary to access a particular service. - * - * In effect, Bonjour combines the functions of a local DNS server and - * AppleTalk. Bonjour allows applications to provide user-friendly printer - * and server browsing, among other things, over standard IP networks. - * This behavior is a result of combining protocols such as multicast and - * DNS to add new functionality to the network (such as multicast DNS). - * - * Bonjour gives applications easy access to services over local IP - * networks without requiring the service or the application to support - * an AppleTalk or a Netbeui stack, and without requiring a DNS server - * for the local network. - */ - - -/* _DNS_SD_H contains the mDNSResponder version number for this header file, formatted as follows: - * Major part of the build number * 10000 + - * minor part of the build number * 100 - * For example, Mac OS X 10.4.9 has mDNSResponder-108.4, which would be represented as - * version 1080400. This allows C code to do simple greater-than and less-than comparisons: - * e.g. an application that requires the DNSServiceGetProperty() call (new in mDNSResponder-126) can check: - * - * #if _DNS_SD_H+0 >= 1260000 - * ... some C code that calls DNSServiceGetProperty() ... - * #endif - * - * The version defined in this header file symbol allows for compile-time - * checking, so that C code building with earlier versions of the header file - * can avoid compile errors trying to use functions that aren't even defined - * in those earlier versions. Similar checks may also be performed at run-time: - * => weak linking -- to avoid link failures if run with an earlier - * version of the library that's missing some desired symbol, or - * => DNSServiceGetProperty(DaemonVersion) -- to verify whether the running daemon - * ("system service" on Windows) meets some required minimum functionality level. - */ - -#ifndef _DNS_SD_H -#define _DNS_SD_H 2140300 - -#ifdef __cplusplus - extern "C" { -#endif - -/* standard calling convention under Win32 is __stdcall */ -/* Note: When compiling Intel EFI (Extensible Firmware Interface) under MS Visual Studio, the */ -/* _WIN32 symbol is defined by the compiler even though it's NOT compiling code for Windows32 */ -#if defined(_WIN32) && !defined(EFI32) && !defined(EFI64) -#define DNSSD_API __stdcall -#else -#define DNSSD_API -#endif - -/* stdint.h does not exist on FreeBSD 4.x; its types are defined in sys/types.h instead */ -#if defined(__FreeBSD__) && (__FreeBSD__ < 5) -#include - -/* Likewise, on Sun, standard integer types are in sys/types.h */ -#elif defined(__sun__) -#include - -/* EFI does not have stdint.h, or anything else equivalent */ -#elif defined(EFI32) || defined(EFI64) || defined(EFIX64) -#include "Tiano.h" -#if !defined(_STDINT_H_) -typedef UINT8 uint8_t; -typedef INT8 int8_t; -typedef UINT16 uint16_t; -typedef INT16 int16_t; -typedef UINT32 uint32_t; -typedef INT32 int32_t; -#endif -/* Windows has its own differences */ -#elif defined(_WIN32) -#include -#define _UNUSED -#ifndef _MSL_STDINT_H -typedef UINT8 uint8_t; -typedef INT8 int8_t; -typedef UINT16 uint16_t; -typedef INT16 int16_t; -typedef UINT32 uint32_t; -//typedef INT32 int32_t; -#endif - -/* All other Posix platforms use stdint.h */ -#else -#include -#endif - -/* DNSServiceRef, DNSRecordRef - * - * Opaque internal data types. - * Note: client is responsible for serializing access to these structures if - * they are shared between concurrent threads. - */ - -typedef struct _DNSServiceRef_t *DNSServiceRef; -typedef struct _DNSRecordRef_t *DNSRecordRef; - -struct sockaddr; - -/*! @enum General flags - * Most DNS-SD API functions and callbacks include a DNSServiceFlags parameter. - * As a general rule, any given bit in the 32-bit flags field has a specific fixed meaning, - * regardless of the function or callback being used. For any given function or callback, - * typically only a subset of the possible flags are meaningful, and all others should be zero. - * The discussion section for each API call describes which flags are valid for that call - * and callback. In some cases, for a particular call, it may be that no flags are currently - * defined, in which case the DNSServiceFlags parameter exists purely to allow future expansion. - * In all cases, developers should expect that in future releases, it is possible that new flag - * values will be defined, and write code with this in mind. For example, code that tests - * if (flags == kDNSServiceFlagsAdd) ... - * will fail if, in a future release, another bit in the 32-bit flags field is also set. - * The reliable way to test whether a particular bit is set is not with an equality test, - * but with a bitwise mask: - * if (flags & kDNSServiceFlagsAdd) ... - */ -enum - { - kDNSServiceFlagsMoreComing = 0x1, - /* MoreComing indicates to a callback that at least one more result is - * queued and will be delivered following immediately after this one. - * When the MoreComing flag is set, applications should not immediately - * update their UI, because this can result in a great deal of ugly flickering - * on the screen, and can waste a great deal of CPU time repeatedly updating - * the screen with content that is then immediately erased, over and over. - * Applications should wait until until MoreComing is not set, and then - * update their UI when no more changes are imminent. - * When MoreComing is not set, that doesn't mean there will be no more - * answers EVER, just that there are no more answers immediately - * available right now at this instant. If more answers become available - * in the future they will be delivered as usual. - */ - - kDNSServiceFlagsAdd = 0x2, - kDNSServiceFlagsDefault = 0x4, - /* Flags for domain enumeration and browse/query reply callbacks. - * "Default" applies only to enumeration and is only valid in - * conjunction with "Add". An enumeration callback with the "Add" - * flag NOT set indicates a "Remove", i.e. the domain is no longer - * valid. - */ - - kDNSServiceFlagsNoAutoRename = 0x8, - /* Flag for specifying renaming behavior on name conflict when registering - * non-shared records. By default, name conflicts are automatically handled - * by renaming the service. NoAutoRename overrides this behavior - with this - * flag set, name conflicts will result in a callback. The NoAutorename flag - * is only valid if a name is explicitly specified when registering a service - * (i.e. the default name is not used.) - */ - - kDNSServiceFlagsShared = 0x10, - kDNSServiceFlagsUnique = 0x20, - /* Flag for registering individual records on a connected - * DNSServiceRef. Shared indicates that there may be multiple records - * with this name on the network (e.g. PTR records). Unique indicates that the - * record's name is to be unique on the network (e.g. SRV records). - */ - - kDNSServiceFlagsBrowseDomains = 0x40, - kDNSServiceFlagsRegistrationDomains = 0x80, - /* Flags for specifying domain enumeration type in DNSServiceEnumerateDomains. - * BrowseDomains enumerates domains recommended for browsing, RegistrationDomains - * enumerates domains recommended for registration. - */ - - kDNSServiceFlagsLongLivedQuery = 0x100, - /* Flag for creating a long-lived unicast query for the DNSServiceQueryRecord call. */ - - kDNSServiceFlagsAllowRemoteQuery = 0x200, - /* Flag for creating a record for which we will answer remote queries - * (queries from hosts more than one hop away; hosts not directly connected to the local link). - */ - - kDNSServiceFlagsForceMulticast = 0x400, - /* Flag for signifying that a query or registration should be performed exclusively via multicast - * DNS, even for a name in a domain (e.g. foo.apple.com.) that would normally imply unicast DNS. - */ - - kDNSServiceFlagsForce = 0x800, - /* Flag for signifying a "stronger" variant of an operation. - * Currently defined only for DNSServiceReconfirmRecord(), where it forces a record to - * be removed from the cache immediately, instead of querying for a few seconds before - * concluding that the record is no longer valid and then removing it. This flag should - * be used with caution because if a service browsing PTR record is indeed still valid - * on the network, forcing its removal will result in a user-interface flap -- the - * discovered service instance will disappear, and then re-appear moments later. - */ - - kDNSServiceFlagsReturnIntermediates = 0x1000, - /* Flag for returning intermediate results. - * For example, if a query results in an authoritative NXDomain (name does not exist) - * then that result is returned to the client. However the query is not implicitly - * cancelled -- it remains active and if the answer subsequently changes - * (e.g. because a VPN tunnel is subsequently established) then that positive - * result will still be returned to the client. - * Similarly, if a query results in a CNAME record, then in addition to following - * the CNAME referral, the intermediate CNAME result is also returned to the client. - * When this flag is not set, NXDomain errors are not returned, and CNAME records - * are followed silently without informing the client of the intermediate steps. - * (In earlier builds this flag was briefly calledkDNSServiceFlagsReturnCNAME) - */ - - kDNSServiceFlagsNonBrowsable = 0x2000, - /* A service registered with the NonBrowsable flag set can be resolved using - * DNSServiceResolve(), but will not be discoverable using DNSServiceBrowse(). - * This is for cases where the name is actually a GUID; it is found by other means; - * there is no end-user benefit to browsing to find a long list of opaque GUIDs. - * Using the NonBrowsable flag creates SRV+TXT without the cost of also advertising - * an associated PTR record. - */ - - kDNSServiceFlagsShareConnection = 0x4000, - /* For efficiency, clients that perform many concurrent operations may want to use a - * single Unix Domain Socket connection with the background daemon, instead of having a - * separate connection for each independent operation. To use this mode, clients first - * call DNSServiceCreateConnection(&MainRef) to initialize the main DNSServiceRef. - * For each subsequent operation that is to share that same connection, the client copies - * the MainRef, and then passes the address of that copy, setting the ShareConnection flag - * to tell the library that this DNSServiceRef is not a typical uninitialized DNSServiceRef; - * it's a copy of an existing DNSServiceRef whose connection information should be reused. - * - * For example: - * - * DNSServiceErrorType error; - * DNSServiceRef MainRef; - * error = DNSServiceCreateConnection(&MainRef); - * if (error) ... - * DNSServiceRef BrowseRef = MainRef; // Important: COPY the primary DNSServiceRef first... - * error = DNSServiceBrowse(&BrowseRef, kDNSServiceFlagsShareConnection, ...); // then use the copy - * if (error) ... - * ... - * DNSServiceRefDeallocate(BrowseRef); // Terminate the browse operation - * DNSServiceRefDeallocate(MainRef); // Terminate the shared connection - * - * Notes: - * - * 1. Collective kDNSServiceFlagsMoreComing flag - * When callbacks are invoked using a shared DNSServiceRef, the - * kDNSServiceFlagsMoreComing flag applies collectively to *all* active - * operations sharing the same parent DNSServiceRef. If the MoreComing flag is - * set it means that there are more results queued on this parent DNSServiceRef, - * but not necessarily more results for this particular callback function. - * The implication of this for client programmers is that when a callback - * is invoked with the MoreComing flag set, the code should update its - * internal data structures with the new result, and set a variable indicating - * that its UI needs to be updated. Then, later when a callback is eventually - * invoked with the MoreComing flag not set, the code should update *all* - * stale UI elements related to that shared parent DNSServiceRef that need - * updating, not just the UI elements related to the particular callback - * that happened to be the last one to be invoked. - * - * 2. Canceling operations and kDNSServiceFlagsMoreComing - * Whenever you cancel any operation for which you had deferred UI updates - * waiting because of a kDNSServiceFlagsMoreComing flag, you should perform - * those deferred UI updates. This is because, after cancelling the operation, - * you can no longer wait for a callback *without* MoreComing set, to tell - * you do perform your deferred UI updates (the operation has been canceled, - * so there will be no more callbacks). An implication of the collective - * kDNSServiceFlagsMoreComing flag for shared connections is that this - * guideline applies more broadly -- any time you cancel an operation on - * a shared connection, you should perform all deferred UI updates for all - * operations sharing that connection. This is because the MoreComing flag - * might have been referring to events coming for the operation you canceled, - * which will now not be coming because the operation has been canceled. - * - * 3. Only share DNSServiceRef's created with DNSServiceCreateConnection - * Calling DNSServiceCreateConnection(&ref) creates a special shareable DNSServiceRef. - * DNSServiceRef's created by other calls like DNSServiceBrowse() or DNSServiceResolve() - * cannot be shared by copying them and using kDNSServiceFlagsShareConnection. - * - * 4. Don't Double-Deallocate - * Calling DNSServiceRefDeallocate(ref) for a particular operation's DNSServiceRef terminates - * just that operation. Calling DNSServiceRefDeallocate(ref) for the main shared DNSServiceRef - * (the parent DNSServiceRef, originally created by DNSServiceCreateConnection(&ref)) - * automatically terminates the shared connection and all operations that were still using it. - * After doing this, DO NOT then attempt to deallocate any remaining subordinate DNSServiceRef's. - * The memory used by those subordinate DNSServiceRef's has already been freed, so any attempt - * to do a DNSServiceRefDeallocate (or any other operation) on them will result in accesses - * to freed memory, leading to crashes or other equally undesirable results. - * - * 5. Thread Safety - * The dns_sd.h API does not presuppose any particular threading model, and consequently - * does no locking of its own (which would require linking some specific threading library). - * If client code calls API routines on the same DNSServiceRef concurrently - * from multiple threads, it is the client's responsibility to use a mutext - * lock or take similar appropriate precautions to serialize those calls. - */ - - kDNSServiceFlagsSuppressUnusable = 0x8000 - /* Placeholder definition, for future use - */ - }; - -/* Possible protocols for DNSServiceNATPortMappingCreate(). */ -enum - { - kDNSServiceProtocol_IPv4 = 0x01, - kDNSServiceProtocol_IPv6 = 0x02, - /* 0x04 and 0x08 reserved for future internetwork protocols */ - - kDNSServiceProtocol_UDP = 0x10, - kDNSServiceProtocol_TCP = 0x20 - /* 0x40 and 0x80 reserved for future transport protocols, e.g. SCTP [RFC 2960] - * or DCCP [RFC 4340]. If future NAT gateways are created that support port - * mappings for these protocols, new constants will be defined here. - */ - }; - -/* - * The values for DNS Classes and Types are listed in RFC 1035, and are available - * on every OS in its DNS header file. Unfortunately every OS does not have the - * same header file containing DNS Class and Type constants, and the names of - * the constants are not consistent. For example, BIND 8 uses "T_A", - * BIND 9 uses "ns_t_a", Windows uses "DNS_TYPE_A", etc. - * For this reason, these constants are also listed here, so that code using - * the DNS-SD programming APIs can use these constants, so that the same code - * can compile on all our supported platforms. - */ - -enum - { - kDNSServiceClass_IN = 1 /* Internet */ - }; - -enum - { - kDNSServiceType_A = 1, /* Host address. */ - kDNSServiceType_NS = 2, /* Authoritative server. */ - kDNSServiceType_MD = 3, /* Mail destination. */ - kDNSServiceType_MF = 4, /* Mail forwarder. */ - kDNSServiceType_CNAME = 5, /* Canonical name. */ - kDNSServiceType_SOA = 6, /* Start of authority zone. */ - kDNSServiceType_MB = 7, /* Mailbox domain name. */ - kDNSServiceType_MG = 8, /* Mail group member. */ - kDNSServiceType_MR = 9, /* Mail rename name. */ - kDNSServiceType_NULL = 10, /* Null resource record. */ - kDNSServiceType_WKS = 11, /* Well known service. */ - kDNSServiceType_PTR = 12, /* Domain name pointer. */ - kDNSServiceType_HINFO = 13, /* Host information. */ - kDNSServiceType_MINFO = 14, /* Mailbox information. */ - kDNSServiceType_MX = 15, /* Mail routing information. */ - kDNSServiceType_TXT = 16, /* One or more text strings (NOT "zero or more..."). */ - kDNSServiceType_RP = 17, /* Responsible person. */ - kDNSServiceType_AFSDB = 18, /* AFS cell database. */ - kDNSServiceType_X25 = 19, /* X_25 calling address. */ - kDNSServiceType_ISDN = 20, /* ISDN calling address. */ - kDNSServiceType_RT = 21, /* Router. */ - kDNSServiceType_NSAP = 22, /* NSAP address. */ - kDNSServiceType_NSAP_PTR = 23, /* Reverse NSAP lookup (deprecated). */ - kDNSServiceType_SIG = 24, /* Security signature. */ - kDNSServiceType_KEY = 25, /* Security key. */ - kDNSServiceType_PX = 26, /* X.400 mail mapping. */ - kDNSServiceType_GPOS = 27, /* Geographical position (withdrawn). */ - kDNSServiceType_AAAA = 28, /* IPv6 Address. */ - kDNSServiceType_LOC = 29, /* Location Information. */ - kDNSServiceType_NXT = 30, /* Next domain (security). */ - kDNSServiceType_EID = 31, /* Endpoint identifier. */ - kDNSServiceType_NIMLOC = 32, /* Nimrod Locator. */ - kDNSServiceType_SRV = 33, /* Server Selection. */ - kDNSServiceType_ATMA = 34, /* ATM Address */ - kDNSServiceType_NAPTR = 35, /* Naming Authority PoinTeR */ - kDNSServiceType_KX = 36, /* Key Exchange */ - kDNSServiceType_CERT = 37, /* Certification record */ - kDNSServiceType_A6 = 38, /* IPv6 Address (deprecated) */ - kDNSServiceType_DNAME = 39, /* Non-terminal DNAME (for IPv6) */ - kDNSServiceType_SINK = 40, /* Kitchen sink (experimental) */ - kDNSServiceType_OPT = 41, /* EDNS0 option (meta-RR) */ - kDNSServiceType_APL = 42, /* Address Prefix List */ - kDNSServiceType_DS = 43, /* Delegation Signer */ - kDNSServiceType_SSHFP = 44, /* SSH Key Fingerprint */ - kDNSServiceType_IPSECKEY = 45, /* IPSECKEY */ - kDNSServiceType_RRSIG = 46, /* RRSIG */ - kDNSServiceType_NSEC = 47, /* Denial of Existence */ - kDNSServiceType_DNSKEY = 48, /* DNSKEY */ - kDNSServiceType_DHCID = 49, /* DHCP Client Identifier */ - kDNSServiceType_NSEC3 = 50, /* Hashed Authenticated Denial of Existence */ - kDNSServiceType_NSEC3PARAM= 51, /* Hashed Authenticated Denial of Existence */ - - kDNSServiceType_HIP = 55, /* Host Identity Protocol */ - - kDNSServiceType_SPF = 99, /* Sender Policy Framework for E-Mail */ - kDNSServiceType_UINFO = 100, /* IANA-Reserved */ - kDNSServiceType_UID = 101, /* IANA-Reserved */ - kDNSServiceType_GID = 102, /* IANA-Reserved */ - kDNSServiceType_UNSPEC = 103, /* IANA-Reserved */ - - kDNSServiceType_TKEY = 249, /* Transaction key */ - kDNSServiceType_TSIG = 250, /* Transaction signature. */ - kDNSServiceType_IXFR = 251, /* Incremental zone transfer. */ - kDNSServiceType_AXFR = 252, /* Transfer zone of authority. */ - kDNSServiceType_MAILB = 253, /* Transfer mailbox records. */ - kDNSServiceType_MAILA = 254, /* Transfer mail agent records. */ - kDNSServiceType_ANY = 255 /* Wildcard match. */ - }; - -/* possible error code values */ -enum - { - kDNSServiceErr_NoError = 0, - kDNSServiceErr_Unknown = -65537, /* 0xFFFE FFFF */ - kDNSServiceErr_NoSuchName = -65538, - kDNSServiceErr_NoMemory = -65539, - kDNSServiceErr_BadParam = -65540, - kDNSServiceErr_BadReference = -65541, - kDNSServiceErr_BadState = -65542, - kDNSServiceErr_BadFlags = -65543, - kDNSServiceErr_Unsupported = -65544, - kDNSServiceErr_NotInitialized = -65545, - kDNSServiceErr_AlreadyRegistered = -65547, - kDNSServiceErr_NameConflict = -65548, - kDNSServiceErr_Invalid = -65549, - kDNSServiceErr_Firewall = -65550, - kDNSServiceErr_Incompatible = -65551, /* client library incompatible with daemon */ - kDNSServiceErr_BadInterfaceIndex = -65552, - kDNSServiceErr_Refused = -65553, - kDNSServiceErr_NoSuchRecord = -65554, - kDNSServiceErr_NoAuth = -65555, - kDNSServiceErr_NoSuchKey = -65556, - kDNSServiceErr_NATTraversal = -65557, - kDNSServiceErr_DoubleNAT = -65558, - kDNSServiceErr_BadTime = -65559, /* Codes up to here existed in Tiger */ - kDNSServiceErr_BadSig = -65560, - kDNSServiceErr_BadKey = -65561, - kDNSServiceErr_Transient = -65562, - kDNSServiceErr_ServiceNotRunning = -65563, /* Background daemon not running */ - kDNSServiceErr_NATPortMappingUnsupported = -65564, /* NAT doesn't support NAT-PMP or UPnP */ - kDNSServiceErr_NATPortMappingDisabled = -65565, /* NAT supports NAT-PMP or UPnP but it's disabled by the administrator */ - kDNSServiceErr_NoRouter = -65566, /* No router currently configured (probably no network connectivity) */ - kDNSServiceErr_PollingMode = -65567 - - /* mDNS Error codes are in the range - * FFFE FF00 (-65792) to FFFE FFFF (-65537) */ - }; - -/* Maximum length, in bytes, of a service name represented as a */ -/* literal C-String, including the terminating NULL at the end. */ - -#define kDNSServiceMaxServiceName 64 - -/* Maximum length, in bytes, of a domain name represented as an *escaped* C-String */ -/* including the final trailing dot, and the C-String terminating NULL at the end. */ - -#define kDNSServiceMaxDomainName 1009 - -/* - * Notes on DNS Name Escaping - * -- or -- - * "Why is kDNSServiceMaxDomainName 1009, when the maximum legal domain name is 256 bytes?" - * - * All strings used in the DNS-SD APIs are UTF-8 strings. Apart from the exceptions noted below, - * the APIs expect the strings to be properly escaped, using the conventional DNS escaping rules: - * - * '\\' represents a single literal '\' in the name - * '\.' represents a single literal '.' in the name - * '\ddd', where ddd is a three-digit decimal value from 000 to 255, - * represents a single literal byte with that value. - * A bare unescaped '.' is a label separator, marking a boundary between domain and subdomain. - * - * The exceptions, that do not use escaping, are the routines where the full - * DNS name of a resource is broken, for convenience, into servicename/regtype/domain. - * In these routines, the "servicename" is NOT escaped. It does not need to be, since - * it is, by definition, just a single literal string. Any characters in that string - * represent exactly what they are. The "regtype" portion is, technically speaking, - * escaped, but since legal regtypes are only allowed to contain letters, digits, - * and hyphens, there is nothing to escape, so the issue is moot. The "domain" - * portion is also escaped, though most domains in use on the public Internet - * today, like regtypes, don't contain any characters that need to be escaped. - * As DNS-SD becomes more popular, rich-text domains for service discovery will - * become common, so software should be written to cope with domains with escaping. - * - * The servicename may be up to 63 bytes of UTF-8 text (not counting the C-String - * terminating NULL at the end). The regtype is of the form _service._tcp or - * _service._udp, where the "service" part is 1-14 characters, which may be - * letters, digits, or hyphens. The domain part of the three-part name may be - * any legal domain, providing that the resulting servicename+regtype+domain - * name does not exceed 256 bytes. - * - * For most software, these issues are transparent. When browsing, the discovered - * servicenames should simply be displayed as-is. When resolving, the discovered - * servicename/regtype/domain are simply passed unchanged to DNSServiceResolve(). - * When a DNSServiceResolve() succeeds, the returned fullname is already in - * the correct format to pass to standard system DNS APIs such as res_query(). - * For converting from servicename/regtype/domain to a single properly-escaped - * full DNS name, the helper function DNSServiceConstructFullName() is provided. - * - * The following (highly contrived) example illustrates the escaping process. - * Suppose you have an service called "Dr. Smith\Dr. Johnson", of type "_ftp._tcp" - * in subdomain "4th. Floor" of subdomain "Building 2" of domain "apple.com." - * The full (escaped) DNS name of this service's SRV record would be: - * Dr\.\032Smith\\Dr\.\032Johnson._ftp._tcp.4th\.\032Floor.Building\0322.apple.com. - */ - - -/* - * Constants for specifying an interface index - * - * Specific interface indexes are identified via a 32-bit unsigned integer returned - * by the if_nametoindex() family of calls. - * - * If the client passes 0 for interface index, that means "do the right thing", - * which (at present) means, "if the name is in an mDNS local multicast domain - * (e.g. 'local.', '254.169.in-addr.arpa.', '{8,9,A,B}.E.F.ip6.arpa.') then multicast - * on all applicable interfaces, otherwise send via unicast to the appropriate - * DNS server." Normally, most clients will use 0 for interface index to - * automatically get the default sensible behaviour. - * - * If the client passes a positive interface index, then for multicast names that - * indicates to do the operation only on that one interface. For unicast names the - * interface index is ignored unless kDNSServiceFlagsForceMulticast is also set. - * - * If the client passes kDNSServiceInterfaceIndexLocalOnly when registering - * a service, then that service will be found *only* by other local clients - * on the same machine that are browsing using kDNSServiceInterfaceIndexLocalOnly - * or kDNSServiceInterfaceIndexAny. - * If a client has a 'private' service, accessible only to other processes - * running on the same machine, this allows the client to advertise that service - * in a way such that it does not inadvertently appear in service lists on - * all the other machines on the network. - * - * If the client passes kDNSServiceInterfaceIndexLocalOnly when browsing - * then it will find *all* records registered on that same local machine. - * Clients explicitly wishing to discover *only* LocalOnly services can - * accomplish this by inspecting the interfaceIndex of each service reported - * to their DNSServiceBrowseReply() callback function, and discarding those - * where the interface index is not kDNSServiceInterfaceIndexLocalOnly. - */ - -#define kDNSServiceInterfaceIndexAny 0 -#define kDNSServiceInterfaceIndexLocalOnly ((uint32_t)-1) -#define kDNSServiceInterfaceIndexUnicast ((uint32_t)-2) - -typedef uint32_t DNSServiceFlags; -typedef uint32_t DNSServiceProtocol; -typedef INT32 DNSServiceErrorType; - - -/********************************************************************************************* - * - * Version checking - * - *********************************************************************************************/ - -/* DNSServiceGetProperty() Parameters: - * - * property: The requested property. - * Currently the only property defined is kDNSServiceProperty_DaemonVersion. - * - * result: Place to store result. - * For retrieving DaemonVersion, this should be the address of a uint32_t. - * - * size: Pointer to uint32_t containing size of the result location. - * For retrieving DaemonVersion, this should be sizeof(uint32_t). - * On return the uint32_t is updated to the size of the data returned. - * For DaemonVersion, the returned size is always sizeof(uint32_t), but - * future properties could be defined which return variable-sized results. - * - * return value: Returns kDNSServiceErr_NoError on success, or kDNSServiceErr_ServiceNotRunning - * if the daemon (or "system service" on Windows) is not running. - */ - -DNSServiceErrorType DNSSD_API DNSServiceGetProperty - ( - const char *property, /* Requested property (i.e. kDNSServiceProperty_DaemonVersion) */ - void *result, /* Pointer to place to store result */ - uint32_t *size /* size of result location */ - ); - -/* - * When requesting kDNSServiceProperty_DaemonVersion, the result pointer must point - * to a 32-bit unsigned integer, and the size parameter must be set to sizeof(uint32_t). - * - * On return, the 32-bit unsigned integer contains the version number, formatted as follows: - * Major part of the build number * 10000 + - * minor part of the build number * 100 - * - * For example, Mac OS X 10.4.9 has mDNSResponder-108.4, which would be represented as - * version 1080400. This allows applications to do simple greater-than and less-than comparisons: - * e.g. an application that requires at least mDNSResponder-108.4 can check: - * - * if (version >= 1080400) ... - * - * Example usage: - * - * uint32_t version; - * uint32_t size = sizeof(version); - * DNSServiceErrorType err = DNSServiceGetProperty(kDNSServiceProperty_DaemonVersion, &version, &size); - * if (!err) printf("Bonjour version is %d.%d\n", version / 10000, version / 100 % 100); - */ - -#define kDNSServiceProperty_DaemonVersion "DaemonVersion" - - -/********************************************************************************************* - * - * Unix Domain Socket access, DNSServiceRef deallocation, and data processing functions - * - *********************************************************************************************/ - -/* DNSServiceRefSockFD() - * - * Access underlying Unix domain socket for an initialized DNSServiceRef. - * The DNS Service Discovery implementation uses this socket to communicate between the client and - * the mDNSResponder daemon. The application MUST NOT directly read from or write to this socket. - * Access to the socket is provided so that it can be used as a kqueue event source, a CFRunLoop - * event source, in a select() loop, etc. When the underlying event management subsystem (kqueue/ - * select/CFRunLoop etc.) indicates to the client that data is available for reading on the - * socket, the client should call DNSServiceProcessResult(), which will extract the daemon's - * reply from the socket, and pass it to the appropriate application callback. By using a run - * loop or select(), results from the daemon can be processed asynchronously. Alternatively, - * a client can choose to fork a thread and have it loop calling "DNSServiceProcessResult(ref);" - * If DNSServiceProcessResult() is called when no data is available for reading on the socket, it - * will block until data does become available, and then process the data and return to the caller. - * When data arrives on the socket, the client is responsible for calling DNSServiceProcessResult(ref) - * in a timely fashion -- if the client allows a large backlog of data to build up the daemon - * may terminate the connection. - * - * sdRef: A DNSServiceRef initialized by any of the DNSService calls. - * - * return value: The DNSServiceRef's underlying socket descriptor, or -1 on - * error. - */ - -int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef); - - -/* DNSServiceProcessResult() - * - * Read a reply from the daemon, calling the appropriate application callback. This call will - * block until the daemon's response is received. Use DNSServiceRefSockFD() in - * conjunction with a run loop or select() to determine the presence of a response from the - * server before calling this function to process the reply without blocking. Call this function - * at any point if it is acceptable to block until the daemon's response arrives. Note that the - * client is responsible for ensuring that DNSServiceProcessResult() is called whenever there is - * a reply from the daemon - the daemon may terminate its connection with a client that does not - * process the daemon's responses. - * - * sdRef: A DNSServiceRef initialized by any of the DNSService calls - * that take a callback parameter. - * - * return value: Returns kDNSServiceErr_NoError on success, otherwise returns - * an error code indicating the specific failure that occurred. - */ - -DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdRef); - - -/* DNSServiceRefDeallocate() - * - * Terminate a connection with the daemon and free memory associated with the DNSServiceRef. - * Any services or records registered with this DNSServiceRef will be deregistered. Any - * Browse, Resolve, or Query operations called with this reference will be terminated. - * - * Note: If the reference's underlying socket is used in a run loop or select() call, it should - * be removed BEFORE DNSServiceRefDeallocate() is called, as this function closes the reference's - * socket. - * - * Note: If the reference was initialized with DNSServiceCreateConnection(), any DNSRecordRefs - * created via this reference will be invalidated by this call - the resource records are - * deregistered, and their DNSRecordRefs may not be used in subsequent functions. Similarly, - * if the reference was initialized with DNSServiceRegister, and an extra resource record was - * added to the service via DNSServiceAddRecord(), the DNSRecordRef created by the Add() call - * is invalidated when this function is called - the DNSRecordRef may not be used in subsequent - * functions. - * - * Note: This call is to be used only with the DNSServiceRef defined by this API. It is - * not compatible with dns_service_discovery_ref objects defined in the legacy Mach-based - * DNSServiceDiscovery.h API. - * - * sdRef: A DNSServiceRef initialized by any of the DNSService calls. - * - */ - -void DNSSD_API DNSServiceRefDeallocate(DNSServiceRef sdRef); - - -/********************************************************************************************* - * - * Domain Enumeration - * - *********************************************************************************************/ - -/* DNSServiceEnumerateDomains() - * - * Asynchronously enumerate domains available for browsing and registration. - * - * The enumeration MUST be cancelled via DNSServiceRefDeallocate() when no more domains - * are to be found. - * - * Note that the names returned are (like all of DNS-SD) UTF-8 strings, - * and are escaped using standard DNS escaping rules. - * (See "Notes on DNS Name Escaping" earlier in this file for more details.) - * A graphical browser displaying a hierarchical tree-structured view should cut - * the names at the bare dots to yield individual labels, then de-escape each - * label according to the escaping rules, and then display the resulting UTF-8 text. - * - * DNSServiceDomainEnumReply Callback Parameters: - * - * sdRef: The DNSServiceRef initialized by DNSServiceEnumerateDomains(). - * - * flags: Possible values are: - * kDNSServiceFlagsMoreComing - * kDNSServiceFlagsAdd - * kDNSServiceFlagsDefault - * - * interfaceIndex: Specifies the interface on which the domain exists. (The index for a given - * interface is determined via the if_nametoindex() family of calls.) - * - * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise indicates - * the failure that occurred (other parameters are undefined if errorCode is nonzero). - * - * replyDomain: The name of the domain. - * - * context: The context pointer passed to DNSServiceEnumerateDomains. - * - */ - -typedef void (DNSSD_API *DNSServiceDomainEnumReply) - ( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char *replyDomain, - void *context - ); - - -/* DNSServiceEnumerateDomains() Parameters: - * - * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds - * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, - * and the enumeration operation will run indefinitely until the client - * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). - * - * flags: Possible values are: - * kDNSServiceFlagsBrowseDomains to enumerate domains recommended for browsing. - * kDNSServiceFlagsRegistrationDomains to enumerate domains recommended - * for registration. - * - * interfaceIndex: If non-zero, specifies the interface on which to look for domains. - * (the index for a given interface is determined via the if_nametoindex() - * family of calls.) Most applications will pass 0 to enumerate domains on - * all interfaces. See "Constants for specifying an interface index" for more details. - * - * callBack: The function to be called when a domain is found or the call asynchronously - * fails. - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred (the callback is not invoked and the DNSServiceRef - * is not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceEnumerateDomains - ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceDomainEnumReply callBack, - void *context /* may be NULL */ - ); - - -/******************************************************************************************* - * - * Service Registration - * - *********************************************************************************************/ - -/* Register a service that is discovered via Browse() and Resolve() calls. - * - * DNSServiceRegisterReply() Callback Parameters: - * - * sdRef: The DNSServiceRef initialized by DNSServiceRegister(). - * - * flags: When a name is successfully registered, the callback will be - * invoked with the kDNSServiceFlagsAdd flag set. When Wide-Area - * DNS-SD is in use, it is possible for a single service to get - * more than one success callback (e.g. one in the "local" multicast - * DNS domain, and another in a wide-area unicast DNS domain). - * If a successfully-registered name later suffers a name conflict - * or similar problem and has to be deregistered, the callback will - * be invoked with the kDNSServiceFlagsAdd flag not set. The callback - * is *not* invoked in the case where the caller explicitly terminates - * the service registration by calling DNSServiceRefDeallocate(ref); - * - * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will - * indicate the failure that occurred (including name conflicts, - * if the kDNSServiceFlagsNoAutoRename flag was used when registering.) - * Other parameters are undefined if errorCode is nonzero. - * - * name: The service name registered (if the application did not specify a name in - * DNSServiceRegister(), this indicates what name was automatically chosen). - * - * regtype: The type of service registered, as it was passed to the callout. - * - * domain: The domain on which the service was registered (if the application did not - * specify a domain in DNSServiceRegister(), this indicates the default domain - * on which the service was registered). - * - * context: The context pointer that was passed to the callout. - * - */ - -typedef void (DNSSD_API *DNSServiceRegisterReply) - ( - DNSServiceRef sdRef, - DNSServiceFlags flags, - DNSServiceErrorType errorCode, - const char *name, - const char *regtype, - const char *domain, - void *context - ); - - -/* DNSServiceRegister() Parameters: - * - * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds - * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, - * and the registration will remain active indefinitely until the client - * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). - * - * interfaceIndex: If non-zero, specifies the interface on which to register the service - * (the index for a given interface is determined via the if_nametoindex() - * family of calls.) Most applications will pass 0 to register on all - * available interfaces. See "Constants for specifying an interface index" for more details. - * - * flags: Indicates the renaming behavior on name conflict (most applications - * will pass 0). See flag definitions above for details. - * - * name: If non-NULL, specifies the service name to be registered. - * Most applications will not specify a name, in which case the computer - * name is used (this name is communicated to the client via the callback). - * If a name is specified, it must be 1-63 bytes of UTF-8 text. - * If the name is longer than 63 bytes it will be automatically truncated - * to a legal length, unless the NoAutoRename flag is set, - * in which case kDNSServiceErr_BadParam will be returned. - * - * regtype: The service type followed by the protocol, separated by a dot - * (e.g. "_ftp._tcp"). The service type must be an underscore, followed - * by 1-14 characters, which may be letters, digits, or hyphens. - * The transport protocol must be "_tcp" or "_udp". New service types - * should be registered at . - * - * Additional subtypes of the primary service type (where a service - * type has defined subtypes) follow the primary service type in a - * comma-separated list, with no additional spaces, e.g. - * "_primarytype._tcp,_subtype1,_subtype2,_subtype3" - * Subtypes provide a mechanism for filtered browsing: A client browsing - * for "_primarytype._tcp" will discover all instances of this type; - * a client browsing for "_primarytype._tcp,_subtype2" will discover only - * those instances that were registered with "_subtype2" in their list of - * registered subtypes. - * - * The subtype mechanism can be illustrated with some examples using the - * dns-sd command-line tool: - * - * % dns-sd -R Simple _test._tcp "" 1001 & - * % dns-sd -R Better _test._tcp,HasFeatureA "" 1002 & - * % dns-sd -R Best _test._tcp,HasFeatureA,HasFeatureB "" 1003 & - * - * Now: - * % dns-sd -B _test._tcp # will find all three services - * % dns-sd -B _test._tcp,HasFeatureA # finds "Better" and "Best" - * % dns-sd -B _test._tcp,HasFeatureB # finds only "Best" - * - * domain: If non-NULL, specifies the domain on which to advertise the service. - * Most applications will not specify a domain, instead automatically - * registering in the default domain(s). - * - * host: If non-NULL, specifies the SRV target host name. Most applications - * will not specify a host, instead automatically using the machine's - * default host name(s). Note that specifying a non-NULL host does NOT - * create an address record for that host - the application is responsible - * for ensuring that the appropriate address record exists, or creating it - * via DNSServiceRegisterRecord(). - * - * port: The port, in network byte order, on which the service accepts connections. - * Pass 0 for a "placeholder" service (i.e. a service that will not be discovered - * by browsing, but will cause a name conflict if another client tries to - * register that same name). Most clients will not use placeholder services. - * - * txtLen: The length of the txtRecord, in bytes. Must be zero if the txtRecord is NULL. - * - * txtRecord: The TXT record rdata. A non-NULL txtRecord MUST be a properly formatted DNS - * TXT record, i.e. ... - * Passing NULL for the txtRecord is allowed as a synonym for txtLen=1, txtRecord="", - * i.e. it creates a TXT record of length one containing a single empty string. - * RFC 1035 doesn't allow a TXT record to contain *zero* strings, so a single empty - * string is the smallest legal DNS TXT record. - * As with the other parameters, the DNSServiceRegister call copies the txtRecord - * data; e.g. if you allocated the storage for the txtRecord parameter with malloc() - * then you can safely free that memory right after the DNSServiceRegister call returns. - * - * callBack: The function to be called when the registration completes or asynchronously - * fails. The client MAY pass NULL for the callback - The client will NOT be notified - * of the default values picked on its behalf, and the client will NOT be notified of any - * asynchronous errors (e.g. out of memory errors, etc.) that may prevent the registration - * of the service. The client may NOT pass the NoAutoRename flag if the callback is NULL. - * The client may still deregister the service at any time via DNSServiceRefDeallocate(). - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred (the callback is never invoked and the DNSServiceRef - * is not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceRegister - ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *name, /* may be NULL */ - const char *regtype, - const char *domain, /* may be NULL */ - const char *host, /* may be NULL */ - uint16_t port, - uint16_t txtLen, - const void *txtRecord, /* may be NULL */ - DNSServiceRegisterReply callBack, /* may be NULL */ - void *context /* may be NULL */ - ); - - -/* DNSServiceAddRecord() - * - * Add a record to a registered service. The name of the record will be the same as the - * registered service's name. - * The record can later be updated or deregistered by passing the RecordRef initialized - * by this function to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). - * - * Note that the DNSServiceAddRecord/UpdateRecord/RemoveRecord are *NOT* thread-safe - * with respect to a single DNSServiceRef. If you plan to have multiple threads - * in your program simultaneously add, update, or remove records from the same - * DNSServiceRef, then it's the caller's responsibility to use a mutext lock - * or take similar appropriate precautions to serialize those calls. - * - * Parameters; - * - * sdRef: A DNSServiceRef initialized by DNSServiceRegister(). - * - * RecordRef: A pointer to an uninitialized DNSRecordRef. Upon succesfull completion of this - * call, this ref may be passed to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). - * If the above DNSServiceRef is passed to DNSServiceRefDeallocate(), RecordRef is also - * invalidated and may not be used further. - * - * flags: Currently ignored, reserved for future use. - * - * rrtype: The type of the record (e.g. kDNSServiceType_TXT, kDNSServiceType_SRV, etc) - * - * rdlen: The length, in bytes, of the rdata. - * - * rdata: The raw rdata to be contained in the added resource record. - * - * ttl: The time to live of the resource record, in seconds. - * Most clients should pass 0 to indicate that the system should - * select a sensible default value. - * - * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an - * error code indicating the error that occurred (the RecordRef is not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceAddRecord - ( - DNSServiceRef sdRef, - DNSRecordRef *RecordRef, - DNSServiceFlags flags, - uint16_t rrtype, - uint16_t rdlen, - const void *rdata, - uint32_t ttl - ); - - -/* DNSServiceUpdateRecord - * - * Update a registered resource record. The record must either be: - * - The primary txt record of a service registered via DNSServiceRegister() - * - A record added to a registered service via DNSServiceAddRecord() - * - An individual record registered by DNSServiceRegisterRecord() - * - * Parameters: - * - * sdRef: A DNSServiceRef that was initialized by DNSServiceRegister() - * or DNSServiceCreateConnection(). - * - * RecordRef: A DNSRecordRef initialized by DNSServiceAddRecord, or NULL to update the - * service's primary txt record. - * - * flags: Currently ignored, reserved for future use. - * - * rdlen: The length, in bytes, of the new rdata. - * - * rdata: The new rdata to be contained in the updated resource record. - * - * ttl: The time to live of the updated resource record, in seconds. - * Most clients should pass 0 to indicate that the system should - * select a sensible default value. - * - * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an - * error code indicating the error that occurred. - */ - -DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord - ( - DNSServiceRef sdRef, - DNSRecordRef RecordRef, /* may be NULL */ - DNSServiceFlags flags, - uint16_t rdlen, - const void *rdata, - uint32_t ttl - ); - - -/* DNSServiceRemoveRecord - * - * Remove a record previously added to a service record set via DNSServiceAddRecord(), or deregister - * an record registered individually via DNSServiceRegisterRecord(). - * - * Parameters: - * - * sdRef: A DNSServiceRef initialized by DNSServiceRegister() (if the - * record being removed was registered via DNSServiceAddRecord()) or by - * DNSServiceCreateConnection() (if the record being removed was registered via - * DNSServiceRegisterRecord()). - * - * recordRef: A DNSRecordRef initialized by a successful call to DNSServiceAddRecord() - * or DNSServiceRegisterRecord(). - * - * flags: Currently ignored, reserved for future use. - * - * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an - * error code indicating the error that occurred. - */ - -DNSServiceErrorType DNSSD_API DNSServiceRemoveRecord - ( - DNSServiceRef sdRef, - DNSRecordRef RecordRef, - DNSServiceFlags flags - ); - - -/********************************************************************************************* - * - * Service Discovery - * - *********************************************************************************************/ - -/* Browse for instances of a service. - * - * DNSServiceBrowseReply() Parameters: - * - * sdRef: The DNSServiceRef initialized by DNSServiceBrowse(). - * - * flags: Possible values are kDNSServiceFlagsMoreComing and kDNSServiceFlagsAdd. - * See flag definitions for details. - * - * interfaceIndex: The interface on which the service is advertised. This index should - * be passed to DNSServiceResolve() when resolving the service. - * - * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise will - * indicate the failure that occurred. Other parameters are undefined if - * the errorCode is nonzero. - * - * serviceName: The discovered service name. This name should be displayed to the user, - * and stored for subsequent use in the DNSServiceResolve() call. - * - * regtype: The service type, which is usually (but not always) the same as was passed - * to DNSServiceBrowse(). One case where the discovered service type may - * not be the same as the requested service type is when using subtypes: - * The client may want to browse for only those ftp servers that allow - * anonymous connections. The client will pass the string "_ftp._tcp,_anon" - * to DNSServiceBrowse(), but the type of the service that's discovered - * is simply "_ftp._tcp". The regtype for each discovered service instance - * should be stored along with the name, so that it can be passed to - * DNSServiceResolve() when the service is later resolved. - * - * domain: The domain of the discovered service instance. This may or may not be the - * same as the domain that was passed to DNSServiceBrowse(). The domain for each - * discovered service instance should be stored along with the name, so that - * it can be passed to DNSServiceResolve() when the service is later resolved. - * - * context: The context pointer that was passed to the callout. - * - */ - -typedef void (DNSSD_API *DNSServiceBrowseReply) - ( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char *serviceName, - const char *regtype, - const char *replyDomain, - void *context - ); - - -/* DNSServiceBrowse() Parameters: - * - * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds - * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, - * and the browse operation will run indefinitely until the client - * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). - * - * flags: Currently ignored, reserved for future use. - * - * interfaceIndex: If non-zero, specifies the interface on which to browse for services - * (the index for a given interface is determined via the if_nametoindex() - * family of calls.) Most applications will pass 0 to browse on all available - * interfaces. See "Constants for specifying an interface index" for more details. - * - * regtype: The service type being browsed for followed by the protocol, separated by a - * dot (e.g. "_ftp._tcp"). The transport protocol must be "_tcp" or "_udp". - * A client may optionally specify a single subtype to perform filtered browsing: - * e.g. browsing for "_primarytype._tcp,_subtype" will discover only those - * instances of "_primarytype._tcp" that were registered specifying "_subtype" - * in their list of registered subtypes. - * - * domain: If non-NULL, specifies the domain on which to browse for services. - * Most applications will not specify a domain, instead browsing on the - * default domain(s). - * - * callBack: The function to be called when an instance of the service being browsed for - * is found, or if the call asynchronously fails. - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred (the callback is not invoked and the DNSServiceRef - * is not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceBrowse - ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *regtype, - const char *domain, /* may be NULL */ - DNSServiceBrowseReply callBack, - void *context /* may be NULL */ - ); - - -/* DNSServiceResolve() - * - * Resolve a service name discovered via DNSServiceBrowse() to a target host name, port number, and - * txt record. - * - * Note: Applications should NOT use DNSServiceResolve() solely for txt record monitoring - use - * DNSServiceQueryRecord() instead, as it is more efficient for this task. - * - * Note: When the desired results have been returned, the client MUST terminate the resolve by calling - * DNSServiceRefDeallocate(). - * - * Note: DNSServiceResolve() behaves correctly for typical services that have a single SRV record - * and a single TXT record. To resolve non-standard services with multiple SRV or TXT records, - * DNSServiceQueryRecord() should be used. - * - * DNSServiceResolveReply Callback Parameters: - * - * sdRef: The DNSServiceRef initialized by DNSServiceResolve(). - * - * flags: Possible values: kDNSServiceFlagsMoreComing - * - * interfaceIndex: The interface on which the service was resolved. - * - * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise will - * indicate the failure that occurred. Other parameters are undefined if - * the errorCode is nonzero. - * - * fullname: The full service domain name, in the form ... - * (This name is escaped following standard DNS rules, making it suitable for - * passing to standard system DNS APIs such as res_query(), or to the - * special-purpose functions included in this API that take fullname parameters. - * See "Notes on DNS Name Escaping" earlier in this file for more details.) - * - * hosttarget: The target hostname of the machine providing the service. This name can - * be passed to functions like gethostbyname() to identify the host's IP address. - * - * port: The port, in network byte order, on which connections are accepted for this service. - * - * txtLen: The length of the txt record, in bytes. - * - * txtRecord: The service's primary txt record, in standard txt record format. - * - * context: The context pointer that was passed to the callout. - * - * NOTE: In earlier versions of this header file, the txtRecord parameter was declared "const char *" - * This is incorrect, since it contains length bytes which are values in the range 0 to 255, not -128 to +127. - * Depending on your compiler settings, this change may cause signed/unsigned mismatch warnings. - * These should be fixed by updating your own callback function definition to match the corrected - * function signature using "const unsigned char *txtRecord". Making this change may also fix inadvertent - * bugs in your callback function, where it could have incorrectly interpreted a length byte with value 250 - * as being -6 instead, with various bad consequences ranging from incorrect operation to software crashes. - * If you need to maintain portable code that will compile cleanly with both the old and new versions of - * this header file, you should update your callback function definition to use the correct unsigned value, - * and then in the place where you pass your callback function to DNSServiceResolve(), use a cast to eliminate - * the compiler warning, e.g.: - * DNSServiceResolve(sd, flags, index, name, regtype, domain, (DNSServiceResolveReply)MyCallback, context); - * This will ensure that your code compiles cleanly without warnings (and more importantly, works correctly) - * with both the old header and with the new corrected version. - * - */ - -typedef void (DNSSD_API *DNSServiceResolveReply) - ( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char *fullname, - const char *hosttarget, - uint16_t port, - uint16_t txtLen, - const unsigned char *txtRecord, - void *context - ); - - -/* DNSServiceResolve() Parameters - * - * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds - * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, - * and the resolve operation will run indefinitely until the client - * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). - * - * flags: Specifying kDNSServiceFlagsForceMulticast will cause query to be - * performed with a link-local mDNS query, even if the name is an - * apparently non-local name (i.e. a name not ending in ".local.") - * - * interfaceIndex: The interface on which to resolve the service. If this resolve call is - * as a result of a currently active DNSServiceBrowse() operation, then the - * interfaceIndex should be the index reported in the DNSServiceBrowseReply - * callback. If this resolve call is using information previously saved - * (e.g. in a preference file) for later use, then use interfaceIndex 0, because - * the desired service may now be reachable via a different physical interface. - * See "Constants for specifying an interface index" for more details. - * - * name: The name of the service instance to be resolved, as reported to the - * DNSServiceBrowseReply() callback. - * - * regtype: The type of the service instance to be resolved, as reported to the - * DNSServiceBrowseReply() callback. - * - * domain: The domain of the service instance to be resolved, as reported to the - * DNSServiceBrowseReply() callback. - * - * callBack: The function to be called when a result is found, or if the call - * asynchronously fails. - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred (the callback is never invoked and the DNSServiceRef - * is not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceResolve - ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *name, - const char *regtype, - const char *domain, - DNSServiceResolveReply callBack, - void *context /* may be NULL */ - ); - - -/********************************************************************************************* - * - * Querying Individual Specific Records - * - *********************************************************************************************/ - -/* DNSServiceQueryRecord - * - * Query for an arbitrary DNS record. - * - * DNSServiceQueryRecordReply() Callback Parameters: - * - * sdRef: The DNSServiceRef initialized by DNSServiceQueryRecord(). - * - * flags: Possible values are kDNSServiceFlagsMoreComing and - * kDNSServiceFlagsAdd. The Add flag is NOT set for PTR records - * with a ttl of 0, i.e. "Remove" events. - * - * interfaceIndex: The interface on which the query was resolved (the index for a given - * interface is determined via the if_nametoindex() family of calls). - * See "Constants for specifying an interface index" for more details. - * - * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will - * indicate the failure that occurred. Other parameters are undefined if - * errorCode is nonzero. - * - * fullname: The resource record's full domain name. - * - * rrtype: The resource record's type (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) - * - * rrclass: The class of the resource record (usually kDNSServiceClass_IN). - * - * rdlen: The length, in bytes, of the resource record rdata. - * - * rdata: The raw rdata of the resource record. - * - * ttl: If the client wishes to cache the result for performance reasons, - * the TTL indicates how long the client may legitimately hold onto - * this result, in seconds. After the TTL expires, the client should - * consider the result no longer valid, and if it requires this data - * again, it should be re-fetched with a new query. Of course, this - * only applies to clients that cancel the asynchronous operation when - * they get a result. Clients that leave the asynchronous operation - * running can safely assume that the data remains valid until they - * get another callback telling them otherwise. - * - * context: The context pointer that was passed to the callout. - * - */ - -typedef void (DNSSD_API *DNSServiceQueryRecordReply) - ( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char *fullname, - uint16_t rrtype, - uint16_t rrclass, - uint16_t rdlen, - const void *rdata, - uint32_t ttl, - void *context - ); - - -/* DNSServiceQueryRecord() Parameters: - * - * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds - * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, - * and the query operation will run indefinitely until the client - * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). - * - * flags: kDNSServiceFlagsForceMulticast or kDNSServiceFlagsLongLivedQuery. - * Pass kDNSServiceFlagsLongLivedQuery to create a "long-lived" unicast - * query in a non-local domain. Without setting this flag, unicast queries - * will be one-shot - that is, only answers available at the time of the call - * will be returned. By setting this flag, answers (including Add and Remove - * events) that become available after the initial call is made will generate - * callbacks. This flag has no effect on link-local multicast queries. - * - * interfaceIndex: If non-zero, specifies the interface on which to issue the query - * (the index for a given interface is determined via the if_nametoindex() - * family of calls.) Passing 0 causes the name to be queried for on all - * interfaces. See "Constants for specifying an interface index" for more details. - * - * fullname: The full domain name of the resource record to be queried for. - * - * rrtype: The numerical type of the resource record to be queried for - * (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) - * - * rrclass: The class of the resource record (usually kDNSServiceClass_IN). - * - * callBack: The function to be called when a result is found, or if the call - * asynchronously fails. - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred (the callback is never invoked and the DNSServiceRef - * is not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceQueryRecord - ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *fullname, - uint16_t rrtype, - uint16_t rrclass, - DNSServiceQueryRecordReply callBack, - void *context /* may be NULL */ - ); - - -/********************************************************************************************* - * - * Unified lookup of both IPv4 and IPv6 addresses for a fully qualified hostname - * - *********************************************************************************************/ - -/* DNSServiceGetAddrInfo - * - * Queries for the IP address of a hostname by using either Multicast or Unicast DNS. - * - * DNSServiceGetAddrInfoReply() parameters: - * - * sdRef: The DNSServiceRef initialized by DNSServiceGetAddrInfo(). - * - * flags: Possible values are kDNSServiceFlagsMoreComing and - * kDNSServiceFlagsAdd. - * - * interfaceIndex: The interface to which the answers pertain. - * - * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will - * indicate the failure that occurred. Other parameters are - * undefined if errorCode is nonzero. - * - * hostname: The fully qualified domain name of the host to be queried for. - * - * address: IPv4 or IPv6 address. - * - * ttl: If the client wishes to cache the result for performance reasons, - * the TTL indicates how long the client may legitimately hold onto - * this result, in seconds. After the TTL expires, the client should - * consider the result no longer valid, and if it requires this data - * again, it should be re-fetched with a new query. Of course, this - * only applies to clients that cancel the asynchronous operation when - * they get a result. Clients that leave the asynchronous operation - * running can safely assume that the data remains valid until they - * get another callback telling them otherwise. - * - * context: The context pointer that was passed to the callout. - * - */ - -typedef void (DNSSD_API *DNSServiceGetAddrInfoReply) - ( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char *hostname, - const struct sockaddr *address, - uint32_t ttl, - void *context - ); - - -/* DNSServiceGetAddrInfo() Parameters: - * - * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds then it - * initializes the DNSServiceRef, returns kDNSServiceErr_NoError, and the query - * begins and will last indefinitely until the client terminates the query - * by passing this DNSServiceRef to DNSServiceRefDeallocate(). - * - * flags: kDNSServiceFlagsForceMulticast or kDNSServiceFlagsLongLivedQuery. - * Pass kDNSServiceFlagsLongLivedQuery to create a "long-lived" unicast - * query in a non-local domain. Without setting this flag, unicast queries - * will be one-shot - that is, only answers available at the time of the call - * will be returned. By setting this flag, answers (including Add and Remove - * events) that become available after the initial call is made will generate - * callbacks. This flag has no effect on link-local multicast queries. - * - * interfaceIndex: The interface on which to issue the query. Passing 0 causes the query to be - * sent on all active interfaces via Multicast or the primary interface via Unicast. - * - * protocol: Pass in kDNSServiceProtocol_IPv4 to look up IPv4 addresses, or kDNSServiceProtocol_IPv6 - * to look up IPv6 addresses, or both to look up both kinds. If neither flag is - * set, the system will apply an intelligent heuristic, which is (currently) - * that it will attempt to look up both, except: - * - * * If "hostname" is a wide-area unicast DNS hostname (i.e. not a ".local." name) - * but this host has no routable IPv6 address, then the call will not try to - * look up IPv6 addresses for "hostname", since any addresses it found would be - * unlikely to be of any use anyway. Similarly, if this host has no routable - * IPv4 address, the call will not try to look up IPv4 addresses for "hostname". - * - * * If "hostname" is a link-local multicast DNS hostname (i.e. a ".local." name) - * but this host has no IPv6 address of any kind, then it will not try to look - * up IPv6 addresses for "hostname". Similarly, if this host has no IPv4 address - * of any kind, the call will not try to look up IPv4 addresses for "hostname". - * - * hostname: The fully qualified domain name of the host to be queried for. - * - * callBack: The function to be called when the query succeeds or fails asynchronously. - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred. - */ - -DNSServiceErrorType DNSSD_API DNSServiceGetAddrInfo - ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceProtocol protocol, - const char *hostname, - DNSServiceGetAddrInfoReply callBack, - void *context /* may be NULL */ - ); - - -/********************************************************************************************* - * - * Special Purpose Calls: - * DNSServiceCreateConnection(), DNSServiceRegisterRecord(), DNSServiceReconfirmRecord() - * (most applications will not use these) - * - *********************************************************************************************/ - -/* DNSServiceCreateConnection() - * - * Create a connection to the daemon allowing efficient registration of - * multiple individual records. - * - * Parameters: - * - * sdRef: A pointer to an uninitialized DNSServiceRef. Deallocating - * the reference (via DNSServiceRefDeallocate()) severs the - * connection and deregisters all records registered on this connection. - * - * return value: Returns kDNSServiceErr_NoError on success, otherwise returns - * an error code indicating the specific failure that occurred (in which - * case the DNSServiceRef is not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceCreateConnection(DNSServiceRef *sdRef); - - -/* DNSServiceRegisterRecord - * - * Register an individual resource record on a connected DNSServiceRef. - * - * Note that name conflicts occurring for records registered via this call must be handled - * by the client in the callback. - * - * DNSServiceRegisterRecordReply() parameters: - * - * sdRef: The connected DNSServiceRef initialized by - * DNSServiceCreateConnection(). - * - * RecordRef: The DNSRecordRef initialized by DNSServiceRegisterRecord(). If the above - * DNSServiceRef is passed to DNSServiceRefDeallocate(), this DNSRecordRef is - * invalidated, and may not be used further. - * - * flags: Currently unused, reserved for future use. - * - * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will - * indicate the failure that occurred (including name conflicts.) - * Other parameters are undefined if errorCode is nonzero. - * - * context: The context pointer that was passed to the callout. - * - */ - - typedef void (DNSSD_API *DNSServiceRegisterRecordReply) - ( - DNSServiceRef sdRef, - DNSRecordRef RecordRef, - DNSServiceFlags flags, - DNSServiceErrorType errorCode, - void *context - ); - - -/* DNSServiceRegisterRecord() Parameters: - * - * sdRef: A DNSServiceRef initialized by DNSServiceCreateConnection(). - * - * RecordRef: A pointer to an uninitialized DNSRecordRef. Upon succesfull completion of this - * call, this ref may be passed to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). - * (To deregister ALL records registered on a single connected DNSServiceRef - * and deallocate each of their corresponding DNSServiceRecordRefs, call - * DNSServiceRefDeallocate()). - * - * flags: Possible values are kDNSServiceFlagsShared or kDNSServiceFlagsUnique - * (see flag type definitions for details). - * - * interfaceIndex: If non-zero, specifies the interface on which to register the record - * (the index for a given interface is determined via the if_nametoindex() - * family of calls.) Passing 0 causes the record to be registered on all interfaces. - * See "Constants for specifying an interface index" for more details. - * - * fullname: The full domain name of the resource record. - * - * rrtype: The numerical type of the resource record (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) - * - * rrclass: The class of the resource record (usually kDNSServiceClass_IN) - * - * rdlen: Length, in bytes, of the rdata. - * - * rdata: A pointer to the raw rdata, as it is to appear in the DNS record. - * - * ttl: The time to live of the resource record, in seconds. - * Most clients should pass 0 to indicate that the system should - * select a sensible default value. - * - * callBack: The function to be called when a result is found, or if the call - * asynchronously fails (e.g. because of a name conflict.) - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred (the callback is never invoked and the DNSRecordRef is - * not initialized). - */ - -DNSServiceErrorType DNSSD_API DNSServiceRegisterRecord - ( - DNSServiceRef sdRef, - DNSRecordRef *RecordRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *fullname, - uint16_t rrtype, - uint16_t rrclass, - uint16_t rdlen, - const void *rdata, - uint32_t ttl, - DNSServiceRegisterRecordReply callBack, - void *context /* may be NULL */ - ); - - -/* DNSServiceReconfirmRecord - * - * Instruct the daemon to verify the validity of a resource record that appears - * to be out of date (e.g. because TCP connection to a service's target failed.) - * Causes the record to be flushed from the daemon's cache (as well as all other - * daemons' caches on the network) if the record is determined to be invalid. - * Use this routine conservatively. Reconfirming a record necessarily consumes - * network bandwidth, so this should not be done indiscriminately. - * - * Parameters: - * - * flags: Pass kDNSServiceFlagsForce to force immediate deletion of record, - * instead of after some number of reconfirmation queries have gone unanswered. - * - * interfaceIndex: Specifies the interface of the record in question. - * The caller must specify the interface. - * This API (by design) causes increased network traffic, so it requires - * the caller to be precise about which record should be reconfirmed. - * It is not possible to pass zero for the interface index to perform - * a "wildcard" reconfirmation, where *all* matching records are reconfirmed. - * - * fullname: The resource record's full domain name. - * - * rrtype: The resource record's type (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) - * - * rrclass: The class of the resource record (usually kDNSServiceClass_IN). - * - * rdlen: The length, in bytes, of the resource record rdata. - * - * rdata: The raw rdata of the resource record. - * - */ - -DNSServiceErrorType DNSSD_API DNSServiceReconfirmRecord - ( - DNSServiceFlags flags, - uint32_t interfaceIndex, - const char *fullname, - uint16_t rrtype, - uint16_t rrclass, - uint16_t rdlen, - const void *rdata - ); - - -/********************************************************************************************* - * - * NAT Port Mapping - * - *********************************************************************************************/ - -/* DNSServiceNATPortMappingCreate - * - * Request a port mapping in the NAT gateway, which maps a port on the local machine - * to an external port on the NAT. - * - * The port mapping will be renewed indefinitely until the client process exits, or - * explicitly terminates the port mapping request by calling DNSServiceRefDeallocate(). - * The client callback will be invoked, informing the client of the NAT gateway's - * external IP address and the external port that has been allocated for this client. - * The client should then record this external IP address and port using whatever - * directory service mechanism it is using to enable peers to connect to it. - * (Clients advertising services using Wide-Area DNS-SD DO NOT need to use this API - * -- when a client calls DNSServiceRegister() NAT mappings are automatically created - * and the external IP address and port for the service are recorded in the global DNS. - * Only clients using some directory mechanism other than Wide-Area DNS-SD need to use - * this API to explicitly map their own ports.) - * - * It's possible that the client callback could be called multiple times, for example - * if the NAT gateway's IP address changes, or if a configuration change results in a - * different external port being mapped for this client. Over the lifetime of any long-lived - * port mapping, the client should be prepared to handle these notifications of changes - * in the environment, and should update its recorded address and/or port as appropriate. - * - * NOTE: There are two unusual aspects of how the DNSServiceNATPortMappingCreate API works, - * which were intentionally designed to help simplify client code: - * - * 1. It's not an error to request a NAT mapping when the machine is not behind a NAT gateway. - * In other NAT mapping APIs, if you request a NAT mapping and the machine is not behind a NAT - * gateway, then the API returns an error code -- it can't get you a NAT mapping if there's no - * NAT gateway. The DNSServiceNATPortMappingCreate API takes a different view. Working out - * whether or not you need a NAT mapping can be tricky and non-obvious, particularly on - * a machine with multiple active network interfaces. Rather than make every client recreate - * this logic for deciding whether a NAT mapping is required, the PortMapping API does that - * work for you. If the client calls the PortMapping API when the machine already has a - * routable public IP address, then instead of complaining about it and giving an error, - * the PortMapping API just invokes your callback, giving the machine's public address - * and your own port number. This means you don't need to write code to work out whether - * your client needs to call the PortMapping API -- just call it anyway, and if it wasn't - * necessary, no harm is done: - * - * - If the machine already has a routable public IP address, then your callback - * will just be invoked giving your own address and port. - * - If a NAT mapping is required and obtained, then your callback will be invoked - * giving you the external address and port. - * - If a NAT mapping is required but not obtained from the local NAT gateway, - * or the machine has no network connectivity, then your callback will be - * invoked giving zero address and port. - * - * 2. In other NAT mapping APIs, if a laptop computer is put to sleep and woken up on a new - * network, it's the client's job to notice this, and work out whether a NAT mapping - * is required on the new network, and make a new NAT mapping request if necessary. - * The DNSServiceNATPortMappingCreate API does this for you, automatically. - * The client just needs to make one call to the PortMapping API, and its callback will - * be invoked any time the mapping state changes. This property complements point (1) above. - * If the client didn't make a NAT mapping request just because it determined that one was - * not required at that particular moment in time, the client would then have to monitor - * for network state changes to determine if a NAT port mapping later became necessary. - * By unconditionally making a NAT mapping request, even when a NAT mapping not to be - * necessary, the PortMapping API will then begin monitoring network state changes on behalf of - * the client, and if a NAT mapping later becomes necessary, it will automatically create a NAT - * mapping and inform the client with a new callback giving the new address and port information. - * - * DNSServiceNATPortMappingReply() parameters: - * - * sdRef: The DNSServiceRef initialized by DNSServiceNATPortMappingCreate(). - * - * flags: Currently unused, reserved for future use. - * - * interfaceIndex: The interface through which the NAT gateway is reached. - * - * errorCode: Will be kDNSServiceErr_NoError on success. - * Will be kDNSServiceErr_DoubleNAT when the NAT gateway is itself behind one or - * more layers of NAT, in which case the other parameters have the defined values. - * For other failures, will indicate the failure that occurred, and the other - * parameters are undefined. - * - * externalAddress: Four byte IPv4 address in network byte order. - * - * protocol: Will be kDNSServiceProtocol_UDP or kDNSServiceProtocol_TCP or both. - * - * internalPort: The port on the local machine that was mapped. - * - * externalPort: The actual external port in the NAT gateway that was mapped. - * This is likely to be different than the requested external port. - * - * ttl: The lifetime of the NAT port mapping created on the gateway. - * This controls how quickly stale mappings will be garbage-collected - * if the client machine crashes, suffers a power failure, is disconnected - * from the network, or suffers some other unfortunate demise which - * causes it to vanish without explicitly removing its NAT port mapping. - * It's possible that the ttl value will differ from the requested ttl value. - * - * context: The context pointer that was passed to the callout. - * - */ - -typedef void (DNSSD_API *DNSServiceNATPortMappingReply) - ( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - uint32_t externalAddress, /* four byte IPv4 address in network byte order */ - DNSServiceProtocol protocol, - uint16_t internalPort, - uint16_t externalPort, /* may be different than the requested port */ - uint32_t ttl, /* may be different than the requested ttl */ - void *context - ); - - -/* DNSServiceNATPortMappingCreate() Parameters: - * - * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds then it - * initializes the DNSServiceRef, returns kDNSServiceErr_NoError, and the nat - * port mapping will last indefinitely until the client terminates the port - * mapping request by passing this DNSServiceRef to DNSServiceRefDeallocate(). - * - * flags: Currently ignored, reserved for future use. - * - * interfaceIndex: The interface on which to create port mappings in a NAT gateway. Passing 0 causes - * the port mapping request to be sent on the primary interface. - * - * protocol: To request a port mapping, pass in kDNSServiceProtocol_UDP, or kDNSServiceProtocol_TCP, - * or (kDNSServiceProtocol_UDP | kDNSServiceProtocol_TCP) to map both. - * The local listening port number must also be specified in the internalPort parameter. - * To just discover the NAT gateway's external IP address, pass zero for protocol, - * internalPort, externalPort and ttl. - * - * internalPort: The port number in network byte order on the local machine which is listening for packets. - * - * externalPort: The requested external port in network byte order in the NAT gateway that you would - * like to map to the internal port. Pass 0 if you don't care which external port is chosen for you. - * - * ttl: The requested renewal period of the NAT port mapping, in seconds. - * If the client machine crashes, suffers a power failure, is disconnected from - * the network, or suffers some other unfortunate demise which causes it to vanish - * unexpectedly without explicitly removing its NAT port mappings, then the NAT gateway - * will garbage-collect old stale NAT port mappings when their lifetime expires. - * Requesting a short TTL causes such orphaned mappings to be garbage-collected - * more promptly, but consumes system resources and network bandwidth with - * frequent renewal packets to keep the mapping from expiring. - * Requesting a long TTL is more efficient on the network, but in the event of the - * client vanishing, stale NAT port mappings will not be garbage-collected as quickly. - * Most clients should pass 0 to use a system-wide default value. - * - * callBack: The function to be called when the port mapping request succeeds or fails asynchronously. - * - * context: An application context pointer which is passed to the callback function - * (may be NULL). - * - * return value: Returns kDNSServiceErr_NoError on success (any subsequent, asynchronous - * errors are delivered to the callback), otherwise returns an error code indicating - * the error that occurred. - * - * If you don't actually want a port mapped, and are just calling the API - * because you want to find out the NAT's external IP address (e.g. for UI - * display) then pass zero for protocol, internalPort, externalPort and ttl. - */ - -DNSServiceErrorType DNSSD_API DNSServiceNATPortMappingCreate - ( - DNSServiceRef *sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceProtocol protocol, /* TCP and/or UDP */ - uint16_t internalPort, /* network byte order */ - uint16_t externalPort, /* network byte order */ - uint32_t ttl, /* time to live in seconds */ - DNSServiceNATPortMappingReply callBack, - void *context /* may be NULL */ - ); - - -/********************************************************************************************* - * - * General Utility Functions - * - *********************************************************************************************/ - -/* DNSServiceConstructFullName() - * - * Concatenate a three-part domain name (as returned by the above callbacks) into a - * properly-escaped full domain name. Note that callbacks in the above functions ALREADY ESCAPE - * strings where necessary. - * - * Parameters: - * - * fullName: A pointer to a buffer that where the resulting full domain name is to be written. - * The buffer must be kDNSServiceMaxDomainName (1009) bytes in length to - * accommodate the longest legal domain name without buffer overrun. - * - * service: The service name - any dots or backslashes must NOT be escaped. - * May be NULL (to construct a PTR record name, e.g. - * "_ftp._tcp.apple.com."). - * - * regtype: The service type followed by the protocol, separated by a dot - * (e.g. "_ftp._tcp"). - * - * domain: The domain name, e.g. "apple.com.". Literal dots or backslashes, - * if any, must be escaped, e.g. "1st\. Floor.apple.com." - * - * return value: Returns kDNSServiceErr_NoError (0) on success, kDNSServiceErr_BadParam on error. - * - */ - -DNSServiceErrorType DNSSD_API DNSServiceConstructFullName - ( - char *fullName, - const char *service, /* may be NULL */ - const char *regtype, - const char *domain - ); - - -/********************************************************************************************* - * - * TXT Record Construction Functions - * - *********************************************************************************************/ - -/* - * A typical calling sequence for TXT record construction is something like: - * - * Client allocates storage for TXTRecord data (e.g. declare buffer on the stack) - * TXTRecordCreate(); - * TXTRecordSetValue(); - * TXTRecordSetValue(); - * TXTRecordSetValue(); - * ... - * DNSServiceRegister( ... TXTRecordGetLength(), TXTRecordGetBytesPtr() ... ); - * TXTRecordDeallocate(); - * Explicitly deallocate storage for TXTRecord data (if not allocated on the stack) - */ - - -/* TXTRecordRef - * - * Opaque internal data type. - * Note: Represents a DNS-SD TXT record. - */ - -typedef union _TXTRecordRef_t { char PrivateData[16]; char *ForceNaturalAlignment; } TXTRecordRef; - - -/* TXTRecordCreate() - * - * Creates a new empty TXTRecordRef referencing the specified storage. - * - * If the buffer parameter is NULL, or the specified storage size is not - * large enough to hold a key subsequently added using TXTRecordSetValue(), - * then additional memory will be added as needed using malloc(). - * - * On some platforms, when memory is low, malloc() may fail. In this - * case, TXTRecordSetValue() will return kDNSServiceErr_NoMemory, and this - * error condition will need to be handled as appropriate by the caller. - * - * You can avoid the need to handle this error condition if you ensure - * that the storage you initially provide is large enough to hold all - * the key/value pairs that are to be added to the record. - * The caller can precompute the exact length required for all of the - * key/value pairs to be added, or simply provide a fixed-sized buffer - * known in advance to be large enough. - * A no-value (key-only) key requires (1 + key length) bytes. - * A key with empty value requires (1 + key length + 1) bytes. - * A key with non-empty value requires (1 + key length + 1 + value length). - * For most applications, DNS-SD TXT records are generally - * less than 100 bytes, so in most cases a simple fixed-sized - * 256-byte buffer will be more than sufficient. - * Recommended size limits for DNS-SD TXT Records are discussed in - * - * - * Note: When passing parameters to and from these TXT record APIs, - * the key name does not include the '=' character. The '=' character - * is the separator between the key and value in the on-the-wire - * packet format; it is not part of either the key or the value. - * - * txtRecord: A pointer to an uninitialized TXTRecordRef. - * - * bufferLen: The size of the storage provided in the "buffer" parameter. - * - * buffer: Optional caller-supplied storage used to hold the TXTRecord data. - * This storage must remain valid for as long as - * the TXTRecordRef. - */ - -void DNSSD_API TXTRecordCreate - ( - TXTRecordRef *txtRecord, - uint16_t bufferLen, - void *buffer - ); - - -/* TXTRecordDeallocate() - * - * Releases any resources allocated in the course of preparing a TXT Record - * using TXTRecordCreate()/TXTRecordSetValue()/TXTRecordRemoveValue(). - * Ownership of the buffer provided in TXTRecordCreate() returns to the client. - * - * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). - * - */ - -void DNSSD_API TXTRecordDeallocate - ( - TXTRecordRef *txtRecord - ); - - -/* TXTRecordSetValue() - * - * Adds a key (optionally with value) to a TXTRecordRef. If the "key" already - * exists in the TXTRecordRef, then the current value will be replaced with - * the new value. - * Keys may exist in four states with respect to a given TXT record: - * - Absent (key does not appear at all) - * - Present with no value ("key" appears alone) - * - Present with empty value ("key=" appears in TXT record) - * - Present with non-empty value ("key=value" appears in TXT record) - * For more details refer to "Data Syntax for DNS-SD TXT Records" in - * - * - * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). - * - * key: A null-terminated string which only contains printable ASCII - * values (0x20-0x7E), excluding '=' (0x3D). Keys should be - * 9 characters or fewer (not counting the terminating null). - * - * valueSize: The size of the value. - * - * value: Any binary value. For values that represent - * textual data, UTF-8 is STRONGLY recommended. - * For values that represent textual data, valueSize - * should NOT include the terminating null (if any) - * at the end of the string. - * If NULL, then "key" will be added with no value. - * If non-NULL but valueSize is zero, then "key=" will be - * added with empty value. - * - * return value: Returns kDNSServiceErr_NoError on success. - * Returns kDNSServiceErr_Invalid if the "key" string contains - * illegal characters. - * Returns kDNSServiceErr_NoMemory if adding this key would - * exceed the available storage. - */ - -DNSServiceErrorType DNSSD_API TXTRecordSetValue - ( - TXTRecordRef *txtRecord, - const char *key, - uint8_t valueSize, /* may be zero */ - const void *value /* may be NULL */ - ); - - -/* TXTRecordRemoveValue() - * - * Removes a key from a TXTRecordRef. The "key" must be an - * ASCII string which exists in the TXTRecordRef. - * - * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). - * - * key: A key name which exists in the TXTRecordRef. - * - * return value: Returns kDNSServiceErr_NoError on success. - * Returns kDNSServiceErr_NoSuchKey if the "key" does not - * exist in the TXTRecordRef. - */ - -DNSServiceErrorType DNSSD_API TXTRecordRemoveValue - ( - TXTRecordRef *txtRecord, - const char *key - ); - - -/* TXTRecordGetLength() - * - * Allows you to determine the length of the raw bytes within a TXTRecordRef. - * - * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). - * - * return value: Returns the size of the raw bytes inside a TXTRecordRef - * which you can pass directly to DNSServiceRegister() or - * to DNSServiceUpdateRecord(). - * Returns 0 if the TXTRecordRef is empty. - */ - -uint16_t DNSSD_API TXTRecordGetLength - ( - const TXTRecordRef *txtRecord - ); - - -/* TXTRecordGetBytesPtr() - * - * Allows you to retrieve a pointer to the raw bytes within a TXTRecordRef. - * - * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). - * - * return value: Returns a pointer to the raw bytes inside the TXTRecordRef - * which you can pass directly to DNSServiceRegister() or - * to DNSServiceUpdateRecord(). - */ - -const void * DNSSD_API TXTRecordGetBytesPtr - ( - const TXTRecordRef *txtRecord - ); - - -/********************************************************************************************* - * - * TXT Record Parsing Functions - * - *********************************************************************************************/ - -/* - * A typical calling sequence for TXT record parsing is something like: - * - * Receive TXT record data in DNSServiceResolve() callback - * if (TXTRecordContainsKey(txtLen, txtRecord, "key")) then do something - * val1ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key1", &len1); - * val2ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key2", &len2); - * ... - * memcpy(myval1, val1ptr, len1); - * memcpy(myval2, val2ptr, len2); - * ... - * return; - * - * If you wish to retain the values after return from the DNSServiceResolve() - * callback, then you need to copy the data to your own storage using memcpy() - * or similar, as shown in the example above. - * - * If for some reason you need to parse a TXT record you built yourself - * using the TXT record construction functions above, then you can do - * that using TXTRecordGetLength and TXTRecordGetBytesPtr calls: - * TXTRecordGetValue(TXTRecordGetLength(x), TXTRecordGetBytesPtr(x), key, &len); - * - * Most applications only fetch keys they know about from a TXT record and - * ignore the rest. - * However, some debugging tools wish to fetch and display all keys. - * To do that, use the TXTRecordGetCount() and TXTRecordGetItemAtIndex() calls. - */ - -/* TXTRecordContainsKey() - * - * Allows you to determine if a given TXT Record contains a specified key. - * - * txtLen: The size of the received TXT Record. - * - * txtRecord: Pointer to the received TXT Record bytes. - * - * key: A null-terminated ASCII string containing the key name. - * - * return value: Returns 1 if the TXT Record contains the specified key. - * Otherwise, it returns 0. - */ - -int DNSSD_API TXTRecordContainsKey - ( - uint16_t txtLen, - const void *txtRecord, - const char *key - ); - - -/* TXTRecordGetValuePtr() - * - * Allows you to retrieve the value for a given key from a TXT Record. - * - * txtLen: The size of the received TXT Record - * - * txtRecord: Pointer to the received TXT Record bytes. - * - * key: A null-terminated ASCII string containing the key name. - * - * valueLen: On output, will be set to the size of the "value" data. - * - * return value: Returns NULL if the key does not exist in this TXT record, - * or exists with no value (to differentiate between - * these two cases use TXTRecordContainsKey()). - * Returns pointer to location within TXT Record bytes - * if the key exists with empty or non-empty value. - * For empty value, valueLen will be zero. - * For non-empty value, valueLen will be length of value data. - */ - -const void * DNSSD_API TXTRecordGetValuePtr - ( - uint16_t txtLen, - const void *txtRecord, - const char *key, - uint8_t *valueLen - ); - - -/* TXTRecordGetCount() - * - * Returns the number of keys stored in the TXT Record. The count - * can be used with TXTRecordGetItemAtIndex() to iterate through the keys. - * - * txtLen: The size of the received TXT Record. - * - * txtRecord: Pointer to the received TXT Record bytes. - * - * return value: Returns the total number of keys in the TXT Record. - * - */ - -uint16_t DNSSD_API TXTRecordGetCount - ( - uint16_t txtLen, - const void *txtRecord - ); - - -/* TXTRecordGetItemAtIndex() - * - * Allows you to retrieve a key name and value pointer, given an index into - * a TXT Record. Legal index values range from zero to TXTRecordGetCount()-1. - * It's also possible to iterate through keys in a TXT record by simply - * calling TXTRecordGetItemAtIndex() repeatedly, beginning with index zero - * and increasing until TXTRecordGetItemAtIndex() returns kDNSServiceErr_Invalid. - * - * On return: - * For keys with no value, *value is set to NULL and *valueLen is zero. - * For keys with empty value, *value is non-NULL and *valueLen is zero. - * For keys with non-empty value, *value is non-NULL and *valueLen is non-zero. - * - * txtLen: The size of the received TXT Record. - * - * txtRecord: Pointer to the received TXT Record bytes. - * - * itemIndex: An index into the TXT Record. - * - * keyBufLen: The size of the string buffer being supplied. - * - * key: A string buffer used to store the key name. - * On return, the buffer contains a null-terminated C string - * giving the key name. DNS-SD TXT keys are usually - * 9 characters or fewer. To hold the maximum possible - * key name, the buffer should be 256 bytes long. - * - * valueLen: On output, will be set to the size of the "value" data. - * - * value: On output, *value is set to point to location within TXT - * Record bytes that holds the value data. - * - * return value: Returns kDNSServiceErr_NoError on success. - * Returns kDNSServiceErr_NoMemory if keyBufLen is too short. - * Returns kDNSServiceErr_Invalid if index is greater than - * TXTRecordGetCount()-1. - */ - -DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex - ( - uint16_t txtLen, - const void *txtRecord, - uint16_t itemIndex, - uint16_t keyBufLen, - char *key, - uint8_t *valueLen, - const void **value - ); - -#ifdef __APPLE_API_PRIVATE - -/* - * Mac OS X specific functionality - * 3rd party clients of this API should not depend on future support or availability of this routine - */ - -/* DNSServiceSetDefaultDomainForUser() - * - * Set the default domain for the caller's UID. Future browse and registration - * calls by this user that do not specify an explicit domain will browse and - * register in this wide-area domain in addition to .local. In addition, this - * domain will be returned as a Browse domain via domain enumeration calls. - * - * Parameters: - * - * flags: Pass kDNSServiceFlagsAdd to add a domain for a user. Call without - * this flag set to clear a previously added domain. - * - * domain: The domain to be used for the caller's UID. - * - * return value: Returns kDNSServiceErr_NoError on success, otherwise returns - * an error code indicating the error that occurred. - */ - -DNSServiceErrorType DNSSD_API DNSServiceSetDefaultDomainForUser - ( - DNSServiceFlags flags, - const char *domain - ); - -/* Symbol defined to tell System Configuration Framework where to look in the Dynamic Store - * for the list of PrivateDNS domains that need to be handed off to mDNSResponder - * (the complete key is "State:/Network/PrivateDNS") - */ -#define kDNSServiceCompPrivateDNS "PrivateDNS" -#define kDNSServiceCompMulticastDNS "MulticastDNS" - -#endif //__APPLE_API_PRIVATE - -/* Some C compiler cleverness. We can make the compiler check certain things for us, - * and report errors at compile-time if anything is wrong. The usual way to do this would - * be to use a run-time "if" statement or the conventional run-time "assert" mechanism, but - * then you don't find out what's wrong until you run the software. This way, if the assertion - * condition is false, the array size is negative, and the complier complains immediately. - */ - -struct CompileTimeAssertionChecks_DNS_SD - { - char assert0[(sizeof(union _TXTRecordRef_t) == 16) ? 1 : -1]; - }; - -#ifdef __cplusplus - } -#endif - -#endif /* _DNS_SD_H */ diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/ReaderWriterZeroConfDevice.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/ReaderWriterZeroConfDevice.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/ReaderWriterZeroConfDevice.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/ZeroConfDevice/ReaderWriterZeroConfDevice.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield - * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or - * (at your option) any later version. The full license is in LICENSE file - * included with this distribution, and on the openscenegraph.org website. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * OpenSceneGraph Public License for more details. -*/ - - - -#include -#include -#include -#include -#include -#include -#include "AutoDiscovery.h" - - -class ZeroConfRegisterDevice: public osgGA::Device{ -public: - ZeroConfRegisterDevice() - : osgGA::Device() - , _autoDiscovery(new AutoDiscovery()) - { - setCapabilities(RECEIVE_EVENTS); - } - - void advertise(const std::string& type, unsigned int port) - { - OSG_NOTICE << "ZeroConfDevice :: advertise: " << type << ":" << port << std::endl; - _autoDiscovery->registerService(type, port); - } - - virtual bool checkEvents() - { - _autoDiscovery->update(); - return !(getEventQueue()->empty()); - } - - virtual void sendEvent(const osgGA::GUIEventAdapter& event) - { - if (event.getName() == "/zeroconf/advertise") - { - std::string type; - unsigned int port = 0; - event.getUserValue("type",type); - event.getUserValue("port", port); - if (type.empty() || (port == 0)) - { - OSG_WARN << "ZeroConfRegisterDevice :: could not advertise service, missing type/port " << std::endl; - } - else - { - advertise(type, port); - } - } - } - -private: - osg::ref_ptr _autoDiscovery; - -}; - - - -class ZeroConfDiscoverDevice : public osgGA::Device { -public: - ZeroConfDiscoverDevice(const std::string& type); - - virtual bool checkEvents() - { - _autoDiscovery->update(); - return !(getEventQueue()->empty()); - } - -private: - osg::ref_ptr _autoDiscovery; -}; - - -class MyDiscoveredServicesCallback : public DiscoveredServicesCallback { -public: - MyDiscoveredServicesCallback(ZeroConfDiscoverDevice* device, const std::string& type) - : DiscoveredServicesCallback() - , _device(device) - , _type(type) - { - } - - virtual bool ignoreIP6Addresses() { return true; } - virtual void serviceAdded(const std::string& host, unsigned int port) - { - osg::ref_ptr event = new osgGA::GUIEventAdapter(); - - OSG_NOTICE << "ZeroConfDevice :: serviceAdded: " << host << ":" << port << " event " << event << std::endl; - - event->setEventType(osgGA::GUIEventAdapter::USER); - - event->setName("/zeroconf/service-added"); - event->setUserValue("host", host); - event->setUserValue("port", port); - event->setUserValue("type", _type); - event->setTime(_device->getEventQueue()->getTime()); - _device->getEventQueue()->addEvent(event); - } - - virtual void serviceRemoved(const std::string& host, unsigned int port) - { - osg::ref_ptr event = new osgGA::GUIEventAdapter(); - - OSG_NOTICE << "ZeroConfDevice :: serviceRemoved: " << host << ":" << port << " event " << event << std::endl; - - event->setEventType(osgGA::GUIEventAdapter::USER); - - event->setName("/zeroconf/service-removed"); - event->setUserValue("host", host); - event->setUserValue("port", port); - event->setUserValue("type", _type); - event->setTime(_device->getEventQueue()->getTime()); - _device->getEventQueue()->addEvent(event); - } -private: - osg::observer_ptr _device; - std::string _type; -}; - - - -ZeroConfDiscoverDevice::ZeroConfDiscoverDevice(const std::string& type) - : osgGA::Device() - , _autoDiscovery(new AutoDiscovery()) -{ - setCapabilities(RECEIVE_EVENTS); - _autoDiscovery->discoverServices(type, new MyDiscoveredServicesCallback(this, type)); -} - - - -class ReaderWriterZeroConf : public osgDB::ReaderWriter -{ - public: - - ReaderWriterZeroConf() - { - supportsExtension("zeroconf", "zeroconf plugin to advertise ip-services and discover them"); - } - - virtual const char* className() const { return "ZeroConf Virtual Device Integration plugin"; } - - virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options* options =NULL) const - { - if (osgDB::getFileExtension(file) == "zeroconf") - { - std::string file_name = osgDB::getNameLessExtension(file); - - if (osgDB::getFileExtension(file_name) == "discover") - { - std::string type = osgDB::getNameLessExtension(file_name); - return new ZeroConfDiscoverDevice(type); - } - else if (osgDB::getFileExtension(file_name) == "advertise") - { - file_name = osgDB::getNameLessExtension(file_name); - - std::string type = file_name.substr(0,file_name.find(':')); - std::string port = file_name.substr(file_name.find(':') + 1); - - ZeroConfRegisterDevice* device = new ZeroConfRegisterDevice(); - device->advertise(type, atoi(port.c_str())); - - return device; - } - } - - return ReadResult::FILE_NOT_HANDLED; - } -private: - -}; - -// now register with Registry to instantiate the above -// reader/writer. -REGISTER_OSGPLUGIN(zeroconf, ReaderWriterZeroConf) diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/zip/ZipArchive.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/zip/ZipArchive.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/zip/ZipArchive.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgPlugins/zip/ZipArchive.cpp 2015-08-08 08:49:33.000000000 +0000 @@ -641,7 +641,7 @@ { data._zipHandle = OpenZip( _filename.c_str(), _password.c_str() ); } - else if ( _membuffer.empty() ) + else if ( !_membuffer.empty() ) { data._zipHandle = OpenZip( (void*)_membuffer.c_str(), _membuffer.length(), _password.c_str() ); } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgText/Glyph.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgText/Glyph.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgText/Glyph.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgText/Glyph.cpp 2014-07-21 13:45:57.000000000 +0000 @@ -221,6 +221,11 @@ imageData[i] = 0; } + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + glPixelStorei(GL_UNPACK_ROW_LENGTH,getTextureWidth()); + #endif // allocate the texture memory. glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA, @@ -367,6 +372,12 @@ // clear the list since we have now subloaded them. glyphsWereSubloading.clear(); + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + glPixelStorei(GL_UNPACK_ROW_LENGTH,getTextureWidth()); + #endif + // Subload the image once glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, getTextureWidth(), diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgText/Text3D.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgText/Text3D.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgText/Text3D.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgText/Text3D.cpp 2015-05-21 14:11:54.000000000 +0000 @@ -369,12 +369,11 @@ ++itr; } - if (itr!=_text.end()) - { - // skip over spaces and return. - while (*itr==' ') ++itr; - if (*itr=='\n') ++itr; - } + // skip over spaces + while ((itr!=_text.end()) && (*itr==' ')) ++itr; + + // skip over return + if ((itr!=_text.end()) && (*itr=='\n')) ++itr; // move to new line. switch(_layout) diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgText/TextBase.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgText/TextBase.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgText/TextBase.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgText/TextBase.cpp 2015-06-12 08:04:38.000000000 +0000 @@ -105,12 +105,17 @@ void TextBase::setFontResolution(unsigned int width, unsigned int height) { - _fontSize = FontResolution(width,height); + FontResolution size(width,height); + if (_fontSize==size) return; + + _fontSize = size; computeGlyphRepresentation(); } void TextBase::setCharacterSize(float height) { + if (_characterHeight==height) return; + _characterHeight = height; computeGlyphRepresentation(); } @@ -126,18 +131,24 @@ void TextBase::setMaximumWidth(float maximumWidth) { + if (_maximumWidth==maximumWidth) return; + _maximumWidth = maximumWidth; computeGlyphRepresentation(); } void TextBase::setMaximumHeight(float maximumHeight) { + if (_maximumHeight==maximumHeight) return; + _maximumHeight = maximumHeight; computeGlyphRepresentation(); } void TextBase::setLineSpacing(float lineSpacing) { + if (_lineSpacing==lineSpacing) return; + _lineSpacing = lineSpacing; computeGlyphRepresentation(); } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/CullVisitor.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/CullVisitor.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/CullVisitor.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/CullVisitor.cpp 2014-12-08 11:08:48.000000000 +0000 @@ -1361,19 +1361,41 @@ namespace osgUtil { -class RenderStageCache : public osg::Object +class RenderStageCache : public osg::Object, public osg::Observer { public: RenderStageCache() {} RenderStageCache(const RenderStageCache&, const osg::CopyOp&) {} + virtual ~RenderStageCache() + { + for(RenderStageMap::iterator itr = _renderStageMap.begin(); + itr != _renderStageMap.end(); + ++itr) + { + itr->first->removeObserver(this); + } + } META_Object(osgUtil, RenderStageCache); + virtual void objectDeleted(void* object) + { + osg::Referenced* ref = reinterpret_cast(object); + osgUtil::CullVisitor* cv = dynamic_cast(ref); + OpenThreads::ScopedLock lock(_mutex); + RenderStageMap::iterator itr = _renderStageMap.find(cv); + if (itr!=_renderStageMap.end()) + { + _renderStageMap.erase(cv); + } + } + void setRenderStage(CullVisitor* cv, RenderStage* rs) { OpenThreads::ScopedLock lock(_mutex); _renderStageMap[cv] = rs; + cv->addObserver(this); } RenderStage* getRenderStage(osgUtil::CullVisitor* cv) diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/MeshOptimizers.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/MeshOptimizers.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/MeshOptimizers.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/MeshOptimizers.cpp 2014-11-20 10:45:03.000000000 +0000 @@ -60,7 +60,6 @@ typedef std::vector ArrayList; GeometryArrayGatherer(osg::Geometry& geometry) - : _useDrawElements(true) { add(geometry.getVertexArray()); add(geometry.getNormalArray()); @@ -97,9 +96,6 @@ } ArrayList _arrayList; - // True if geometry contains bindings that are compatible with - // DrawElements. - bool _useDrawElements; }; // Compare vertices in a mesh using all their attributes. The vertices @@ -979,7 +975,7 @@ void VertexCacheMissVisitor::doGeometry(Geometry& geom) { Array* vertArray = geom.getVertexArray(); - if (!vertArray) + if (!vertArray || vertArray->getNumElements()==0) return; Geometry::PrimitiveSetList& primSets = geom.getPrimitiveSetList(); CacheRecorder recorder(_cacheSize); @@ -1121,12 +1117,9 @@ void VertexAccessOrderVisitor::optimizeOrder(Geometry& geom) { Array* vertArray = geom.getVertexArray(); - if (!vertArray) + if (!vertArray || vertArray->getNumElements()==0) return; Geometry::PrimitiveSetList& primSets = geom.getPrimitiveSetList(); - GeometryArrayGatherer gatherer(geom); - if (!gatherer._useDrawElements) - return; VertexReorder vr(vertArray->getNumElements()); for (Geometry::PrimitiveSetList::iterator itr = primSets.begin(), end = primSets.end(); @@ -1144,6 +1137,7 @@ // duplicate shared arrays as it isn't safe to rearrange vertices when arrays are shared. if (geom.containsSharedArrays()) geom.duplicateSharedArrays(); + GeometryArrayGatherer gatherer(geom); Remapper remapper(vr.remap); gatherer.accept(remapper); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/Optimizer.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/Optimizer.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/Optimizer.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/Optimizer.cpp 2015-03-03 12:56:10.000000000 +0000 @@ -1099,7 +1099,7 @@ titr!=_transformMap.end(); ++titr) { - if (titr->second._canBeApplied) + if (titr->first!=0 && titr->second._canBeApplied) { if (titr->first!=nodeWeCannotRemove) { diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/RenderStage.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/RenderStage.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgUtil/RenderStage.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgUtil/RenderStage.cpp 2015-06-19 09:54:05.000000000 +0000 @@ -989,8 +989,10 @@ // framebuffer is multisampled then the dimension arguments are ignored // and the whole framebuffer is always copied. fbo_ext->glBlitFramebuffer( - 0, 0, static_cast(_viewport->width()), static_cast(_viewport->height()), - 0, 0, static_cast(_viewport->width()), static_cast(_viewport->height()), + static_cast(_viewport->x()), static_cast(_viewport->y()), + static_cast(_viewport->x() + _viewport->width()), static_cast(_viewport->y() + _viewport->height()), + static_cast(_viewport->x()), static_cast(_viewport->y()), + static_cast(_viewport->x() + _viewport->width()), static_cast(_viewport->y() + _viewport->height()), blitMask, GL_NEAREST); } @@ -1008,8 +1010,10 @@ glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + (attachment - osg::Camera::COLOR_BUFFER0)); fbo_ext->glBlitFramebuffer( - 0, 0, static_cast(_viewport->width()), static_cast(_viewport->height()), - 0, 0, static_cast(_viewport->width()), static_cast(_viewport->height()), + static_cast(_viewport->x()), static_cast(_viewport->y()), + static_cast(_viewport->x() + _viewport->width()), static_cast(_viewport->y() + _viewport->height()), + static_cast(_viewport->x()), static_cast(_viewport->y()), + static_cast(_viewport->x() + _viewport->width()), static_cast(_viewport->y() + _viewport->height()), GL_COLOR_BUFFER_BIT, GL_NEAREST); } } @@ -1513,14 +1517,14 @@ itr != _preRenderList.end(); ++itr) { - itr->second->collateReferencesToDependentCameras(); + itr->second->clearReferencesToDependentCameras(); } for(RenderStageList::iterator itr = _postRenderList.begin(); itr != _postRenderList.end(); ++itr) { - itr->second->collateReferencesToDependentCameras(); + itr->second->clearReferencesToDependentCameras(); } _dependentCameras.clear(); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/CompositeViewer.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/CompositeViewer.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/CompositeViewer.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/CompositeViewer.cpp 2015-06-07 11:13:08.000000000 +0000 @@ -362,7 +362,7 @@ { osg::Timer_t tick = osg::Timer::instance()->tick(); double currentTime = osg::Timer::instance()->delta_s(_startTick, tick); - double delta_ticks = (time-currentTime)*(osg::Timer::instance()->getSecondsPerTick()); + double delta_ticks = (time-currentTime)/(osg::Timer::instance()->getSecondsPerTick()); if (delta_ticks>=0) tick += osg::Timer_t(delta_ticks); else tick -= osg::Timer_t(-delta_ticks); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/GraphicsWindowX11.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/GraphicsWindowX11.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/GraphicsWindowX11.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/GraphicsWindowX11.cpp 2015-04-20 10:43:00.000000000 +0000 @@ -962,11 +962,14 @@ XFlush( _display ); XSync( _display, 0 ); - // now update the window dimensions to account for any size changes made by the window manager, + + // get window geometry relative to root window/screen + Window child_return; + int windowX, windowY; XGetWindowAttributes( _display, _window, &watt ); + XTranslateCoordinates( _display, _window, watt.root, watt.x, watt.y, &windowX, &windowY, &child_return); - if (_traits->x != watt.x || _traits->y != watt.y - ||_traits->width != watt.width || _traits->height != watt.height) + if (_traits->x != windowX || _traits->y != windowY ||_traits->width != watt.width || _traits->height != watt.height) { if (doFullSceenWorkAround) @@ -978,9 +981,10 @@ XSync(_display, 0); XGetWindowAttributes( _display, _window, &watt ); + XTranslateCoordinates( _display, _window, watt.root, watt.x, watt.y, &windowX, &windowY, &child_return); } - resized( watt.x, watt.y, watt.width, watt.height ); + resized( windowX, windowY, watt.width, watt.height ); } //OSG_NOTICE<<"After sync apply.x = "<(ev.xclient.data.l[0]) == _deleteWindow) { - OSG_NOTICE<<"DeleteWindow event received"<closeWindow(eventTime); } @@ -1252,15 +1256,13 @@ break; case DestroyNotify : - OSG_NOTICE<<"DestroyNotify event received"<x || windowY != _traits->y || windowWidth != _traits->width || windowHeight != _traits->height) { + resized(windowX, windowY, windowWidth, windowHeight); getEventQueue()->windowResize(windowX, windowY, windowWidth, windowHeight, resizeTime); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/PixelBufferCocoa.mm openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/PixelBufferCocoa.mm --- openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/PixelBufferCocoa.mm 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/PixelBufferCocoa.mm 2014-11-24 15:24:31.000000000 +0000 @@ -74,7 +74,7 @@ _context = [[NSOpenGLContext alloc] initWithFormat: pixelformat shareContext: sharedContext]; NSOpenGLPixelBuffer* pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget: _traits->target textureInternalFormat: _traits->format textureMaxMipMapLevel: _traits->level pixelsWide: _traits->width pixelsHigh: _traits->height]; - [_context setPixelBuffer: pbuffer cubeMapFace: _traits->face mipMapLevel:_traits->level currentVirtualScreen: nil]; + [_context setPixelBuffer: pbuffer cubeMapFace: _traits->face mipMapLevel:_traits->level currentVirtualScreen: 0]; [pool release]; diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/StatsHandler.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/StatsHandler.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/StatsHandler.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/StatsHandler.cpp 2015-02-23 11:07:35.000000000 +0000 @@ -326,6 +326,7 @@ // only clear the depth buffer _camera->setClearMask(0); + _camera->setAllowEventFocus(false); _camera->setRenderer(new Renderer(_camera.get())); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/Viewer.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/Viewer.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgViewer/Viewer.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgViewer/Viewer.cpp 2015-06-07 11:13:08.000000000 +0000 @@ -435,7 +435,7 @@ { osg::Timer_t tick = osg::Timer::instance()->tick(); double currentTime = osg::Timer::instance()->delta_s(_startTick, tick); - double delta_ticks = (time-currentTime)*(osg::Timer::instance()->getSecondsPerTick()); + double delta_ticks = (time-currentTime)/(osg::Timer::instance()->getSecondsPerTick()); if (delta_ticks>=0) tick += osg::Timer_t(delta_ticks); else tick -= osg::Timer_t(-delta_ticks); diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Property.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Property.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Property.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Property.cpp 2015-01-06 14:55:10.000000000 +0000 @@ -52,7 +52,7 @@ // // SwitchProperty // -SwitchProperty::SwitchProperty() +SwitchProperty::SwitchProperty():_activeProperty(0) { } diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_frag.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_frag.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_frag.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_frag.cpp 2015-08-12 08:34:57.000000000 +0000 @@ -9,7 +9,7 @@ "varying vec4 baseColor;\n" "\n" "void main(void)\n" - "{ \n" + "{\n" " vec4 t0 = vertexPos;\n" " vec4 te = cameraPos;\n" "\n" @@ -61,19 +61,17 @@ " t0 = t0 * texgen;\n" " te = te * texgen;\n" "\n" - " const float max_iteratrions = 2048.0;\n" + " const float min_iterations = 2.0;\n" + " const float max_iterations = 2048.0;\n" " float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n" - " if (num_iterations<2.0) num_iterations = 2.0;\n" + " if (num_iterationsmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " if (num_iterations>max_iteratrions) \n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" - "\n" - " vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n" + " vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n" " vec3 texcoord = t0.xyz;\n" "\n" - " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n" + " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n" " while(num_iterations>0.0)\n" " {\n" " vec4 color = texture3D( baseTexture, texcoord);\n" @@ -88,7 +86,7 @@ " {\n" " fragColor = color;\n" " }\n" - " texcoord += deltaTexCoord; \n" + " texcoord += deltaTexCoord;\n" "\n" " --num_iterations;\n" " }\n" @@ -99,7 +97,6 @@ " fragColor *= baseColor;\n" "\n" " if (fragColor.wmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " if (num_iterations>max_iteratrions) \n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" - "\n" - " vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n" + " vec3 deltaTexCoord=(t0-te).xyz/(num_iterations-1.0);\n" " vec3 texcoord = te.xyz;\n" "\n" " vec4 previousColor = texture3D( baseTexture, texcoord);\n" diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_lit_frag.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_lit_frag.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_lit_frag.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_lit_frag.cpp 2015-08-12 08:34:57.000000000 +0000 @@ -10,7 +10,7 @@ "varying vec4 baseColor;\n" "\n" "void main(void)\n" - "{ \n" + "{\n" " vec4 t0 = vertexPos;\n" " vec4 te = cameraPos;\n" "\n" @@ -62,16 +62,14 @@ " t0 = t0 * texgen;\n" " te = te * texgen;\n" "\n" - " const float max_iteratrions = 2048.0;\n" - " float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n" - " if (num_iterations<2.0) num_iterations = 2.0;\n" + " const float min_iterations = 2.0;\n" + " const float max_iterations = 2048.0;\n" + " float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n" + " if (num_iterationsmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " if (num_iterations>max_iteratrions) \n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" - "\n" - " vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n" + " vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n" " vec3 texcoord = t0.xyz;\n" "\n" " float normalSampleDistance = 1.0/512.0;\n" @@ -115,18 +113,17 @@ " {\n" " fragColor = color;\n" " }\n" - " texcoord += deltaTexCoord; \n" + " texcoord += deltaTexCoord;\n" "\n" " --num_iterations;\n" " }\n" "\n" " fragColor.w *= TransparencyValue;\n" - " if (fragColor.w>1.0) fragColor.w = 1.0; \n" + " if (fragColor.w>1.0) fragColor.w = 1.0;\n" "\n" " fragColor *= baseColor;\n" "\n" " if (fragColor.wmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " if (num_iterations>max_iteratrions) \n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" - "\n" - " vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n" + " vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n" " vec3 texcoord = t0.xyz;\n" "\n" " float normalSampleDistance = 1.0/512.0;\n" @@ -112,7 +110,6 @@ " color.z *= lightScale;\n" " }\n" "\n" - "\n" " float r = color[3]*TransparencyValue;\n" " if (r>AlphaFuncValue)\n" " {\n" @@ -124,7 +121,7 @@ " {\n" " fragColor = color;\n" " }\n" - " texcoord += deltaTexCoord; \n" + " texcoord += deltaTexCoord;\n" "\n" " --num_iterations;\n" " }\n" diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_mip_frag.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_mip_frag.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_mip_frag.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_mip_frag.cpp 2015-08-12 08:34:57.000000000 +0000 @@ -9,7 +9,7 @@ "varying vec4 baseColor;\n" "\n" "void main(void)\n" - "{ \n" + "{\n" " vec4 t0 = vertexPos;\n" " vec4 te = cameraPos;\n" "\n" @@ -61,19 +61,17 @@ " t0 = t0 * texgen;\n" " te = te * texgen;\n" "\n" - " const float max_iteratrions = 2048.0;\n" + " const float min_iterations = 2.0;\n" + " const float max_iterations = 2048.0;\n" " float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n" - " if (num_iterations<2.0) num_iterations = 2.0;\n" + " if (num_iterationsmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " if (num_iterations>max_iteratrions) \n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" - "\n" - " vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n" + " vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n" " vec3 texcoord = t0.xyz;\n" "\n" - " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n" + " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n" " while(num_iterations>0.0)\n" " {\n" " vec4 color = texture3D( baseTexture, texcoord);\n" @@ -81,18 +79,17 @@ " {\n" " fragColor = color;\n" " }\n" - " texcoord += deltaTexCoord; \n" + " texcoord += deltaTexCoord;\n" "\n" " --num_iterations;\n" " }\n" "\n" " fragColor.w *= TransparencyValue;\n" - " if (fragColor.w>1.0) fragColor.w = 1.0; \n" + " if (fragColor.w>1.0) fragColor.w = 1.0;\n" "\n" " fragColor *= baseColor;\n" "\n" " if (fragColor.wmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " if (num_iterations>max_iteratrions) \n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" - "\n" - " vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n" + " vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n" " vec3 texcoord = t0.xyz;\n" "\n" - " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n" + " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n" " while(num_iterations>0.0)\n" " {\n" " float v = texture3D( baseTexture, texcoord).a * tfScale + tfOffset;\n" @@ -95,7 +93,7 @@ " {\n" " fragColor = color;\n" " }\n" - " texcoord += deltaTexCoord; \n" + " texcoord += deltaTexCoord;\n" "\n" " --num_iterations;\n" " }\n" @@ -106,7 +104,6 @@ " fragColor *= baseColor;\n" "\n" " if (fragColor.wmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " if (num_iterations>max_iteratrions)\n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" "\n" " vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n" " vec3 texcoord = te.xyz;\n" @@ -84,7 +83,7 @@ " vec3 deltaX = vec3(normalSampleDistance, 0.0, 0.0);\n" " vec3 deltaY = vec3(0.0, normalSampleDistance, 0.0);\n" " vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n" - "\n" + " \n" " while(num_iterations>0.0)\n" " {\n" "\n" @@ -134,6 +133,5 @@ "\n" " // we didn't find an intersection so just discard fragment\n" " discard;\n" - "\n" "}\n" "\n"; diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_tf_mip_frag.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_tf_mip_frag.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgVolume/Shaders/volume_tf_mip_frag.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgVolume/Shaders/volume_tf_mip_frag.cpp 2015-08-12 08:34:57.000000000 +0000 @@ -14,9 +14,9 @@ "varying vec4 baseColor;\n" "\n" "void main(void)\n" - "{ \n" - " vec3 t0 = (texgen * vertexPos).xyz;\n" - " vec3 te = (texgen * cameraPos).xyz;\n" + "{\n" + " vec4 t0 = vertexPos;\n" + " vec4 te = cameraPos;\n" "\n" " if (te.x>=0.0 && te.x<=1.0 &&\n" " te.y>=0.0 && te.y<=1.0 &&\n" @@ -63,19 +63,20 @@ " }\n" " }\n" "\n" - " const float max_iteratrions = 2048.0;\n" - " float num_iterations = ceil(length(te-t0)/SampleDensityValue);\n" - " if (num_iterations<2.0) num_iterations = 2.0;\n" - " \n" - " if (num_iterations>max_iteratrions) \n" - " {\n" - " num_iterations = max_iteratrions;\n" - " }\n" + " t0 = t0 * texgen;\n" + " te = te * texgen;\n" + "\n" + " const float min_iterations = 2.0;\n" + " const float max_iterations = 2048.0;\n" + " float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n" + " if (num_iterationsmax_iterations) num_iterations = max_iterations;\n" + " else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n" "\n" - " vec3 deltaTexCoord=(te-t0)/float(num_iterations-1.0);\n" - " vec3 texcoord = t0;\n" + " vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n" + " vec3 texcoord = t0.xyz;\n" "\n" - " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n" + " vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n" " while(num_iterations>0.0)\n" " {\n" " float v = texture3D( baseTexture, texcoord).s * tfScale + tfOffset;\n" @@ -84,7 +85,7 @@ " {\n" " fragColor = color;\n" " }\n" - " texcoord += deltaTexCoord; \n" + " texcoord += deltaTexCoord;\n" "\n" " --num_iterations;\n" " }\n" diff -Nru openscenegraph-3.2.1/OpenSceneGraph/src/osgWrappers/deprecated-dotosg/osg/ProxyNode.cpp openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgWrappers/deprecated-dotosg/osg/ProxyNode.cpp --- openscenegraph-3.2.1/OpenSceneGraph/src/osgWrappers/deprecated-dotosg/osg/ProxyNode.cpp 2014-07-14 17:40:57.000000000 +0000 +++ openscenegraph-3.2.3+dfsg1/OpenSceneGraph/src/osgWrappers/deprecated-dotosg/osg/ProxyNode.cpp 2014-11-19 11:37:33.000000000 +0000 @@ -123,6 +123,8 @@ iteratorAdvanced = true; } + bool make_options = (fr.getOptions() == NULL); + if (make_options) fr.setOptions(new osgDB::Options()); //need valid options unsigned int i; for(i=0; i