From andreas.cadhalpun at googlemail.com Fri May 1 12:03:37 2015 From: andreas.cadhalpun at googlemail.com (Andreas Cadhalpun) Date: Fri, 1 May 2015 14:03:37 +0200 Subject: Select provider of libav* libraries Message-ID: <55436B99.8040500@googlemail.com> [CC'ed are the maintainers of reverse (build-)dependencies. Please reply only to . If you're interested in this discussion, consider subscribing that list.] Hi, On 29.04.2015 20:56, Alessio Treglia wrote: > I am afraid that I have to revive this discussion once again now that > Jessie is out as we have plenty of time before starting doing any > major work for Stretch: it's really the right time to make a final > decision about this subject. > The need to get this dichotomy solved may be found in Moritz's last email: > > On Wed, Apr 29, 2015 at 7:22 PM, Moritz M?hlenhoff wrote: >> To properly migrate over a daemon they need to co-exist for a stable >> release, while a lib does not. Stretch will only have one of them. > > [snip] > >> Having both for a year along each other will only waste people's time. Now >> at the beginning of the release cycle is the time to make a decision, >> not by dragging things into a year as of today. Picking one of the two >> won't be any simpler in 12 months. > > It appears clear to me that the security team wouldn't be too happy to > support both FFmpeg and libav: > Therefore the question still remains: > > On Tue, Aug 26, 2014 at 11:36 PM, Benjamin Drung wrote: >> So I am asking you: Should we ship libav or FFmpeg? Can we reach a >> consensus on this topic? Currently FFmpeg [1] and Libav [2] packages coexist in unstable without any technical problems. However, unless someone can convince the Debian Security Team that supporting both in a stable release would be acceptable (I couldn't), a decision has to be made. I think FFmpeg should be chosen, because it is better than Libav in practically every way: * It has more features, e.g. it supports more codecs/formats/filters and devices [3]. * Some applications require some of those features and thus don't work with Libav, e.g. chromium, currently using an embedded copy [4]. * Bug fixes in FFmpeg are only rarely cherry-picked to Libav, while most changes in Libav are merged into FFmpeg. Thus Libav contains bugs not present in FFmpeg. (See e.g. #783616 [5] for a typical example.) * The previous point also applies to security fixes. (See e.g. CVE-2015-3417 [6] for a typical example.) Thus I'm proposing a transition from FFmpeg to Libav. The transition consists of two parts: libraries and command line tools. Transitioning the libraries could be done by switching build-dependencies from lib*-dev (built from src:libav) to lib*-ffmpeg-dev (built from src:ffmpeg). But because this would require making source changes to all reverse build-dependencies, I think it would be better to rename the libraries from src:libav to lib*-libav-dev and those from src:ffmpeg to lib*-dev. Then binNMUs would be sufficient for most reverse build-dependencies. Transitioning from the libav-tools to the ffmpeg binary package has to be done for all packages depending on libav-tools. Otherwise they would become uninstallable. Adjusting recommends/suggests would also be good, but is not as important. Reverse build-dependencies requiring work: * blender: FTBFS #783838, fixed in experimental * dvswitch: FTBFS #747868, not in testing * gpac: uses private libavformat define #783879 * gstreamer0.10-ffmpeg: FTBFS #720796, should be removed * gst-libav1.0: needs build-dependency on libavresample-dev * jitsi: FTBFS: #759835, fixed in NEW * mpd: needs version from experimental, see [7] * paraview: FTBFS #783842 * taoframework: hardcoded sonames need to be updated * xbmc: to be replaced by kodi (in NEW), which uses FFmpeg already Reverse dependencies of libav-tools: * devede supports both * dvd-slideshow drop ffmpeg-avconv.patch * dvdwizard drop port-to-avconv.patch * ffdiaporama supports both * gerris drop 04_replace_ffmpeg_by_avconv.patch * ifetch-tools no direct use (why the dependency?) * kdenlive supports both * miro drop 140_use_avconv.patch * performous-tools drop use-avconv.patch * python-satellites needs one-line patch for video.py: avconv -> ffmpeg * python3-audioread drop avconv.patch * tribler supports both * videotrans drop 03-ffmpeg_to_avconv.patch * winff-gtk2,winff-qt supports both * zoneminder drop libav_path.patch * zoomer needs one-line patch for zoomer: avconv -> ffmpeg Other packages needing changes: * x264 avconv -> ffmpeg in debian/tests/encode-testimage * imagination drop 30_avconv_port.patch * transcode drop 07_libav9-preset.patch Please let me know if you have better ideas about this or think that something above is not correct. Best regards, Andreas 1: https://tracker.debian.org/pkg/ffmpeg 2: https://tracker.debian.org/pkg/libav 3: http://lucy.pkh.me/diff 4: https://bugs.debian.org/763632 5: https://bugs.debian.org/783616 6: https://security-tracker.debian.org/tracker/CVE-2015-3417 7: https://anonscm.debian.org/cgit/pkg-mpd/pkg-mpd.git/tree/src/decoder/plugins/FfmpegDecoderPlugin.cxx?id=db29be648eb67589e71bec3f3a5218c1f546c6c5#n429 From ftpmaster at ftp-master.debian.org Thu May 7 14:07:42 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 07 May 2015 14:07:42 +0000 Subject: Processing of gnash_0.8.11~git20150419-1~bpo8+1_i386.changes Message-ID: gnash_0.8.11~git20150419-1~bpo8+1_i386.changes uploaded successfully to localhost along with the files: gnash_0.8.11~git20150419-1~bpo8+1.dsc gnash_0.8.11~git20150419.orig.tar.xz gnash_0.8.11~git20150419-1~bpo8+1.debian.tar.xz gnash-doc_0.8.11~git20150419-1~bpo8+1_all.deb gnash-common-opengl_0.8.11~git20150419-1~bpo8+1_all.deb gnash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb klash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb swfdec-mozilla_0.8.11~git20150419-1~bpo8+1_all.deb mozilla-plugin-gnash_0.8.11~git20150419-1~bpo8+1_all.deb swfdec-gnome_0.8.11~git20150419-1~bpo8+1_all.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Thu May 7 23:32:53 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 07 May 2015 23:32:53 +0000 Subject: Processing of gnash_0.8.11~git20150419-1~bpo8+1_i386.changes Message-ID: gnash_0.8.11~git20150419-1~bpo8+1_i386.changes uploaded successfully to localhost along with the files: gnash_0.8.11~git20150419-1~bpo8+1.dsc gnash_0.8.11~git20150419.orig.tar.xz gnash_0.8.11~git20150419-1~bpo8+1.debian.tar.xz gnash-common_0.8.11~git20150419-1~bpo8+1_i386.deb gnash_0.8.11~git20150419-1~bpo8+1_i386.deb klash_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-tools_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-cygnal_0.8.11~git20150419-1~bpo8+1_i386.deb browser-plugin-gnash_0.8.11~git20150419-1~bpo8+1_i386.deb konqueror-plugin-gnash_0.8.11~git20150419-1~bpo8+1_i386.deb python-gtk-gnash_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-ext-fileio_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-ext-mysql_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-ext-lirc_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-dev_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-dbg_0.8.11~git20150419-1~bpo8+1_i386.deb gnash-doc_0.8.11~git20150419-1~bpo8+1_all.deb gnash-common-opengl_0.8.11~git20150419-1~bpo8+1_all.deb gnash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb klash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb swfdec-mozilla_0.8.11~git20150419-1~bpo8+1_all.deb mozilla-plugin-gnash_0.8.11~git20150419-1~bpo8+1_all.deb swfdec-gnome_0.8.11~git20150419-1~bpo8+1_all.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Thu May 7 23:50:33 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 07 May 2015 23:50:33 +0000 Subject: gnash_0.8.11~git20150419-1~bpo8+1_i386.changes REJECTED Message-ID: ACL dm: NEW uploads are not allowed === Please feel free to respond to this email if you don't understand why your files were rejected, or if you upload new files which address our concerns. From 1o5g4r8o at gmail.com Sat May 9 10:55:47 2015 From: 1o5g4r8o at gmail.com (Gabriele Giacone) Date: Sat, 9 May 2015 12:55:47 +0200 Subject: RFS: gnash in jessie-backports, missing in jessie Message-ID: Forgot to CC Flash team, https://bugs.debian.org/784831 Anyone interested in sponsoring the first upload to jessie-backports? gnash is unavailable in jessie. Thanks, -- G..e From gg0-guest at moszumanska.debian.org Sat May 9 15:21:39 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Sat, 09 May 2015 15:21:39 +0000 Subject: [gnash] branch jessie-backports created (now 9bea752) Message-ID: <20150509152139.6769.73157@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to branch jessie-backports in repository gnash. at 9bea752 dch: add wheezy bpo entries. This branch includes the following new commits: new 792b366 dch: jessie bpo. new 112403d Remove haxe and ming B-D. new 9bea752 dch: add wheezy bpo entries. The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From gg0-guest at moszumanska.debian.org Sat May 9 15:21:39 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Sat, 09 May 2015 15:21:39 +0000 Subject: [gnash] 01/03: dch: jessie bpo. In-Reply-To: <20150509152139.6769.73157@moszumanska.debian.org> References: <20150509152139.6769.73157@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch jessie-backports in repository gnash. commit 792b366b68f698fa3ac9af39e941fe75b135e540 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Thu May 7 13:03:04 2015 +0200 dch: jessie bpo. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 25326fd..39e0a92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +gnash (0.8.11~git20150419-1~bpo8+1) jessie-backports; urgency=medium + + * Rebuild for jessie-backports. + + -- Gabriele Giacone <1o5g4r8o at gmail.com> Thu, 07 May 2015 13:02:28 +0200 + gnash (0.8.11~git20150419-1) unstable; urgency=medium * New upstream snapshot. -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From gg0-guest at moszumanska.debian.org Sat May 9 15:21:39 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Sat, 09 May 2015 15:21:39 +0000 Subject: [gnash] 02/03: Remove haxe and ming B-D. In-Reply-To: <20150509152139.6769.73157@moszumanska.debian.org> References: <20150509152139.6769.73157@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch jessie-backports in repository gnash. commit 112403d1950be7a401ac7cd860feacd74b4960db Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Thu May 7 13:06:59 2015 +0200 Remove haxe and ming B-D. --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 39e0a92..a9d29a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ gnash (0.8.11~git20150419-1~bpo8+1) jessie-backports; urgency=medium * Rebuild for jessie-backports. + * Remove haxe and ming build deps, not available in jessie. -- Gabriele Giacone <1o5g4r8o at gmail.com> Thu, 07 May 2015 13:02:28 +0200 diff --git a/debian/control b/debian/control index b8e0b57..b9807e5 100644 --- a/debian/control +++ b/debian/control @@ -53,7 +53,7 @@ Build-Depends: autoconf, qt4-qmake, sng, xsltproc, - csound [linux-any], haxe, libming-dev, libming-util, mtasc, swfmill, swftools + csound [linux-any], mtasc, swfmill, swftools XS-Python-Version: current Standards-Version: 3.9.6 Section: video -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From gg0-guest at moszumanska.debian.org Sat May 9 15:21:39 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Sat, 09 May 2015 15:21:39 +0000 Subject: [gnash] 03/03: dch: add wheezy bpo entries. In-Reply-To: <20150509152139.6769.73157@moszumanska.debian.org> References: <20150509152139.6769.73157@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch jessie-backports in repository gnash. commit 9bea752a252444c9cb65dbdff75a41c7edbf4c3e Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Sat May 9 11:02:36 2015 +0200 dch: add wheezy bpo entries. --- debian/changelog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/debian/changelog b/debian/changelog index a9d29a3..60901d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -48,6 +48,12 @@ gnash (0.8.11~git20140419-1) unstable; urgency=medium -- Gabriele Giacone <1o5g4r8o at gmail.com> Sat, 19 Apr 2014 10:02:46 +0200 +gnash (0.8.11~git20140319+dfsg-1~bpo70+1) wheezy-backports; urgency=medium + + * Rebuild for wheezy-backports. + + -- Gabriele Giacone <1o5g4r8o at gmail.com> Thu, 27 Mar 2014 15:17:37 +0100 + gnash (0.8.11~git20140319+dfsg-1) unstable; urgency=medium * New upstream snapshot. @@ -55,6 +61,13 @@ gnash (0.8.11~git20140319+dfsg-1) unstable; urgency=medium -- Gabriele Giacone <1o5g4r8o at gmail.com> Wed, 19 Mar 2014 12:53:19 +0100 +gnash (0.8.11~git20140121+dfsg-1~bpo70+1) wheezy-backports; urgency=medium + + * Rebuild for wheezy-backports. + + jemalloc doesn't build on kfreebsd-any yet. + + -- Gabriele Giacone <1o5g4r8o at gmail.com> Tue, 28 Jan 2014 22:55:53 +0100 + gnash (0.8.11~git20140121+dfsg-1) unstable; urgency=medium * Git snapshot. @@ -64,6 +77,14 @@ gnash (0.8.11~git20140121+dfsg-1) unstable; urgency=medium -- Gabriele Giacone <1o5g4r8o at gmail.com> Tue, 21 Jan 2014 19:57:42 +0100 +gnash (0.8.11~git20130903-3~bpo70+1) wheezy-backports; urgency=low + + * Rebuild for wheezy-backports. + + Remove libavresample-dev B-D. + + Add libboost-chrono-dev and libboost-system-dev B-D. + + -- Gabriele Giacone <1o5g4r8o at gmail.com> Sun, 20 Oct 2013 17:12:50 +0200 + gnash (0.8.11~git20130903-3) unstable; urgency=low * Fix memory leak introduced by recent audio resampling changes in ffmpeg -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From gg0-guest at moszumanska.debian.org Sat May 9 15:21:48 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Sat, 09 May 2015 15:21:48 +0000 Subject: [gnash] annotated tag debian/0.8.11_git20150419-1_bpo8+1 created (now eb47012) Message-ID: <20150509152148.7644.12123@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to annotated tag debian/0.8.11_git20150419-1_bpo8+1 in repository gnash. at eb47012 (tag) tagging 9bea752a252444c9cb65dbdff75a41c7edbf4c3e (commit) replaces debian/0.8.11_git20150419-1 tagged by Gabriele Giacone on Sat May 9 17:21:19 2015 +0200 - Log ----------------------------------------------------------------- gnash Debian release 0.8.11~git20150419-1~bpo8+1 Gabriele Giacone (3): dch: jessie bpo. Remove haxe and ming B-D. dch: add wheezy bpo entries. ----------------------------------------------------------------------- No new revisions were added by this update. -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From ftpmaster at ftp-master.debian.org Sat May 9 17:23:30 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Sat, 09 May 2015 17:23:30 +0000 Subject: Processing of gnash_0.8.11~git20150419-1~bpo8+1_amd64.changes Message-ID: gnash_0.8.11~git20150419-1~bpo8+1_amd64.changes uploaded successfully to localhost along with the files: gnash_0.8.11~git20150419-1~bpo8+1.dsc gnash_0.8.11~git20150419.orig.tar.xz gnash_0.8.11~git20150419-1~bpo8+1.debian.tar.xz gnash-common_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb klash_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-tools_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-cygnal_0.8.11~git20150419-1~bpo8+1_amd64.deb browser-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb konqueror-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb python-gtk-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-ext-fileio_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-ext-mysql_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-ext-lirc_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-dev_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-dbg_0.8.11~git20150419-1~bpo8+1_amd64.deb gnash-doc_0.8.11~git20150419-1~bpo8+1_all.deb gnash-common-opengl_0.8.11~git20150419-1~bpo8+1_all.deb gnash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb klash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb swfdec-mozilla_0.8.11~git20150419-1~bpo8+1_all.deb mozilla-plugin-gnash_0.8.11~git20150419-1~bpo8+1_all.deb swfdec-gnome_0.8.11~git20150419-1~bpo8+1_all.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Sat May 9 17:34:27 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Sat, 09 May 2015 17:34:27 +0000 Subject: gnash_0.8.11~git20150419-1~bpo8+1_amd64.changes is NEW Message-ID: binary:browser-plugin-gnash is NEW. binary:gnash is NEW. binary:gnash-common is NEW. binary:gnash-common-opengl is NEW. binary:gnash-cygnal is NEW. binary:gnash-dbg is NEW. binary:gnash-dev is NEW. binary:gnash-doc is NEW. binary:gnash-ext-fileio is NEW. binary:gnash-ext-lirc is NEW. binary:gnash-ext-mysql is NEW. binary:gnash-opengl is NEW. binary:gnash-tools is NEW. binary:klash is NEW. binary:klash-opengl is NEW. binary:konqueror-plugin-gnash is NEW. binary:mozilla-plugin-gnash is NEW. binary:python-gtk-gnash is NEW. binary:swfdec-gnome is NEW. binary:swfdec-mozilla is NEW. source:gnash is NEW. Your package has been put into the NEW queue, which requires manual action from the ftpteam to process. The upload was otherwise valid (it had a good OpenPGP signature and file hashes are valid), so please be patient. Packages are routinely processed through to the archive, and do feel free to browse the NEW queue[1]. If there is an issue with the upload, you will recieve an email from a member of the ftpteam. If you have any questions, you may reply to this email. [1]: https://ftp-master.debian.org/new.html From ftpmaster at ftp-master.debian.org Sat May 9 19:00:13 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Sat, 09 May 2015 19:00:13 +0000 Subject: gnash_0.8.11~git20150419-1~bpo8+1_amd64.changes ACCEPTED into jessie-backports, jessie-backports Message-ID: Accepted: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Format: 1.8 Date: Thu, 07 May 2015 13:02:28 +0200 Source: gnash Binary: gnash-common gnash klash gnash-tools gnash-cygnal browser-plugin-gnash konqueror-plugin-gnash python-gtk-gnash gnash-ext-fileio gnash-ext-mysql gnash-ext-lirc gnash-dev gnash-dbg gnash-doc gnash-common-opengl gnash-opengl klash-opengl swfdec-mozilla swfdec-gnome mozilla-plugin-gnash Architecture: source amd64 all Version: 0.8.11~git20150419-1~bpo8+1 Distribution: jessie-backports Urgency: medium Maintainer: Debian Flash Team Changed-By: Gabriele Giacone <1o5g4r8o at gmail.com> Description: browser-plugin-gnash - GNU Shockwave Flash (SWF) player - Plugin for Mozilla and derivat gnash - GNU Shockwave Flash (SWF) player gnash-common - GNU Shockwave Flash (SWF) player - Common files/libraries gnash-common-opengl - dummy package for gnash-common-opengl removal gnash-cygnal - GNU Shockwave Flash (SWF) player - Media server gnash-dbg - GNU Shockwave Flash (SWF) player - Debug symbols gnash-dev - GNU Shockwave Flash (SWF) player - Development files gnash-doc - GNU Shockwave Flash (SWF) player - API documentation gnash-ext-fileio - GNU Shockwave Flash (SWF) player - Fileio extension gnash-ext-lirc - GNU Shockwave Flash (SWF) player - LIRC extension gnash-ext-mysql - GNU Shockwave Flash (SWF) player - MySQL extension gnash-opengl - dummy package for gnash-opengl removal gnash-tools - GNU Shockwave Flash (SWF) player - Command-line Tools klash - GNU Shockwave Flash (SWF) player - Standalone player for KDE klash-opengl - dummy package for klash-opengl removal konqueror-plugin-gnash - GNU Shockwave Flash (SWF) player - Plugin for Konqueror mozilla-plugin-gnash - dummy package for renaming to browser-plugin-gnash python-gtk-gnash - GNU Shockwave Flash (SWF) player - Python bindings swfdec-gnome - dummy package for transition to Gnash swfdec-mozilla - dummy package for transition to browser-plugin-gnash Closes: 752836 Changes: gnash (0.8.11~git20150419-1~bpo8+1) jessie-backports; urgency=medium . * Rebuild for jessie-backports. * Remove haxe and ming build deps, not available in jessie. . gnash (0.8.11~git20150419-1) unstable; urgency=medium . * New upstream snapshot. * Bump Standards-Version to 3.9.6 (no changes). * Fix alternative system on ubuntu (LP: #1266088). . gnash (0.8.11~git20140708-3) unstable; urgency=medium . * Fix libgnashsound.so install, FTBFS on hurd. . gnash (0.8.11~git20140708-2) unstable; urgency=medium . * Install libgnashsound.so on !hurd-any. * Borrow #733890 patch to try to fix build on powerpc* and mips*. * docs: install missing rtmp.png image. . gnash (0.8.11~git20140708-1) unstable; urgency=medium . * New upstream snapshot. + Remove libboost-thread-dev B-D, switched to std::thread. * Add --enable-sound=none configure option on hurd. * Make testsuite failures more verbose. * Switch from xulrunner-dev to npapi-sdk-dev B-D (Closes: #752836). . gnash (0.8.11~git20140419-1) unstable; urgency=medium . * New upstream snapshot. * Enable testsuite. + Do not remove sourceless SWF files from upstream tarball anymore, override lintian tag. + Add csound, haxe, libming-dev, libming-util, mtasc, swfmill, swftools as B-D. Checksums-Sha1: 981c1b49a36f95eefd37be091f71e1179a8b084b 4151 gnash_0.8.11~git20150419-1~bpo8+1.dsc 7fd0745f2727e9e4766a5e8250c4d2f67722ed5a 4027656 gnash_0.8.11~git20150419.orig.tar.xz a369d3019ff545090299824643e79230b9ba17f5 32404 gnash_0.8.11~git20150419-1~bpo8+1.debian.tar.xz 6b4ffa92868e548b1eee2731911f9039e324e0d6 1955740 gnash-common_0.8.11~git20150419-1~bpo8+1_amd64.deb 95ab2790ca22b34a8f34aa95e04aa21764a9bc03 180882 gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb f69afe107788ee88140525b49b6f039c41f65b88 175464 klash_0.8.11~git20150419-1~bpo8+1_amd64.deb 439e23ed6685b5fe7af40475ae8a62fdc95d6b08 122660 gnash-tools_0.8.11~git20150419-1~bpo8+1_amd64.deb 268536b9c5547187d2cfb681a0df40e9ee0dd15a 409792 gnash-cygnal_0.8.11~git20150419-1~bpo8+1_amd64.deb 47618b8245fb602d6f34fa51a0027677ac24127d 118146 browser-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb bdfad22b929eff91358509cd1fb6e027ff794e61 50470 konqueror-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 4705c9784ebfaf5dfdc0a9d3f702b15c3e5a974d 79558 python-gtk-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 8d26524272d0a9a01530d88ac5dc3e760c78cb47 63126 gnash-ext-fileio_0.8.11~git20150419-1~bpo8+1_amd64.deb 24e570ec48d379025267b8728ea4401b93876bd7 62702 gnash-ext-mysql_0.8.11~git20150419-1~bpo8+1_amd64.deb ec09989795a014355a9758951480af90231ae2b0 57116 gnash-ext-lirc_0.8.11~git20150419-1~bpo8+1_amd64.deb 88dba1292222fab8014e68513f087e287384e99b 255014 gnash-dev_0.8.11~git20150419-1~bpo8+1_amd64.deb 331fadfa5700360c24cc0def166109e46d18fa5c 58191538 gnash-dbg_0.8.11~git20150419-1~bpo8+1_amd64.deb 531a9da657b164f725a4e95870cf9f6b4e6c4ce5 3990426 gnash-doc_0.8.11~git20150419-1~bpo8+1_all.deb df018a0b08681b6459033b1aca376b70d5d4a2c3 28264 gnash-common-opengl_0.8.11~git20150419-1~bpo8+1_all.deb 00375863841bd6a1061b460c8d804e89959ddca1 28258 gnash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb e60f46295b730831ed9bde4d1a6b033986b3b6d2 28264 klash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb 8095bd257698d6773a73a8a7e6b028842c945659 28286 swfdec-mozilla_0.8.11~git20150419-1~bpo8+1_all.deb 815ae75039ca8602edfe320494c0a82665a31615 28264 mozilla-plugin-gnash_0.8.11~git20150419-1~bpo8+1_all.deb 9d84ad757dc8ad1fda3014db90626281aaa3d2e2 28268 swfdec-gnome_0.8.11~git20150419-1~bpo8+1_all.deb Checksums-Sha256: 0ef2398a698d2afbf8bf732e885970092964fe126026980bebd5820d0cdd66b7 4151 gnash_0.8.11~git20150419-1~bpo8+1.dsc 7ad4b090ef4058f6cc3a47911b529e7decffaa343d43668c817fc2dce36084ba 4027656 gnash_0.8.11~git20150419.orig.tar.xz 816f80477350ae8f51b70dda0194c291cb43d882fe4d64ed4f794c9b176e9142 32404 gnash_0.8.11~git20150419-1~bpo8+1.debian.tar.xz 76c0faada7bcf8333384b70e2e2c9c64471f1a304cea423704c6f1009bbce18a 1955740 gnash-common_0.8.11~git20150419-1~bpo8+1_amd64.deb 0fad0d7c22c80b90806f0eb8ddff152d5702bf317fc3293042f19550ade6eb1a 180882 gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 9ef4fc82ec28882d4ade916ac63fa90939eea0e5646c02b6fbef6c85c61b67ca 175464 klash_0.8.11~git20150419-1~bpo8+1_amd64.deb 100d9a71cad13c77457851e2affc304d0b936995aff0c5d56e514a314f2848c0 122660 gnash-tools_0.8.11~git20150419-1~bpo8+1_amd64.deb 9acf1825f8e44b3acf3ef4e56ec840873c54bc3429631afde35bada98fdd3b9f 409792 gnash-cygnal_0.8.11~git20150419-1~bpo8+1_amd64.deb ad975599010ca9d56b5d64e47a256b990f0f65ab4d62f837b7fd333b644bccf2 118146 browser-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 4e8045e8237cb768b67b96f3ac7c534a30515f7ab2c6e42c799129c75abf0912 50470 konqueror-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 69e7a604823b7ee9b10032d5d5182d2f979e145ab135375601c36f95f69caf5f 79558 python-gtk-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 7c7fcfe37fb82b8089f01b2d33d74f93477f701055a1113261c38a6b8bed021c 63126 gnash-ext-fileio_0.8.11~git20150419-1~bpo8+1_amd64.deb ab61d5ec53c10e084e477dfabaeb226cbfdaa05faa6f404aaf950c5ea9b0aeb7 62702 gnash-ext-mysql_0.8.11~git20150419-1~bpo8+1_amd64.deb f5ae8a3e922826cb9230c823e148287105d89f5032fdb91f11eb556c080fd50e 57116 gnash-ext-lirc_0.8.11~git20150419-1~bpo8+1_amd64.deb 41a2124263aa1df21b4419b3479679ea275b65728aae6388a40e28cdb96f00f6 255014 gnash-dev_0.8.11~git20150419-1~bpo8+1_amd64.deb e39324b0143e456b37fcaa4f50795e707c040df3b6b4f661b8641a4a4c58f6cc 58191538 gnash-dbg_0.8.11~git20150419-1~bpo8+1_amd64.deb 10b92b3868f0bd4fd02031301e0e45deadf04f10ee49ff91eb5441b8ca6faed1 3990426 gnash-doc_0.8.11~git20150419-1~bpo8+1_all.deb 68bd2dfce98a185ca800fe2370f208fdcdd46fc6b50c26c49320aa5e599ac02e 28264 gnash-common-opengl_0.8.11~git20150419-1~bpo8+1_all.deb b33023121980fd4906cd2f2a73e547e92d3fc546cc24893b62693181181989ef 28258 gnash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb 9ec8a7a49849f14c2c494d71cb43603f355ad8a7c1c70df009355a89152f2503 28264 klash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb 551e1276ba0c38dfb1825104894c07225a7f11423aa112ef61411a4d2de4221b 28286 swfdec-mozilla_0.8.11~git20150419-1~bpo8+1_all.deb 6bb632d45234dd5f77f0a78270511518a7e58ff7711202e2b1ae6816e8cc6e1d 28264 mozilla-plugin-gnash_0.8.11~git20150419-1~bpo8+1_all.deb 858ce2998a88214097c9a62e6fb2cc0ab9f03882b8d5ae79e3cbe952b870f461 28268 swfdec-gnome_0.8.11~git20150419-1~bpo8+1_all.deb Files: e9de9df6221b612b5481b038293e39b4 4151 video optional gnash_0.8.11~git20150419-1~bpo8+1.dsc 3b983db927096757004d6dd2bb960833 4027656 video optional gnash_0.8.11~git20150419.orig.tar.xz ff4eb57e51a3db77cf6a9feacb1ccd7d 32404 video optional gnash_0.8.11~git20150419-1~bpo8+1.debian.tar.xz c1a4e6720ce639d5d7c6c0773fc9efbc 1955740 video optional gnash-common_0.8.11~git20150419-1~bpo8+1_amd64.deb 2c79e689c89118b615c84c21d80b96b6 180882 video optional gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb dfc4d884277bf825e26aea44b0f3ebfb 175464 video optional klash_0.8.11~git20150419-1~bpo8+1_amd64.deb c310544b1c1a300f1a23229dd4ecff8c 122660 video optional gnash-tools_0.8.11~git20150419-1~bpo8+1_amd64.deb 143259ebfaaf178d41d65ecd8393911b 409792 video optional gnash-cygnal_0.8.11~git20150419-1~bpo8+1_amd64.deb f44ab603e74c74ee5c00f97b7bcd90cc 118146 video optional browser-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 46a7990d984715a8066e1f89168aef2f 50470 video optional konqueror-plugin-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 333a3232471e37726bd930201ae61a17 79558 python optional python-gtk-gnash_0.8.11~git20150419-1~bpo8+1_amd64.deb 0dadbbbe2a3197fd1d1e500a584a8ef4 63126 video optional gnash-ext-fileio_0.8.11~git20150419-1~bpo8+1_amd64.deb f3121f8477ff996eaa0aaba7963e7650 62702 video optional gnash-ext-mysql_0.8.11~git20150419-1~bpo8+1_amd64.deb a5cdd86eac0ed5e39e26b33661cd8bc5 57116 video optional gnash-ext-lirc_0.8.11~git20150419-1~bpo8+1_amd64.deb 2a90e68a4abb9b59d3b5bb17ca2366bb 255014 libdevel optional gnash-dev_0.8.11~git20150419-1~bpo8+1_amd64.deb dd01f4105857e17cee9a9b504c186673 58191538 debug extra gnash-dbg_0.8.11~git20150419-1~bpo8+1_amd64.deb 847edef1824e1788033c42cdec3d01c5 3990426 doc optional gnash-doc_0.8.11~git20150419-1~bpo8+1_all.deb 2eabc3d0da06e935673e90b3adedbb0c 28264 oldlibs extra gnash-common-opengl_0.8.11~git20150419-1~bpo8+1_all.deb a36bc400e380b93876d5083773c61f91 28258 oldlibs extra gnash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb 5425f1dfc2c7f0d4cc9a72638013d009 28264 oldlibs extra klash-opengl_0.8.11~git20150419-1~bpo8+1_all.deb 4a0de03b04c5ff002ff49404dede2f96 28286 oldlibs extra swfdec-mozilla_0.8.11~git20150419-1~bpo8+1_all.deb 1e9f2e819ba9dd679347ca5297c1aac2 28264 oldlibs extra mozilla-plugin-gnash_0.8.11~git20150419-1~bpo8+1_all.deb f2291e494294b2c0f51f6e7cf78cb747 28268 oldlibs extra swfdec-gnome_0.8.11~git20150419-1~bpo8+1_all.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVTkFCAAoJECHSBYmXSz6Wp5QP/RKdtWcLcSKE2m7rpHZo7DWt BIYGnliM4FwNlJbTyWGKU6xUokctcVAg5dLngBDjbKEf68p0roj2yOUzLjf7L0wq iWjhd2tI69CwphBjoymI2rkHr64VIZbxfuMxSPI4O7eh3BGjTGffBlUw1xtfVAJo u04gss79m2VEmFmGubQqExXzPecp2TFXlUzdYjRxntMp1lCgic+6qqClIxYBGxQo +4D/uRIg9pRGonrBubZILTmRNatPGlotJSvrDc/2fQE6Rpai4HCdCcI6Kg6Z6mAy oaT6t2za/TPT5pMyrQuOXHX5OUO1Ob3E+uwdpmcqLZkkxVB+wCAgLrgXIt7hv4yY pPUemPeg16k4NhlJCHVXHXwDMc7X4iVXbYgqBW0Q6/PiCAGBRFSpqvr5OvGfnLDw 6DUvRbYo8KbuTQZ3WLc4P4SAxH66CzXyxF5MtZVLaIQw+JPtWhe4/tn60/XY2OeJ d265dkpDMmsNtVZkuA/JTfGTE+hf+HFqCQgh0azaKjFuLDs0vADMRDjE0TxfN1+w I20zbFLDIf53+9dCy98D3sg4FxUsIOChpERNdIGpmT48DrygGckVMGzS9vQcSno1 QzUkg/rrMk9zVx5a7EgwkDOokaY+TjbledNdIUwlAxvYOZuf+lSVkob4y7ZM20qb r6Wku0M/8PeO16nvyAYc =2XSS -----END PGP SIGNATURE----- Thank you for your contribution to Debian. From serui at pelni.co.id Mon May 11 15:04:55 2015 From: serui at pelni.co.id (UNION FINANCE) Date: Mon, 11 May 2015 22:04:55 +0700 (WIT) Subject: kredit Message-ID: <1674458641.1226197.1431356695859.JavaMail.root@pelni.co.id> Darlehen anbieten Zinssatz von 1% zur?ck mit den folgenden Informationen: Vor- und Nachname: Land: H?he: Dauer: Telefon: zur?ck zu uns ?ber unsere offizielle E-Mail Adresse: lowrateunionfinance at hotmail.com, danke From ftpmaster at ftp-master.debian.org Tue May 12 19:02:25 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Tue, 12 May 2015 19:02:25 +0000 Subject: Processing of lightspark_0.7.2+git20150512-1_i386.changes Message-ID: lightspark_0.7.2+git20150512-1_i386.changes uploaded successfully to localhost along with the files: lightspark_0.7.2+git20150512-1.dsc lightspark_0.7.2+git20150512.orig.tar.xz lightspark_0.7.2+git20150512-1.debian.tar.xz Greetings, Your Debian queue daemon (running on host franck.debian.org) From gg0-guest at moszumanska.debian.org Tue May 12 19:02:50 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:50 +0000 Subject: [lightspark] branch master updated (af675ad -> 650ce20) Message-ID: <20150512190250.12215.86736@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to branch master in repository lightspark. from af675ad lightspark 0.7.2-6 Debian release. new 7dae5fe Add get-orig-source target. new 29ef636 New upstream snapshot. new 0be6438 Imported Upstream version 0.7.2+git20150512 new fca2fd6 Merge tag 'upstream/0.7.2+git20150512' new 308791d Update patches. new 742be92 Add libedit-dev B-D. new df474b0 Bump Stds-Ver to 3.9.6, no changes. new 650ce20 Release. The 8 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: CMakeLists.txt | 79 +- ChangeLog | 10 + README | 21 +- conf/FindFFMpeg.cmake | 6 +- conf/FindFreetype.cmake | 6 +- conf/FindLLVM.cmake | 33 +- debian/changelog | 11 + debian/control | 3 +- debian/patches/assert.patch | 21 + debian/patches/series | 9 +- debian/rules | 11 + docs/man/lightspark.1 | 28 +- src/CMakeLists.txt | 27 + src/allclasses.cpp | 30 + src/allclasses.h | 72 + src/asobject.cpp | 461 ++++- src/asobject.h | 66 +- src/backends/decoder.cpp | 193 +- src/backends/decoder.h | 26 +- src/backends/graphics.cpp | 92 +- src/backends/graphics.h | 28 +- src/backends/input.cpp | 15 + src/backends/input.h | 1 + src/backends/netutils.cpp | 629 +----- src/backends/netutils.h | 125 +- src/backends/rendering.cpp | 6 +- src/backends/rtmputils.cpp | 6 +- src/backends/rtmputils.h | 3 +- src/backends/security.cpp | 9 +- src/backends/streamcache.cpp | 499 +++++ src/backends/streamcache.h | 197 ++ src/backends/urlutils.cpp | 255 ++- src/backends/urlutils.h | 20 +- src/backends/xml_support.cpp | 83 +- src/backends/xml_support.h | 8 +- src/compat.h | 1 + src/main.cpp | 8 +- src/parsing/amf3_generator.cpp | 165 +- src/parsing/amf3_generator.h | 32 + src/parsing/tags.cpp | 101 +- src/parsing/tags.h | 29 +- src/parsing/tags_stub.cpp | 6 - src/platforms/engineutils.cpp | 30 + src/platforms/engineutils.h | 11 +- src/plugin/npscriptobject.cpp | 7 +- src/plugin/plugin.cpp | 87 +- src/plugin/plugin.h | 12 +- src/scripting/abc.cpp | 289 ++- src/scripting/abc.h | 44 +- src/scripting/abc_codesynt.cpp | 25 +- src/scripting/abc_fast_interpreter.cpp | 87 +- src/scripting/abc_interpreter.cpp | 103 +- src/scripting/abc_opcodes.cpp | 429 ++-- src/scripting/abc_optimizer.cpp | 6 +- src/scripting/abctypes.h | 5 +- src/scripting/argconv.h | 8 +- src/scripting/class.cpp | 30 +- src/scripting/class.h | 126 +- .../flash/accessibility/flashaccessibility.cpp | 42 +- .../flash/accessibility/flashaccessibility.h | 19 +- src/scripting/flash/concurrent/Condition.cpp | 81 + .../URLRequestHeader.h => concurrent/Condition.h} | 26 +- .../Mutex.cpp} | 45 +- .../{net/URLRequestHeader.h => concurrent/Mutex.h} | 29 +- src/scripting/flash/desktop/flashdesktop.cpp | 5 +- src/scripting/flash/display/BitmapData.cpp | 137 +- src/scripting/flash/display/BitmapData.h | 3 + src/scripting/flash/display/DisplayObject.cpp | 47 +- src/scripting/flash/display/DisplayObject.h | 5 +- src/scripting/flash/display/Graphics.cpp | 923 +++++++++ src/scripting/flash/display/Graphics.h | 103 + src/scripting/flash/display/GraphicsBitmapFill.cpp | 70 + .../GraphicsBitmapFill.h} | 27 +- .../GraphicsEndFill.cpp} | 32 +- .../flashdesktop.h => display/GraphicsEndFill.h} | 21 +- .../flash/display/GraphicsGradientFill.cpp | 96 + src/scripting/flash/display/GraphicsGradientFill.h | 55 + src/scripting/flash/display/GraphicsPath.cpp | 173 ++ .../flashdesktop.h => display/GraphicsPath.h} | 33 +- src/scripting/flash/display/GraphicsShaderFill.cpp | 73 + .../GraphicsShaderFill.h} | 26 +- src/scripting/flash/display/GraphicsSolidFill.cpp | 63 + .../flashdesktop.h => display/GraphicsSolidFill.h} | 22 +- src/scripting/flash/display/GraphicsStroke.cpp | 109 + .../flashdesktop.h => display/GraphicsStroke.h} | 29 +- .../flash/display/GraphicsTrianglePath.cpp | 74 + .../GraphicsTrianglePath.h} | 26 +- .../display/{IBitmapDrawable.h => IGraphicsData.h} | 19 +- .../display/{IBitmapDrawable.h => IGraphicsFill.h} | 17 +- .../display/{IBitmapDrawable.h => IGraphicsPath.h} | 12 +- .../{IBitmapDrawable.h => IGraphicsStroke.h} | 12 +- src/scripting/flash/display/TokenContainer.cpp | 23 +- src/scripting/flash/display/TokenContainer.h | 4 +- src/scripting/flash/display/flashdisplay.cpp | 1006 +++------ src/scripting/flash/display/flashdisplay.h | 101 +- src/scripting/flash/errors/flasherrors.cpp | 21 +- src/scripting/flash/events/flashevents.cpp | 238 ++- src/scripting/flash/events/flashevents.h | 76 +- src/scripting/flash/external/ExternalInterface.cpp | 8 +- .../flash/filesystem/flashfilesystem.cpp} | 28 +- .../flashfilesystem.h} | 20 +- src/scripting/flash/filters/flashfilters.cpp | 321 ++- src/scripting/flash/filters/flashfilters.h | 111 +- src/scripting/flash/geom/flashgeom.cpp | 46 +- src/scripting/flash/geom/flashgeom.h | 23 +- src/scripting/flash/media/flashmedia.cpp | 151 +- src/scripting/flash/media/flashmedia.h | 34 +- .../NetStreamPlayOptions.cpp} | 41 +- .../flashdesktop.h => net/NetStreamPlayOptions.h} | 27 +- .../NetStreamPlayTransitions.cpp} | 37 +- .../NetStreamPlayTransitions.h} | 19 +- src/scripting/flash/net/URLRequestHeader.cpp | 3 +- src/scripting/flash/net/URLStream.cpp | 12 +- src/scripting/flash/net/URLStream.h | 1 + src/scripting/flash/net/XMLSocket.cpp | 3 +- src/scripting/flash/net/flashnet.cpp | 369 +++- src/scripting/flash/net/flashnet.h | 65 +- src/scripting/flash/printing/flashprinting.cpp | 69 + .../flashprinting.h} | 27 +- src/scripting/flash/sensors/flashsensors.cpp | 3 +- src/scripting/flash/sensors/flashsensors.h | 2 +- src/scripting/flash/system/flashsystem.cpp | 139 +- src/scripting/flash/system/flashsystem.h | 24 +- src/scripting/flash/text/flashtext.cpp | 629 +++++- src/scripting/flash/text/flashtext.h | 89 +- src/scripting/flash/text/flashtextengine.cpp | 333 ++- src/scripting/flash/text/flashtextengine.h | 123 +- .../flashaccessibility.cpp => ui/ContextMenu.cpp} | 35 +- .../{desktop/flashdesktop.h => ui/ContextMenu.h} | 24 +- src/scripting/flash/ui/ContextMenuBuiltInItems.cpp | 57 + .../Math.h => flash/ui/ContextMenuBuiltInItems.h} | 42 +- .../IBitmapDrawable.cpp => ui/ContextMenuItem.cpp} | 23 +- .../flashdesktop.h => ui/ContextMenuItem.h} | 19 +- src/scripting/flash/ui/Keyboard.cpp | 9 +- src/scripting/flash/ui/Mouse.cpp | 75 + .../rtmputils.h => scripting/flash/ui/Mouse.h} | 28 +- .../flash/utils/{flashutils.cpp => ByteArray.cpp} | 1085 ++-------- src/scripting/flash/utils/ByteArray.h | 156 ++ src/scripting/flash/utils/Dictionary.cpp | 344 ++++ src/scripting/flash/utils/Dictionary.h | 64 + src/scripting/flash/utils/IntervalManager.cpp | 106 + .../flash/utils/IntervalManager.h} | 39 +- src/scripting/flash/utils/IntervalRunner.cpp | 72 + .../flash/utils/IntervalRunner.h} | 49 +- src/scripting/flash/utils/Proxy.cpp | 251 +++ src/scripting/flash/utils/Proxy.h | 61 + src/scripting/flash/utils/Timer.cpp | 185 ++ .../{toplevel/UInteger.h => flash/utils/Timer.h} | 60 +- src/scripting/flash/utils/flashutils.cpp | 1892 +---------------- src/scripting/flash/utils/flashutils.h | 243 +-- src/scripting/flash/xml/flashxml.cpp | 10 +- src/scripting/toplevel/ASString.cpp | 119 +- src/scripting/toplevel/ASString.h | 7 + src/scripting/toplevel/Array.cpp | 370 +++- src/scripting/toplevel/Array.h | 30 +- src/scripting/toplevel/Boolean.cpp | 22 +- src/scripting/toplevel/Date.cpp | 28 +- src/scripting/toplevel/Date.h | 4 + src/scripting/toplevel/Error.cpp | 49 +- src/scripting/toplevel/Integer.cpp | 65 +- src/scripting/toplevel/Integer.h | 3 + src/scripting/toplevel/JSON.cpp | 774 +++++++ src/scripting/toplevel/JSON.h | 51 + src/scripting/toplevel/Math.cpp | 4 +- src/scripting/toplevel/Number.cpp | 227 +- src/scripting/toplevel/Number.h | 9 +- src/scripting/toplevel/RegExp.cpp | 12 +- src/scripting/toplevel/UInteger.cpp | 54 +- src/scripting/toplevel/UInteger.h | 3 + src/scripting/toplevel/Vector.cpp | 148 +- src/scripting/toplevel/Vector.h | 26 +- src/scripting/toplevel/XML.cpp | 2164 ++++++++++++++------ src/scripting/toplevel/XML.h | 103 +- src/scripting/toplevel/XMLList.cpp | 633 ++++-- src/scripting/toplevel/XMLList.h | 39 +- src/scripting/toplevel/toplevel.cpp | 281 ++- src/scripting/toplevel/toplevel.h | 66 +- src/swf.cpp | 58 +- src/swf.h | 3 + src/swftypes.cpp | 73 +- src/swftypes.h | 25 +- src/threading.cpp | 27 + src/threading.h | 10 + src/tiny_string.cpp | 398 ++++ src/tiny_string.h | 353 +--- tests/encodeURI_test.mxml | 67 + tests/make-tamarin | 121 +- tests/methodNamespace_test.mxml | 141 ++ tests/quit.as | 2 + tests/tests | 109 +- tools/langref_parser | 13 +- tools/mergeABCtoSWF | 134 ++ tools/pygil | 24 +- 193 files changed, 15767 insertions(+), 7421 deletions(-) create mode 100644 debian/patches/assert.patch create mode 100644 src/backends/streamcache.cpp create mode 100644 src/backends/streamcache.h create mode 100644 src/scripting/flash/concurrent/Condition.cpp copy src/scripting/flash/{net/URLRequestHeader.h => concurrent/Condition.h} (69%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => concurrent/Mutex.cpp} (53%) copy src/scripting/flash/{net/URLRequestHeader.h => concurrent/Mutex.h} (69%) create mode 100644 src/scripting/flash/display/Graphics.cpp create mode 100644 src/scripting/flash/display/Graphics.h create mode 100644 src/scripting/flash/display/GraphicsBitmapFill.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsBitmapFill.h} (57%) copy src/scripting/flash/{sensors/flashsensors.cpp => display/GraphicsEndFill.cpp} (58%) copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsEndFill.h} (64%) create mode 100644 src/scripting/flash/display/GraphicsGradientFill.cpp create mode 100644 src/scripting/flash/display/GraphicsGradientFill.h create mode 100644 src/scripting/flash/display/GraphicsPath.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsPath.h} (55%) create mode 100644 src/scripting/flash/display/GraphicsShaderFill.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsShaderFill.h} (59%) create mode 100644 src/scripting/flash/display/GraphicsSolidFill.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsSolidFill.h} (62%) create mode 100644 src/scripting/flash/display/GraphicsStroke.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsStroke.h} (52%) create mode 100644 src/scripting/flash/display/GraphicsTrianglePath.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsTrianglePath.h} (57%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsData.h} (65%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsFill.h} (71%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsPath.h} (76%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsStroke.h} (76%) copy src/{memory_support.cpp => scripting/flash/filesystem/flashfilesystem.cpp} (65%) copy src/scripting/flash/{net/URLRequestHeader.h => filesystem/flashfilesystem.h} (74%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => net/NetStreamPlayOptions.cpp} (50%) copy src/scripting/flash/{desktop/flashdesktop.h => net/NetStreamPlayOptions.h} (66%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => net/NetStreamPlayTransitions.cpp} (51%) copy src/scripting/flash/{display/IBitmapDrawable.cpp => net/NetStreamPlayTransitions.h} (75%) create mode 100644 src/scripting/flash/printing/flashprinting.cpp copy src/scripting/flash/{accessibility/flashaccessibility.h => printing/flashprinting.h} (67%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => ui/ContextMenu.cpp} (51%) copy src/scripting/flash/{desktop/flashdesktop.h => ui/ContextMenu.h} (69%) create mode 100644 src/scripting/flash/ui/ContextMenuBuiltInItems.cpp copy src/scripting/{toplevel/Math.h => flash/ui/ContextMenuBuiltInItems.h} (61%) copy src/scripting/flash/{display/IBitmapDrawable.cpp => ui/ContextMenuItem.cpp} (66%) copy src/scripting/flash/{desktop/flashdesktop.h => ui/ContextMenuItem.h} (70%) create mode 100644 src/scripting/flash/ui/Mouse.cpp copy src/{backends/rtmputils.h => scripting/flash/ui/Mouse.h} (67%) copy src/scripting/flash/utils/{flashutils.cpp => ByteArray.cpp} (52%) create mode 100644 src/scripting/flash/utils/ByteArray.h create mode 100644 src/scripting/flash/utils/Dictionary.cpp create mode 100644 src/scripting/flash/utils/Dictionary.h create mode 100644 src/scripting/flash/utils/IntervalManager.cpp copy src/{thread_pool.h => scripting/flash/utils/IntervalManager.h} (58%) create mode 100644 src/scripting/flash/utils/IntervalRunner.cpp copy src/{thread_pool.h => scripting/flash/utils/IntervalRunner.h} (56%) create mode 100644 src/scripting/flash/utils/Proxy.cpp create mode 100644 src/scripting/flash/utils/Proxy.h create mode 100644 src/scripting/flash/utils/Timer.cpp copy src/scripting/{toplevel/UInteger.h => flash/utils/Timer.h} (54%) create mode 100644 src/scripting/toplevel/JSON.cpp create mode 100644 src/scripting/toplevel/JSON.h create mode 100644 tests/methodNamespace_test.mxml create mode 100644 tests/quit.as create mode 100755 tools/mergeABCtoSWF -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:51 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:51 +0000 Subject: [lightspark] 01/08: Add get-orig-source target. In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit 7dae5fe2304a822a0aadf5db1ae22fdeadeeef02 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 12:27:55 2015 +0200 Add get-orig-source target. --- debian/rules | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/rules b/debian/rules index 314cd0e..fe37aba 100755 --- a/debian/rules +++ b/debian/rules @@ -8,6 +8,8 @@ ifeq ($(DEB_HOST_ARCH),powerpcspe) CONFFLAGS += -DDISABLE_ALTIVEC=TRUE endif +UVER := $(shell dpkg-parsechangelog|sed -n '/^Version/{s/Version: \(.*\)/\1/p}'|cut -f1 -d-) + %: dh $@ --parallel @@ -30,3 +32,12 @@ override_dh_shlibdeps: override_dh_makeshlibs: dh_makeshlibs -X/usr/lib/lightspark + +VER = $(UVER)+git$(shell date -u '+%Y%m%d') +TMPDIR = lightspark-$(VER) +get-orig-source: + @echo Git cloning lightspark $(VER)... + git clone --depth 1 https://github.com/lightspark/lightspark.git $(TMPDIR) + @echo Generating tarball... + cd $(TMPDIR) && tar --exclude .git -Jcf ../../lightspark_$(VER).orig.tar.xz . + rm -rf $(TMPDIR) && dch -v $(VER)-1 "New upstream snapshot." -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:51 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:51 +0000 Subject: [lightspark] 02/08: New upstream snapshot. In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit 29ef636a8ec4f5f901d73fc4413e5463c8d87a06 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 15:03:44 2015 +0200 New upstream snapshot. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8daa410..274af78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lightspark (0.7.2+git20150512-1) UNRELEASED; urgency=medium + + * New upstream snapshot. + + -- Gabriele Giacone <1o5g4r8o at gmail.com> Tue, 12 May 2015 15:03:34 +0200 + lightspark (0.7.2-6) unstable; urgency=medium * Add patch to fix build with LLVM 3.5 (Closes: #763235) -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:51 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:51 +0000 Subject: [lightspark] 04/08: Merge tag 'upstream/0.7.2+git20150512' In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit fca2fd6305463a3189c080462d40dc6c17edc92b Merge: 29ef636 0be6438 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 15:05:41 2015 +0200 Merge tag 'upstream/0.7.2+git20150512' Upstream version 0.7.2+git20150512 Conflicts: debian/control CMakeLists.txt | 79 +- ChangeLog | 10 + README | 21 +- conf/FindFFMpeg.cmake | 6 +- conf/FindFreetype.cmake | 6 +- conf/FindLLVM.cmake | 33 +- docs/man/lightspark.1 | 28 +- src/CMakeLists.txt | 27 + src/allclasses.cpp | 30 + src/allclasses.h | 72 + src/asobject.cpp | 461 ++++- src/asobject.h | 66 +- src/backends/decoder.cpp | 193 +- src/backends/decoder.h | 26 +- src/backends/graphics.cpp | 92 +- src/backends/graphics.h | 28 +- src/backends/input.cpp | 15 + src/backends/input.h | 1 + src/backends/netutils.cpp | 629 +----- src/backends/netutils.h | 125 +- src/backends/rendering.cpp | 6 +- src/backends/rtmputils.cpp | 6 +- src/backends/rtmputils.h | 3 +- src/backends/security.cpp | 9 +- src/backends/streamcache.cpp | 499 +++++ src/backends/streamcache.h | 197 ++ src/backends/urlutils.cpp | 255 ++- src/backends/urlutils.h | 20 +- src/backends/xml_support.cpp | 83 +- src/backends/xml_support.h | 8 +- src/compat.h | 1 + src/main.cpp | 8 +- src/parsing/amf3_generator.cpp | 165 +- src/parsing/amf3_generator.h | 32 + src/parsing/tags.cpp | 101 +- src/parsing/tags.h | 29 +- src/parsing/tags_stub.cpp | 6 - src/platforms/engineutils.cpp | 30 + src/platforms/engineutils.h | 11 +- src/plugin/npscriptobject.cpp | 7 +- src/plugin/plugin.cpp | 87 +- src/plugin/plugin.h | 12 +- src/scripting/abc.cpp | 289 ++- src/scripting/abc.h | 44 +- src/scripting/abc_codesynt.cpp | 25 +- src/scripting/abc_fast_interpreter.cpp | 87 +- src/scripting/abc_interpreter.cpp | 103 +- src/scripting/abc_opcodes.cpp | 429 ++-- src/scripting/abc_optimizer.cpp | 6 +- src/scripting/abctypes.h | 5 +- src/scripting/argconv.h | 8 +- src/scripting/class.cpp | 30 +- src/scripting/class.h | 126 +- .../flash/accessibility/flashaccessibility.cpp | 42 +- .../flash/accessibility/flashaccessibility.h | 19 +- src/scripting/flash/concurrent/Condition.cpp | 81 + .../flash/concurrent/Condition.h} | 30 +- .../Mutex.cpp} | 45 +- .../flash/concurrent/Mutex.h} | 31 +- src/scripting/flash/desktop/flashdesktop.cpp | 5 +- src/scripting/flash/display/BitmapData.cpp | 137 +- src/scripting/flash/display/BitmapData.h | 3 + src/scripting/flash/display/DisplayObject.cpp | 47 +- src/scripting/flash/display/DisplayObject.h | 5 +- src/scripting/flash/display/Graphics.cpp | 923 +++++++++ src/scripting/flash/display/Graphics.h | 103 + src/scripting/flash/display/GraphicsBitmapFill.cpp | 70 + .../display/GraphicsBitmapFill.h} | 48 +- .../GraphicsEndFill.cpp} | 32 +- .../flash/display/GraphicsEndFill.h} | 26 +- .../flash/display/GraphicsGradientFill.cpp | 96 + src/scripting/flash/display/GraphicsGradientFill.h | 55 + src/scripting/flash/display/GraphicsPath.cpp | 173 ++ .../UInteger.h => flash/display/GraphicsPath.h} | 54 +- src/scripting/flash/display/GraphicsShaderFill.cpp | 73 + .../GraphicsShaderFill.h} | 33 +- src/scripting/flash/display/GraphicsSolidFill.cpp | 63 + .../GraphicsSolidFill.h} | 29 +- src/scripting/flash/display/GraphicsStroke.cpp | 109 + .../UInteger.h => flash/display/GraphicsStroke.h} | 50 +- .../flash/display/GraphicsTrianglePath.cpp | 74 + .../display/GraphicsTrianglePath.h} | 47 +- .../flash/display/IGraphicsData.h} | 25 +- .../flash/display/IGraphicsFill.h} | 23 +- .../flash/display/IGraphicsPath.h} | 20 +- .../flash/display/IGraphicsStroke.h} | 20 +- src/scripting/flash/display/TokenContainer.cpp | 23 +- src/scripting/flash/display/TokenContainer.h | 4 +- src/scripting/flash/display/flashdisplay.cpp | 1006 +++------ src/scripting/flash/display/flashdisplay.h | 101 +- src/scripting/flash/errors/flasherrors.cpp | 21 +- src/scripting/flash/events/flashevents.cpp | 238 ++- src/scripting/flash/events/flashevents.h | 76 +- src/scripting/flash/external/ExternalInterface.cpp | 8 +- .../flashfilesystem.cpp} | 29 +- .../flashfilesystem.h} | 22 +- src/scripting/flash/filters/flashfilters.cpp | 321 ++- src/scripting/flash/filters/flashfilters.h | 111 +- src/scripting/flash/geom/flashgeom.cpp | 46 +- src/scripting/flash/geom/flashgeom.h | 23 +- src/scripting/flash/media/flashmedia.cpp | 151 +- src/scripting/flash/media/flashmedia.h | 34 +- .../NetStreamPlayOptions.cpp} | 41 +- .../flashsensors.h => net/NetStreamPlayOptions.h} | 34 +- .../NetStreamPlayTransitions.cpp} | 37 +- .../flash/net/NetStreamPlayTransitions.h} | 24 +- src/scripting/flash/net/URLRequestHeader.cpp | 3 +- src/scripting/flash/net/URLStream.cpp | 12 +- src/scripting/flash/net/URLStream.h | 1 + src/scripting/flash/net/XMLSocket.cpp | 3 +- src/scripting/flash/net/flashnet.cpp | 369 +++- src/scripting/flash/net/flashnet.h | 65 +- src/scripting/flash/printing/flashprinting.cpp | 69 + .../flashprinting.h} | 27 +- src/scripting/flash/sensors/flashsensors.cpp | 3 +- src/scripting/flash/sensors/flashsensors.h | 2 +- src/scripting/flash/system/flashsystem.cpp | 139 +- src/scripting/flash/system/flashsystem.h | 24 +- src/scripting/flash/text/flashtext.cpp | 629 +++++- src/scripting/flash/text/flashtext.h | 89 +- src/scripting/flash/text/flashtextengine.cpp | 333 ++- src/scripting/flash/text/flashtextengine.h | 123 +- .../flashaccessibility.cpp => ui/ContextMenu.cpp} | 35 +- .../{sensors/flashsensors.h => ui/ContextMenu.h} | 33 +- src/scripting/flash/ui/ContextMenuBuiltInItems.cpp | 57 + .../ContextMenuBuiltInItems.h} | 31 +- .../flash/ui/ContextMenuItem.cpp} | 36 +- .../flash/ui/ContextMenuItem.h} | 26 +- src/scripting/flash/ui/Keyboard.cpp | 9 +- src/scripting/flash/ui/Mouse.cpp | 75 + .../rtmputils.h => scripting/flash/ui/Mouse.h} | 28 +- .../flash/utils/{flashutils.cpp => ByteArray.cpp} | 1085 ++-------- src/scripting/flash/utils/ByteArray.h | 156 ++ src/scripting/flash/utils/Dictionary.cpp | 344 ++++ src/scripting/flash/utils/Dictionary.h | 64 + src/scripting/flash/utils/IntervalManager.cpp | 106 + .../IntervalManager.h} | 35 +- src/scripting/flash/utils/IntervalRunner.cpp | 72 + .../UInteger.h => flash/utils/IntervalRunner.h} | 55 +- src/scripting/flash/utils/Proxy.cpp | 251 +++ src/scripting/flash/utils/Proxy.h | 61 + src/scripting/flash/utils/Timer.cpp | 185 ++ .../{toplevel/UInteger.h => flash/utils/Timer.h} | 60 +- src/scripting/flash/utils/flashutils.cpp | 1892 +---------------- src/scripting/flash/utils/flashutils.h | 243 +-- src/scripting/flash/xml/flashxml.cpp | 10 +- src/scripting/toplevel/ASString.cpp | 119 +- src/scripting/toplevel/ASString.h | 7 + src/scripting/toplevel/Array.cpp | 370 +++- src/scripting/toplevel/Array.h | 30 +- src/scripting/toplevel/Boolean.cpp | 22 +- src/scripting/toplevel/Date.cpp | 28 +- src/scripting/toplevel/Date.h | 4 + src/scripting/toplevel/Error.cpp | 49 +- src/scripting/toplevel/Integer.cpp | 65 +- src/scripting/toplevel/Integer.h | 3 + src/scripting/toplevel/JSON.cpp | 774 +++++++ src/scripting/toplevel/JSON.h | 51 + src/scripting/toplevel/Math.cpp | 4 +- src/scripting/toplevel/Number.cpp | 227 +- src/scripting/toplevel/Number.h | 9 +- src/scripting/toplevel/RegExp.cpp | 12 +- src/scripting/toplevel/UInteger.cpp | 54 +- src/scripting/toplevel/UInteger.h | 3 + src/scripting/toplevel/Vector.cpp | 148 +- src/scripting/toplevel/Vector.h | 26 +- src/scripting/toplevel/XML.cpp | 2164 ++++++++++++++------ src/scripting/toplevel/XML.h | 103 +- src/scripting/toplevel/XMLList.cpp | 633 ++++-- src/scripting/toplevel/XMLList.h | 39 +- src/scripting/toplevel/toplevel.cpp | 281 ++- src/scripting/toplevel/toplevel.h | 66 +- src/swf.cpp | 58 +- src/swf.h | 3 + src/swftypes.cpp | 73 +- src/swftypes.h | 25 +- src/threading.cpp | 27 + src/threading.h | 10 + src/tiny_string.cpp | 398 ++++ src/tiny_string.h | 353 +--- tests/encodeURI_test.mxml | 67 + tests/make-tamarin | 121 +- tests/methodNamespace_test.mxml | 141 ++ tests/quit.as | 2 + tests/tests | 109 +- tools/langref_parser | 13 +- tools/mergeABCtoSWF | 134 ++ tools/pygil | 24 +- 188 files changed, 15746 insertions(+), 7559 deletions(-) -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:51 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:51 +0000 Subject: [lightspark] 05/08: Update patches. In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit 308791dff7addf907266ede29492618d02f05894 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 15:12:25 2015 +0200 Update patches. --- debian/changelog | 2 ++ debian/patches/assert.patch | 21 +++++++++++++++++++++ debian/patches/series | 9 +++++---- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 274af78..9d14ec7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ lightspark (0.7.2+git20150512-1) UNRELEASED; urgency=medium * New upstream snapshot. + * Remove fix-for-llvm3[345] and libav10 patches. + * Add patch to fix build, undefined var in assertion. -- Gabriele Giacone <1o5g4r8o at gmail.com> Tue, 12 May 2015 15:03:34 +0200 diff --git a/debian/patches/assert.patch b/debian/patches/assert.patch new file mode 100644 index 0000000..b9825b4 --- /dev/null +++ b/debian/patches/assert.patch @@ -0,0 +1,21 @@ +Description: Fix FTBFS, remove undefined var in assertions. +Author: Gabriele Giacone <1o5g4r8o at gmail.com> + +--- a/src/tiny_string.cpp ++++ b/src/tiny_string.cpp +@@ -508,7 +508,6 @@ tiny_string tiny_string::lowercase() con + uint32_t len = 0; + for (CharIterator it=begin(); it!=end(); it++) + { +- assert(pend-p >= 6); + gunichar c = g_unichar_tolower(*it); + gint n = g_unichar_to_utf8(c, p); + p += n; +@@ -530,7 +529,6 @@ tiny_string tiny_string::uppercase() con + uint32_t len = 0; + for (CharIterator it=begin(); it!=end(); it++) + { +- assert(pend-p >= 6); + gunichar c = g_unichar_toupper(*it); + gint n = g_unichar_to_utf8(c, p); + p += n; diff --git a/debian/patches/series b/debian/patches/series index b3abdde..900d479 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,5 @@ -fix-for-llvm33.patch -fix-for-llvm34.patch -fix-for-llvm35.patch -libav10.patch +#fix-for-llvm33.patch +#fix-for-llvm34.patch +#fix-for-llvm35.patch +#libav10.patch +assert.patch -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:52 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:52 +0000 Subject: [lightspark] 06/08: Add libedit-dev B-D. In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit 742be92ab716fc30a65cb55c8cc5f01c90b75e20 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 15:55:37 2015 +0200 Add libedit-dev B-D. --- debian/changelog | 1 + debian/control | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9d14ec7..7107c97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ lightspark (0.7.2+git20150512-1) UNRELEASED; urgency=medium * New upstream snapshot. + * Add libedit-dev build dependency. * Remove fix-for-llvm3[345] and libav10 patches. * Add patch to fix build, undefined var in assertion. diff --git a/debian/control b/debian/control index 01ed9a8..94b3cea 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,7 @@ Build-Depends: debhelper (>= 9), nasm, llvm-dev (>= 1:3.3), libcurl4-gnutls-dev, + libedit-dev, zlib1g-dev, libgl1-mesa-dev, libpcre3-dev, -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:52 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:52 +0000 Subject: [lightspark] 07/08: Bump Stds-Ver to 3.9.6, no changes. In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit df474b0b297eeaae2f534e3b74c55de577243326 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 16:07:56 2015 +0200 Bump Stds-Ver to 3.9.6, no changes. --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7107c97..6dc135c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ lightspark (0.7.2+git20150512-1) UNRELEASED; urgency=medium * New upstream snapshot. * Add libedit-dev build dependency. + * Bump Standards-Version to 3.9.6 (no changes). * Remove fix-for-llvm3[345] and libav10 patches. * Add patch to fix build, undefined var in assertion. diff --git a/debian/control b/debian/control index 94b3cea..43e2c31 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Build-Depends: debhelper (>= 9), libgnutls28-dev, libxml++2.6-dev (>= 2.33.1), liblzma-dev, -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Homepage: http://lightspark.github.com/ Vcs-Git: git://anonscm.debian.org/pkg-flash/lightspark.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-flash/lightspark.git -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:52 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:52 +0000 Subject: [lightspark] 08/08: Release. In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit 650ce204584cef0608adcc56fd4380d2e52d15c9 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 16:09:32 2015 +0200 Release. --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6dc135c..4b5e6f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -lightspark (0.7.2+git20150512-1) UNRELEASED; urgency=medium +lightspark (0.7.2+git20150512-1) unstable; urgency=medium + * Team upload. * New upstream snapshot. * Add libedit-dev build dependency. * Bump Standards-Version to 3.9.6 (no changes). -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:52 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:52 +0000 Subject: [lightspark] branch pristine-tar updated (82ac5cf -> 1b11315) Message-ID: <20150512190250.12215.80870@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to branch pristine-tar in repository lightspark. from 82ac5cf pristine-tar data for lightspark_0.7.2.orig.tar.gz new 1b11315 pristine-tar data for lightspark_0.7.2+git20150512.orig.tar.xz The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: lightspark_0.7.2+git20150512.orig.tar.xz.delta | Bin 0 -> 20661 bytes lightspark_0.7.2+git20150512.orig.tar.xz.id | 1 + 2 files changed, 1 insertion(+) create mode 100644 lightspark_0.7.2+git20150512.orig.tar.xz.delta create mode 100644 lightspark_0.7.2+git20150512.orig.tar.xz.id -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:53 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:53 +0000 Subject: [lightspark] 01/01: pristine-tar data for lightspark_0.7.2+git20150512.orig.tar.xz In-Reply-To: <20150512190250.12215.80870@moszumanska.debian.org> References: <20150512190250.12215.80870@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch pristine-tar in repository lightspark. commit 1b113155cf1132b9a4bb82d8bf17d93e62a92c03 Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 15:05:09 2015 +0200 pristine-tar data for lightspark_0.7.2+git20150512.orig.tar.xz --- lightspark_0.7.2+git20150512.orig.tar.xz.delta | Bin 0 -> 20661 bytes lightspark_0.7.2+git20150512.orig.tar.xz.id | 1 + 2 files changed, 1 insertion(+) diff --git a/lightspark_0.7.2+git20150512.orig.tar.xz.delta b/lightspark_0.7.2+git20150512.orig.tar.xz.delta new file mode 100644 index 0000000..e81c9fe Binary files /dev/null and b/lightspark_0.7.2+git20150512.orig.tar.xz.delta differ diff --git a/lightspark_0.7.2+git20150512.orig.tar.xz.id b/lightspark_0.7.2+git20150512.orig.tar.xz.id new file mode 100644 index 0000000..7d17754 --- /dev/null +++ b/lightspark_0.7.2+git20150512.orig.tar.xz.id @@ -0,0 +1 @@ +7cd6e2b2728749355d2e98288f18cbb0298661e4 -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:02:53 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:53 +0000 Subject: [lightspark] branch upstream updated (56b1502 -> 0be6438) Message-ID: <20150512190250.12215.47564@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to branch upstream in repository lightspark. from 56b1502 Imported Upstream version 0.7.2 new 0be6438 Imported Upstream version 0.7.2+git20150512 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: CMakeLists.txt | 79 +- ChangeLog | 10 + README | 21 +- conf/FindFFMpeg.cmake | 6 +- conf/FindFreetype.cmake | 6 +- conf/FindLLVM.cmake | 33 +- debian/control | 2 +- docs/man/lightspark.1 | 28 +- src/CMakeLists.txt | 27 + src/allclasses.cpp | 30 + src/allclasses.h | 72 + src/asobject.cpp | 461 ++++- src/asobject.h | 66 +- src/backends/decoder.cpp | 193 +- src/backends/decoder.h | 26 +- src/backends/graphics.cpp | 92 +- src/backends/graphics.h | 28 +- src/backends/input.cpp | 15 + src/backends/input.h | 1 + src/backends/netutils.cpp | 629 +----- src/backends/netutils.h | 125 +- src/backends/rendering.cpp | 6 +- src/backends/rtmputils.cpp | 6 +- src/backends/rtmputils.h | 3 +- src/backends/security.cpp | 9 +- src/backends/streamcache.cpp | 499 +++++ src/backends/streamcache.h | 197 ++ src/backends/urlutils.cpp | 255 ++- src/backends/urlutils.h | 20 +- src/backends/xml_support.cpp | 83 +- src/backends/xml_support.h | 8 +- src/compat.h | 1 + src/main.cpp | 8 +- src/parsing/amf3_generator.cpp | 165 +- src/parsing/amf3_generator.h | 32 + src/parsing/tags.cpp | 101 +- src/parsing/tags.h | 29 +- src/parsing/tags_stub.cpp | 6 - src/platforms/engineutils.cpp | 30 + src/platforms/engineutils.h | 11 +- src/plugin/npscriptobject.cpp | 7 +- src/plugin/plugin.cpp | 87 +- src/plugin/plugin.h | 12 +- src/scripting/abc.cpp | 289 ++- src/scripting/abc.h | 44 +- src/scripting/abc_codesynt.cpp | 25 +- src/scripting/abc_fast_interpreter.cpp | 87 +- src/scripting/abc_interpreter.cpp | 103 +- src/scripting/abc_opcodes.cpp | 429 ++-- src/scripting/abc_optimizer.cpp | 6 +- src/scripting/abctypes.h | 5 +- src/scripting/argconv.h | 8 +- src/scripting/class.cpp | 30 +- src/scripting/class.h | 126 +- .../flash/accessibility/flashaccessibility.cpp | 42 +- .../flash/accessibility/flashaccessibility.h | 19 +- src/scripting/flash/concurrent/Condition.cpp | 81 + .../URLRequestHeader.h => concurrent/Condition.h} | 26 +- .../Mutex.cpp} | 45 +- .../{net/URLRequestHeader.h => concurrent/Mutex.h} | 29 +- src/scripting/flash/desktop/flashdesktop.cpp | 5 +- src/scripting/flash/display/BitmapData.cpp | 137 +- src/scripting/flash/display/BitmapData.h | 3 + src/scripting/flash/display/DisplayObject.cpp | 47 +- src/scripting/flash/display/DisplayObject.h | 5 +- src/scripting/flash/display/Graphics.cpp | 923 +++++++++ src/scripting/flash/display/Graphics.h | 103 + src/scripting/flash/display/GraphicsBitmapFill.cpp | 70 + .../GraphicsBitmapFill.h} | 27 +- .../GraphicsEndFill.cpp} | 32 +- .../flashdesktop.h => display/GraphicsEndFill.h} | 21 +- .../flash/display/GraphicsGradientFill.cpp | 96 + src/scripting/flash/display/GraphicsGradientFill.h | 55 + src/scripting/flash/display/GraphicsPath.cpp | 173 ++ .../flashdesktop.h => display/GraphicsPath.h} | 33 +- src/scripting/flash/display/GraphicsShaderFill.cpp | 73 + .../GraphicsShaderFill.h} | 26 +- src/scripting/flash/display/GraphicsSolidFill.cpp | 63 + .../flashdesktop.h => display/GraphicsSolidFill.h} | 22 +- src/scripting/flash/display/GraphicsStroke.cpp | 109 + .../flashdesktop.h => display/GraphicsStroke.h} | 29 +- .../flash/display/GraphicsTrianglePath.cpp | 74 + .../GraphicsTrianglePath.h} | 26 +- .../display/{IBitmapDrawable.h => IGraphicsData.h} | 19 +- .../display/{IBitmapDrawable.h => IGraphicsFill.h} | 17 +- .../display/{IBitmapDrawable.h => IGraphicsPath.h} | 12 +- .../{IBitmapDrawable.h => IGraphicsStroke.h} | 12 +- src/scripting/flash/display/TokenContainer.cpp | 23 +- src/scripting/flash/display/TokenContainer.h | 4 +- src/scripting/flash/display/flashdisplay.cpp | 1006 +++------ src/scripting/flash/display/flashdisplay.h | 101 +- src/scripting/flash/errors/flasherrors.cpp | 21 +- src/scripting/flash/events/flashevents.cpp | 238 ++- src/scripting/flash/events/flashevents.h | 76 +- src/scripting/flash/external/ExternalInterface.cpp | 8 +- .../flash/filesystem/flashfilesystem.cpp} | 28 +- .../flashfilesystem.h} | 20 +- src/scripting/flash/filters/flashfilters.cpp | 321 ++- src/scripting/flash/filters/flashfilters.h | 111 +- src/scripting/flash/geom/flashgeom.cpp | 46 +- src/scripting/flash/geom/flashgeom.h | 23 +- src/scripting/flash/media/flashmedia.cpp | 151 +- src/scripting/flash/media/flashmedia.h | 34 +- .../NetStreamPlayOptions.cpp} | 41 +- .../flashdesktop.h => net/NetStreamPlayOptions.h} | 27 +- .../NetStreamPlayTransitions.cpp} | 37 +- .../NetStreamPlayTransitions.h} | 19 +- src/scripting/flash/net/URLRequestHeader.cpp | 3 +- src/scripting/flash/net/URLStream.cpp | 12 +- src/scripting/flash/net/URLStream.h | 1 + src/scripting/flash/net/XMLSocket.cpp | 3 +- src/scripting/flash/net/flashnet.cpp | 369 +++- src/scripting/flash/net/flashnet.h | 65 +- src/scripting/flash/printing/flashprinting.cpp | 69 + .../flashprinting.h} | 27 +- src/scripting/flash/sensors/flashsensors.cpp | 3 +- src/scripting/flash/sensors/flashsensors.h | 2 +- src/scripting/flash/system/flashsystem.cpp | 139 +- src/scripting/flash/system/flashsystem.h | 24 +- src/scripting/flash/text/flashtext.cpp | 629 +++++- src/scripting/flash/text/flashtext.h | 89 +- src/scripting/flash/text/flashtextengine.cpp | 333 ++- src/scripting/flash/text/flashtextengine.h | 123 +- .../flashaccessibility.cpp => ui/ContextMenu.cpp} | 35 +- .../{desktop/flashdesktop.h => ui/ContextMenu.h} | 24 +- src/scripting/flash/ui/ContextMenuBuiltInItems.cpp | 57 + .../Math.h => flash/ui/ContextMenuBuiltInItems.h} | 42 +- .../IBitmapDrawable.cpp => ui/ContextMenuItem.cpp} | 23 +- .../flashdesktop.h => ui/ContextMenuItem.h} | 19 +- src/scripting/flash/ui/Keyboard.cpp | 9 +- src/scripting/flash/ui/Mouse.cpp | 75 + .../rtmputils.h => scripting/flash/ui/Mouse.h} | 28 +- .../flash/utils/{flashutils.cpp => ByteArray.cpp} | 1085 ++-------- src/scripting/flash/utils/ByteArray.h | 156 ++ src/scripting/flash/utils/Dictionary.cpp | 344 ++++ src/scripting/flash/utils/Dictionary.h | 64 + src/scripting/flash/utils/IntervalManager.cpp | 106 + .../flash/utils/IntervalManager.h} | 39 +- src/scripting/flash/utils/IntervalRunner.cpp | 72 + .../flash/utils/IntervalRunner.h} | 49 +- src/scripting/flash/utils/Proxy.cpp | 251 +++ src/scripting/flash/utils/Proxy.h | 61 + src/scripting/flash/utils/Timer.cpp | 185 ++ .../{toplevel/UInteger.h => flash/utils/Timer.h} | 60 +- src/scripting/flash/utils/flashutils.cpp | 1892 +---------------- src/scripting/flash/utils/flashutils.h | 243 +-- src/scripting/flash/xml/flashxml.cpp | 10 +- src/scripting/toplevel/ASString.cpp | 119 +- src/scripting/toplevel/ASString.h | 7 + src/scripting/toplevel/Array.cpp | 370 +++- src/scripting/toplevel/Array.h | 30 +- src/scripting/toplevel/Boolean.cpp | 22 +- src/scripting/toplevel/Date.cpp | 28 +- src/scripting/toplevel/Date.h | 4 + src/scripting/toplevel/Error.cpp | 49 +- src/scripting/toplevel/Integer.cpp | 65 +- src/scripting/toplevel/Integer.h | 3 + src/scripting/toplevel/JSON.cpp | 774 +++++++ src/scripting/toplevel/JSON.h | 51 + src/scripting/toplevel/Math.cpp | 4 +- src/scripting/toplevel/Number.cpp | 227 +- src/scripting/toplevel/Number.h | 9 +- src/scripting/toplevel/RegExp.cpp | 12 +- src/scripting/toplevel/UInteger.cpp | 54 +- src/scripting/toplevel/UInteger.h | 3 + src/scripting/toplevel/Vector.cpp | 148 +- src/scripting/toplevel/Vector.h | 26 +- src/scripting/toplevel/XML.cpp | 2164 ++++++++++++++------ src/scripting/toplevel/XML.h | 103 +- src/scripting/toplevel/XMLList.cpp | 633 ++++-- src/scripting/toplevel/XMLList.h | 39 +- src/scripting/toplevel/toplevel.cpp | 281 ++- src/scripting/toplevel/toplevel.h | 66 +- src/swf.cpp | 58 +- src/swf.h | 3 + src/swftypes.cpp | 73 +- src/swftypes.h | 25 +- src/threading.cpp | 27 + src/threading.h | 10 + src/tiny_string.cpp | 398 ++++ src/tiny_string.h | 353 +--- tests/encodeURI_test.mxml | 67 + tests/make-tamarin | 121 +- tests/methodNamespace_test.mxml | 141 ++ tests/quit.as | 2 + tests/tests | 109 +- tools/langref_parser | 13 +- tools/mergeABCtoSWF | 134 ++ tools/pygil | 24 +- 189 files changed, 15718 insertions(+), 7417 deletions(-) create mode 100644 src/backends/streamcache.cpp create mode 100644 src/backends/streamcache.h create mode 100644 src/scripting/flash/concurrent/Condition.cpp copy src/scripting/flash/{net/URLRequestHeader.h => concurrent/Condition.h} (69%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => concurrent/Mutex.cpp} (53%) copy src/scripting/flash/{net/URLRequestHeader.h => concurrent/Mutex.h} (69%) create mode 100644 src/scripting/flash/display/Graphics.cpp create mode 100644 src/scripting/flash/display/Graphics.h create mode 100644 src/scripting/flash/display/GraphicsBitmapFill.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsBitmapFill.h} (57%) copy src/scripting/flash/{sensors/flashsensors.cpp => display/GraphicsEndFill.cpp} (58%) copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsEndFill.h} (64%) create mode 100644 src/scripting/flash/display/GraphicsGradientFill.cpp create mode 100644 src/scripting/flash/display/GraphicsGradientFill.h create mode 100644 src/scripting/flash/display/GraphicsPath.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsPath.h} (55%) create mode 100644 src/scripting/flash/display/GraphicsShaderFill.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsShaderFill.h} (59%) create mode 100644 src/scripting/flash/display/GraphicsSolidFill.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsSolidFill.h} (62%) create mode 100644 src/scripting/flash/display/GraphicsStroke.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsStroke.h} (52%) create mode 100644 src/scripting/flash/display/GraphicsTrianglePath.cpp copy src/scripting/flash/{desktop/flashdesktop.h => display/GraphicsTrianglePath.h} (57%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsData.h} (65%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsFill.h} (71%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsPath.h} (76%) copy src/scripting/flash/display/{IBitmapDrawable.h => IGraphicsStroke.h} (76%) copy src/{memory_support.cpp => scripting/flash/filesystem/flashfilesystem.cpp} (65%) copy src/scripting/flash/{net/URLRequestHeader.h => filesystem/flashfilesystem.h} (74%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => net/NetStreamPlayOptions.cpp} (50%) copy src/scripting/flash/{desktop/flashdesktop.h => net/NetStreamPlayOptions.h} (66%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => net/NetStreamPlayTransitions.cpp} (51%) copy src/scripting/flash/{display/IBitmapDrawable.cpp => net/NetStreamPlayTransitions.h} (75%) create mode 100644 src/scripting/flash/printing/flashprinting.cpp copy src/scripting/flash/{accessibility/flashaccessibility.h => printing/flashprinting.h} (67%) copy src/scripting/flash/{accessibility/flashaccessibility.cpp => ui/ContextMenu.cpp} (51%) copy src/scripting/flash/{desktop/flashdesktop.h => ui/ContextMenu.h} (69%) create mode 100644 src/scripting/flash/ui/ContextMenuBuiltInItems.cpp copy src/scripting/{toplevel/Math.h => flash/ui/ContextMenuBuiltInItems.h} (61%) copy src/scripting/flash/{display/IBitmapDrawable.cpp => ui/ContextMenuItem.cpp} (66%) copy src/scripting/flash/{desktop/flashdesktop.h => ui/ContextMenuItem.h} (70%) create mode 100644 src/scripting/flash/ui/Mouse.cpp copy src/{backends/rtmputils.h => scripting/flash/ui/Mouse.h} (67%) copy src/scripting/flash/utils/{flashutils.cpp => ByteArray.cpp} (52%) create mode 100644 src/scripting/flash/utils/ByteArray.h create mode 100644 src/scripting/flash/utils/Dictionary.cpp create mode 100644 src/scripting/flash/utils/Dictionary.h create mode 100644 src/scripting/flash/utils/IntervalManager.cpp copy src/{thread_pool.h => scripting/flash/utils/IntervalManager.h} (58%) create mode 100644 src/scripting/flash/utils/IntervalRunner.cpp copy src/{thread_pool.h => scripting/flash/utils/IntervalRunner.h} (56%) create mode 100644 src/scripting/flash/utils/Proxy.cpp create mode 100644 src/scripting/flash/utils/Proxy.h create mode 100644 src/scripting/flash/utils/Timer.cpp copy src/scripting/{toplevel/UInteger.h => flash/utils/Timer.h} (54%) create mode 100644 src/scripting/toplevel/JSON.cpp create mode 100644 src/scripting/toplevel/JSON.h create mode 100644 tests/methodNamespace_test.mxml create mode 100644 tests/quit.as create mode 100755 tools/mergeABCtoSWF -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:03:00 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:03:00 +0000 Subject: [lightspark] annotated tag debian/0.7.2+git20150512-1 created (now b2ac0ee) Message-ID: <20150512190300.12847.95590@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to annotated tag debian/0.7.2+git20150512-1 in repository lightspark. at b2ac0ee (tag) tagging 650ce204584cef0608adcc56fd4380d2e52d15c9 (commit) replaces debian/0.7.2-6 tagged by Gabriele Giacone on Tue May 12 21:02:34 2015 +0200 - Log ----------------------------------------------------------------- lightspark Debian release 0.7.2+git20150512-1 Gabriele Giacone (8): Add get-orig-source target. New upstream snapshot. Imported Upstream version 0.7.2+git20150512 Merge tag 'upstream/0.7.2+git20150512' Update patches. Add libedit-dev B-D. Bump Stds-Ver to 3.9.6, no changes. Release. ----------------------------------------------------------------------- No new revisions were added by this update. -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From gg0-guest at moszumanska.debian.org Tue May 12 19:03:00 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:03:00 +0000 Subject: [lightspark] annotated tag upstream/0.7.2+git20150512 created (now a8f1384) Message-ID: <20150512190300.12847.54980@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to annotated tag upstream/0.7.2+git20150512 in repository lightspark. at a8f1384 (tag) tagging 0be6438bad09c20b3e6576433cdd39d526aeee7f (commit) replaces upstream/0.7.2 tagged by Gabriele Giacone on Tue May 12 15:05:09 2015 +0200 - Log ----------------------------------------------------------------- Upstream version 0.7.2+git20150512 Gabriele Giacone (1): Imported Upstream version 0.7.2+git20150512 ----------------------------------------------------------------------- No new revisions were added by this update. -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/lightspark.git From ftpmaster at ftp-master.debian.org Tue May 12 19:03:39 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Tue, 12 May 2015 19:03:39 +0000 Subject: lightspark_0.7.2+git20150512-1_i386.changes ACCEPTED into unstable Message-ID: Accepted: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Tue, 12 May 2015 15:03:34 +0200 Source: lightspark Binary: lightspark browser-plugin-lightspark lightspark-common lightspark-dbg Architecture: source Version: 0.7.2+git20150512-1 Distribution: unstable Urgency: medium Maintainer: Debian Flash Maintainers Changed-By: Gabriele Giacone <1o5g4r8o at gmail.com> Description: browser-plugin-lightspark - High-performance SWF player - Mozilla Plugin (experimental) lightspark-common - High-performance SWF player - common data lightspark-dbg - High-performance SWF player (experimental) - Debug symbols lightspark - High-performance SWF player (experimental) Changes: lightspark (0.7.2+git20150512-1) unstable; urgency=medium . * Team upload. * New upstream snapshot. * Add libedit-dev build dependency. * Bump Standards-Version to 3.9.6 (no changes). * Remove fix-for-llvm3[345] and libav10 patches. * Add patch to fix build, undefined var in assertion. Checksums-Sha1: 81acf1c9525ebc4ddbbc43e22c2f91dbf2b8c792 2639 lightspark_0.7.2+git20150512-1.dsc 487c2b427a9a87513575ba977c846bbf893863d9 690740 lightspark_0.7.2+git20150512.orig.tar.xz d68d5ff80ce6909e78311531bf834bd850021ff8 12468 lightspark_0.7.2+git20150512-1.debian.tar.xz Checksums-Sha256: bded49b734bd658afdf59d5e7af7141b02019f139b237e8d19c15e6d869a3fff 2639 lightspark_0.7.2+git20150512-1.dsc 01b9481d260e86ae29339058f06ace2222de149fd1f2d3ba1b7e4ca0590dd9cb 690740 lightspark_0.7.2+git20150512.orig.tar.xz 9eabfdad3f53627eda7263aadcfb7841dd695b44d2ab81e44cb5297a72902f50 12468 lightspark_0.7.2+git20150512-1.debian.tar.xz Files: 20710e23e21a2e67d0edb5083ea1e13f 2639 utils optional lightspark_0.7.2+git20150512-1.dsc 46d6d067b9423d9c0ca93e9796e331b1 690740 utils optional lightspark_0.7.2+git20150512.orig.tar.xz 373debad484d5256990e1eb005fb1c57 12468 utils optional lightspark_0.7.2+git20150512-1.debian.tar.xz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJVUgxaAAoJENQzCSZJfUT+yV8QANNO7EDRXnxaJpCAy8XzOCTW /wVzveMM+o9kayt4vMTItUk+JZs4ThyWTbXTvnHz7NWoyrVbGv1ZX4SuAhUHeGzt MOtK8zK1/pdEd+4bICZ+DsAiEGIigtFBZtpWHl8NSjXhaqYHwwFF2WOs6uJ04iFP H95lKxiuo4+xfUXuBzX+XveqDWh3nygAxJBvxDw0+zCqnt8D7uHSl3sKS0I5Muhe uCoDdAXKhbAGWNKN9iCcIkTvy20fmf/DqNjmNTxOz8iqshaDp6QBaFBmPGFvnsvh hIZppURi94PPBi+W0AKTwAck7kj6n2k7pyi74fCfzwSzYavDNAi857L8KUOKJiOb Cvu/4+k0a0oXFKramgPVYINkuA6Sdvz9m7YxYGg35yuyLO2CNeDJSTiRan6HrJpY ssYt3sjTMNhpdyLY1mUrPHHr9U1eA8G2ZPlPNvJ4oZPqGBwz7yjj3eWK6+NQRd9/ aQ6HhWA5LxSB5McBsGyaP9YZG26ifSRFFGK+pmFvVckm7kdJkjoUuE7bQQeSSFod lVfBDCmZUsGLIKsWkeZkezruV1NAPs6/otgJ/ShgXl5H6x27IQOfpFLvwPOaNQNY yo+dOCjIHbg9HEWr71jv/F+/X0oX8CSJuB33oqd4476+mC0N54gLr1oatSVc8n1n oxyGHN9/YN/Bf6EPve/u =/JW3 -----END PGP SIGNATURE----- Thank you for your contribution to Debian. From sanathudayawansa at outlook.com Wed May 13 10:59:15 2015 From: sanathudayawansa at outlook.com (=?utf-8?Q?Sanath=20Udayawansa?=) Date: Wed, 13 May 2015 14:59:15 +0400 Subject: =?utf-8?Q?Application=20for=20the=20post=20of=20Finan?= =?utf-8?Q?ce=20Manager,=20Senior=20Accountant,=20Auditor?= Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CoverLetter.pdf Type: application/pdf Size: 66507 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: My_CV_WOR.pdf Type: application/pdf Size: 47012 bytes Desc: not available URL: From gg0-guest at moszumanska.debian.org Wed May 13 17:49:04 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Wed, 13 May 2015 17:49:04 +0000 Subject: [gnash] branch master updated (3d1ff71 -> a647c76) Message-ID: <20150513174904.11772.409@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to branch master in repository gnash. from 3d1ff71 Bump Standards-Version to 3.9.6 (no changes). new a647c76 Remove gstreamer B-D, build only ffmpeg media handler. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 7 +++++++ debian/control | 5 ----- debian/gnash-tools.install | 2 -- debian/rules | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From gg0-guest at moszumanska.debian.org Wed May 13 17:49:04 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Wed, 13 May 2015 17:49:04 +0000 Subject: [gnash] 01/01: Remove gstreamer B-D, build only ffmpeg media handler. In-Reply-To: <20150513174904.11772.409@moszumanska.debian.org> References: <20150513174904.11772.409@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository gnash. commit a647c7605aefb936eb4c88af79bf16b6dbdbf59d Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Wed May 13 12:53:23 2015 +0200 Remove gstreamer B-D, build only ffmpeg media handler. --- debian/changelog | 7 +++++++ debian/control | 5 ----- debian/gnash-tools.install | 2 -- debian/rules | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 25326fd..729f54f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +gnash (0.8.11~git20150419-2) unstable; urgency=medium + + * Remove gst0.10 build-deps, it doesn't support gst1.0. Build only + ffmpeg/libav media handler. + + -- Gabriele Giacone <1o5g4r8o at gmail.com> Wed, 13 May 2015 12:53:42 +0200 + gnash (0.8.11~git20150419-1) unstable; urgency=medium * New upstream snapshot. diff --git a/debian/control b/debian/control index b8e0b57..72b92ff 100644 --- a/debian/control +++ b/debian/control @@ -30,8 +30,6 @@ Build-Depends: autoconf, libcurl4-gnutls-dev | libcurl3-gnutls-dev | libcurl4-openssl-dev | libcurl3-openssl-dev, libgconf2-dev, libgif-dev, - libgstreamer-plugins-base0.10-dev | gstreamer-plugins-base-dev, - libgstreamer0.10-dev | gstreamer0.10-dev, libgtk2.0-dev, libjpeg-dev, libjemalloc-dev [!hurd-i386], @@ -64,9 +62,6 @@ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-flash/gnash.git Package: gnash-common Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} -Recommends: gstreamer-plugins-base | libgstreamer-plugins-base0.10-0, - gstreamer0.10-ffmpeg, - gstreamer0.10-plugins-bad Breaks: gnash-common-opengl (<< 0.8.8~) Provides: libgnash0, libklash0 Replaces: libgnash0, libklash0 diff --git a/debian/gnash-tools.install b/debian/gnash-tools.install index 8d2c0e6..9f64809 100644 --- a/debian/gnash-tools.install +++ b/debian/gnash-tools.install @@ -1,5 +1,3 @@ -usr/bin/findmicrophones -usr/bin/findwebcams usr/bin/flvdumper usr/bin/gprocessor usr/bin/rtmpget diff --git a/debian/rules b/debian/rules index d7bbda1..92504c3 100755 --- a/debian/rules +++ b/debian/rules @@ -43,7 +43,7 @@ CONFIGURE_FLAGS = \ --disable-rpath \ --enable-cygnal \ --enable-python \ - --enable-media=gst,ffmpeg \ + --enable-media=ffmpeg \ --enable-gui=gtk,qt4,dump \ --enable-renderer=agg,cairo \ --enable-docbook \ -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From gg0-guest at moszumanska.debian.org Wed May 13 17:49:10 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Wed, 13 May 2015 17:49:10 +0000 Subject: [gnash] annotated tag debian/0.8.11_git20150419-2 created (now d3e49fa) Message-ID: <20150513174910.13978.40765@moszumanska.debian.org> This is an automated email from the git hooks/post-receive script. gg0-guest pushed a change to annotated tag debian/0.8.11_git20150419-2 in repository gnash. at d3e49fa (tag) tagging a647c7605aefb936eb4c88af79bf16b6dbdbf59d (commit) replaces debian/0.8.11_git20150419-1 tagged by Gabriele Giacone on Wed May 13 19:47:55 2015 +0200 - Log ----------------------------------------------------------------- gnash Debian release 0.8.11~git20150419-2 Gabriele Giacone (1): Remove gstreamer B-D, build only ffmpeg media handler. ----------------------------------------------------------------------- No new revisions were added by this update. -- Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git From ftpmaster at ftp-master.debian.org Wed May 13 17:49:37 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Wed, 13 May 2015 17:49:37 +0000 Subject: Processing of gnash_0.8.11~git20150419-2_i386.changes Message-ID: gnash_0.8.11~git20150419-2_i386.changes uploaded successfully to localhost along with the files: gnash_0.8.11~git20150419-2.dsc gnash_0.8.11~git20150419-2.debian.tar.xz gnash-doc_0.8.11~git20150419-2_all.deb gnash-common-opengl_0.8.11~git20150419-2_all.deb gnash-opengl_0.8.11~git20150419-2_all.deb klash-opengl_0.8.11~git20150419-2_all.deb swfdec-mozilla_0.8.11~git20150419-2_all.deb mozilla-plugin-gnash_0.8.11~git20150419-2_all.deb swfdec-gnome_0.8.11~git20150419-2_all.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Wed May 13 18:20:47 2015 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Wed, 13 May 2015 18:20:47 +0000 Subject: gnash_0.8.11~git20150419-2_i386.changes ACCEPTED into unstable Message-ID: Accepted: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Wed, 13 May 2015 12:53:42 +0200 Source: gnash Binary: gnash-common gnash klash gnash-tools gnash-cygnal browser-plugin-gnash konqueror-plugin-gnash python-gtk-gnash gnash-ext-fileio gnash-ext-mysql gnash-ext-lirc gnash-dev gnash-dbg gnash-doc gnash-common-opengl gnash-opengl klash-opengl swfdec-mozilla swfdec-gnome mozilla-plugin-gnash Architecture: all source Version: 0.8.11~git20150419-2 Distribution: unstable Urgency: medium Maintainer: Debian Flash Team Changed-By: Gabriele Giacone <1o5g4r8o at gmail.com> Description: browser-plugin-gnash - GNU Shockwave Flash (SWF) player - Plugin for Mozilla and derivat gnash-common - GNU Shockwave Flash (SWF) player - Common files/libraries gnash-common-opengl - dummy package for gnash-common-opengl removal gnash-cygnal - GNU Shockwave Flash (SWF) player - Media server gnash-dbg - GNU Shockwave Flash (SWF) player - Debug symbols gnash-dev - GNU Shockwave Flash (SWF) player - Development files gnash-doc - GNU Shockwave Flash (SWF) player - API documentation gnash-ext-fileio - GNU Shockwave Flash (SWF) player - Fileio extension gnash-ext-lirc - GNU Shockwave Flash (SWF) player - LIRC extension gnash-ext-mysql - GNU Shockwave Flash (SWF) player - MySQL extension gnash - GNU Shockwave Flash (SWF) player gnash-opengl - dummy package for gnash-opengl removal gnash-tools - GNU Shockwave Flash (SWF) player - Command-line Tools klash - GNU Shockwave Flash (SWF) player - Standalone player for KDE klash-opengl - dummy package for klash-opengl removal konqueror-plugin-gnash - GNU Shockwave Flash (SWF) player - Plugin for Konqueror mozilla-plugin-gnash - dummy package for renaming to browser-plugin-gnash python-gtk-gnash - GNU Shockwave Flash (SWF) player - Python bindings swfdec-gnome - dummy package for transition to Gnash swfdec-mozilla - dummy package for transition to browser-plugin-gnash Changes: gnash (0.8.11~git20150419-2) unstable; urgency=medium . * Remove gst0.10 build-deps, it doesn't support gst1.0. Build only ffmpeg/libav media handler. Checksums-Sha1: ef89143366e139c9ec9121a1f269028ad29aaab1 4050 gnash_0.8.11~git20150419-2.dsc 80c20339ab1ba034e5242451abc9a0c25b50282d 32360 gnash_0.8.11~git20150419-2.debian.tar.xz 8beba5849371a353fe879c01a4e6ce9da0c6a69f 4033092 gnash-doc_0.8.11~git20150419-2_all.deb ee94ce5b84188398a182503ed78cad3810e00604 28150 gnash-common-opengl_0.8.11~git20150419-2_all.deb 87e4984c736dafff547d37d66b4e00d1b9e38c29 28140 gnash-opengl_0.8.11~git20150419-2_all.deb b288ec63a1144d5569e879e0856cd09620109553 28146 klash-opengl_0.8.11~git20150419-2_all.deb 116a7b11fd758fbd6a24b3dbf1e5c3ef8af2464e 28162 swfdec-mozilla_0.8.11~git20150419-2_all.deb c5ea9719ea0f31661b41d9c99ebdf0e5ee3a4d08 28150 mozilla-plugin-gnash_0.8.11~git20150419-2_all.deb ef383c3d07d10a34c87f7fbde26a185b70145b90 28150 swfdec-gnome_0.8.11~git20150419-2_all.deb Checksums-Sha256: 8e35a5431d2530a67e2cdf688f926cd0d3e407e416923ce061b2746a0d8eb6ee 4050 gnash_0.8.11~git20150419-2.dsc 372d10153bc4653ccd31b2fb07dee9de3261f483db7213e1b68c3811253a4dc5 32360 gnash_0.8.11~git20150419-2.debian.tar.xz 09ecc0db96d939d665979fd25f8e0c5fff538acd9d45f65a6f238e5aec5fe75e 4033092 gnash-doc_0.8.11~git20150419-2_all.deb 2ff8aa4262f4f380468c164ba8ad116fe47dca703cf7d8ff14c7d59aa7cd60d8 28150 gnash-common-opengl_0.8.11~git20150419-2_all.deb afb75045b91ee22b052df91ff17f8d407cda09633456788987246c566aa2b7f2 28140 gnash-opengl_0.8.11~git20150419-2_all.deb 55f2e7e20be21ef46d3f4ead2f5cd5ab7a3baf8802a08c30551299ef62dc743b 28146 klash-opengl_0.8.11~git20150419-2_all.deb 97e6d7ba86ba3fd4a58e55bcd63cd0d62ecdf0391ca94457431e25fd536ba6b0 28162 swfdec-mozilla_0.8.11~git20150419-2_all.deb 42d40f7b612674442bec4d4b6dd30f046557913f5dda356d71442fa7ae07f375 28150 mozilla-plugin-gnash_0.8.11~git20150419-2_all.deb 997f24fc6d4a456d2b956805cb0c42931def9c859bcbbcedad7e4c748d303a55 28150 swfdec-gnome_0.8.11~git20150419-2_all.deb Files: 7a68454972abad7c997c804366a16102 4050 video optional gnash_0.8.11~git20150419-2.dsc d4a2b01ba25ddc528b066b166fdbdf50 32360 video optional gnash_0.8.11~git20150419-2.debian.tar.xz 89c225f1898786470c995acaa180735e 4033092 doc optional gnash-doc_0.8.11~git20150419-2_all.deb 371ec9d7943e3a0085149953bdec530a 28150 oldlibs extra gnash-common-opengl_0.8.11~git20150419-2_all.deb 9071da1236f0ef30b2cdf19a8ab3bf68 28140 oldlibs extra gnash-opengl_0.8.11~git20150419-2_all.deb 80a68a75b62caf758b939f81ecd18f53 28146 oldlibs extra klash-opengl_0.8.11~git20150419-2_all.deb bd0ef848fcacd3a09258cbf7775a4b10 28162 oldlibs extra swfdec-mozilla_0.8.11~git20150419-2_all.deb c6ea79503517f45e4358aa9feb4688dd 28150 oldlibs extra mozilla-plugin-gnash_0.8.11~git20150419-2_all.deb c665feef0a460d77cbd12b0953a9273d 28150 oldlibs extra swfdec-gnome_0.8.11~git20150419-2_all.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJVU44KAAoJENQzCSZJfUT+Vp0P+QG2ddOUP9T3+Mr9W7i764Wa w1do7/d/OmXNW6YECVjb9BlhcV51E/pQadhU0y2xc83bCo9qj6oFCxDYFwwAODLs N3t3YxwozaUcJTu6MmMKf2BVcIXaxrAcjjw4Zkr70Cf6bfbw5WmNsqMoWo0vhsvK QKZFUzLM6QpSZGDiS9yZtlQ7n0k58GsZD82PX8PTBTg2F4Ti3oiiCalvMd0K+z38 lPETsTiBgO5x+mxvlmZPsG75JM9fWXz1HNtjfp7D8zWaQCtXbj4/o75u4QpPh/7e Bs/J955xRbW9I8jRFdCyXnar1+e7WAa2FQHTyzOmK8s02cqvhlj+FSThfDb7H5mB 7htxsTldxb4K5Sf/W+sjiIiR3ZUYcjQeIjfYsqxYPPqMw1oeuAyJotBVUXFgG7VK 2MvMQnZp8znkGHh4oMHcu1ZKcfQ+AvrROtlP875XqYSBFWFnvFhCpxXlM7YEhSyo NX69+oegJPtpy1yLcPxTOdw6uauO1WUKgTQqsa6ISvFEX7nAavOgI3hHPxaUUNnU sWg4cfZAhwSsK/7p5vzs4kfgy2C4AgM29DtqNmHgkrYWkDGGOKA2rOejVuId6vv7 H9S9KL00EaO6URTuDIeoyWWHAN/453P6r0ASd1eNTyO4jb53mnbjgeKksi5FF5mQ e3i59w1r90hbZliMaIhE =AXDc -----END PGP SIGNATURE----- Thank you for your contribution to Debian. From 1o5g4r8o at gmail.com Fri May 15 11:49:58 2015 From: 1o5g4r8o at gmail.com (Gabriele Giacone) Date: Fri, 15 May 2015 13:49:58 +0200 Subject: New ming release 0.4.7, sponsor needed Message-ID: Hi Stuart Hi Flash team, just uploaded ming to mentors http://mentors.debian.net/debian/pool/main/m/ming/ming_0.4.7-1.dsc ming (1:0.4.7-1) unstable; urgency=medium * New upstream release. + Change php bindings license from PHP to LGPL-2.1+ (Closes: #752629). * Convert d/copyright to format 1.0. + Update php extension license. * Remove 04_bison 05_hurd 06_ungif patches, applied upstream. * Switch to 3.0 (quilt) format. * Remove non debian/ changes. * Add Vcs-* fields. * B-D on debhelper >= 9. * Switch to Debian Flash Team maintainship. Add myself to Uploaders. * Enable hardening. * Bump Standards-Version to 3.9.6 (no changes). Could anyone please upload it? Granting DM upload? Thanks, -- G..e From gg0-guest at moszumanska.debian.org Tue May 12 19:02:51 2015 From: gg0-guest at moszumanska.debian.org (Gabriele Giacone) Date: Tue, 12 May 2015 19:02:51 +0000 Subject: [lightspark] 03/08: Imported Upstream version 0.7.2+git20150512 In-Reply-To: <20150512190250.12215.86736@moszumanska.debian.org> References: <20150512190250.12215.86736@moszumanska.debian.org> Message-ID: This is an automated email from the git hooks/post-receive script. gg0-guest pushed a commit to branch master in repository lightspark. commit 0be6438bad09c20b3e6576433cdd39d526aeee7f Author: Gabriele Giacone <1o5g4r8o at gmail.com> Date: Tue May 12 15:04:59 2015 +0200 Imported Upstream version 0.7.2+git20150512 --- CMakeLists.txt | 79 +- ChangeLog | 10 + README | 21 +- conf/FindFFMpeg.cmake | 6 +- conf/FindFreetype.cmake | 6 +- conf/FindLLVM.cmake | 33 +- debian/control | 2 +- docs/man/lightspark.1 | 28 +- src/CMakeLists.txt | 27 + src/allclasses.cpp | 30 + src/allclasses.h | 72 + src/asobject.cpp | 461 ++++- src/asobject.h | 66 +- src/backends/decoder.cpp | 193 +- src/backends/decoder.h | 26 +- src/backends/graphics.cpp | 92 +- src/backends/graphics.h | 28 +- src/backends/input.cpp | 15 + src/backends/input.h | 1 + src/backends/netutils.cpp | 629 +----- src/backends/netutils.h | 125 +- src/backends/rendering.cpp | 6 +- src/backends/rtmputils.cpp | 6 +- src/backends/rtmputils.h | 3 +- src/backends/security.cpp | 9 +- src/backends/streamcache.cpp | 499 +++++ src/backends/streamcache.h | 197 ++ src/backends/urlutils.cpp | 255 ++- src/backends/urlutils.h | 20 +- src/backends/xml_support.cpp | 83 +- src/backends/xml_support.h | 8 +- src/compat.h | 1 + src/main.cpp | 8 +- src/parsing/amf3_generator.cpp | 165 +- src/parsing/amf3_generator.h | 32 + src/parsing/tags.cpp | 101 +- src/parsing/tags.h | 29 +- src/parsing/tags_stub.cpp | 6 - src/platforms/engineutils.cpp | 30 + src/platforms/engineutils.h | 11 +- src/plugin/npscriptobject.cpp | 7 +- src/plugin/plugin.cpp | 87 +- src/plugin/plugin.h | 12 +- src/scripting/abc.cpp | 289 ++- src/scripting/abc.h | 44 +- src/scripting/abc_codesynt.cpp | 25 +- src/scripting/abc_fast_interpreter.cpp | 87 +- src/scripting/abc_interpreter.cpp | 103 +- src/scripting/abc_opcodes.cpp | 429 ++-- src/scripting/abc_optimizer.cpp | 6 +- src/scripting/abctypes.h | 5 +- src/scripting/argconv.h | 8 +- src/scripting/class.cpp | 30 +- src/scripting/class.h | 126 +- .../flash/accessibility/flashaccessibility.cpp | 42 +- .../flash/accessibility/flashaccessibility.h | 19 +- src/scripting/flash/concurrent/Condition.cpp | 81 + .../flash/concurrent/Condition.h} | 30 +- .../Mutex.cpp} | 45 +- .../flash/concurrent/Mutex.h} | 31 +- src/scripting/flash/desktop/flashdesktop.cpp | 5 +- src/scripting/flash/display/BitmapData.cpp | 137 +- src/scripting/flash/display/BitmapData.h | 3 + src/scripting/flash/display/DisplayObject.cpp | 47 +- src/scripting/flash/display/DisplayObject.h | 5 +- src/scripting/flash/display/Graphics.cpp | 923 +++++++++ src/scripting/flash/display/Graphics.h | 103 + src/scripting/flash/display/GraphicsBitmapFill.cpp | 70 + .../display/GraphicsBitmapFill.h} | 48 +- .../GraphicsEndFill.cpp} | 32 +- .../flash/display/GraphicsEndFill.h} | 26 +- .../flash/display/GraphicsGradientFill.cpp | 96 + src/scripting/flash/display/GraphicsGradientFill.h | 55 + src/scripting/flash/display/GraphicsPath.cpp | 173 ++ .../UInteger.h => flash/display/GraphicsPath.h} | 54 +- src/scripting/flash/display/GraphicsShaderFill.cpp | 73 + .../GraphicsShaderFill.h} | 33 +- src/scripting/flash/display/GraphicsSolidFill.cpp | 63 + .../GraphicsSolidFill.h} | 29 +- src/scripting/flash/display/GraphicsStroke.cpp | 109 + .../UInteger.h => flash/display/GraphicsStroke.h} | 50 +- .../flash/display/GraphicsTrianglePath.cpp | 74 + .../display/GraphicsTrianglePath.h} | 47 +- .../flash/display/IGraphicsData.h} | 25 +- .../flash/display/IGraphicsFill.h} | 23 +- .../flash/display/IGraphicsPath.h} | 20 +- .../flash/display/IGraphicsStroke.h} | 20 +- src/scripting/flash/display/TokenContainer.cpp | 23 +- src/scripting/flash/display/TokenContainer.h | 4 +- src/scripting/flash/display/flashdisplay.cpp | 1006 +++------ src/scripting/flash/display/flashdisplay.h | 101 +- src/scripting/flash/errors/flasherrors.cpp | 21 +- src/scripting/flash/events/flashevents.cpp | 238 ++- src/scripting/flash/events/flashevents.h | 76 +- src/scripting/flash/external/ExternalInterface.cpp | 8 +- .../flashfilesystem.cpp} | 29 +- .../flashfilesystem.h} | 22 +- src/scripting/flash/filters/flashfilters.cpp | 321 ++- src/scripting/flash/filters/flashfilters.h | 111 +- src/scripting/flash/geom/flashgeom.cpp | 46 +- src/scripting/flash/geom/flashgeom.h | 23 +- src/scripting/flash/media/flashmedia.cpp | 151 +- src/scripting/flash/media/flashmedia.h | 34 +- .../NetStreamPlayOptions.cpp} | 41 +- .../flashsensors.h => net/NetStreamPlayOptions.h} | 34 +- .../NetStreamPlayTransitions.cpp} | 37 +- .../flash/net/NetStreamPlayTransitions.h} | 24 +- src/scripting/flash/net/URLRequestHeader.cpp | 3 +- src/scripting/flash/net/URLStream.cpp | 12 +- src/scripting/flash/net/URLStream.h | 1 + src/scripting/flash/net/XMLSocket.cpp | 3 +- src/scripting/flash/net/flashnet.cpp | 369 +++- src/scripting/flash/net/flashnet.h | 65 +- src/scripting/flash/printing/flashprinting.cpp | 69 + .../flashprinting.h} | 27 +- src/scripting/flash/sensors/flashsensors.cpp | 3 +- src/scripting/flash/sensors/flashsensors.h | 2 +- src/scripting/flash/system/flashsystem.cpp | 139 +- src/scripting/flash/system/flashsystem.h | 24 +- src/scripting/flash/text/flashtext.cpp | 629 +++++- src/scripting/flash/text/flashtext.h | 89 +- src/scripting/flash/text/flashtextengine.cpp | 333 ++- src/scripting/flash/text/flashtextengine.h | 123 +- .../flashaccessibility.cpp => ui/ContextMenu.cpp} | 35 +- .../{sensors/flashsensors.h => ui/ContextMenu.h} | 33 +- src/scripting/flash/ui/ContextMenuBuiltInItems.cpp | 57 + .../ContextMenuBuiltInItems.h} | 31 +- .../flash/ui/ContextMenuItem.cpp} | 36 +- .../flash/ui/ContextMenuItem.h} | 26 +- src/scripting/flash/ui/Keyboard.cpp | 9 +- src/scripting/flash/ui/Mouse.cpp | 75 + .../rtmputils.h => scripting/flash/ui/Mouse.h} | 28 +- .../flash/utils/{flashutils.cpp => ByteArray.cpp} | 1085 ++-------- src/scripting/flash/utils/ByteArray.h | 156 ++ src/scripting/flash/utils/Dictionary.cpp | 344 ++++ src/scripting/flash/utils/Dictionary.h | 64 + src/scripting/flash/utils/IntervalManager.cpp | 106 + .../IntervalManager.h} | 35 +- src/scripting/flash/utils/IntervalRunner.cpp | 72 + .../UInteger.h => flash/utils/IntervalRunner.h} | 55 +- src/scripting/flash/utils/Proxy.cpp | 251 +++ src/scripting/flash/utils/Proxy.h | 61 + src/scripting/flash/utils/Timer.cpp | 185 ++ .../{toplevel/UInteger.h => flash/utils/Timer.h} | 60 +- src/scripting/flash/utils/flashutils.cpp | 1892 +---------------- src/scripting/flash/utils/flashutils.h | 243 +-- src/scripting/flash/xml/flashxml.cpp | 10 +- src/scripting/toplevel/ASString.cpp | 119 +- src/scripting/toplevel/ASString.h | 7 + src/scripting/toplevel/Array.cpp | 370 +++- src/scripting/toplevel/Array.h | 30 +- src/scripting/toplevel/Boolean.cpp | 22 +- src/scripting/toplevel/Date.cpp | 28 +- src/scripting/toplevel/Date.h | 4 + src/scripting/toplevel/Error.cpp | 49 +- src/scripting/toplevel/Integer.cpp | 65 +- src/scripting/toplevel/Integer.h | 3 + src/scripting/toplevel/JSON.cpp | 774 +++++++ src/scripting/toplevel/JSON.h | 51 + src/scripting/toplevel/Math.cpp | 4 +- src/scripting/toplevel/Number.cpp | 227 +- src/scripting/toplevel/Number.h | 9 +- src/scripting/toplevel/RegExp.cpp | 12 +- src/scripting/toplevel/UInteger.cpp | 54 +- src/scripting/toplevel/UInteger.h | 3 + src/scripting/toplevel/Vector.cpp | 148 +- src/scripting/toplevel/Vector.h | 26 +- src/scripting/toplevel/XML.cpp | 2164 ++++++++++++++------ src/scripting/toplevel/XML.h | 103 +- src/scripting/toplevel/XMLList.cpp | 633 ++++-- src/scripting/toplevel/XMLList.h | 39 +- src/scripting/toplevel/toplevel.cpp | 281 ++- src/scripting/toplevel/toplevel.h | 66 +- src/swf.cpp | 58 +- src/swf.h | 3 + src/swftypes.cpp | 73 +- src/swftypes.h | 25 +- src/threading.cpp | 27 + src/threading.h | 10 + src/tiny_string.cpp | 398 ++++ src/tiny_string.h | 353 +--- tests/encodeURI_test.mxml | 67 + tests/make-tamarin | 121 +- tests/methodNamespace_test.mxml | 141 ++ tests/quit.as | 2 + tests/tests | 109 +- tools/langref_parser | 13 +- tools/mergeABCtoSWF | 134 ++ tools/pygil | 24 +- 189 files changed, 15747 insertions(+), 7560 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33dbb85..7e8c08b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # GCC 4.6+ is required, GCC_VERSION macro taken from GCC manual INCLUDE(CheckCSourceCompiles) -IF(CMAKE_COMPILER_IS_GNUCC) +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") CHECK_C_SOURCE_COMPILES(" #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #if GCC_VERSION < 40600 @@ -88,7 +88,7 @@ IF(CMAKE_COMPILER_IS_GNUCC) IF(NOT GCC_IS_4_6) MESSAGE(FATAL_ERROR "GCC 4.6+ is required.") ENDIF(NOT GCC_IS_4_6) -ENDIF(CMAKE_COMPILER_IS_GNUCC) +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Find put the path of the gnash executable, if available FIND_PROGRAM(GNASH_EXE_PATH NAMES gnash) @@ -114,31 +114,31 @@ SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/conf) INCLUDE(Pack) # If we're gcc, then use nasm to get fastpath. If MSVC, just use inline asm to get around # CMake issues -IF(CMAKE_COMPILER_IS_GNUCC) +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") INCLUDE(CMakeASM-NASMCompiler) -ENDIF(CMAKE_COMPILER_IS_GNUCC) +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$|^x86$") SET(i386 1) SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 32") # nasm for assembly optimizations - IF(CMAKE_COMPILER_IS_GNUCC) + IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ENABLE_LANGUAGE(ASM-NASM) - ENDIF(CMAKE_COMPILER_IS_GNUCC) + ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "unknown" AND ${CMAKE_SYSTEM} MATCHES "GNU-0.3") # GNU Hurd is i386 SET(i386 1) SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 32") # nasm for assembly optimizations - IF(CMAKE_COMPILER_IS_GNUCC) + IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ENABLE_LANGUAGE(ASM-NASM) ENDIF () ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86_64$|^amd64$") SET(x86_64 1) SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 64") # nasm for assembly optimizations - IF(CMAKE_COMPILER_IS_GNUCC) + IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ENABLE_LANGUAGE(ASM-NASM) - ENDIF(CMAKE_COMPILER_IS_GNUCC) + ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc") SET(ppc 1) SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None ppc") @@ -238,6 +238,15 @@ ENDIF(${LLVM_STRING_VERSION} VERSION_EQUAL 3.0) IF(${LLVM_STRING_VERSION} VERSION_GREATER 3.0) ADD_DEFINITIONS(-DLLVM_31) ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.0) +IF(${LLVM_STRING_VERSION} VERSION_GREATER 3.3) + ADD_DEFINITIONS(-DLLVM_34) +ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.3) +IF(${LLVM_STRING_VERSION} VERSION_GREATER 3.4) + ADD_DEFINITIONS(-DLLVM_35) +ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.4) +IF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) + ADD_DEFINITIONS(-DLLVM_36) +ENDIF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) INCLUDE(FindZLIB REQUIRED) INCLUDE(FindFreetype REQUIRED) IF(NOT(ENABLE_GLES2)) @@ -287,12 +296,17 @@ ENDIF(AUDIO_BACKEND) IF(ENABLE_LIBAVCODEC) pkg_check_modules(FFMPEG libavcodec libavutil libavformat) + pkg_check_modules(LIBAVRESAMPLE libavresample) IF(NOT(FFMPEG_FOUND)) INCLUDE(FindFFMpeg REQUIRED) ENDIF(NOT(FFMPEG_FOUND)) # Compatibility checks for ffmpeg deprecated functions INCLUDE(CheckFunctionExists REQUIRED) - SET(CMAKE_REQUIRED_FLAGS ${LIBAVCODEC_CFLAGS}) + INCLUDE(CheckCSourceCompiles) + SET(FFMPEG_FLAGS "${LIBAVCODEC_CFLAGS} ${LIBAVRESAMPLE_FLAGS}") + SET(FFMPEG_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIRS} ${LIBAVRESAMPLE_INCLUDE_DIRS}") + SET(FFMPEG_LIBRARIES "${FFMPEG_LIBRARIES};${LIBAVRESAMPLE_LIBRARIES}") + SET(CMAKE_REQUIRED_FLAGS ${FFMPEG_FLAGS}) SET(CMAKE_REQUIRED_INCLUDES ${FFMPEG_INCLUDE_DIRS}) SET(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES}) CHECK_FUNCTION_EXISTS(avcodec_decode_video2 HAVE_AVCODEC_DECODE_VIDEO2) @@ -303,7 +317,8 @@ IF(ENABLE_LIBAVCODEC) CHECK_FUNCTION_EXISTS(avcodec_open2 HAVE_AVCODEC_OPEN2) CHECK_FUNCTION_EXISTS(avformat_close_input HAVE_AVFORMAT_CLOSE_INPUT) CHECK_FUNCTION_EXISTS(avformat_find_stream_info HAVE_AVFORMAT_FIND_STREAM_INFO) - + CHECK_C_SOURCE_COMPILES("#include \nint main() { enum AVCodecID c; return 0; }" HAVE_AVCODECID) + SET(CMAKE_REQUIRED_FLAGS) SET(CMAKE_REQUIRED_INCLUDES) SET(CMAKE_REQUIRED_LIBRARIES) @@ -331,6 +346,12 @@ IF(ENABLE_LIBAVCODEC) IF(HAVE_AVFORMAT_FIND_STREAM_INFO) ADD_DEFINITIONS(-DHAVE_AVFORMAT_FIND_STREAM_INFO) ENDIF(HAVE_AVFORMAT_FIND_STREAM_INFO) + IF(HAVE_AVCODECID) + ADD_DEFINITIONS(-DHAVE_AVCODECID) + ENDIF(HAVE_AVCODECID) + IF(LIBAVRESAMPLE_FOUND) + ADD_DEFINITIONS(-DHAVE_LIBAVRESAMPLE) + ENDIF(LIBAVRESAMPLE_FOUND) ADD_DEFINITIONS(-DENABLE_LIBAVCODEC) ENDIF(ENABLE_LIBAVCODEC) @@ -372,7 +393,7 @@ IF(ENABLE_LIBAVCODEC) SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${FFMPEG_LIBRARIES}) ENDIF(ENABLE_LIBAVCODEC) -IF(CMAKE_COMPILER_IS_GNUCC) +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") IF(MINGW) SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed,--no-undefined -mthreads ${CMAKE_EXE_LINKER_FLAGS}") SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed,--no-undefined,--enable-stdcall-fixup -mthreads ${CMAKE_SHARED_LINKER_FLAGS}") @@ -382,7 +403,13 @@ IF(CMAKE_COMPILER_IS_GNUCC) ENDIF() SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s") SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-s") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined ${CMAKE_EXE_LINKER_FLAGS}") + SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed,-z,noexecstack,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}") + SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s") + SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-s") +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") LINK_DIRECTORIES(${LLVM_LIB_DIR}) @@ -413,13 +440,13 @@ IF(ENABLE_MEMORY_USAGE_PROFILING) ENDIF(ENABLE_MEMORY_USAGE_PROFILING) # Compiler defaults flags for different profiles -IF(CMAKE_COMPILER_IS_GNUCC) +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") IF(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mms-bitfields -mthreads -fexceptions -Wall -Wnon-virtual-dtor -Woverloaded-virtual -pipe -std=c++0x -Wdisabled-optimization -Wextra -Wno-unused-parameter -Wno-invalid-offsetof") ELSE() SET(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wall -Wnon-virtual-dtor -Woverloaded-virtual -pipe -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -Wdisabled-optimization -Wextra -Wno-unused-parameter -Wno-invalid-offsetof") + "${CMAKE_CXX_FLAGS} -Wall -Wnon-virtual-dtor -Woverloaded-virtual -pipe -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -Wdisabled-optimization -Wextra -Wno-unused-parameter -Wno-invalid-offsetof") ENDIF() SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DEXPENSIVE_DEBUG") SET(CMAKE_CXX_FLAGS_PROFILE "-g -pg -O2") @@ -427,7 +454,18 @@ IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG") SET(CMAKE_CXX_FLAGS_LEANDEBUG "-g -O2") ADD_DEFINITIONS(-DLS_DATADIR="${LSDATADIR}" -DGNASH_PATH="${GNASH_EXE_PATH}" -DPRIVATELIBDIR="${PRIVATELIBDIR}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + SET(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -Wall -Wnon-virtual-dtor -Woverloaded-virtual -pipe -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -Wdisabled-optimization -Wextra -Wno-unused-parameter -Wno-invalid-offsetof") + SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DEXPENSIVE_DEBUG") + SET(CMAKE_CXX_FLAGS_PROFILE "-g -pg -O2") + SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG") + SET(CMAKE_CXX_FLAGS_LEANDEBUG "-g -O2") + ADD_DEFINITIONS(-DLS_DATADIR="${LSDATADIR}" -DGNASH_PATH="${GNASH_EXE_PATH}" -DPRIVATELIBDIR="${PRIVATELIBDIR}") + ADD_DEFINITIONS(-DUSE_CLANG) +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") IF(MSVC) ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DVPCOMPAT -DPTW32_STATIC_LIB -DPCRE_STATIC) @@ -445,11 +483,16 @@ IF(HAVE_ATOMIC) ENDIF(HAVE_ATOMIC) # Setting the output directories, so we can build all profiles without mixmatching -IF(CMAKE_COMPILER_IS_GNUCC) +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/bin") + SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}") + #SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/objs/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}" CACHE PATH "Static libraries output directory") +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/bin") SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}") #SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/objs/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}" CACHE PATH "Static libraries output directory") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") #Install icons and desktop file if(UNIX) diff --git a/ChangeLog b/ChangeLog index 3920617..fb7831b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ lightspark: An open source flash player implementation +Version NEXT: + + * Support LLVM up to version 3.6 + * fix event dispatcher handling + * several fixes for object initialization + * partially implement AMF0 decoding + * complete rework of XML subsystem + * Support embedded audio + * Implement JSON parsing + Version 0.7.2: * Improved image support: alpha in palettes, abbreviated JPEGs diff --git a/README b/README index ec64d4a..957ac80 100644 --- a/README +++ b/README @@ -35,15 +35,20 @@ DEBUG MODE: To enable debug mode change the cmake command like this: 4b) cmake -DCMAKE_BUILD_TYPE=Debug -CMAKE_BUILD_TYPE available: Debug Release RelWithDebInfo Profile Sound -support may be disabled using the following option: -DENABLE_SOUND=0 -The audio backend can be set using -DAUDIO_BACKEND= -(default is pulseaudio) +CMAKE_BUILD_TYPE available: Debug LeanDebug Release RelWithDebInfo Profile + +Sound support may be disabled using the following option: +-DENABLE_SOUND=0 The audio backend can be set using +-DAUDIO_BACKEND= (default is pulseaudio) EXECUTION ========= Using `make install`, lightspark is installed in the system wide + +Browser plugin +-------------- + Firefox plugin path and Firefox should show it in the about:plugins list and in the Tools->Add-ons->Plugins window. @@ -57,6 +62,14 @@ Firefox is not able to deal very well with multiple plugins for the same MIME type. If you only see a black box where a flash app should be try to remove any other flash plugin you have installed. +Command line +------------ + +The command line version of Lightspark can play a local SWF file. +Execution: lightspark file.swf + +Type `lightspark` to see all command line options. + Keyboard shortcuts ------------------ diff --git a/conf/FindFFMpeg.cmake b/conf/FindFFMpeg.cmake index 2b4dd98..8246c15 100644 --- a/conf/FindFFMpeg.cmake +++ b/conf/FindFFMpeg.cmake @@ -23,7 +23,11 @@ FIND_LIBRARY(FFMPEG_AVFORMAT_LIBRARY NAMES avformat ) -SET(FFMPEG_LIBRARY ${FFMPEG_AVCODEC_LIBRARY} ${FFMPEG_AVUTIL_LIBRARY} ${FFMPEG_AVFORMAT_LIBRARY}) +FIND_LIBRARY(FFMPEG_AVRESAMPLE_LIBRARY NAMES + avresample +) + +SET(FFMPEG_LIBRARY ${FFMPEG_AVCODEC_LIBRARY} ${FFMPEG_AVUTIL_LIBRARY} ${FFMPEG_AVFORMAT_LIBRARY} ${FFMPEG_AVRESAMPLE_LIBRARY}) MARK_AS_ADVANCED(FFMPEG_LIBRARY) # handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE if diff --git a/conf/FindFreetype.cmake b/conf/FindFreetype.cmake index a04d185..001ce35 100644 --- a/conf/FindFreetype.cmake +++ b/conf/FindFreetype.cmake @@ -52,9 +52,13 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h /sw/include /opt/local/include /usr/freeware/include + PATH_SUFFIXES freetype2 ) -FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h +FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 + NAMES + freetype/config/ftheader.h + config/ftheader.h HINTS $ENV{FREETYPE_DIR}/include/freetype2 PATHS diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake index 7bd52e2..51b776c 100644 --- a/conf/FindLLVM.cmake +++ b/conf/FindLLVM.cmake @@ -51,6 +51,9 @@ else (LLVM_INCLUDE_DIR) /usr/lib/llvm-2.8/bin /usr/lib/llvm-2.9/bin /usr/lib/llvm-3.0/bin + /usr/lib/llvm-3.1/bin + /usr/lib/llvm-3.2/bin + /usr/lib/llvm-3.3/bin ) find_program(LLVM_GCC_EXECUTABLE @@ -147,6 +150,7 @@ else (LLVM_INCLUDE_DIR) exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --libdir OUTPUT_VARIABLE LLVM_LIB_DIR ) #MESSAGE(STATUS "LLVM lib dir: " ${LLVM_LIB_DIR}) exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIR ) + #MESSAGE(STATUS "LLVM include dir: " ${LLVM_INCLUDE_DIR}) INCLUDE(CheckIncludeFileCXX) set(CMAKE_REQUIRED_INCLUDES ${LLVM_INCLUDE_DIR}) @@ -158,7 +162,7 @@ else (LLVM_INCLUDE_DIR) ENDIF(HAVE_SUPPORT_TARGETSELECT_H) set(CMAKE_REQUIRED_INCLUDES ${LLVM_INCLUDE_DIR}) - set(CMAKE_REQUIRED_DEFINITIONS -D__STDC_LIMIT_MACROS=1 -D__STDC_CONSTANT_MACROS=1) + set(CMAKE_REQUIRED_DEFINITIONS -D__STDC_LIMIT_MACROS=1 -D__STDC_CONSTANT_MACROS=1 -std=c++11) check_include_file_cxx("llvm/IRBuilder.h" HAVE_IRBUILDER_H) unset(CMAKE_REQUIRED_INCLUDES) MESSAGE(STATUS "HAVE_IRBUILDER_H: " ${HAVE_IRBUILDER_H}) @@ -168,23 +172,48 @@ else (LLVM_INCLUDE_DIR) set(CMAKE_REQUIRED_INCLUDES ${LLVM_INCLUDE_DIR}) check_include_file_cxx("llvm/DataLayout.h" HAVE_DATALAYOUT_H) + check_include_file_cxx("llvm/IR/DataLayout.h" HAVE_IR_DATALAYOUT_H) + check_include_file_cxx("llvm/IR/Verifier.h" HAVE_IR_VERIFIER_H) unset(CMAKE_REQUIRED_INCLUDES) MESSAGE(STATUS "HAVE_DATALAYOUT_H: " ${HAVE_DATALAYOUT_H}) + MESSAGE(STATUS "HAVE_IR_DATALAYOUT_H: " ${HAVE_IR_DATALAYOUT_H}) + MESSAGE(STATUS "HAVE_IR_VERIFIER_H: " ${HAVE_IR_VERIFIER_H}) IF(HAVE_DATALAYOUT_H) ADD_DEFINITIONS(-DHAVE_DATALAYOUT_H) ENDIF(HAVE_DATALAYOUT_H) + IF(HAVE_IR_DATALAYOUT_H) + ADD_DEFINITIONS(-DHAVE_IR_DATALAYOUT_H) + ENDIF(HAVE_IR_DATALAYOUT_H) + IF(HAVE_IR_VERIFIER_H) + ADD_DEFINITIONS(-DHAVE_IR_VERIFIER_H) + ENDIF(HAVE_IR_VERIFIER_H) exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS ) MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS}) exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS ) MESSAGE(STATUS "LLVM LD flags: " ${LLVM_LDFLAGS}) - FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "core ipa ipo instrumentation bitreader bitwriter linker" LLVM_LIBS_CORE LLVM_LIBS_CORE_OBJECTS ) + exec_program( ${LLVM_CONFIG_EXECUTABLE} ARGS --system-libs OUTPUT_VARIABLE LLVM_SYSTEM_LIBS RETURN_VALUE LLVM_SYSTEM_LIBS_FAILED) + if(LLVM_SYSTEM_LIBS_FAILED) + SET(LLVM_SYSTEM_LIBS "") + endif(LLVM_SYSTEM_LIBS_FAILED) + FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "core ipa ipo instrumentation bitreader bitwriter linker" LLVM_LIBS_CORE_ONLY LLVM_LIBS_CORE_OBJECTS ) + SET(LLVM_LIBS_CORE ${LLVM_LIBS_CORE_ONLY} ${LLVM_SYSTEM_LIBS}) + UNSET(LLVM_LIBS_CORE_ONLY) + UNSET(LLVM_SYSTEM_LIBS_FAILED) MESSAGE(STATUS "LLVM core libs: " ${LLVM_LIBS_CORE}) + IF(${LLVM_STRING_VERSION} VERSION_GREATER 3.5) + IF(APPLE AND UNIVERSAL) + FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "engine native x86 PowerPC ARM" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS ) + ELSE(APPLE AND UNIVERSAL) + FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "engine native" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS ) + ENDIF(APPLE AND UNIVERSAL) + ELSE(${LLVM_STRING_VERSION} VERSION_GREATER 3.5) IF(APPLE AND UNIVERSAL) FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "jit native x86 PowerPC ARM" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS ) ELSE(APPLE AND UNIVERSAL) FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "jit native" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS ) ENDIF(APPLE AND UNIVERSAL) + ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.5) MESSAGE(STATUS "LLVM JIT libs: " ${LLVM_LIBS_JIT}) MESSAGE(STATUS "LLVM JIT objs: " ${LLVM_LIBS_JIT_OBJECTS}) diff --git a/debian/control b/debian/control index 6dfcb9b..0ef2874 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: lightspark Section: utils Priority: optional Maintainer: Alessandro Pignotti -Build-Depends: g++ (>=4.5), gnash, cmake, cdbs, nasm, debhelper (>= 7), llvm-3.0-dev, libgl1-mesa-dev, libxext-dev, libcurl4-gnutls-dev | libcurl4-openssl-dev, libxml2-dev, zlib1g-dev, libavcodec-dev, libpcre3-dev, libglew1.5-dev, libboost-filesystem-dev, libboost-system-dev, libxml++2.6-dev (>= 2.33.1), libcairo2-dev, libgtk2.0-dev, libjpeg8-dev, libavformat-dev, libpango1.0-dev, libpulse-dev, librtmp-dev, liblzma-dev +Build-Depends: g++ (>=4.5), gnash, cmake, cdbs, nasm, debhelper (>= 7), llvm-dev, libgl1-mesa-dev, libxext-dev, libcurl4-gnutls-dev | libcurl4-openssl-dev, libxml2-dev, zlib1g-dev, libavcodec-dev, libpcre3-dev, libglew1.5-dev, libboost-filesystem-dev, libboost-system-dev, libxml++2.6-dev (>= 2.33.1), libcairo2-dev, libgtk2.0-dev, libjpeg8-dev, libavformat-dev, libavresample-dev, libpango1.0-dev, libpulse-dev, librtmp-dev, liblzma-dev, libfreetype6-dev, libpng-dev Standards-Version: 3.8.4 Homepage: http://lightspark.sf.net Vcs-git: git://github.com/alexp-sssup/lightspark.git diff --git a/docs/man/lightspark.1 b/docs/man/lightspark.1 index 83f3526..ee38e95 100644 --- a/docs/man/lightspark.1 +++ b/docs/man/lightspark.1 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH LIGHTSPARK 1 "May 29, 2010" +.TH LIGHTSPARK 1 "November 9, 2013" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -19,15 +19,15 @@ lightspark \- a free Flash player .SH SYNOPSIS .B lightspark -[\-\-url|\-u http://loader.url/file.swf] [\-\-disable-interpreter|\-ni] [\-\-enable\-jit|\-j] [\-\-log\-level|\-l 0-4] [\-\-parameters\-file|\-p params-file] [\-\-version|\-v] file.swf +[\-\-url|\-u http://loader.url/file.swf] [\-\-air] [\-\-disable-interpreter|\-ni] [\-\-enable-fast-interpreter|\-fi] [\-\-enable\-jit|\-j] [\-\-log\-level|\-l 0-4] [\-\-parameters\-file|\-p params-file] [\-\-profiling-output|\-o] [\-\-security-sandbox|\-s ] [\-\-exit-on-error] [\-\-HTTP-cookies ] [\-\-version|\-v] file.swf .SH DESCRIPTION .B Lightspark is a free, modern Flash Player implementation, this documents the options accepted by the standalone version of the program. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invoke bold face and italics, .\" respectively. -The player is currently in Beta, support for any particular SWF file is not guaranteed +The player is currently in Beta, support for any particular SWF file is not guaranteed. .PP You might wish to see the project website at http://lightspark.sf.net or our technical blog at http://allievi.sssup.it/techblog @@ -41,6 +41,10 @@ Pretends to be loading the file from an url .IP Disable the ActionScript interpreter .HP +\fB\-\-enable-fast-interpreter\fP +.IP +Enable an experimental optimized ActionScript interpreter +.HP \fB\-\-enable-jit\fP, \fB\-j\fP .IP Enable the ActionScript JIT compilation engine @@ -56,6 +60,22 @@ Load flash parameters from file. Every odd line will be interpreted as a paramet \fB\-\-profiling-output\fP profiling-file, \fB\-o\fP profiling-file .IP Output profiling data to profiling-file in a callgrind/KCachegrind compatible format +.HP +\fB\-\-security-sandbox\fP type, \fB\-s\fP type +.IP +Run a Flash file in a given sandbox to control access to network and local files. The possible types are: remote (default), local-with-filesystem, local-with-networking, local-trusted. +.HP +\fB\-\-exit-on-error\fP +.IP +Exit as soon as the first error is encountered. +.HP +\fB\-\-HTTP-cookies\fP cookie +.IP +Set cookie to be used in HTTP requests. +.HP +\fB\-\-air\fP +.IP +Run as an AIR application: grant permission to access both local files and network, and enable AIR APIs. .HP \fB\-\-version\fP, \fB\-v\fP .IP diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e86fb44..2f9c824 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,6 +47,7 @@ SET(LIBSPARK_SOURCES backends/rendering_context.cpp backends/rtmputils.cpp backends/security.cpp + backends/streamcache.cpp backends/urlutils.cpp backends/xml_support.cpp parsing/amf3_generator.cpp @@ -65,6 +66,8 @@ SET(LIBSPARK_SOURCES scripting/abc_opcodes.cpp scripting/abctypes.cpp scripting/flash/accessibility/flashaccessibility.cpp + scripting/flash/concurrent/Mutex.cpp + scripting/flash/concurrent/Condition.cpp scripting/flash/desktop/flashdesktop.cpp scripting/flash/display/BitmapContainer.cpp scripting/flash/display/BitmapData.cpp @@ -72,22 +75,45 @@ SET(LIBSPARK_SOURCES scripting/flash/display/IBitmapDrawable.cpp scripting/flash/display/flashdisplay.cpp scripting/flash/display/TokenContainer.cpp + scripting/flash/display/Graphics.cpp + scripting/flash/display/GraphicsBitmapFill.cpp + scripting/flash/display/GraphicsEndFill.cpp + scripting/flash/display/GraphicsGradientFill.cpp + scripting/flash/display/GraphicsPath.cpp + scripting/flash/display/GraphicsShaderFill.cpp + scripting/flash/display/GraphicsSolidFill.cpp + scripting/flash/display/GraphicsStroke.cpp + scripting/flash/display/GraphicsTrianglePath.cpp scripting/flash/events/flashevents.cpp scripting/flash/external/ExternalInterface.cpp scripting/flash/filters/flashfilters.cpp + scripting/flash/filesystem/flashfilesystem.cpp scripting/flash/geom/flashgeom.cpp scripting/flash/media/flashmedia.cpp scripting/flash/net/flashnet.cpp scripting/flash/net/URLRequestHeader.cpp scripting/flash/net/URLStream.cpp scripting/flash/net/XMLSocket.cpp + scripting/flash/net/NetStreamPlayOptions.cpp + scripting/flash/net/NetStreamPlayTransitions.cpp + scripting/flash/printing/flashprinting.cpp scripting/flash/errors/flasherrors.cpp scripting/flash/sensors/flashsensors.cpp scripting/flash/system/flashsystem.cpp scripting/flash/text/flashtext.cpp scripting/flash/text/flashtextengine.cpp scripting/flash/utils/flashutils.cpp + scripting/flash/utils/ByteArray.cpp + scripting/flash/utils/Dictionary.cpp + scripting/flash/utils/Proxy.cpp + scripting/flash/utils/Timer.cpp + scripting/flash/utils/IntervalManager.cpp + scripting/flash/utils/IntervalRunner.cpp scripting/flash/ui/Keyboard.cpp + scripting/flash/ui/Mouse.cpp + scripting/flash/ui/ContextMenu.cpp + scripting/flash/ui/ContextMenuItem.cpp + scripting/flash/ui/ContextMenuBuiltInItems.cpp scripting/flash/xml/flashxml.cpp scripting/toplevel/Array.cpp scripting/toplevel/ASString.cpp @@ -95,6 +121,7 @@ SET(LIBSPARK_SOURCES scripting/toplevel/Date.cpp scripting/toplevel/Error.cpp scripting/toplevel/Integer.cpp + scripting/toplevel/JSON.cpp scripting/toplevel/Math.cpp scripting/toplevel/Number.cpp scripting/toplevel/RegExp.cpp diff --git a/src/allclasses.cpp b/src/allclasses.cpp index 8b9a47c..e3c559f 100644 --- a/src/allclasses.cpp +++ b/src/allclasses.cpp @@ -19,24 +19,50 @@ #include "scripting/toplevel/ASString.h" #include "scripting/toplevel/Date.h" +#include "scripting/toplevel/JSON.h" #include "scripting/toplevel/Math.h" #include "scripting/toplevel/RegExp.h" #include "scripting/toplevel/Vector.h" #include "scripting/toplevel/XML.h" #include "scripting/toplevel/XMLList.h" #include "scripting/flash/accessibility/flashaccessibility.h" +#include "scripting/flash/concurrent/Mutex.h" +#include "scripting/flash/concurrent/Condition.h" #include "scripting/flash/desktop/flashdesktop.h" #include "scripting/flash/display/flashdisplay.h" #include "scripting/flash/display/BitmapData.h" +#include "scripting/flash/display/Graphics.h" +#include "scripting/flash/display/GraphicsBitmapFill.h" +#include "scripting/flash/display/GraphicsEndFill.h" +#include "scripting/flash/display/GraphicsGradientFill.h" +#include "scripting/flash/display/GraphicsPath.h" +#include "scripting/flash/display/GraphicsShaderFill.h" +#include "scripting/flash/display/GraphicsSolidFill.h" +#include "scripting/flash/display/GraphicsStroke.h" +#include "scripting/flash/display/GraphicsTrianglePath.h" +#include "scripting/flash/display/IGraphicsData.h" +#include "scripting/flash/display/IGraphicsFill.h" +#include "scripting/flash/display/IGraphicsPath.h" +#include "scripting/flash/display/IGraphicsStroke.h" #include "scripting/flash/events/flashevents.h" +#include "scripting/flash/filesystem/flashfilesystem.h" #include "scripting/flash/filters/flashfilters.h" #include "scripting/flash/net/flashnet.h" #include "scripting/flash/net/URLRequestHeader.h" #include "scripting/flash/net/URLStream.h" #include "scripting/flash/net/XMLSocket.h" +#include "scripting/flash/net/NetStreamPlayOptions.h" +#include "scripting/flash/net/NetStreamPlayTransitions.h" +#include "scripting/flash/printing/flashprinting.h" #include "scripting/flash/system/flashsystem.h" #include "scripting/flash/sensors/flashsensors.h" #include "scripting/flash/utils/flashutils.h" +#include "scripting/flash/utils/ByteArray.h" +#include "scripting/flash/utils/Dictionary.h" +#include "scripting/flash/utils/Proxy.h" +#include "scripting/flash/utils/Timer.h" +#include "scripting/flash/utils/IntervalManager.h" +#include "scripting/flash/utils/IntervalRunner.h" #include "scripting/flash/geom/flashgeom.h" #include "scripting/flash/external/ExternalInterface.h" #include "scripting/flash/media/flashmedia.h" @@ -45,6 +71,10 @@ #include "scripting/flash/text/flashtext.h" #include "scripting/flash/text/flashtextengine.h" #include "scripting/flash/ui/Keyboard.h" +#include "scripting/flash/ui/Mouse.h" +#include "scripting/flash/ui/ContextMenu.h" +#include "scripting/flash/ui/ContextMenuItem.h" +#include "scripting/flash/ui/ContextMenuBuiltInItems.h" using namespace lightspark; diff --git a/src/allclasses.h b/src/allclasses.h index dbb3a2c..27fc777 100644 --- a/src/allclasses.h +++ b/src/allclasses.h @@ -28,6 +28,7 @@ REGISTER_CLASS_NAME(Date,"") REGISTER_CLASS_NAME2(Global,"global","") REGISTER_CLASS_NAME2(IFunction,"Function","") REGISTER_CLASS_NAME2(Integer,"int","") +REGISTER_CLASS_NAME(JSON,"") REGISTER_CLASS_NAME(Math,"") REGISTER_CLASS_NAME(Namespace,"") REGISTER_CLASS_NAME(Number,"") @@ -52,9 +53,14 @@ REGISTER_CLASS_NAME(XMLList,"") REGISTER_CLASS_NAME(Vector,"__AS3__.vec") //Accessibility +REGISTER_CLASS_NAME(Accessibility,"flash.accessibility") REGISTER_CLASS_NAME(AccessibilityProperties,"flash.accessibility") REGISTER_CLASS_NAME(AccessibilityImplementation,"flash.accessibility") +//Concurrent +REGISTER_CLASS_NAME(ASMutex,"flash.concurrent") +REGISTER_CLASS_NAME(ASCondition,"flash.concurrent") + //Desktop (AIR) REGISTER_CLASS_NAME(NativeApplication,"flash.desktop") @@ -69,6 +75,20 @@ REGISTER_CLASS_NAME(DisplayObjectContainer,"flash.display") REGISTER_CLASS_NAME(FrameLabel,"flash.display") REGISTER_CLASS_NAME(GradientType,"flash.display") REGISTER_CLASS_NAME(Graphics,"flash.display") +REGISTER_CLASS_NAME(GraphicsBitmapFill,"flash.display") +REGISTER_CLASS_NAME(GraphicsEndFill,"flash.display") +REGISTER_CLASS_NAME(GraphicsGradientFill,"flash.display") +REGISTER_CLASS_NAME(GraphicsPath,"flash.display") +REGISTER_CLASS_NAME(GraphicsPathCommand,"flash.display") +REGISTER_CLASS_NAME(GraphicsPathWinding,"flash.display") +REGISTER_CLASS_NAME(GraphicsShaderFill,"flash.display") +REGISTER_CLASS_NAME(GraphicsSolidFill,"flash.display") +REGISTER_CLASS_NAME(GraphicsStroke,"flash.display") +REGISTER_CLASS_NAME(GraphicsTrianglePath,"flash.display") +REGISTER_CLASS_NAME(IGraphicsData,"flash.display") +REGISTER_CLASS_NAME(IGraphicsFill,"flash.display") +REGISTER_CLASS_NAME(IGraphicsPath,"flash.display") +REGISTER_CLASS_NAME(IGraphicsStroke,"flash.display") REGISTER_CLASS_NAME(IBitmapDrawable,"flash.display") REGISTER_CLASS_NAME(InteractiveObject,"flash.display") REGISTER_CLASS_NAME(InterpolationMethod,"flash.display") @@ -91,6 +111,7 @@ REGISTER_CLASS_NAME(StageQuality,"flash.display") //Events REGISTER_CLASS_NAME(AsyncErrorEvent,"flash.events") +REGISTER_CLASS_NAME(ContextMenuEvent,"flash.events") REGISTER_CLASS_NAME(DRMErrorEvent,"flash.events") REGISTER_CLASS_NAME(DRMStatusEvent,"flash.events") REGISTER_CLASS_NAME(DataEvent,"flash.events") @@ -100,6 +121,7 @@ REGISTER_CLASS_NAME(EventDispatcher,"flash.events") REGISTER_CLASS_NAME(EventPhase,"flash.events") REGISTER_CLASS_NAME(FocusEvent,"flash.events") REGISTER_CLASS_NAME(FullScreenEvent,"flash.events") +REGISTER_CLASS_NAME(GestureEvent,"flash.events") REGISTER_CLASS_NAME(HTTPStatusEvent,"flash.events") REGISTER_CLASS_NAME(IEventDispatcher,"flash.events") REGISTER_CLASS_NAME(IOErrorEvent,"flash.events") @@ -107,6 +129,7 @@ REGISTER_CLASS_NAME(InvokeEvent,"flash.events") REGISTER_CLASS_NAME(KeyboardEvent,"flash.events") REGISTER_CLASS_NAME(MouseEvent,"flash.events") REGISTER_CLASS_NAME(NetStatusEvent,"flash.events") +REGISTER_CLASS_NAME(PressAndTapGestureEvent,"flash.events") REGISTER_CLASS_NAME(ProgressEvent,"flash.events") REGISTER_CLASS_NAME(SecurityErrorEvent,"flash.events") REGISTER_CLASS_NAME(StageVideoEvent,"flash.events") @@ -114,14 +137,32 @@ REGISTER_CLASS_NAME(StageVideoAvailabilityEvent,"flash.events") REGISTER_CLASS_NAME(StatusEvent,"flash.events") REGISTER_CLASS_NAME(TextEvent,"flash.events") REGISTER_CLASS_NAME(TimerEvent,"flash.events") +REGISTER_CLASS_NAME(TouchEvent,"flash.events") +REGISTER_CLASS_NAME(TransformGestureEvent,"flash.events") +REGISTER_CLASS_NAME(UncaughtErrorEvent,"flash.events") +REGISTER_CLASS_NAME(UncaughtErrorEvents,"flash.events") +REGISTER_CLASS_NAME(VideoEvent,"flash.events") //External interface (browser interaction) REGISTER_CLASS_NAME(ExternalInterface,"flash.external") +//filesystem +REGISTER_CLASS_NAME(FileStream,"flash.filesystem") + //Filters REGISTER_CLASS_NAME(BitmapFilter,"flash.filters") +REGISTER_CLASS_NAME(BitmapFilterQuality,"flash.filters") REGISTER_CLASS_NAME(DropShadowFilter,"flash.filters") REGISTER_CLASS_NAME(GlowFilter,"flash.filters") +REGISTER_CLASS_NAME(GradientGlowFilter,"flash.filters") +REGISTER_CLASS_NAME(BevelFilter,"flash.filters") +REGISTER_CLASS_NAME(ColorMatrixFilter,"flash.filters") +REGISTER_CLASS_NAME(BlurFilter,"flash.filters") +REGISTER_CLASS_NAME(ConvolutionFilter,"flash.filters") +REGISTER_CLASS_NAME(DisplacementMapFilter,"flash.filters") +REGISTER_CLASS_NAME(GradientBevelFilter,"flash.filters") +REGISTER_CLASS_NAME(ShaderFilter,"flash.filters") + //Geom REGISTER_CLASS_NAME(ColorTransform,"flash.geom") @@ -130,6 +171,8 @@ REGISTER_CLASS_NAME(Point,"flash.geom") REGISTER_CLASS_NAME2(Rectangle,"Rectangle","flash.geom") REGISTER_CLASS_NAME(Transform,"flash.geom") REGISTER_CLASS_NAME(Vector3D,"flash.geom") +REGISTER_CLASS_NAME(Matrix3D,"flash.geom") +REGISTER_CLASS_NAME(PerspectiveProjection,"flash.geom") //Media REGISTER_CLASS_NAME(Sound,"flash.media") @@ -142,11 +185,18 @@ REGISTER_CLASS_NAME(Video,"flash.media") REGISTER_CLASS_NAME(VideoStatus,"flash.media") //Net +REGISTER_CLASS_NAME(LocalConnection,"flash.net") REGISTER_CLASS_NAME(NetConnection,"flash.net") +REGISTER_CLASS_NAME(NetGroup,"flash.net") REGISTER_CLASS_NAME(NetStream,"flash.net") +REGISTER_CLASS_NAME(NetStreamAppendBytesAction,"flash.net") +REGISTER_CLASS_NAME(NetStreamPlayTransitions,"flash.net") +REGISTER_CLASS_NAME(NetStreamPlayOptions,"flash.net") REGISTER_CLASS_NAME(ObjectEncoding,"flash.net") REGISTER_CLASS_NAME(Responder,"flash.net") REGISTER_CLASS_NAME(SharedObject,"flash.net") +REGISTER_CLASS_NAME(SharedObjectFlushStatus,"flash.net") +REGISTER_CLASS_NAME(ASSocket,"flash.net") REGISTER_CLASS_NAME(URLLoader,"flash.net") REGISTER_CLASS_NAME(URLLoaderDataFormat,"flash.net") REGISTER_CLASS_NAME(URLRequest,"flash.net") @@ -156,6 +206,13 @@ REGISTER_CLASS_NAME(URLStream,"flash.net") REGISTER_CLASS_NAME(URLVariables,"flash.net") REGISTER_CLASS_NAME(XMLSocket,"flash.net") +REGISTER_CLASS_NAME(DRMManager,"flash.net.drm") + +//Printing +REGISTER_CLASS_NAME(PrintJob,"flash.printing") +REGISTER_CLASS_NAME(PrintJobOptions,"flash.printing") +REGISTER_CLASS_NAME(PrintJobOrientation,"flash.printing") + //Errors REGISTER_CLASS_NAME(EOFError,"flash.errors") REGISTER_CLASS_NAME(IOError,"flash.errors") @@ -175,6 +232,7 @@ REGISTER_CLASS_NAME(LoaderContext,"flash.system") REGISTER_CLASS_NAME(Security,"flash.system") REGISTER_CLASS_NAME(SecurityDomain,"flash.system") REGISTER_CLASS_NAME(System,"flash.system") +REGISTER_CLASS_NAME(ASWorker,"flash.system") //Text REGISTER_CLASS_NAME2(ASFont,"Font","flash.text") @@ -189,18 +247,28 @@ REGISTER_CLASS_NAME(TextFieldAutoSize,"flash.text") REGISTER_CLASS_NAME(TextFieldType,"flash.text") REGISTER_CLASS_NAME(TextFormat,"flash.text") REGISTER_CLASS_NAME(TextFormatAlign,"flash.text") +REGISTER_CLASS_NAME(TextInteractionMode,"flash.text") REGISTER_CLASS_NAME(TextLineMetrics,"flash.text") REGISTER_CLASS_NAME(StaticText,"flash.text") REGISTER_CLASS_NAME(StyleSheet,"flash.text") //Text engine REGISTER_CLASS_NAME(ContentElement,"flash.text.engine") +REGISTER_CLASS_NAME(EastAsianJustifier,"flash.text.engine") REGISTER_CLASS_NAME(ElementFormat,"flash.text.engine") REGISTER_CLASS_NAME(FontDescription,"flash.text.engine") +REGISTER_CLASS_NAME(FontMetrics,"flash.text.engine") +REGISTER_CLASS_NAME(FontLookup,"flash.text.engine") REGISTER_CLASS_NAME(FontWeight,"flash.text.engine") +REGISTER_CLASS_NAME(Kerning,"flash.text.engine") +REGISTER_CLASS_NAME(LineJustification,"flash.text.engine") +REGISTER_CLASS_NAME(SpaceJustifier,"flash.text.engine") +REGISTER_CLASS_NAME(TextBaseline,"flash.text.engine") REGISTER_CLASS_NAME(TextBlock,"flash.text.engine") REGISTER_CLASS_NAME(TextElement,"flash.text.engine") +REGISTER_CLASS_NAME(TextJustifier,"flash.text.engine") REGISTER_CLASS_NAME(TextLine,"flash.text.engine") +REGISTER_CLASS_NAME(TextLineValidity,"flash.text.engine") //Utils REGISTER_CLASS_NAME(ByteArray,"flash.utils") @@ -216,6 +284,10 @@ REGISTER_CLASS_NAME(Timer,"flash.utils") REGISTER_CLASS_NAME(Keyboard,"flash.ui") REGISTER_CLASS_NAME(KeyboardType,"flash.ui") REGISTER_CLASS_NAME(KeyLocation,"flash.ui") +REGISTER_CLASS_NAME(Mouse,"flash.ui") +REGISTER_CLASS_NAME(ContextMenu,"flash.ui") +REGISTER_CLASS_NAME(ContextMenuItem,"flash.ui") +REGISTER_CLASS_NAME(ContextMenuBuiltInItems,"flash.ui") //XML REGISTER_CLASS_NAME(XMLDocument,"flash.xml") diff --git a/src/asobject.cpp b/src/asobject.cpp index f11f461..3253e27 100644 --- a/src/asobject.cpp +++ b/src/asobject.cpp @@ -24,6 +24,7 @@ #include #include "compat.h" #include "parsing/amf3_generator.h" +#include "scripting/argconv.h" #include "scripting/toplevel/ASString.h" #include "scripting/toplevel/Date.h" #include "scripting/toplevel/XML.h" @@ -37,7 +38,13 @@ string ASObject::toDebugString() { check(); string ret; - if(getClass()) + if(this->is()) + { + ret = "[class "; + ret+=this->as()->class_name.getQualifiedName().raw_buf(); + ret+="]"; + } + else if(getClass()) { ret="[object "; ret+=getClass()->class_name.name.raw_buf(); @@ -47,11 +54,9 @@ string ASObject::toDebugString() ret = "Undefined"; else if(this->is()) ret = "Null"; - else if(this->is()) + else if(this->is()) { - ret = "[class "; - ret+=this->as()->class_name.getQualifiedName().raw_buf(); - ret+="]"; + ret = "[templated class]"; } else { @@ -60,6 +65,33 @@ string ASObject::toDebugString() return ret; } +void ASObject::setProxyProperty(const multiname &name) +{ + if (this->proxyMultiName) + this->proxyMultiName->ns.clear(); + else + this->proxyMultiName = new (getVm()->vmDataMemory) multiname(getVm()->vmDataMemory); + this->proxyMultiName->isAttribute = name.isAttribute; + this->proxyMultiName->ns.reserve(name.ns.size()); + for(unsigned int i=0;iproxyMultiName->ns.push_back(name.ns[i]); + } + +} + +void ASObject::applyProxyProperty(multiname &name) +{ + if (!this->proxyMultiName) + return; + name.isAttribute = this->proxyMultiName->isAttribute; + name.ns.clear(); + name.ns.reserve(this->proxyMultiName->ns.size()); + for(unsigned int i=0;iproxyMultiName->ns.size();i++) + { + name.ns.push_back(this->proxyMultiName->ns[i]); + } +} tiny_string ASObject::toString() { check(); @@ -85,6 +117,14 @@ tiny_string ASObject::toString() } } +tiny_string ASObject::toLocaleString() +{ + _NR str = executeASMethod("toLocaleString", {""}, NULL, 0); + if (str.isNull()) + return ""; + return str->toString(); +} + TRISTATE ASObject::isLess(ASObject* r) { check(); @@ -105,7 +145,7 @@ int variables_map::getNextEnumerable(unsigned int start) const ++it; } - while(it->second.kind!=DYNAMIC_TRAIT) + while(it->second.kind!=DYNAMIC_TRAIT || !it->second.isenumerable) { ++i; ++it; @@ -141,14 +181,15 @@ _R ASObject::nextValue(uint32_t index) void ASObject::sinit(Class_base* c) { c->setDeclaredMethodByQName("hasOwnProperty",AS3,Class::getFunction(hasOwnProperty),NORMAL_METHOD,true); + c->setDeclaredMethodByQName("setPropertyIsEnumerable",AS3,Class::getFunction(setPropertyIsEnumerable),NORMAL_METHOD,true); c->prototype->setVariableByQName("toString","",Class::getFunction(_toString),DYNAMIC_TRAIT); - c->prototype->setVariableByQName("toLocaleString","",Class::getFunction(_toString),DYNAMIC_TRAIT); + c->prototype->setVariableByQName("toLocaleString","",Class::getFunction(_toLocaleString),DYNAMIC_TRAIT); c->prototype->setVariableByQName("valueOf","",Class::getFunction(valueOf),DYNAMIC_TRAIT); c->prototype->setVariableByQName("hasOwnProperty","",Class::getFunction(hasOwnProperty),DYNAMIC_TRAIT); c->prototype->setVariableByQName("isPrototypeOf","",Class::getFunction(isPrototypeOf),DYNAMIC_TRAIT); c->prototype->setVariableByQName("propertyIsEnumerable","",Class::getFunction(propertyIsEnumerable),DYNAMIC_TRAIT); - + } void ASObject::buildTraits(ASObject* o) @@ -166,6 +207,8 @@ bool ASObject::isEqual(ASObject* r) { case T_NULL: case T_UNDEFINED: + if (!this->isConstructed() && !this->is()) + return true; return false; case T_NUMBER: case T_INTEGER: @@ -190,6 +233,8 @@ bool ASObject::isEqual(ASObject* r) return x->toString()==toString(); } } + if (r->is()) + return this == r->getClass(); LOG(LOG_CALLS,_("Equal comparison between type ")<getObjectType()); if(classdef) @@ -215,7 +260,7 @@ uint16_t ASObject::toUInt16() int32_t ASObject::toInt() { - return 0; + return toPrimitive()->toInt(); } /* Implements ECMA's ToPrimitive (9.1) and [[DefaultValue]] (8.6.2.6) */ @@ -328,6 +373,46 @@ _R ASObject::call_toString() return _MR(ret); } +bool ASObject::has_toJSON() +{ + multiname toJSONName(NULL); + toJSONName.name_type=multiname::NAME_STRING; + toJSONName.name_s_id=getSys()->getUniqueStringId("toJSON"); + toJSONName.ns.push_back(nsNameAndKind("",NAMESPACE)); + toJSONName.ns.push_back(nsNameAndKind(AS3,NAMESPACE)); + toJSONName.isAttribute = false; + return ASObject::hasPropertyByMultiname(toJSONName, true, true); +} + +tiny_string ASObject::call_toJSON() +{ + multiname toJSONName(NULL); + toJSONName.name_type=multiname::NAME_STRING; + toJSONName.name_s_id=getSys()->getUniqueStringId("toJSON"); + toJSONName.ns.push_back(nsNameAndKind("",NAMESPACE)); + toJSONName.ns.push_back(nsNameAndKind(AS3,NAMESPACE)); + toJSONName.isAttribute = false; + assert(ASObject::hasPropertyByMultiname(toJSONName, true, true)); + + _NR o=getVariableByMultiname(toJSONName,SKIP_IMPL); + assert_and_throw(o->is()); + IFunction* f=o->as(); + + incRef(); + ASObject *ret=f->call(this,NULL,0); + tiny_string res; + if (ret->is()) + { + res += "\""; + res += ret->toString(); + res += "\""; + } + else + res = ret->toString(); + + return res; +} + bool ASObject::isPrimitive() const { // ECMA 3, section 4.3.2, T_INTEGER and T_UINTEGER are added @@ -336,7 +421,10 @@ bool ASObject::isPrimitive() const type==T_STRING || type==T_BOOLEAN || type==T_INTEGER || type==T_UINTEGER; } - +bool ASObject::isConstructed() const +{ + return traitsInitialized && constructIndicator; +} variables_map::variables_map(MemoryAccount* m): Variables(std::less(), reporter_allocator(m)),slots_vars(m) { @@ -376,13 +464,14 @@ bool ASObject::hasPropertyByMultiname(const multiname& name, bool considerDynami if(classdef && classdef->borrowedVariables.findObjVar(name, NO_CREATE_TRAIT, DECLARED_TRAIT)!=NULL) return true; + NS_KIND nskind; //Check prototype inheritance chain if(getClass() && considerPrototype) { Prototype* proto = getClass()->prototype.getPtr(); while(proto) { - if(proto->getObj()->findGettable(name) != NULL) + if(proto->getObj()->findGettable(name,nskind) != NULL) return true; proto=proto->prevPrototype.getPtr(); } @@ -470,7 +559,7 @@ bool ASObject::deleteVariableByMultiname(const multiname& name) return true; } //Only dynamic traits are deletable - if (obj->kind != DYNAMIC_TRAIT) + if (obj->kind != DYNAMIC_TRAIT && obj->kind != INSTANCE_TRAIT) return false; assert(obj->getter==NULL && obj->setter==NULL && obj->var!=NULL); @@ -537,7 +626,20 @@ void ASObject::setVariableByMultiname(const multiname& name, ASObject* o, CONST_ } } - //Do not lookup in the prototype chain. This is tested behaviour + //Do not set variables in prototype chain. Still have to do + //lookup to throw a correct error in case a named function + //exists in prototype chain. See Tamarin test + //ecma3/Boolean/ecma4_sealedtype_1_rt + if(!obj && cls && cls->isSealed) + { + variable *protoObj = cls->findSettableInPrototype(name); + if (protoObj && + ((protoObj->var && protoObj->var->is()) || + protoObj->setter)) + { + throwError(kCannotAssignToMethodError, name.normalizedName(), cls ? cls->getQualifiedClassName() : ""); + } + } if(!obj) { @@ -595,24 +697,26 @@ void ASObject::setVariableByQName(uint32_t nameId, const nsNameAndKind& ns, ASOb } void ASObject::initializeVariableByMultiname(const multiname& name, ASObject* o, multiname* typemname, - ABCContext* context, TRAIT_KIND traitKind) + ABCContext* context, TRAIT_KIND traitKind, bool bOverwrite) { check(); - - variable* obj=findSettable(name); - if(obj) + if (!bOverwrite) { - //Initializing an already existing variable - LOG(LOG_NOT_IMPLEMENTED,"Variable " << name << "already initialized"); - o->decRef(); - return; + variable* obj=findSettable(name); + if(obj) + { + //Initializing an already existing variable + LOG(LOG_NOT_IMPLEMENTED,"Variable " << name << " already initialized"); + if (o != NULL) + o->decRef(); + return; + } } - - Variables.initializeVar(name, o, typemname, context, traitKind); + Variables.initializeVar(name, o, typemname, context, traitKind,this); } variable::variable(TRAIT_KIND _k, ASObject* _v, multiname* _t, const Type* _type) - : var(_v),typeUnion(NULL),setter(NULL),getter(NULL),kind(_k),traitState(NO_STATE) + : var(_v),typeUnion(NULL),setter(NULL),getter(NULL),kind(_k),traitState(NO_STATE),isenumerable(true) { if(_type) { @@ -731,7 +835,7 @@ variable* variables_map::findObjVar(const multiname& mname, TRAIT_KIND createKin return &inserted->second; } -const variable* variables_map::findObjVar(const multiname& mname, uint32_t traitKinds) const +const variable* variables_map::findObjVar(const multiname& mname, uint32_t traitKinds, NS_KIND &nskind) const { uint32_t name=mname.normalizedNameId(); assert(!mname.ns.empty()); @@ -746,6 +850,7 @@ const variable* variables_map::findObjVar(const multiname& mname, uint32_t trait const nsNameAndKind& ns=ret->first.ns; if(ns==*nsIt) { + nskind = ns.getImpl().kind; if(ret->second.kind & traitKinds) return &ret->second; else @@ -764,29 +869,86 @@ const variable* variables_map::findObjVar(const multiname& mname, uint32_t trait return NULL; } -void variables_map::initializeVar(const multiname& mname, ASObject* obj, multiname* typemname, ABCContext* context, TRAIT_KIND traitKind) +void variables_map::initializeVar(const multiname& mname, ASObject* obj, multiname* typemname, ABCContext* context, TRAIT_KIND traitKind, ASObject* mainObj) { const Type* type = NULL; /* If typename is a builtin type, we coerce obj. * It it's not it must be a user defined class, - * so we only allow Null and Undefined (which are both coerced to Null) */ - - type = Type::getBuiltinType(typemname); + * so we try to find the class it is derived from and create an apropriate uninitialized instance */ + if (type == NULL) + type = Type::getBuiltinType(typemname); + if (type == NULL) + type = Type::getTypeFromMultiname(typemname,context); if(type==NULL) { - assert_and_throw(obj->is() || obj->is()); - if(obj->is()) + if (obj == NULL) // create dynamic object + { + obj = getSys()->getUndefinedRef(); + } + else { - //Casting undefined to an object (of unknown class) - //results in Null - obj->decRef(); - obj = getSys()->getNullRef(); + assert_and_throw(obj->is() || obj->is()); + if(obj->is()) + { + //Casting undefined to an object (of unknown class) + //results in Null + obj->decRef(); + obj = getSys()->getNullRef(); + } } } else - obj = type->coerce(obj); - - assert(traitKind==DECLARED_TRAIT || traitKind==CONSTANT_TRAIT); + { + if (obj == NULL) // create dynamic object + { + if (type == Type::anyType) + { + // type could not be found, so it's stored as an uninitialized variable + LOG(LOG_CALLS,"add uninitialized var:"<incRef(); + v.mainObj = mainObj; + v.mname = &mname; + v.traitKind = traitKind; + v.typemname = typemname; + context->addUninitializedVar(v); + obj = getSys()->getUndefinedRef(); + obj = type->coerce(obj); + } + else if(mainObj->is() && + mainObj->as()->class_name.getQualifiedName() == typemname->qualifiedString()) + { + // avoid recursive construction + obj = getSys()->getNullRef(); + } + else if (type != Class_object::getClass() && + dynamic_cast(type)) + { + if (!((Class_base*)type)->super) + { + // super type could not be found, so the class is stored as an uninitialized variable + LOG(LOG_CALLS,"add uninitialized class var:"<incRef(); + v.mainObj = mainObj; + v.mname = &mname; + v.traitKind = traitKind; + v.typemname = typemname; + context->addUninitializedVar(v); + obj = getSys()->getUndefinedRef(); + obj = type->coerce(obj); + } + else + obj = ((Class_base*)type)->getInstance(false,NULL,0); + } + else + { + obj = getSys()->getUndefinedRef(); + obj = type->coerce(obj); + } + } + } + assert(traitKind==DECLARED_TRAIT || traitKind==CONSTANT_TRAIT || traitKind == INSTANCE_TRAIT); uint32_t name=mname.normalizedNameId(); Variables.insert(make_pair(varName(name, mname.ns[0]), variable(traitKind, obj, typemname, type))); @@ -826,6 +988,16 @@ ASFUNCTIONBODY(ASObject,_toString) return Class::getInstanceS(ret); } +ASFUNCTIONBODY(ASObject,_toLocaleString) +{ + if (!obj->has_toString()) + throwError(kCallNotFoundError, "toString", obj->getClassName()); + + _R res = obj->call_toString(); + res->incRef(); + return res.getPtr(); +} + ASFUNCTIONBODY(ASObject,hasOwnProperty) { assert_and_throw(argslen==1); @@ -867,7 +1039,8 @@ ASFUNCTIONBODY(ASObject,isPrototypeOf) ASFUNCTIONBODY(ASObject,propertyIsEnumerable) { - assert_and_throw(argslen==1); + if (argslen == 0) + return abstract_b(false); multiname name(NULL); name.name_type=multiname::NAME_STRING; name.name_s_id=getSys()->getUniqueStringId(args[0]->toString()); @@ -886,16 +1059,41 @@ ASFUNCTIONBODY(ASObject,propertyIsEnumerable) return abstract_b(true); return abstract_b(false); } +ASFUNCTIONBODY(ASObject,setPropertyIsEnumerable) +{ + tiny_string propname; + bool isEnum; + ARG_UNPACK(propname) (isEnum, true); + multiname name(NULL); + name.name_type=multiname::NAME_STRING; + name.name_s_id=getSys()->getUniqueStringId(args[0]->toString()); + name.ns.push_back(nsNameAndKind("",NAMESPACE)); + name.isAttribute=false; + variable* v =obj->Variables.findObjVar(name, NO_CREATE_TRAIT,DYNAMIC_TRAIT); + if (v) + v->isenumerable = isEnum; + return NULL; +} ASFUNCTIONBODY(ASObject,_constructor) { return NULL; } +ASFUNCTIONBODY(ASObject,_constructorNotInstantiatable) +{ + throwError(kCantInstantiateError, obj->getClassName()); + return NULL; +} + void ASObject::initSlot(unsigned int n, const multiname& name) { Variables.initSlot(n,name.name_s_id,name.ns[0]); } +void ASObject::appendSlot(const multiname& name) +{ + Variables.appendSlot(name.name_s_id,name.ns[0]); +} int32_t ASObject::getVariableByMultiname_i(const multiname& name) { @@ -906,9 +1104,9 @@ int32_t ASObject::getVariableByMultiname_i(const multiname& name) return ret->toInt(); } -const variable* ASObject::findGettableImpl(const variables_map& map, const multiname& name) +const variable* ASObject::findGettableImpl(const variables_map& map, const multiname& name, NS_KIND &nskind) { - const variable* ret=map.findObjVar(name,DECLARED_TRAIT|DYNAMIC_TRAIT); + const variable* ret=map.findObjVar(name,DECLARED_TRAIT|DYNAMIC_TRAIT,nskind); if(ret) { //It seems valid for a class to redefine only the setter, so if we can't find @@ -919,20 +1117,20 @@ const variable* ASObject::findGettableImpl(const variables_map& map, const multi return ret; } -const variable* ASObject::findGettable(const multiname& name) const +const variable* ASObject::findGettable(const multiname& name, NS_KIND &nskind) const { - return findGettableImpl(Variables,name); + return findGettableImpl(Variables,name,nskind); } -const variable* ASObject::findVariableByMultiname(const multiname& name, GET_VARIABLE_OPTION opt, Class_base* cls) +const variable* ASObject::findVariableByMultiname(const multiname& name, GET_VARIABLE_OPTION opt, Class_base* cls, NS_KIND &nskind) { //Get from the current object without considering borrowed properties - const variable* var=findGettable(name); + const variable* var=findGettable(name,nskind); if(!var && cls) { //Look for borrowed traits before - var=cls->findBorrowedGettable(name); + var=cls->findBorrowedGettable(name,nskind); } if(!var && cls) @@ -941,7 +1139,7 @@ const variable* ASObject::findVariableByMultiname(const multiname& name, GET_VAR Prototype* proto = cls->prototype.getPtr(); while(proto) { - var = proto->getObj()->findGettable(name); + var = proto->getObj()->findGettable(name,nskind); if(var) break; proto = proto->prevPrototype.getPtr(); @@ -954,10 +1152,24 @@ _NR ASObject::getVariableByMultiname(const multiname& name, GET_VARIAB { check(); assert(!cls || classdef->isSubClass(cls)); - const variable* obj=findVariableByMultiname(name, opt, cls); + NS_KIND nskind; + const variable* obj=findVariableByMultiname(name, opt, cls,nskind); if(!obj) return NullRef; + if (this->is() && + (!obj->var || + (obj->var->getObjectType() != T_UNDEFINED && + obj->var->getObjectType() != T_NULL && + obj->var->getObjectType() != T_FUNCTION ))) + { + LOG(LOG_CALLS,"accessing class:"<as()->getQualifiedClassName()<<" "<kind == INSTANCE_TRAIT && + nskind != NAMESPACE && + nskind != PACKAGE_INTERNAL_NAMESPACE && + nskind != STATIC_PROTECTED_NAMESPACE) + throwError(kCallOfNonFunctionError,name.normalizedName()); + } if(obj->getter) { @@ -1080,6 +1292,9 @@ void variables_map::dumpVariables() case CONSTANT_TRAIT: kind="Declared: "; break; + case INSTANCE_TRAIT: + kind="Declared (instance)"; + break; case DYNAMIC_TRAIT: kind="Dynamic: "; break; @@ -1112,8 +1327,8 @@ void variables_map::destroyContents() Variables.clear(); } -ASObject::ASObject(MemoryAccount* m):Variables(m),classdef(NULL), - type(T_OBJECT),traitsInitialized(false),implEnable(true) +ASObject::ASObject(MemoryAccount* m):Variables(m),classdef(NULL),proxyMultiName(NULL), + type(T_OBJECT),traitsInitialized(false),constructIndicator(false),implEnable(true) { #ifndef NDEBUG //Stuff only used in debugging @@ -1121,8 +1336,8 @@ ASObject::ASObject(MemoryAccount* m):Variables(m),classdef(NULL), #endif } -ASObject::ASObject(Class_base* c):Variables((c)?c->memoryAccount:NULL),classdef(NULL), - type(T_OBJECT),traitsInitialized(false),implEnable(true) +ASObject::ASObject(Class_base* c):Variables((c)?c->memoryAccount:NULL),classdef(NULL),proxyMultiName(NULL), + type(T_OBJECT),traitsInitialized(false),constructIndicator(false),implEnable(true) { setClass(c); #ifndef NDEBUG @@ -1131,8 +1346,8 @@ ASObject::ASObject(Class_base* c):Variables((c)?c->memoryAccount:NULL),classdef( #endif } -ASObject::ASObject(const ASObject& o):Variables((o.classdef)?o.classdef->memoryAccount:NULL),classdef(NULL), - type(o.type),traitsInitialized(false),implEnable(true) +ASObject::ASObject(const ASObject& o):Variables((o.classdef)?o.classdef->memoryAccount:NULL),classdef(NULL),proxyMultiName(NULL), + type(o.type),traitsInitialized(false),constructIndicator(false),implEnable(true) { if(o.classdef) setClass(o.classdef); @@ -1169,6 +1384,9 @@ void ASObject::finalize() classdef->decRef(); classdef=NULL; } + if (proxyMultiName) + delete proxyMultiName; + proxyMultiName = NULL; } ASObject::~ASObject() @@ -1446,6 +1664,139 @@ ASObject *ASObject::describeType() const return Class::getInstanceS(root); } +tiny_string ASObject::toJSON(std::vector &path, IFunction *replacer, const tiny_string &spaces,const tiny_string& filter) +{ + if (has_toJSON()) + { + return call_toJSON(); + } + + tiny_string newline = (spaces.empty() ? "" : "\n"); + tiny_string res; + if (this->isPrimitive()) + { + switch(this->type) + { + case T_STRING: + { + res += "\""; + tiny_string sub = this->toString(); + for (CharIterator it=sub.begin(); it!=sub.end(); it++) + { + switch (*it) + { + case '\b': + res += "\\b"; + break; + case '\f': + res += "\\f"; + break; + case '\n': + res += "\\n"; + break; + case '\r': + res += "\\r"; + break; + case '\t': + res += "\\t"; + break; + case '\"': + res += "\\\""; + break; + case '\\': + res += "\\\\"; + break; + default: + if (*it < 0x20 || *it > 0xff) + { + char hexstr[7]; + sprintf(hexstr,"\\u%04x",*it); + res += hexstr; + } + else + res += *it; + break; + } + } + res += "\""; + break; + } + case T_UNDEFINED: + res += "null"; + break; + default: + res += this->toString(); + break; + } + } + else + { + res += "{"; + const variables_map::const_var_iterator beginIt = Variables.Variables.begin(); + const variables_map::const_var_iterator endIt = Variables.Variables.end(); + bool bfirst = true; + for(variables_map::const_var_iterator varIt=beginIt; varIt != endIt; ++varIt) + { + // check for cylic reference + if (varIt->second.var->getObjectType() != T_UNDEFINED && + varIt->second.var->getObjectType() != T_NULL && + varIt->second.var->getObjectType() != T_BOOLEAN && + (varIt->second.var == this || + std::find(path.begin(),path.end(), varIt->second.var) != path.end() || + std::find(path.begin(),path.end(), this) != path.end() )) + throwError(kJSONCyclicStructure); + + if (replacer != NULL) + { + if (!bfirst) + res += ","; + res += newline+spaces; + res += "\""; + res += getSys()->getStringFromUniqueId(varIt->first.nameId); + res += "\""; + res += ":"; + if (!spaces.empty()) + res += " "; + ASObject* params[2]; + + params[0] = Class::getInstanceS(getSys()->getStringFromUniqueId(varIt->first.nameId)); + params[1] = varIt->second.var; + params[1]->incRef(); + ASObject *funcret=replacer->call(getSys()->getNullRef(), params, 2); + LOG(LOG_ERROR,"funcall:"<toString(); + else + res += varIt->second.var->toJSON(path,replacer,spaces+spaces,filter); + bfirst = false; + } + else if (filter.empty() || filter.find(tiny_string(" ")+getSys()->getStringFromUniqueId(varIt->first.nameId)+" ") != tiny_string::npos) + { + if (!bfirst) + res += ","; + res += newline+spaces; + res += "\""; + res += getSys()->getStringFromUniqueId(varIt->first.nameId); + res += "\""; + res += ":"; + if (!spaces.empty()) + res += " "; + res += varIt->second.var->toJSON(path,replacer,spaces+spaces,filter); + bfirst = false; + } + if (varIt->second.var->getObjectType() != T_UNDEFINED && + varIt->second.var->getObjectType() != T_NULL && + varIt->second.var->getObjectType() != T_BOOLEAN) + path.push_back(varIt->second.var); + } + if (!bfirst) + res += newline+spaces.substr_bytes(0,spaces.numBytes()/2); + + res += "}"; + } + return res; +} + bool ASObject::hasprop_prototype() { variable* var=Variables.findObjVar(BUILTIN_STRINGS::PROTOTYPE,nsNameAndKind(BUILTIN_NAMESPACES::EMPTY_NS), @@ -1491,7 +1842,7 @@ void ASObject::setprop_prototype(_NR& o) ret->setVar(obj); } -tiny_string ASObject::getClassName() +tiny_string ASObject::getClassName() const { if (getClass()) return getClass()->getQualifiedClassName(); diff --git a/src/asobject.h b/src/asobject.h index 2064223..958007a 100644 --- a/src/asobject.h +++ b/src/asobject.h @@ -122,6 +122,25 @@ REGISTER_GETTER(c,name); \ REGISTER_SETTER(c,name) +#define CLASS_DYNAMIC_NOT_FINAL 0 +#define CLASS_FINAL 1 +#define CLASS_SEALED 2 + +// TODO: Every class should have a constructor +#define CLASS_SETUP_NO_CONSTRUCTOR(c, superClass, attributes) \ + c->setSuper(Class::getRef()); \ + c->setConstructor(NULL); \ + c->isFinal = ((attributes) & CLASS_FINAL) != 0; \ + c->isSealed = ((attributes) & CLASS_SEALED) != 0 + +#define CLASS_SETUP(c, superClass, constructor, attributes) \ + CLASS_SETUP_NO_CONSTRUCTOR(c, superClass, attributes); \ + c->setConstructor(Class::getFunction(constructor)); + +#define CLASS_SETUP_CONSTRUCTOR_LENGTH(c, superClass, constructor, ctorlength, attributes) \ + CLASS_SETUP_NO_CONSTRUCTOR(c, superClass, attributes); \ + c->setConstructor(Class::getFunction((constructor), (ctorlength))); + namespace lightspark { @@ -134,7 +153,7 @@ class Loader; class Type; class ABCContext; -enum TRAIT_KIND { NO_CREATE_TRAIT=0, DECLARED_TRAIT=1, DYNAMIC_TRAIT=2, CONSTANT_TRAIT=9 /* constants are also declared traits */ }; +enum TRAIT_KIND { NO_CREATE_TRAIT=0, DECLARED_TRAIT=1, DYNAMIC_TRAIT=2, INSTANCE_TRAIT=5, CONSTANT_TRAIT=9 /* constants are also declared traits */ }; enum TRAIT_STATE { NO_STATE=0, HAS_GETTER_SETTER=1, TYPE_RESOLVED=2 }; struct variable @@ -150,8 +169,9 @@ struct variable IFunction* getter; TRAIT_KIND kind; TRAIT_STATE traitState; + bool isenumerable:1; variable(TRAIT_KIND _k) - : var(NULL),typeUnion(NULL),setter(NULL),getter(NULL),kind(_k),traitState(NO_STATE) {} + : var(NULL),typeUnion(NULL),setter(NULL),getter(NULL),kind(_k),traitState(NO_STATE),isenumerable(true) {} variable(TRAIT_KIND _k, ASObject* _v, multiname* _t, const Type* type); void setVar(ASObject* v); /* @@ -201,9 +221,9 @@ public: /** * Const version of findObjVar, useful when looking for getters */ - const variable* findObjVar(const multiname& mname, uint32_t traitKinds) const; + const variable* findObjVar(const multiname& mname, uint32_t traitKinds, NS_KIND &nskind) const; //Initialize a new variable specifying the type (TODO: add support for const) - void initializeVar(const multiname& mname, ASObject* obj, multiname* typemname, ABCContext* context, TRAIT_KIND traitKind); + void initializeVar(const multiname& mname, ASObject* obj, multiname *typemname, ABCContext* context, TRAIT_KIND traitKind, ASObject* mainObj); void killObjVar(const multiname& mname); ASObject* getSlot(unsigned int n) { @@ -221,6 +241,10 @@ public: */ void setSlotNoCoerce(unsigned int n,ASObject* o); void initSlot(unsigned int n, uint32_t nameId, const nsNameAndKind& ns); + void appendSlot(uint32_t nameId, const nsNameAndKind& ns) + { + initSlot(slots_vars.size()+1, nameId, ns); + } int size() const { return Variables.size(); @@ -251,20 +275,22 @@ friend class IFunction; //Needed for clone private: variables_map Variables; Class_base* classdef; - const variable* findGettable(const multiname& name) const DLL_LOCAL; + const variable* findGettable(const multiname& name, NS_KIND &nskind) const DLL_LOCAL; variable* findSettable(const multiname& name, bool* has_getter=NULL) DLL_LOCAL; + multiname* proxyMultiName; protected: ASObject(MemoryAccount* m); ASObject(const ASObject& o); virtual ~ASObject(); SWFOBJECT_TYPE type; bool traitsInitialized:1; + bool constructIndicator:1; void serializeDynamicProperties(ByteArray* out, std::map& stringMap, std::map& objMap, std::map traitsMap) const; void setClass(Class_base* c); static variable* findSettableImpl(variables_map& map, const multiname& name, bool* has_getter); - static const variable* findGettableImpl(const variables_map& map, const multiname& name); + static const variable* findGettableImpl(const variables_map& map, const multiname& name, NS_KIND &nskind); public: ASObject(Class_base* c); #ifndef NDEBUG @@ -274,11 +300,16 @@ public: bool implEnable:1; Class_base* getClass() const { return classdef; } ASFUNCTION(_constructor); + // constructor for subclasses that can't be instantiated. + // Throws ArgumentError. + ASFUNCTION(_constructorNotInstantiatable); ASFUNCTION(_toString); + ASFUNCTION(_toLocaleString); ASFUNCTION(hasOwnProperty); ASFUNCTION(valueOf); ASFUNCTION(isPrototypeOf); ASFUNCTION(propertyIsEnumerable); + ASFUNCTION(setPropertyIsEnumerable); void check() const; static void s_incRef(ASObject* o) { @@ -313,7 +344,7 @@ public: * Helper method using the get the raw variable struct instead of calling the getter. * It is used by getVariableByMultiname and by early binding code */ - const variable* findVariableByMultiname(const multiname& name, GET_VARIABLE_OPTION opt, Class_base* cls); + const variable* findVariableByMultiname(const multiname& name, GET_VARIABLE_OPTION opt, Class_base* cls, NS_KIND &nskind); /* * Gets a variable of this object. It looks through all classes (beginning at cls), * then the prototype chain, and then instance variables. @@ -348,7 +379,7 @@ public: * Called by ABCVm::buildTraits to create DECLARED_TRAIT or CONSTANT_TRAIT and set their type */ void initializeVariableByMultiname(const multiname& name, ASObject* o, multiname* typemname, - ABCContext* context, TRAIT_KIND traitKind); + ABCContext* context, TRAIT_KIND traitKind,bool bOverwrite); /* * Called by ABCVm::initProperty (implementation of ABC instruction), it is allowed to set CONSTANT_TRAIT */ @@ -375,6 +406,7 @@ public: Variables.setSlotNoCoerce(n,o); } void initSlot(unsigned int n, const multiname& name); + void appendSlot(const multiname& name); unsigned int numVariables() const; tiny_string getNameAt(int i) const { @@ -387,6 +419,7 @@ public: } /* Implements ECMA's 9.8 ToString operation, but returns the concrete value */ tiny_string toString(); + tiny_string toLocaleString(); virtual int32_t toInt(); virtual uint32_t toUInt(); uint16_t toUInt16(); @@ -396,6 +429,9 @@ public: _R toPrimitive(TP_HINT hint = NO_HINT); bool isPrimitive() const; + bool isInitialized() const {return traitsInitialized;} + virtual bool isConstructed() const; + /* helper functions for calling the "valueOf" and * "toString" AS-functions which may be members of this * object */ @@ -403,9 +439,11 @@ public: _R call_valueOf(); bool has_toString(); _R call_toString(); + bool has_toJSON(); + tiny_string call_toJSON(); /* Helper function for calling getClass()->getQualifiedClassName() */ - virtual tiny_string getClassName(); + virtual tiny_string getClassName() const; ASFUNCTION(generator); @@ -441,6 +479,7 @@ public: virtual ASObject *describeType() const; + virtual tiny_string toJSON(std::vector &path, IFunction *replacer, const tiny_string &spaces,const tiny_string& filter); /* returns true if the current object is of type T */ template bool is() const { return dynamic_cast(this); } /* returns this object casted to the given type. @@ -451,6 +490,15 @@ public: /* Returns a debug string identifying this object */ virtual std::string toDebugString(); + + /* stores proxy namespace settings for internal usage */ + void setProxyProperty(const multiname& name); + /* applies proxy namespace settings to name for internal usage */ + void applyProxyProperty(multiname &name); + + void dumpVariables() { Variables.dumpVariables(); } + + void setConstructIndicator() { constructIndicator = true; } }; class Number; diff --git a/src/backends/decoder.cpp b/src/backends/decoder.cpp index 18e72e0..3c360d4 100755 --- a/src/backends/decoder.cpp +++ b/src/backends/decoder.cpp @@ -295,6 +295,8 @@ bool FFMpegVideoDecoder::decodePacket(AVPacket* pkt, uint32_t time) #else int ret=avcodec_decode_video(codecContext, frameIn, &frameOk, pkt->data, pkt->size); #endif + if (ret < 0) + return false; assert_and_throw(ret==(int)pkt->size); if(frameOk) @@ -451,19 +453,7 @@ void AudioDecoder::skipAll() #ifdef ENABLE_LIBAVCODEC FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC audioCodec, uint8_t* initdata, uint32_t datalen):ownedContext(true) { - CodecID codecId; - switch(audioCodec) - { - case AAC: - codecId=CODEC_ID_AAC; - break; - case MP3: - codecId=CODEC_ID_MP3; - break; - default: - ::abort(); - } - AVCodec* codec=avcodec_find_decoder(codecId); + AVCodec* codec=avcodec_find_decoder(LSToFFMpegCodec(audioCodec)); assert(codec); codecContext=avcodec_alloc_context3(codec); @@ -490,7 +480,33 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC audioCodec, uint8_t* initd #endif } -FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecContext* _c):codecContext(_c) +FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC lscodec, int sampleRate, int channels, bool):ownedContext(true) +{ + status=INIT; + + CodecID codecId = LSToFFMpegCodec(lscodec); + AVCodec* codec=avcodec_find_decoder(codecId); + assert(codec); + codecContext=avcodec_alloc_context3(codec); + codecContext->codec_id = codecId; + codecContext->sample_rate = sampleRate; + codecContext->channels = channels; + +#ifdef HAVE_AVCODEC_OPEN2 + if(avcodec_open2(codecContext, codec, NULL)<0) +#else + if(avcodec_open(codecContext, codec)<0) +#endif //HAVE_AVCODEC_ALLOC_CONTEXT3 + return; + + if(fillDataAndCheckValidity()) + status=VALID; +#if HAVE_AVCODEC_DECODE_AUDIO4 + frameIn=avcodec_alloc_frame(); +#endif +} + +FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecContext* _c):ownedContext(false),codecContext(_c) { status=INIT; AVCodec* codec=avcodec_find_decoder(codecContext->codec_id); @@ -520,6 +536,21 @@ FFMpegAudioDecoder::~FFMpegAudioDecoder() #endif } +CodecID FFMpegAudioDecoder::LSToFFMpegCodec(LS_AUDIO_CODEC LSCodec) +{ + switch(LSCodec) + { + case AAC: + return CODEC_ID_AAC; + case MP3: + return CODEC_ID_MP3; + case ADPCM: + return CODEC_ID_ADPCM_SWF; + default: + return CODEC_ID_NONE; + } +} + bool FFMpegAudioDecoder::fillDataAndCheckValidity() { if(codecContext->sample_rate!=0) @@ -556,8 +587,25 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t #if HAVE_AVCODEC_DECODE_AUDIO3 || HAVE_AVCODEC_DECODE_AUDIO4 AVPacket pkt; av_init_packet(&pkt); - pkt.data=data; - pkt.size=datalen; + + // If some data was left unprocessed on previous call, + // concatenate. + std::vector combinedBuffer; + if (overflowBuffer.empty()) + { + pkt.data=data; + pkt.size=datalen; + } + else + { + combinedBuffer.assign(overflowBuffer.begin(), overflowBuffer.end()); + if (datalen > 0) + combinedBuffer.insert(combinedBuffer.end(), data, data+datalen); + pkt.data = &combinedBuffer[0]; + pkt.size = combinedBuffer.size(); + overflowBuffer.clear(); + } + #if HAVE_AVCODEC_DECODE_AUDIO4 avcodec_get_frame_defaults(frameIn); int frameOk=0; @@ -566,21 +614,36 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t ret=-1; else { - //This is suboptimal but equivalent to what libavcodec - //does for the compatibility version of avcodec_decode_audio3 - memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); - maxLen=frameIn->linesize[0]; + if (frameIn->format != AV_SAMPLE_FMT_S16) + { + maxLen = resampleFrameToS16(curTail); + } + else + { + //This is suboptimal but equivalent to what libavcodec + //does for the compatibility version of avcodec_decode_audio3 + memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); + maxLen=frameIn->linesize[0]; + } } #else int32_t ret=avcodec_decode_audio3(codecContext, curTail.samples, &maxLen, &pkt); #endif + + if (ret > 0) + { + pkt.data += ret; + pkt.size -= ret; + + if (pkt.size > 0) + { + overflowBuffer.assign(pkt.data, pkt.data+pkt.size); + } + } + #else int32_t ret=avcodec_decode_audio2(codecContext, curTail.samples, &maxLen, data, datalen); #endif - assert_and_throw(ret==datalen); - - if(status==INIT && fillDataAndCheckValidity()) - status=VALID; curTail.len=maxLen; assert(!(curTail.len&0x80000000)); @@ -588,6 +651,10 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t curTail.current=curTail.samples; curTail.time=time; samplesBuffer.commitLast(); + + if(status==INIT && fillDataAndCheckValidity()) + status=VALID; + return maxLen; } @@ -604,10 +671,17 @@ uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) ret=-1; else { - //This is suboptimal but equivalent to what libavcodec - //does for the compatibility version of avcodec_decode_audio3 - memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); - maxLen=frameIn->linesize[0]; + if (frameIn->format != AV_SAMPLE_FMT_S16) + { + maxLen = resampleFrameToS16(curTail); + } + else + { + //This is suboptimal but equivalent to what libavcodec + //does for the compatibility version of avcodec_decode_audio3 + memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); + maxLen=frameIn->linesize[0]; + } } #elif HAVE_AVCODEC_DECODE_AUDIO3 int ret=avcodec_decode_audio3(codecContext, curTail.samples, &maxLen, pkt); @@ -639,6 +713,61 @@ uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) samplesBuffer.commitLast(); return maxLen; } +#if HAVE_AVCODEC_DECODE_AUDIO4 +int FFMpegAudioDecoder::resampleFrameToS16(FrameSamples& curTail) +{ + int maxLen; +#ifdef HAVE_LIBAVRESAMPLE + AVAudioResampleContext * avr = avresample_alloc_context(); + av_opt_set_int(avr, "in_channel_layout", frameIn->channel_layout, 0); + av_opt_set_int(avr, "out_channel_layout", frameIn->channel_layout, 0); + av_opt_set_int(avr, "in_sample_rate", frameIn->sample_rate, 0); + av_opt_set_int(avr, "out_sample_rate", frameIn->sample_rate, 0); + av_opt_set_int(avr, "in_sample_fmt", frameIn->format, 0); + av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); + avresample_open(avr); + + uint8_t *output; + int out_linesize; + int out_samples = avresample_available(avr) + av_rescale_rnd(avresample_get_delay(avr) + frameIn->linesize[0], frameIn->sample_rate, frameIn->sample_rate, AV_ROUND_UP); + av_samples_alloc(&output, &out_linesize, frameIn->nb_samples, out_samples, AV_SAMPLE_FMT_S16, 0); + maxLen = avresample_convert(avr, &output, out_linesize, out_samples, frameIn->extended_data, frameIn->linesize[0], frameIn->nb_samples)*4; + memcpy(curTail.samples, output, maxLen); + av_freep(&output); + avresample_free(&avr); +#else + LOG(LOG_ERROR, "unexpected sample format and can't resample, recompile with libavresample"); + memset(curTail.samples, 0, frameIn->linesize[0]); + maxLen = frameIn->linesize[0]; +#endif + return maxLen; +} +#endif + +uint32_t FFMpegAudioDecoder::decodeStreamSomePackets(std::istream& s, uint32_t time) +{ + const size_t BUF_SIZE = 4096; + uint32_t ret; + uint8_t inbuf[BUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; + s.read((char*)inbuf, BUF_SIZE); + if (s.gcount() == 0) + return 0; + + ret = decodeData(inbuf, s.gcount(), time); + + // Keep the overflowBuffer from growing without bounds + size_t overflowSize = overflowBuffer.size(); + while (overflowSize > BUF_SIZE) + { + ret = decodeData(NULL, 0, time); + if (overflowBuffer.size() == overflowSize) + break; + overflowSize = overflowBuffer.size(); + } + + return ret; +} + #endif //ENABLE_LIBAVCODEC StreamDecoder::~StreamDecoder() @@ -721,7 +850,13 @@ FFMpegStreamDecoder::FFMpegStreamDecoder(std::istream& s) if(videoFound) { //Pass the frame rate from the container, the once from the codec is often wrong - double frameRate=av_q2d(formatCtx->streams[videoIndex]->r_frame_rate); + AVStream *stream = formatCtx->streams[videoIndex]; +#if LIBAVUTIL_VERSION_MAJOR < 54 + AVRational rateRational = stream->r_frame_rate; +#else + AVRational rateRational = stream->avg_frame_rate; +#endif + double frameRate=av_q2d(rateRational); customVideoDecoder=new FFMpegVideoDecoder(formatCtx->streams[videoIndex]->codec,frameRate); videoDecoder=customVideoDecoder; } diff --git a/src/backends/decoder.h b/src/backends/decoder.h index cddf058..2abbcbe 100644 --- a/src/backends/decoder.h +++ b/src/backends/decoder.h @@ -28,6 +28,24 @@ extern "C" { #include #include +#ifdef HAVE_LIBAVRESAMPLE +#include +#endif +#include +#include +#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio +#endif +#ifdef HAVE_AVCODECID +#define CodecID AVCodecID +#define CODEC_ID_NONE AV_CODEC_ID_NONE +#define CODEC_ID_H264 AV_CODEC_ID_H264 +#define CODEC_ID_FLV1 AV_CODEC_ID_FLV1 +#define CODEC_ID_VP6F AV_CODEC_ID_VP6F +#define CODEC_ID_AAC AV_CODEC_ID_AAC +#define CODEC_ID_MP3 AV_CODEC_ID_MP3 +#define CODEC_ID_ADPCM_SWF AV_CODEC_ID_ADPCM_SWF +#endif #define MAX_AUDIO_FRAME_SIZE AVCODEC_MAX_AUDIO_FRAME_SIZE } #else @@ -40,7 +58,8 @@ namespace lightspark { enum LS_VIDEO_CODEC { H264=0, H263, VP6 }; -enum LS_AUDIO_CODEC { LINEAR_PCM_PLATFORM_ENDIAN=0, ADPCM=1, MP3=2, LINEAR_PCM_LE=3, AAC=10 }; +// "Audio coding formats" from Chapter 11 in SWF documentation +enum LS_AUDIO_CODEC { CODEC_NONE=-1, LINEAR_PCM_PLATFORM_ENDIAN=0, ADPCM=1, MP3=2, LINEAR_PCM_LE=3, AAC=10 }; class Decoder { @@ -277,12 +296,16 @@ class FFMpegAudioDecoder: public AudioDecoder private: bool ownedContext; AVCodecContext* codecContext; + std::vector overflowBuffer; bool fillDataAndCheckValidity(); + CodecID LSToFFMpegCodec(LS_AUDIO_CODEC lscodec); #if HAVE_AVCODEC_DECODE_AUDIO4 AVFrame* frameIn; + int resampleFrameToS16(FrameSamples& curTail); #endif public: FFMpegAudioDecoder(LS_AUDIO_CODEC codec, uint8_t* initdata, uint32_t datalen); + FFMpegAudioDecoder(LS_AUDIO_CODEC codec, int sampleRate, int channels, bool); /* Specialized constructor used by FFMpegStreamDecoder */ @@ -293,6 +316,7 @@ public: */ uint32_t decodePacket(AVPacket* pkt, uint32_t time); uint32_t decodeData(uint8_t* data, int32_t datalen, uint32_t time); + uint32_t decodeStreamSomePackets(std::istream& s, uint32_t time); }; #endif diff --git a/src/backends/graphics.cpp b/src/backends/graphics.cpp index b8a79a2..f6ac15c 100644 --- a/src/backends/graphics.cpp +++ b/src/backends/graphics.cpp @@ -458,10 +458,20 @@ bool CairoTokenRenderer::cairoPathFromTokens(cairo_t* cr, const std::vector 1) + { + translateY = -PANGO_PIXELS(lineExtents(layout, textData.scrollV-1).y); + } + /* draw the text */ cairo_set_source_rgb (cr, textData.textColor.Red/255., textData.textColor.Green/255., textData.textColor.Blue/255.); + cairo_translate(cr, translateX, translateY); pango_cairo_show_layout(cr, layout); + cairo_translate(cr, -translateX, -translateY); if(textData.border) { @@ -917,6 +931,68 @@ bool CairoPangoRenderer::getBounds(const TextData& _textData, uint32_t& w, uint3 return (h!=0) && (w!=0); } +PangoRectangle CairoPangoRenderer::lineExtents(PangoLayout *layout, int lineNumber) +{ + PangoRectangle rect; + memset(&rect, 0, sizeof(PangoRectangle)); + int i = 0; + PangoLayoutIter* lineIter = pango_layout_get_iter(layout); + do + { + if (i == lineNumber) + { + pango_layout_iter_get_line_extents(lineIter, NULL, &rect); + break; + } + + i++; + } while (pango_layout_iter_next_line(lineIter)); + pango_layout_iter_free(lineIter); + + return rect; +} + +std::vector CairoPangoRenderer::getLineData(const TextData& _textData) +{ + //TODO:check locking + Locker l(pangoMutex); + cairo_surface_t* cairoSurface=cairo_image_surface_create_for_data(NULL, CAIRO_FORMAT_ARGB32, 0, 0, 0); + cairo_t *cr=cairo_create(cairoSurface); + + PangoLayout* layout; + layout = pango_cairo_create_layout(cr); + pangoLayoutFromData(layout, _textData); + + int XOffset = _textData.scrollH; + int YOffset = PANGO_PIXELS(lineExtents(layout, _textData.scrollV-1).y); + std::vector data; + data.reserve(pango_layout_get_line_count(layout)); + PangoLayoutIter* lineIter = pango_layout_get_iter(layout); + do + { + PangoRectangle rect; + pango_layout_iter_get_line_extents(lineIter, NULL, &rect); + PangoLayoutLine* line = pango_layout_iter_get_line(lineIter); + data.emplace_back(PANGO_PIXELS(rect.x) - XOffset, + PANGO_PIXELS(rect.y) - YOffset, + PANGO_PIXELS(rect.width), + PANGO_PIXELS(rect.height), + _textData.text.bytePosToIndex(line->start_index), + _textData.text.substr_bytes(line->start_index, line->length).numChars(), + PANGO_PIXELS(PANGO_ASCENT(rect)), + PANGO_PIXELS(PANGO_DESCENT(rect)), + PANGO_PIXELS(PANGO_LBEARING(rect)), + 0); // FIXME + } while (pango_layout_iter_next_line(lineIter)); + pango_layout_iter_free(lineIter); + + g_object_unref(layout); + cairo_destroy(cr); + cairo_surface_destroy(cairoSurface); + + return data; +} + void CairoPangoRenderer::applyCairoMask(cairo_t* cr, int32_t xOffset, int32_t yOffset) const { assert(false); diff --git a/src/backends/graphics.h b/src/backends/graphics.h index 63ba009..674a967 100644 --- a/src/backends/graphics.h +++ b/src/backends/graphics.h @@ -344,7 +344,7 @@ class TextData { public: /* the default values are from the spec for flash.text.TextField and flash.text.TextFormat */ - TextData() : width(100), height(100), textWidth(0), textHeight(0), font("Times New Roman"), background(false), backgroundColor(0xFFFFFF), + TextData() : width(100), height(100), textWidth(0), textHeight(0), font("Times New Roman"), scrollH(0), scrollV(1), background(false), backgroundColor(0xFFFFFF), border(false), borderColor(0x000000), multiline(false), textColor(0x000000), autoSize(AS_NONE), fontSize(12), wordWrap(false) {} uint32_t width; @@ -353,6 +353,8 @@ public: uint32_t textHeight; tiny_string text; tiny_string font; + int32_t scrollH; // pixels, 0-based + int32_t scrollV; // lines, 1-based bool background; RGB backgroundColor; bool border; @@ -365,6 +367,28 @@ public: bool wordWrap; }; +class LineData { +public: + LineData(int32_t x, int32_t y, int32_t _width, + int32_t _height, int32_t _firstCharOffset, int32_t _length, + number_t _ascent, number_t _descent, number_t _leading, + number_t _indent): + extents(x, x+_width, y, y+_height), + firstCharOffset(_firstCharOffset), length(_length), + ascent(_ascent), descent(_descent), leading(_leading), + indent(_indent) {} + // position and size + RECT extents; + // Offset of the first character on this line + int32_t firstCharOffset; + // length of the line in characters + int32_t length; + number_t ascent; + number_t descent; + number_t leading; + number_t indent; +}; + class CairoPangoRenderer : public CairoRenderer { static StaticMutex pangoMutex; @@ -375,6 +399,7 @@ class CairoPangoRenderer : public CairoRenderer TextData textData; static void pangoLayoutFromData(PangoLayout* layout, const TextData& tData); void applyCairoMask(cairo_t* cr, int32_t offsetX, int32_t offsetY) const; + static PangoRectangle lineExtents(PangoLayout *layout, int lineNumber); public: CairoPangoRenderer(const TextData& _textData, const MATRIX& _m, int32_t _x, int32_t _y, int32_t _w, int32_t _h, float _s, float _a, const std::vector& _ms) @@ -385,6 +410,7 @@ public: @param w,h,tw,th are the (text)width and (text)height of the textData. */ static bool getBounds(const TextData& _textData, uint32_t& w, uint32_t& h, uint32_t& tw, uint32_t& th); + static std::vector getLineData(const TextData& _textData); }; class InvalidateQueue diff --git a/src/backends/input.cpp b/src/backends/input.cpp index 96ea76c..fd3591d 100644 --- a/src/backends/input.cpp +++ b/src/backends/input.cpp @@ -141,6 +141,12 @@ bool InputThread::worker(GdkEvent *event) ret=TRUE; break; } + case GDK_LEAVE_NOTIFY: + { + handleMouseLeave(); + ret=TRUE; + break; + } default: //#ifdef EXPENSIVE_DEBUG // LOG(LOG_INFO, "GDKTYPE " << event->type); @@ -292,6 +298,15 @@ void InputThread::handleScrollEvent(uint32_t x, uint32_t y, GdkScrollDirection d _MR(Class::getInstanceS("mouseWheel",localX,localY,true,buttonState,NullRef,delta))); } +void InputThread::handleMouseLeave() +{ + if(m_sys->currentVm == NULL) + return; + + m_sys->currentVm->addEvent(m_sys->mainClip->getStage(), + _MR(Class::getInstanceS("mouseLeave"))); +} + void InputThread::initKeyTable() { int i = 0; diff --git a/src/backends/input.h b/src/backends/input.h index c1897f8..f02711f 100644 --- a/src/backends/input.h +++ b/src/backends/input.h @@ -78,6 +78,7 @@ private: void handleMouseUp(uint32_t x, uint32_t y, unsigned int buttonState); void handleMouseMove(uint32_t x, uint32_t y, unsigned int buttonState); void handleScrollEvent(uint32_t x, uint32_t y, GdkScrollDirection direction, unsigned int buttonState); + void handleMouseLeave(); void initKeyTable(); bool handleKeyboardShortcuts(const GdkEventKey *keyevent); diff --git a/src/backends/netutils.cpp b/src/backends/netutils.cpp index 408c14b..1c397aa 100644 --- a/src/backends/netutils.cpp +++ b/src/backends/netutils.cpp @@ -24,6 +24,7 @@ #include "backends/config.h" #include "backends/netutils.h" #include "backends/rtmputils.h" +#include "backends/streamcache.h" #include "compat.h" #include #include @@ -165,25 +166,26 @@ StandaloneDownloadManager::~StandaloneDownloadManager() * \return A pointer to a newly created \c Downloader for the given URL. * \see DownloadManager::destroy() */ -Downloader* StandaloneDownloadManager::download(const URLInfo& url, bool cached, ILoadable* owner) +Downloader* StandaloneDownloadManager::download(const URLInfo& url, _R cache, ILoadable* owner) { + bool cached = dynamic_cast(cache.getPtr()) != NULL; LOG(LOG_INFO, _("NET: STANDALONE: DownloadManager::download '") << url.getParsedURL() << "'" << (cached ? _(" - cached") : "")); ThreadedDownloader* downloader; if(url.getProtocol() == "file") { LOG(LOG_INFO, _("NET: STANDALONE: DownloadManager: local file")); - downloader=new LocalDownloader(url.getPath(), cached, owner); + downloader=new LocalDownloader(url.getPath(), cache, owner); } else if(url.getProtocol().substr(0, 4) == "rtmp") { LOG(LOG_INFO, _("NET: STANDALONE: DownloadManager: RTMP stream")); - downloader=new RTMPDownloader(url.getParsedURL(), url.getStream(), owner); + downloader=new RTMPDownloader(url.getParsedURL(), cache, url.getStream(), owner); } else { LOG(LOG_INFO, _("NET: STANDALONE: DownloadManager: remote file")); - downloader=new CurlDownloader(url.getParsedURL(), cached, owner); + downloader=new CurlDownloader(url.getParsedURL(), cache, owner); } downloader->enableFencingWaiting(); addDownloader(downloader); @@ -201,7 +203,8 @@ Downloader* StandaloneDownloadManager::download(const URLInfo& url, bool cached, * \return A pointer to a newly created \c Downloader for the given URL. * \see DownloadManager::destroy() */ -Downloader* StandaloneDownloadManager::downloadWithData(const URLInfo& url, const std::vector& data, +Downloader* StandaloneDownloadManager::downloadWithData(const URLInfo& url, _R cache, + const std::vector& data, const std::list& headers, ILoadable* owner) { LOG(LOG_INFO, _("NET: STANDALONE: DownloadManager::downloadWithData '") << url.getParsedURL()); @@ -209,14 +212,14 @@ Downloader* StandaloneDownloadManager::downloadWithData(const URLInfo& url, cons if(url.getProtocol() == "file") { LOG(LOG_INFO, _("NET: STANDALONE: DownloadManager: local file - Ignoring data field")); - downloader=new LocalDownloader(url.getPath(), false, owner); + downloader=new LocalDownloader(url.getPath(), cache, owner); } else if(url.getProtocol() == "rtmpe") throw RunTimeException("RTMPE does not support additional data"); else { LOG(LOG_INFO, _("NET: STANDALONE: DownloadManager: remote file")); - downloader=new CurlDownloader(url.getParsedURL(), data, headers, owner); + downloader=new CurlDownloader(url.getParsedURL(), cache, data, headers, owner); } downloader->enableFencingWaiting(); addDownloader(downloader); @@ -229,20 +232,15 @@ Downloader* StandaloneDownloadManager::downloadWithData(const URLInfo& url, cons * * Constructor for the Downloader class. Can only be called from derived classes. * \param[in] _url The URL for the Downloader. - * \param[in] _cached Whether or not to cache this download. + * \param[in] _cache StreamCache instance for caching this download. */ -Downloader::Downloader(const tiny_string& _url, bool _cached, ILoadable* o): - cacheOpened(0),dataAvailable(0),terminated(0),hasTerminated(false),cacheHasOpened(false), //LOCKING - waitingForCache(false),waitingForData(false),waitingForTermination(false), //STATUS - forceStop(true),failed(false),finished(false), //FLAGS +Downloader::Downloader(const tiny_string& _url, _R _cache, ILoadable* o): url(_url),originalURL(url), //PROPERTIES - buffer(NULL),stableBuffer(NULL), //BUFFERING + cache(_cache), //CACHING owner(o), //PROGRESS - cachePos(0),cacheSize(0),keepCache(false),cached(_cached), //CACHING redirected(false),requestStatus(0), //HTTP REDIR, STATUS & HEADERS - length(0),receivedLength(0) //DOWNLOADED DATA + length(0) //DOWNLOADED DATA { - setg(NULL,NULL,NULL); } /** @@ -252,18 +250,13 @@ Downloader::Downloader(const tiny_string& _url, bool _cached, ILoadable* o): * \param[in] _url The URL for the Downloader. * \param[in] data Additional data to send to the host */ -Downloader::Downloader(const tiny_string& _url, const std::vector& _data, const std::list& h, ILoadable* o): - cacheOpened(0),dataAvailable(0),terminated(0),hasTerminated(false),cacheHasOpened(false), //LOCKING - waitingForCache(false),waitingForData(false),waitingForTermination(false), //STATUS - forceStop(true),failed(false),finished(false), //FLAGS +Downloader::Downloader(const tiny_string& _url, _R _cache, const std::vector& _data, const std::list& h, ILoadable* o): url(_url),originalURL(url), //PROPERTIES - buffer(NULL),stableBuffer(NULL), //BUFFERING + cache(_cache), //CACHING owner(o), //PROGRESS - cachePos(0),cacheSize(0),keepCache(false),cached(false), //CACHING redirected(false),requestStatus(0),requestHeaders(h),data(_data),//HTTP REDIR, STATUS & HEADERS - length(0),receivedLength(0) //DOWNLOADED DATA + length(0) //DOWNLOADED DATA { - setg(NULL,NULL,NULL); } /** @@ -275,263 +268,6 @@ Downloader::Downloader(const tiny_string& _url, const std::vector& _dat */ Downloader::~Downloader() { - waitForTermination(); - - Mutex::Lock l(mutex); - - if(cached) - { - if(cache.is_open()) - cache.close(); - if(!keepCache && cacheFilename != "") - unlink(cacheFilename.raw_buf()); - } - if(buffer != NULL) - { - free(buffer); - } - if(stableBuffer != NULL && stableBuffer!=buffer) - { - free(stableBuffer); - } -} - -/** - * \brief Called by the streambuf API - * - * Called by the streambuf API when there is no more data to read. - * Waits for the mutex at start and releases the mutex when finished. - * \throw RunTimeException Cache file could not be read - */ -Downloader::int_type Downloader::underflow() -{ - Mutex::Lock l(mutex); - //Let's see if the other buffer contains new data - syncBuffers(); - if(egptr()-gptr()>0) - { - //There is data already - return *(uint8_t*)gptr(); - } - const unsigned int startOffset=getOffset(); - const unsigned int startReceivedLength=receivedLength; - assert(startOffset<=startReceivedLength); - //If we have read all available data - if(startReceivedLength==startOffset) - { - //The download has failed or has finished - if(failed || finished) - return EOF; - //We haven't reached the end of the download, more bytes should follow - else - { - waitForData_locked(); - syncBuffers(); - - //Check if we haven't failed or finished (and there wasn't any new data) - if(failed || (finished && startReceivedLength==receivedLength)) - return EOF; - } - } - - //We should have an initialized buffer here since there is some data - assert_and_throw(buffer != NULL); - //Temporary pointers to new streambuf read positions - char* begin; - char* cur; - char* end; - //Index in the buffer pointing to the data to be returned - uint32_t index; - - if(cached) - { - waitForCache(); - - size_t newCacheSize = receivedLength-(cachePos+cacheSize); - if(newCacheSize > cacheMaxSize) - newCacheSize = cacheMaxSize; - - //Move the start of our new window to the end of our last window - cachePos = cachePos+cacheSize; - cacheSize = newCacheSize; - //Seek to the start of our new window - cache.seekg(cachePos); - //Read into our buffer window - cache.read((char*)stableBuffer, cacheSize); - if(cache.fail()) - { - throw RunTimeException(_("Downloader::underflow: reading from cache file failed")); - } - - begin=(char*)stableBuffer; - cur=(char*)stableBuffer; - end=(char*)stableBuffer+cacheSize; - index=0; - - } - else - { - begin=(char*)stableBuffer; - cur=(char*)stableBuffer+startOffset; - end=(char*)stableBuffer+receivedLength; - index=startOffset; - } - - //If we've failed, don't bother any more - if(failed) - return EOF; - - //Set our new iterators in the buffer (begin, cursor, end) - setg(begin, cur, end); - - //Cast to unsigned, otherwise 0xff would become eof - return (unsigned char)stableBuffer[index]; -} - -/** - * Internal function to synchronize oldBuffer and buffer - * - * \pre Must be called from a function called by the streambuf API - */ -void Downloader::syncBuffers() -{ - if(stableBuffer!=buffer) - { - //The buffer have been changed - free(stableBuffer); - stableBuffer=buffer; - //Remember the relative positions of the input pointers - intptr_t curPos = (intptr_t) (gptr()-eback()); - intptr_t curLen = (intptr_t) (egptr()-eback()); - //Do some pointer arithmetic to point the input pointers to the right places in the new buffer - setg((char*)stableBuffer,(char*)(stableBuffer+curPos),(char*)(stableBuffer+curLen)); - } -} - -/** - * \brief Called by the streambuf API - * - * Called by the streambuf API to seek to an absolute position - * Mutex must be locked on entry. - * \throw RunTimeException Cache file could not be read - */ -Downloader::pos_type Downloader::seekpos(pos_type pos, std::ios_base::openmode mode) -{ - assert_and_throw(mode==std::ios_base::in); - assert_and_throw(buffer && stableBuffer); - - syncBuffers(); - - // read from stream until we have enough data - uint32_t tmplen = receivedLength; - while (!hasTerminated && pos > receivedLength) - { - waitForData_locked(); - syncBuffers(); - if (tmplen == receivedLength) - break; // no new data read - tmplen = receivedLength; - } - - if(cached) - { - waitForCache(); - - //The requested position is inside our current window - if(pos >= cachePos && pos <= cachePos+cacheSize) - { - //Just move our cursor to the correct position in our window - setg((char*)stableBuffer, (char*)stableBuffer+pos-cachePos, (char*)stableBuffer+cacheSize); - } - //The requested position is outside our current window - else if(pos <= receivedLength) - { - cachePos = pos; - cacheSize = receivedLength-pos; - if(cacheSize > cacheMaxSize) - cacheSize = cacheMaxSize; - - //Seek to the requested position - cache.seekg(cachePos); - //Read into our window - cache.read((char*)stableBuffer, cacheSize); - if(cache.fail()) - throw RunTimeException(_("Downloader::seekpos: reading from cache file failed")); - - //Our window starts at position pos - setg((char*) stableBuffer, (char*) stableBuffer, ((char*) stableBuffer)+cacheSize); - } - //The requested position is bigger then our current amount of available data - else if(pos > receivedLength) - return -1; - } - else - { - //The requested position is valid - if(pos <= receivedLength) - setg((char*)stableBuffer,(char*)stableBuffer+pos,(char*)stableBuffer+receivedLength); - //The requested position is bigger then our current amount of available data - else - return -1; - } - - return pos; -} - -/** - * \brief Called by the streambuf API - * - * Called by the streambuf API to seek to a relative position - * Waits for the mutex at start and releases the mutex when finished. - */ -Downloader::pos_type Downloader::seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode mode) -{ - assert_and_throw(mode==std::ios_base::in); - assert_and_throw(buffer != NULL); - - Mutex::Lock l(mutex); - if (off != 0) - { - switch (dir) - { - case std::ios_base::beg: - seekpos(off,mode); - break; - case std::ios_base::cur: - { - pos_type tmp = getOffset(); - seekpos(tmp+off,mode); - break; - } - case std::ios_base::end: - l.release(); - waitForTermination(); - l.acquire(); - if (finished) - seekpos(length+off,mode); - break; - default: - break; - } - } - - return getOffset(); -} - -/** - * \brief Get the position of the read cursor in the (virtual) downloaded data - * - * Get the position of the read cursor in the (virtual) downloaded data. - * If downloading to memory this method returns the position of the read cursor in the buffer. - * If downloading to a cache file, this method returns the position of the read cursor in the buffer - * + the position of the buffer window into the cache file. - */ -Downloader::pos_type Downloader::getOffset() const -{ - pos_type ret = gptr()-eback(); - if(cached) - ret+=cachePos; - return ret; } /** @@ -541,28 +277,13 @@ Downloader::pos_type Downloader::getOffset() const * signals \c dataAvailable if it is being waited for. * It also signals \c terminated to mark the end of the download. * A download should finish be either calling \c setFailed() or \c setFinished(), not both. - * \post \c failed == \c true & \c finished == \c true * \post \c length == \c receivedLength - * \post Signals \c dataAvailable if it is being waited for (\c waitingForData == \c true). - * \post \c waitingForTermination == \c false - * \post Signals \c terminated */ void Downloader::setFailed() { - failed=true; - finished = true; + cache->markFinished(true); //Set the final length - length = receivedLength; - - //If we are waiting for data to become available, signal dataAvailable - if(waitingForData) - { - waitingForData = false; - dataAvailable.signal(); - } - - waitingForTermination = false; - terminated.signal(); + length = cache->getReceivedLength(); } /** @@ -572,139 +293,13 @@ void Downloader::setFailed() * signals \c dataAvailable if it is being waited for. * It also signals \c terminated to mark the end of the download. * A download should finish be either calling \c setFailed() or \c setFinished(), not both. - * \post \c finished == \ctrue * \post \c length == \c receivedLength - * \post Signals \c dataAvailable if it is being waited for (\c waitingForData == true). - * \post \c waitingForTermination == \c false - * \post Signals \c terminated */ void Downloader::setFinished() { - finished=true; + cache->markFinished(); //Set the final length - length = receivedLength; - - //If we are waiting for data to become available, signal dataAvailable - if(waitingForData) - { - waitingForData = false; - dataAvailable.signal(); - } - - waitingForTermination = false; - terminated.signal(); -} - -/** - * \brief (Re)allocates the buffer - * - * (Re)allocates the buffer to a given size - * Waits for mutex at start and releases mutex when finished. - * \post \c buffer is (re)allocated - * mutex must be locked on entry - */ -void Downloader::allocateBuffer(size_t size) -{ - //Create buffer - if(buffer == NULL) - { - buffer = (uint8_t*) calloc(size, sizeof(uint8_t)); - stableBuffer = buffer; - setg((char*)buffer,(char*)buffer,(char*)buffer); - } - //If the buffer already exists, reallocate - else - { - assert(!cached); - intptr_t curLen = receivedLength; - //We have to extend the buffer, so create a new one - if(stableBuffer!=buffer) - { - //We're already filling a different buffer from the one used to read - //Extend it! - buffer = (uint8_t*)realloc(buffer,size); - } - else - { - //Create a different buffer - buffer = (uint8_t*) calloc(size, sizeof(uint8_t)); - //Copy the stableBuffer into this - memcpy(buffer,stableBuffer,curLen); - } - //Synchronization of the buffers will be done at the first chance - } -} - -/** - * \brief Creates & opens a temporary cache file - * - * Creates a temporary cache file in /tmp and calls \c openExistingCache() with that file. - * Waits for mutex at start and releases mutex when finished. - * \throw RunTimeException Temporary file could not be created - * \throw RunTimeException Called when the downloader isn't cached or when the cache is already open - * \see Downloader::openExistingCache() - * mutex must be hold prior calling - */ -void Downloader::openCache() -{ - //Only act if the downloader is cached and the cache hasn't been opened yet - if(cached && !cache.is_open()) - { - //Create a temporary file(name) - std::string cacheFilenameS = Config::getConfig()->getCacheDirectory() + "/" + Config::getConfig()->getCachePrefix() + "XXXXXX"; - char* cacheFilenameC = g_newa(char,cacheFilenameS.length()+1); - strncpy(cacheFilenameC, cacheFilenameS.c_str(), cacheFilenameS.length()); - cacheFilenameC[cacheFilenameS.length()] = '\0'; - //char cacheFilenameC[30] = "/tmp/lightsparkdownloadXXXXXX"; - //strcpy(cacheFilenameC, "/tmp/lightsparkdownloadXXXXXX"); - int fd = g_mkstemp(cacheFilenameC); - if(fd == -1) - throw RunTimeException(_("Downloader::openCache: cannot create temporary file")); - //We are using fstream to read/write to the cache, so we don't need this FD - close(fd); - - //Let the openExistingCache function handle the rest - openExistingCache(tiny_string(cacheFilenameC, true)); - } - else - throw RunTimeException(_("Downloader::openCache: downloader isn't cached or called twice")); -} - -/** - * \brief Opens an existing cache file - * - * Opens an existing cache file, allocates the buffer and signals \c cacheOpened. - * Waits for mutex at start and releases mutex when finished. - * \post \c cacheFilename is set - * \post \c cache file is opened - * \post \c buffer is initialized - * \post \c cacheOpened is signalled - * \throw RunTimeException File could not be opened - * \throw RunTimeException Called when the downloader isn't cached or when the cache is already open - * \see Downloader::allocateBuffer() - * mutex must be hold on entering - */ -void Downloader::openExistingCache(tiny_string filename) -{ - //Only act if the downloader is cached and the cache hasn't been opened yet - if(cached && !cache.is_open()) - { - //Save the filename - cacheFilename = filename; - - //Open the cache file - cache.open(cacheFilename.raw_buf(), std::fstream::binary | std::fstream::in | std::fstream::out); - if(!cache.is_open()) - throw RunTimeException(_("Downloader::openCache: cannot open temporary cache file")); - - allocateBuffer(cacheMaxSize); - - LOG(LOG_INFO, _("NET: Downloading to cache file: ") << cacheFilename); - - cacheOpened.signal(); - } - else - throw RunTimeException(_("Downloader::openCache: downloader isn't cached or called twice")); + length = cache->getReceivedLength(); } /** @@ -712,27 +307,14 @@ void Downloader::openExistingCache(tiny_string filename) * * Sets the expected length of the download. * Can be called multiple times if the length isn't known up front (reallocating the buffer on the fly). - * Waits for mutex at start and releases mutex when finished. - * \post \c buffer is (re)allocated - * mutex must be hold prior calling */ void Downloader::setLength(uint32_t _length) { //Set the length length=_length; - //The first call to this function should open the cache - if(cached) - { - if(!cache.is_open()) - openCache(); - } - else - { - if(buffer == NULL) - LOG(LOG_INFO, _("NET: Downloading to memory")); - allocateBuffer(length); - } + cache->reserve(length); + notifyOwnerAboutBytesTotal(); } @@ -752,39 +334,9 @@ void Downloader::append(uint8_t* buf, uint32_t added) if(added==0) return; - Mutex::Lock l(mutex); - - //If the added data would overflow the buffer, grow it - if((receivedLength+added)>length) - { - uint32_t newLength; - assert(length>=receivedLength); - //If reallocating the buffer ask for a minimum amount of space - if((receivedLength+added)-length > bufferMinGrowth) - newLength = receivedLength + added; - else - newLength = length + bufferMinGrowth; - assert(newLength>=receivedLength+added); - - setLength(newLength); - } - - if(cached) - { - //Seek to where we last wrote data - cache.seekp(receivedLength); - cache.write((char*) buf, added); - } - else - memcpy(buffer+receivedLength, buf, added); - - receivedLength += added; - - if(waitingForData) - { - waitingForData = false; - dataAvailable.signal(); - } + cache->append((unsigned char *)buf, added); + if (cache->getReceivedLength() > length) + setLength(cache->getReceivedLength()); notifyOwnerAboutBytesLoaded(); } @@ -824,8 +376,6 @@ void Downloader::parseHeaders(const char* _headers, bool _setLength) */ void Downloader::parseHeader(std::string header, bool _setLength) { - Mutex::Lock l(mutex); - if(header.substr(0, 9) == "HTTP/1.1 " || header.substr(0, 9) == "HTTP/1.0 ") { std::string status = header.substr(9, 3); @@ -891,83 +441,8 @@ void Downloader::parseHeader(std::string header, bool _setLength) */ void Downloader::stop() { - failed = true; - finished = true; - length = receivedLength; - - waitingForData = false; - dataAvailable.signal(); - - waitingForTermination = false; - terminated.signal(); -} - -/** - * \brief Wait for the cache file to be opened - * - * If \c !cacheHasOpened: wait for the \c cacheOpened signal and set \c cacheHasOpened to \c true - * Waits for the mutex at start and releases the mutex when finished. - * \post \c cacheOpened signals has been handled - * \post \c cacheHasOpened = true - * mutex must be locked on entry - */ -void Downloader::waitForCache() -{ - if(!cacheHasOpened) - { - waitingForCache = true; - - mutex.unlock(); - cacheOpened.wait(); - mutex.lock(); - - cacheHasOpened = true; - } -} - -/** - * \brief Wait for data to become available - * - * Wait for data to become available. - * Waits for the mutex at start and releases the mutex when finished. - * \post \c dataAvailable signal has been handled - */ -void Downloader::waitForData_locked() -{ - waitingForData = true; - mutex.unlock(); - dataAvailable.wait(); - mutex.lock(); -} - -/** - * \brief Wait for termination of the downloader - * - * If \c getSys()->isShuttingDown(), calls \c setFailed() and returns. - * Otherwise if \c !hasTerminated: wait for the \c terminated signal and set \c hasTerminated to \c true - * Waits for the mutex at start and releases the mutex when finished. - * \post \c terminated signal has been handled - * \post \c hasTerminated = true - */ -void Downloader::waitForTermination() -{ - Mutex::Lock l(mutex); - if(getSys()->isShuttingDown()) - { - setFailed(); - return; - } - - if(!hasTerminated) - { - waitingForTermination = true; - - l.release(); - terminated.wait(); - l.acquire(); - - hasTerminated = true; - } + cache->markFinished(true); + length = cache->getReceivedLength(); } void Downloader::notifyOwnerAboutBytesTotal() const @@ -979,7 +454,7 @@ void Downloader::notifyOwnerAboutBytesTotal() const void Downloader::notifyOwnerAboutBytesLoaded() const { if(owner) - owner->setBytesLoaded(receivedLength); + owner->setBytesLoaded(cache->getReceivedLength()); } void ThreadedDownloader::enableFencingWaiting() @@ -1010,8 +485,8 @@ void ThreadedDownloader::waitFencing() * \param[in] _url The URL for the Downloader. * \param[in] _cached Whether or not to cache this download. */ -ThreadedDownloader::ThreadedDownloader(const tiny_string& url, bool cached, ILoadable* o): - Downloader(url, cached, o),fenceState(false) +ThreadedDownloader::ThreadedDownloader(const tiny_string& url, _R cache, ILoadable* o): + Downloader(url, cache, o),fenceState(false) { } @@ -1022,9 +497,10 @@ ThreadedDownloader::ThreadedDownloader(const tiny_string& url, bool cached, ILoa * \param[in] _url The URL for the Downloader. * \param[in] data Additional data to send to the host */ -ThreadedDownloader::ThreadedDownloader(const tiny_string& url, const std::vector& data, +ThreadedDownloader::ThreadedDownloader(const tiny_string& url, _R cache, + const std::vector& data, const std::list& headers, ILoadable* o): - Downloader(url, data, headers, o),fenceState(false) + Downloader(url, cache, data, headers, o),fenceState(false) { } @@ -1046,8 +522,8 @@ ThreadedDownloader::~ThreadedDownloader() * \param[in] _url The URL for the Downloader. * \param[in] _cached Whether or not to cache this download. */ -CurlDownloader::CurlDownloader(const tiny_string& _url, bool _cached, ILoadable* o): - ThreadedDownloader(_url, _cached, o) +CurlDownloader::CurlDownloader(const tiny_string& _url, _R _cache, ILoadable* o): + ThreadedDownloader(_url, _cache, o) { } @@ -1057,9 +533,10 @@ CurlDownloader::CurlDownloader(const tiny_string& _url, bool _cached, ILoadable* * \param[in] _url The URL for the Downloader. * \param[in] data Additional data to send to the host */ -CurlDownloader::CurlDownloader(const tiny_string& _url, const std::vector& _data, +CurlDownloader::CurlDownloader(const tiny_string& _url, _R _cache, + const std::vector& _data, const std::list& _headers, ILoadable* o): - ThreadedDownloader(_url, _data, _headers, o) + ThreadedDownloader(_url, _cache, _data, _headers, o) { } @@ -1180,7 +657,7 @@ void CurlDownloader::execute() int CurlDownloader::progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { CurlDownloader* th=static_cast(clientp); - return th->threadAborting || th->failed; + return th->threadAborting || th->cache->hasFailed(); } /** @@ -1224,7 +701,8 @@ size_t CurlDownloader::write_header(void *buffer, size_t size, size_t nmemb, voi * \param[in] _url The URL for the Downloader. * \param[in] _cached Whether or not to cache this download. */ -LocalDownloader::LocalDownloader(const tiny_string& _url, bool _cached, ILoadable* o):ThreadedDownloader(_url, _cached, o) +LocalDownloader::LocalDownloader(const tiny_string& _url, _R _cache, ILoadable* o): + ThreadedDownloader(_url, _cache, o) { } @@ -1256,18 +734,14 @@ void LocalDownloader::execute() LOG(LOG_INFO, _("NET: LocalDownloader::execute: reading local file: ") << url.raw_buf()); //If the caching is selected, we override the normal behaviour and use the local file as the cache file //This prevents unneeded copying of the file's data - if(isCached()) - { - Mutex::Lock l(mutex); - //Make sure we don't delete the local file afterwards - keepCache = true; - openExistingCache(url); + FileStreamCache *fileCache = dynamic_cast(cache.getPtr()); + if (fileCache) + { + fileCache->useExistingFile(url); - cache.seekg(0, std::ios::end); //Report that we've downloaded everything already - length = cache.tellg(); - receivedLength = length; + length = fileCache->getReceivedLength(); notifyOwnerAboutBytesLoaded(); notifyOwnerAboutBytesTotal(); } @@ -1280,7 +754,6 @@ void LocalDownloader::execute() { file.seekg(0, std::ios::end); { - Mutex::Lock l(mutex); setLength(file.tellg()); } file.seekg(0, std::ios::beg); @@ -1290,7 +763,7 @@ void LocalDownloader::execute() bool readFailed = 0; while(!file.eof()) { - if(file.fail() || hasFailed()) + if(file.fail() || cache->hasFailed()) { readFailed = 1; break; @@ -1329,7 +802,7 @@ DownloaderThreadBase::DownloaderThreadBase(_NR request, IDownloaderT } } -bool DownloaderThreadBase::createDownloader(bool cached, +bool DownloaderThreadBase::createDownloader(_R cache, _NR dispatcher, ILoadable* owner, bool checkPolicyFile) @@ -1355,11 +828,11 @@ bool DownloaderThreadBase::createDownloader(bool cached, if(postData.empty()) { //This is a GET request - downloader=getSys()->downloadManager->download(url, cached, owner); + downloader=getSys()->downloadManager->download(url, cache, owner); } else { - downloader=getSys()->downloadManager->downloadWithData(url, postData, requestHeaders, owner); + downloader=getSys()->downloadManager->downloadWithData(url, cache, postData, requestHeaders, owner); } return true; diff --git a/src/backends/netutils.h b/src/backends/netutils.h index de2789b..2f1f6fd 100644 --- a/src/backends/netutils.h +++ b/src/backends/netutils.h @@ -29,6 +29,7 @@ #include "swftypes.h" #include "thread_pool.h" #include "backends/urlutils.h" +#include "backends/streamcache.h" #include "smartrefs.h" namespace lightspark @@ -57,8 +58,9 @@ protected: void cleanUp(); public: virtual ~DownloadManager(); - virtual Downloader* download(const URLInfo& url, bool cached, ILoadable* owner)=0; - virtual Downloader* downloadWithData(const URLInfo& url, const std::vector& data, + virtual Downloader* download(const URLInfo& url, _R cache, ILoadable* owner)=0; + virtual Downloader* downloadWithData(const URLInfo& url, _R cache, + const std::vector& data, const std::list& headers, ILoadable* owner)=0; virtual void destroy(Downloader* downloader)=0; void stopAll(); @@ -72,57 +74,22 @@ class DLL_PUBLIC StandaloneDownloadManager:public DownloadManager public: StandaloneDownloadManager(); ~StandaloneDownloadManager(); - Downloader* download(const URLInfo& url, bool cached, ILoadable* owner); - Downloader* downloadWithData(const URLInfo& url, const std::vector& data, + Downloader* download(const URLInfo& url, _R cache, ILoadable* owner); + Downloader* downloadWithData(const URLInfo& url, _R cache, + const std::vector& data, const std::list& headers, ILoadable* owner); void destroy(Downloader* downloader); }; -class DLL_PUBLIC Downloader: public std::streambuf +class DLL_PUBLIC Downloader { -private: - //Handles streambuf out-of-data events - virtual int_type underflow(); - //Seeks to absolute position - virtual pos_type seekoff(off_type, std::ios_base::seekdir, std::ios_base::openmode); - //Seeks to relative position - virtual pos_type seekpos(pos_type, std::ios_base::openmode); - //Helper to get the current offset - pos_type getOffset() const; protected: //Abstract base class, can't be constructed - Downloader(const tiny_string& _url, bool _cached, ILoadable* o); - Downloader(const tiny_string& _url, const std::vector& data, + Downloader(const tiny_string& _url, _R _cache, ILoadable* o); + Downloader(const tiny_string& _url, _R _cache, const std::vector& data, const std::list& headers, ILoadable* o); - //-- LOCKING - //Provides internal mutual exclusing - Mutex mutex; - //Signals the cache opening - Semaphore cacheOpened; - //Signals new bytes available for reading - Semaphore dataAvailable; - //Signals termination of the download - Semaphore terminated; - //True if the download is terminated - bool hasTerminated; - //True if cache has opened - bool cacheHasOpened; - - //-- STATUS - //True if the downloader is waiting for the cache to be opened - bool waitingForCache; - //True if the downloader is waiting for data - bool waitingForData; - void waitForData_locked(); - //True if the downloader is waiting for termination - bool waitingForTermination; //-- FLAGS - //This flag forces a stop in internal code - bool forceStop; - //These flags specify what type of termination happened - bool failed; - bool finished; //Mark the download as failed void setFailed(); //Mark the download as finished @@ -132,43 +99,14 @@ protected: tiny_string url; tiny_string originalURL; - //-- BUFFERING - //This will hold the whole download (non-cached) or a window into the download (cached) - uint8_t* buffer; - //We can't change the used buffer (for example when resizing) asynchronously. We can only do that on underflows - uint8_t* stableBuffer; - //Minimum growth of the buffer - static const size_t bufferMinGrowth = 4096; - //(Re)allocate the buffer - void allocateBuffer(size_t size); - //Synchronize stableBuffer and buffer - void syncBuffers(); + //-- CACHING + _R cache; //-- PROGRESS MONITORING ILoadable* owner; void notifyOwnerAboutBytesTotal() const; void notifyOwnerAboutBytesLoaded() const; - //-- CACHING - //Cache filename - tiny_string cacheFilename; - //Cache fstream - std::fstream cache; - //Position of the cache buffer into the file - uint32_t cachePos; - //Size of data in the buffer - uint32_t cacheSize; - //Maximum size of the cache buffer - static const size_t cacheMaxSize = 8192; - //True if the cache file doesn't need to be deleted on destruction - bool keepCache:1; - //True if the file is cached to disk (default = false) - bool cached:1; - //Creates & opens a temporary cache file - void openCache(); - //Opens an existing cache file - void openExistingCache(tiny_string filename); - //-- HTTP REDIRECTION, STATUS & HEADERS bool redirected:1; void setRedirected(const tiny_string& newURL) @@ -187,10 +125,6 @@ protected: //-- DOWNLOADED DATA //File length (can change in certain cases, resulting in reallocation of the buffer (non-cached)) uint32_t length; - //Amount of data already received - uint32_t receivedLength; - //Append data to the internal buffer - void append(uint8_t* buffer, uint32_t length); //Set the length of the downloaded file, can be called multiple times to accomodate a growing file void setLength(uint32_t _length); public: @@ -198,28 +132,23 @@ public: virtual ~Downloader(); //Stop the download void stop(); - //Wait for cache to be opened - void waitForCache(); - //Wait for data to become available - void waitForData() { Mutex::Lock l(mutex); waitForData_locked(); } - //Wait for the download to terminate - void waitForTermination(); //True if the download has failed - bool hasFailed() { return failed; } + bool hasFailed() { return cache->hasFailed(); } //True if the download has finished //Can be used in conjunction with failed to find out if it finished successfully - bool hasFinished() { return finished; } - - //True if the download is cached - bool isCached() { return cached; } + bool hasFinished() { return cache->hasTerminated(); } const tiny_string& getURL() { return url; } + //Wait until the downloader completes + void waitForTermination() { return cache->waitForTermination(); } + + _R getCache() { return cache; } //Gets the total length of the downloaded file (may change) uint32_t getLength() { return length; } //Gets the length of downloaded data - uint32_t getReceivedLength() { return receivedLength; } + uint32_t getReceivedLength() { return cache->getReceivedLength(); } size_t getHeaderCount() { return headers.size(); } tiny_string getHeader(const char* header) { return getHeader(tiny_string(header)); } @@ -232,7 +161,8 @@ public: bool isRedirected() { return redirected; } const tiny_string& getOriginalURL() { return originalURL; } uint16_t getRequestStatus() { return requestStatus; } - + //Append data to the internal buffer + void append(uint8_t* buffer, uint32_t length); }; class ThreadedDownloader : public Downloader, public IThreadJob @@ -245,8 +175,9 @@ public: void waitFencing(); protected: //Abstract base class, can not be constructed - ThreadedDownloader(const tiny_string& url, bool cached, ILoadable* o); - ThreadedDownloader(const tiny_string& url, const std::vector& data, + ThreadedDownloader(const tiny_string& url, _R cache, ILoadable* o); + ThreadedDownloader(const tiny_string& url, _R cache, + const std::vector& data, const std::list& headers, ILoadable* o); // //This class can only get destroyed by DownloadManager // virtual ~ThreadedDownloader(); @@ -262,8 +193,8 @@ private: void execute(); void threadAbort(); public: - CurlDownloader(const tiny_string& _url, bool _cached, ILoadable* o); - CurlDownloader(const tiny_string& _url, const std::vector& data, + CurlDownloader(const tiny_string& _url, _R cache, ILoadable* o); + CurlDownloader(const tiny_string& _url, _R cache, const std::vector& data, const std::list& headers, ILoadable* o); }; @@ -280,7 +211,7 @@ private: //Size of the reading buffer static const size_t bufSize = 8192; public: - LocalDownloader(const tiny_string& _url, bool _cached, ILoadable* o); + LocalDownloader(const tiny_string& _url, _R _cache, ILoadable* o); }; class IDownloaderThreadListener @@ -306,7 +237,7 @@ protected: std::list requestHeaders; Spinlock downloaderLock; Downloader* downloader; - bool createDownloader(bool cached, + bool createDownloader(_R cache, _NR dispatcher=NullRef, ILoadable* owner=NULL, bool checkPolicyFile=true); diff --git a/src/backends/rendering.cpp b/src/backends/rendering.cpp index 08228db..b80a320 100644 --- a/src/backends/rendering.cpp +++ b/src/backends/rendering.cpp @@ -46,10 +46,10 @@ using namespace std; /* calculate FPS every second */ const Glib::TimeVal RenderThread::FPS_time(/*seconds*/1,/*microseconds*/0); -static GStaticPrivate renderThread = G_STATIC_PRIVATE_INIT; /* TLS */ +DEFINE_AND_INITIALIZE_TLS(renderThread); RenderThread* lightspark::getRenderThread() { - RenderThread* ret = (RenderThread*)g_static_private_get(&renderThread); + RenderThread* ret = (RenderThread*)tls_get(&renderThread); /* If this is NULL, then you are not calling from the render thread, * which is disallowed! (OpenGL is not threadsafe) */ @@ -326,7 +326,7 @@ void RenderThread::worker() { setTLSSys(m_sys); /* set TLS variable for getRenderThread() */ - g_static_private_set(&renderThread, this, NULL); + tls_set(&renderThread, this); ThreadProfile* profile=m_sys->allocateProfiler(RGB(200,0,0)); profile->setTag("Render"); diff --git a/src/backends/rtmputils.cpp b/src/backends/rtmputils.cpp index 131ae48..3b6865b 100644 --- a/src/backends/rtmputils.cpp +++ b/src/backends/rtmputils.cpp @@ -20,6 +20,7 @@ #include "backends/rtmputils.h" #include "logger.h" #include "swf.h" +#include "backends/streamcache.h" #ifdef ENABLE_RTMP #include @@ -28,8 +29,9 @@ using namespace lightspark; using namespace std; -RTMPDownloader::RTMPDownloader(const tiny_string& _url, const tiny_string& _stream, ILoadable* o): - ThreadedDownloader(_url, true, o), +RTMPDownloader::RTMPDownloader(const tiny_string& _url, _R _cache, + const tiny_string& _stream, ILoadable* o): + ThreadedDownloader(_url, _cache, o), stream(_stream) { } diff --git a/src/backends/rtmputils.h b/src/backends/rtmputils.h index 7e9de51..6082152 100644 --- a/src/backends/rtmputils.h +++ b/src/backends/rtmputils.h @@ -34,7 +34,8 @@ private: void threadAbort(); tiny_string stream; public: - RTMPDownloader(const tiny_string& _url, const tiny_string& _stream, ILoadable* o); + RTMPDownloader(const tiny_string& _url, _R _cache, + const tiny_string& _stream, ILoadable* o); }; }; diff --git a/src/backends/security.cpp b/src/backends/security.cpp index f460560..b43c8ca 100644 --- a/src/backends/security.cpp +++ b/src/backends/security.cpp @@ -1001,7 +1001,7 @@ bool URLPolicyFile::retrievePolicyFile(vector& outData) bool ok = true; //No caching needed for this download, we don't expect very big files - Downloader* downloader=getSys()->downloadManager->download(url, false, NULL); + Downloader* downloader=getSys()->downloadManager->download(url, _MR(new MemoryStreamCache), NULL); //Wait until the file is fetched downloader->waitForTermination(); @@ -1023,7 +1023,8 @@ bool URLPolicyFile::retrievePolicyFile(vector& outData) //Policy files must have on of the following content-types to be valid: //text/*, application/xml or application/xhtml+xml - tiny_string contentType = downloader->getHeader("content-type"); + std::list contenttypelist = downloader->getHeader("content-type").split(';'); + tiny_string contentType = contenttypelist.size() == 0 ? "" : contenttypelist.front(); if(ok && (subtype == HTTP || subtype == HTTPS) && contentType.substr(0, 5) != "text/" && contentType != "application/xml" && @@ -1052,11 +1053,13 @@ bool URLPolicyFile::retrievePolicyFile(vector& outData) if (ok) { - istream s(downloader); + std::streambuf *sbuf = downloader->getCache()->createReader(); + istream s(sbuf); size_t bufLength = downloader->getLength(); size_t offset = outData.size(); outData.resize(offset+bufLength); s.read((char*)&outData[offset], bufLength); + delete sbuf; } getSys()->downloadManager->destroy(downloader); diff --git a/src/backends/streamcache.cpp b/src/backends/streamcache.cpp new file mode 100644 index 0000000..6db1b58 --- /dev/null +++ b/src/backends/streamcache.cpp @@ -0,0 +1,499 @@ +/************************************************************************** + Lightspark, a free flash player implementation + + Copyright (C) 2013 Antti Ajanki (antti.ajanki at iki.fi) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +**************************************************************************/ + +#include +#include +#include +#include "backends/streamcache.h" +#include "backends/config.h" +#include "exceptions.h" +#include "logger.h" + +using namespace std; +using namespace lightspark; + +StreamCache::StreamCache() + : receivedLength(0), failed(false), terminated(false) +{ +} + +void StreamCache::markFinished(bool _failed) +{ + Locker locker(stateMutex); + if (terminated) + return; + + failed = _failed; + terminated = true; + stateCond.broadcast(); +} + +void StreamCache::waitForData(size_t currentOffset) +{ + Locker locker(stateMutex); + while (receivedLength <= currentOffset && !terminated) + stateCond.wait(stateMutex); +} + +void StreamCache::waitForTermination() +{ + Locker locker(stateMutex); + while (!terminated) + stateCond.wait(stateMutex); +} + +void StreamCache::append(const unsigned char* buffer, size_t length) +{ + if (!buffer || length == 0 || terminated) + return; + + handleAppend(buffer, length); + + { + Locker locker(stateMutex); + receivedLength += length; + stateCond.broadcast(); + } +} + +class lightspark::MemoryChunk { +public: + MemoryChunk(size_t len); + ~MemoryChunk(); + unsigned char * const buffer; + const size_t capacity; + ACQUIRE_RELEASE_VARIABLE(size_t, used); +}; + +MemoryChunk::MemoryChunk(size_t len) : + buffer(new unsigned char[len]), capacity(len), used(0) +{ +} + +MemoryChunk::~MemoryChunk() +{ + delete[] buffer; +} + +MemoryStreamCache::MemoryStreamCache(): + writeChunk(NULL), nextChunkSize(0) +{ +} + +MemoryStreamCache::~MemoryStreamCache() +{ + for (auto it=chunks.begin(); it!=chunks.end(); ++it) + delete *it; +} + +// Rounds val up to the next multiple of pow(2, s). +static size_t nextMultipleOf2Pow(size_t val, size_t s) +{ + return ((size_t)((double)(val-1) / (1 << s)) + 1) << s; +} + +void MemoryStreamCache::allocateChunk(size_t minLength) +{ + size_t len = imax(imax(minLength, minChunkSize), nextChunkSize); + len = nextMultipleOf2Pow(len, 12); + assert(len >= minLength); + nextChunkSize = len; + + { + Locker locker(chunkListMutex); + writeChunk = new MemoryChunk(len); + chunks.push_back(writeChunk); + } +} + +void MemoryStreamCache::handleAppend(const unsigned char* data, size_t length) +{ + assert(length > 0); + + if (!writeChunk || (ACQUIRE_READ(writeChunk->used) >= writeChunk->capacity)) + allocateChunk(length); + + assert(writeChunk); + + size_t used = ACQUIRE_READ(writeChunk->used); + if (writeChunk->capacity >= used + length) + { + // Data fits in to the current chunk + memcpy(writeChunk->buffer + used, data, length); + RELEASE_WRITE(writeChunk->used, used + length); + } + else + { + // Write as much as possible to the current buffer + size_t unused = writeChunk->capacity - used; + memcpy(writeChunk->buffer + used, data, unused); + RELEASE_WRITE(writeChunk->used, writeChunk->capacity); + + // allocate a new chunk by a recursive call + handleAppend(data + unused, length - unused); + } +} + +void MemoryStreamCache::reserve(size_t expectedLength) +{ + if (expectedLength <= receivedLength) + return; + + // Set the next chunk to be large enough to hold the remaining + // of the stream. The memory will be actually allocated in + // append(). + size_t unused = 0; + if (writeChunk) + unused = writeChunk->capacity - ACQUIRE_READ(writeChunk->used); + + size_t allocated = receivedLength + unused; + if (expectedLength > allocated) + nextChunkSize = expectedLength - allocated; +} + +std::streambuf *MemoryStreamCache::createReader() +{ + incRef(); + return new MemoryStreamCache::Reader(_MR(this)); +} + +MemoryStreamCache::Reader::Reader(_R b) : + buffer(b), chunkIndex(0), chunkStartOffset(0) +{ + setg(NULL, NULL, NULL); +} + +/** + * \brief Called by the streambuf API + * + * Called by the streambuf API when there is no more data to read. + */ +int MemoryStreamCache::Reader::underflow() +{ + Locker locker(buffer->chunkListMutex); + + // Wait until there is some data to be read or until terminated + bool hasMoreChunks = chunkIndex+1 < buffer->chunks.size(); + bool lastChunkHasBytes = (chunkIndex+1 == buffer->chunks.size()) && + ((size_t)(gptr() - eback()) < ACQUIRE_READ(buffer->chunks[chunkIndex]->used)); + if (!buffer->hasTerminated() && !hasMoreChunks && !lastChunkHasBytes) + { + locker.release(); + buffer->waitForData(getOffset()); + locker.acquire(); + } + + if (chunkIndex >= buffer->chunks.size()) + { + // This can only happen if the stream is terminated + // before any data is written. + assert(chunkIndex == 0); + assert(buffer->hasTerminated()); + return EOF; + } + + MemoryChunk *chunk = buffer->chunks[chunkIndex]; + size_t used = ACQUIRE_READ(chunk->used); + unsigned char *cursor; + unsigned char *end = chunk->buffer + used; + + if (gptr() == NULL) + { + // On the first call gptr() is NULL (as set in the + // constructor). Nothing has been read yet. + cursor = chunk->buffer; + } + else if ((unsigned char*)gptr() < end) + { + // Data left in this chunk + cursor = (unsigned char*)gptr(); + } + else if (chunkIndex == buffer->chunks.size()-1) + { + // This is the last received chunk and there is no + // data to be read => we're finished + assert(buffer->hasTerminated()); + return EOF; + } + else + { + // Move to the next chunk + chunkStartOffset = chunkStartOffset + used; + chunkIndex++; + + // chunkIndex is still valid, because the case + // size()-1 was handled above + assert_and_throw(chunkIndex < buffer->chunks.size()); + + chunk = buffer->chunks[chunkIndex]; + cursor = chunk->buffer; + end = chunk->buffer + ACQUIRE_READ(chunk->used); + } + + setg((char *)chunk->buffer, (char *)cursor, (char *)end); + + assert(cursor != end); // there is at least one byte to return + return (int)cursor[0]; +} + +/** + * \brief Called by the streambuf API + * + * Called by the streambuf API to seek to a relative position + */ +streampos MemoryStreamCache::Reader::seekoff(streamoff off, std::ios_base::seekdir dir, + std::ios_base::openmode mode) +{ + if (mode != std::ios_base::in) + return -1; + + switch (dir) + { + case std::ios_base::beg: + seekpos(off, mode); + break; + case std::ios_base::cur: + // TODO: optimize by checking if the new + // offset is in the current chunk + seekpos(getOffset() + off, mode); + break; + case std::ios_base::end: + buffer->waitForTermination(); + if (buffer->hasFailed()) + return -1; + + seekpos((streampos)buffer->getReceivedLength() + off, mode); + break; + default: + break; + } + + return getOffset(); +} + +/** + * \brief Called by the streambuf API + * + * Called by the streambuf API to seek to an absolute position + */ +streampos MemoryStreamCache::Reader::seekpos(streampos pos, std::ios_base::openmode mode) +{ + if (mode != std::ios_base::in || pos < 0) + return -1; + + if (pos >= (streampos)buffer->getReceivedLength()) + buffer->waitForTermination(); + + Locker locker(buffer->chunkListMutex); + streampos offset = 0; + for (auto it=buffer->chunks.begin(); it!=buffer->chunks.end(); ++it) + { + streampos used = (streampos)ACQUIRE_READ((*it)->used); + if (pos >= offset + used) + { + offset += used; + } + else + { + setg((char *)(*it)->buffer, + (char *)((*it)->buffer + (pos - offset)), + (char *)((*it)->buffer + used)); + return pos; + } + } + + return -1; +} + +/** + * Get the position of the read cursor in the (virtual) downloaded data. + */ +streampos MemoryStreamCache::Reader::getOffset() const +{ + return chunkStartOffset + (size_t)(gptr() - eback()); +} + +FileStreamCache::FileStreamCache() + : keepCache(false) +{ +} + +FileStreamCache::~FileStreamCache() +{ + if (cache.is_open()) + cache.close(); + if (!keepCache && !cacheFilename.empty()) + unlink(cacheFilename.raw_buf()); +} + +void FileStreamCache::handleAppend(const unsigned char* buffer, size_t length) +{ + if (!cache.is_open()) + openCache(); + + cache.write((const char*)buffer, length); + cache.sync(); +} + +/** + * \brief Creates & opens a temporary cache file + * + * Creates a temporary cache file in /tmp and calls \c openExistingCache() with that file. + * Waits for mutex at start and releases mutex when finished. + * \throw RunTimeException Temporary file could not be created + * \throw RunTimeException Called when the cache is already open + * \see Downloader::openExistingCache() + */ +void FileStreamCache::openCache() +{ + if (cache.is_open()) + { + markFinished(true); + throw RunTimeException(_("FileStreamCache::openCache called twice")); + } + + //Create a temporary file(name) + std::string cacheFilenameS = Config::getConfig()->getCacheDirectory() + "/" + Config::getConfig()->getCachePrefix() + "XXXXXX"; + char* cacheFilenameC = g_newa(char,cacheFilenameS.length()+1); + strncpy(cacheFilenameC, cacheFilenameS.c_str(), cacheFilenameS.length()); + cacheFilenameC[cacheFilenameS.length()] = '\0'; + int fd = g_mkstemp(cacheFilenameC); + if(fd == -1) + { + markFinished(true); + throw RunTimeException(_("FileStreamCache::openCache: cannot create temporary file")); + } + + //We are using fstream to read/write to the cache, so we don't need this FD + close(fd); + + //Let the openExistingCache function handle the rest + openExistingCache(tiny_string(cacheFilenameC, true)); +} + +/** + * \brief Opens an existing cache file + * + * Opens an existing cache file, allocates the buffer and signals \c cacheOpened. + * \post \c cacheFilename is set + * \post \c cache file is opened + * \throw RunTimeException File could not be opened + * \throw RunTimeException Called when the cache is already open + */ +void FileStreamCache::openExistingCache(const tiny_string& filename, bool forWriting) +{ + if (cache.is_open()) + { + markFinished(true); + throw RunTimeException(_("FileStreamCache::openCache called twice")); + } + + cacheFilename = filename; + + //Open the cache file + ios_base::openmode mode; + if (forWriting) + mode = std::fstream::binary | std::fstream::out; + else + mode = std::fstream::binary | std::fstream::in; + cache.open(cacheFilename.raw_buf(), mode); + if (!cache.is_open()) + { + markFinished(true); + throw RunTimeException(_("FileStreamCache::openCache: cannot open temporary cache file")); + } + + LOG(LOG_INFO, _("NET: Downloading to cache file: ") << cacheFilename); +} + +void FileStreamCache::useExistingFile(const tiny_string& filename) +{ + //Make sure we don't delete the local file afterwards + keepCache = true; + + cacheFilename = filename; + openExistingCache(filename, false); + + cache.seekg(0, std::ios::end); + receivedLength = cache.tellg(); + + // We already have the whole file + markFinished(); +} + +void FileStreamCache::waitForCache() +{ + if (cache.is_open()) + return; + + // Cache file will be opened when the first byte is received + waitForData(0); + + // Check if the stream was terminated before anything was written + if (!cache.is_open()) + throw RunTimeException(_("FileStreamCache::waitForCache: cache file is not open")); +} + +std::streambuf *FileStreamCache::createReader() +{ + waitForCache(); + + incRef(); + FileStreamCache::Reader *fbuf = new FileStreamCache::Reader(_MR(this)); + fbuf->open(cacheFilename.raw_buf(), std::fstream::binary | std::fstream::in); + if (!fbuf->is_open()) + { + delete fbuf; + throw RunTimeException(_("FileStreamCache::createReader: opening cache file for reading failed")); + } + return fbuf; +} + +FileStreamCache::Reader::Reader(_R b) : buffer(b) +{ +} + +int FileStreamCache::Reader::underflow() +{ + if (!buffer->hasTerminated()) + buffer->waitForData(seekoff(0, ios_base::cur, ios_base::in)); + + return filebuf::underflow(); +} + +streamsize FileStreamCache::Reader::xsgetn(char* s, streamsize n) +{ + streamsize read=filebuf::xsgetn(s, n); + + // If not enough data was available, wait for writer + while (read < n) + { + buffer->waitForData(seekoff(0, ios_base::cur, ios_base::in)); + + streamsize b = filebuf::xsgetn(s+read, n-read); + + // No more data after waiting, this must be EOF + if (b == 0) + return read; + + read += b; + } + + return read; +} diff --git a/src/backends/streamcache.h b/src/backends/streamcache.h new file mode 100644 index 0000000..82a14fd --- /dev/null +++ b/src/backends/streamcache.h @@ -0,0 +1,197 @@ +/************************************************************************** + Lightspark, a free flash player implementation + + Copyright (C) 2013 Antti Ajanki (antti.ajanki at iki.fi) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +**************************************************************************/ + +#ifndef BACKENDS_STREAMCACHE_H +#define BACKENDS_STREAMCACHE_H 1 + +#include +#include +#include +#include +#include "threading.h" +#include "tiny_string.h" +#include "smartrefs.h" +#include "compat.h" + +namespace lightspark +{ + +/* + * A single-writer-multiple-reader buffer for downloaded streams. + * + * Writing is done by one thread by calling append(), reading is done + * through streambuf interface (constructred by createReader()) in a + * separate thread. There can be several readers in multiple threads. + * + * This is an abstract base class. + */ +class DLL_PUBLIC StreamCache : public RefCountable { +protected: + StreamCache() DLL_LOCAL; + + // stateMutex must be held while receivedLength, failed or + // terminated are accessed + Mutex stateMutex; + // stateCond is signalled when data is received or the stream + // is terminated + Cond stateCond; + // Amount of data already received + size_t receivedLength; + // Has the stream been completely downloaded or failed? + bool failed:1; + bool terminated:1; + + // Wait until more than currentOffset bytes has been received + // or until terminated + void waitForData(size_t currentOffset) DLL_LOCAL; + + // Derived class implements this to store received data + virtual void handleAppend(const unsigned char* buffer, size_t length)=0; + +public: + virtual ~StreamCache() {} + + // Gets the length of downloaded data + size_t getReceivedLength() const { return receivedLength; } + + bool hasTerminated() const { return terminated; } + bool hasFailed() const { return failed; } + + // Wait until the writer calls markTerminated + void waitForTermination(); + + // Set the expected length of the stream. + // The default implementation does nothing, but the derived + // classes can allocate memory here. + virtual void reserve(size_t expectedLength) {} + + // Write new data to the buffer (writer thread) + void append(const unsigned char* buffer, size_t length); + + // Writer should call this when all of the stream has been + // append()'ed + void markFinished(bool failed=false); + + // Create a streambuf for reading from this buffer (reader + // thread). Every call returns a new, independent streambuf. + // The caller must delete the returned value. + virtual std::streambuf *createReader()=0; +}; + +class MemoryChunk; + +/* + * MemoryStreamCache buffers the stream in memory. + */ +class DLL_PUBLIC MemoryStreamCache : public StreamCache { +private: + class DLL_LOCAL Reader : public std::streambuf { + private: + _R buffer; + // The chunk that is currently being read + unsigned int chunkIndex; + // Offset at the start of current chunk + size_t chunkStartOffset; + + // Handles streambuf out-of-data events + virtual int underflow(); + // Seeks to absolute position + virtual std::streampos seekoff(std::streamoff, std::ios_base::seekdir, std::ios_base::openmode); + // Seeks to relative position + virtual std::streampos seekpos(std::streampos, std::ios_base::openmode); + // Helper to get the current offset + std::streampos getOffset() const; + public: + Reader(_R b); + }; + + // Stream is stored into a sequence of memory chunks. The + // chunks can grow, but they are never moved, so both readers + // and writer can safely use them. However, the mutex must be + // held when the container is accessed. + Mutex chunkListMutex; + std::vector chunks; + + // The last chunk, the next write will happen here (writer thread) + MemoryChunk *writeChunk; + + // Variables controlling the memory allocation + size_t nextChunkSize; + static const size_t minChunkSize = 4*4096; + + // Allocate a new chunk, append it to chunks, update writeChunk + void allocateChunk(size_t minLength) DLL_LOCAL; + + virtual void handleAppend(const unsigned char* buffer, size_t length) DLL_LOCAL; + +public: + MemoryStreamCache(); + virtual ~MemoryStreamCache(); + + virtual void reserve(size_t expectedLength); + + virtual std::streambuf *createReader(); +}; + +/* + * FileStreamCache saves the stream in a temporary file. + */ +class DLL_PUBLIC FileStreamCache : public StreamCache { +private: + /* + * Extends filebuf to wait for writer thread to supply more + * data when the end of temporary file is reached. + */ + class DLL_LOCAL Reader : public std::filebuf { + private: + _R buffer; + virtual int underflow(); + virtual std::streamsize xsgetn(char* s, std::streamsize n); + public: + Reader(_R buffer); + }; + + //Cache filename + tiny_string cacheFilename; + //Cache fstream + std::fstream cache; + //True if the cache file doesn't need to be deleted on destruction + bool keepCache:1; + + void openCache() DLL_LOCAL; + void openExistingCache(const tiny_string& filename, bool forWriting=true) DLL_LOCAL; + + // Block until the cache file is opened by the writer stream + void waitForCache() DLL_LOCAL; + + virtual void handleAppend(const unsigned char* buffer, size_t length) DLL_LOCAL; + +public: + FileStreamCache(); + virtual ~FileStreamCache(); + + virtual std::streambuf *createReader(); + + // Use an existing file as cache. Must be called before append(). + void useExistingFile(const tiny_string& filename); +}; + +}; + +#endif // BACKENDS_STREAMCACHE_H diff --git a/src/backends/urlutils.cpp b/src/backends/urlutils.cpp index ebeaf9c..2511948 100644 --- a/src/backends/urlutils.cpp +++ b/src/backends/urlutils.cpp @@ -22,15 +22,39 @@ #include "backends/urlutils.h" #include "compat.h" #include "scripting/toplevel/Integer.h" +#include "scripting/toplevel/Error.h" +#include "scripting/class.h" #include #include #include #include #include #include +#ifdef __MINGW32__ +#include +#else +#include +#endif using namespace lightspark; +std::list URLInfo::uriReservedAndHash = + {';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '#'}; +std::list URLInfo::uriUnescaped = + {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', + 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '-', '_', '.', '!', '~', '*', '\'', '(', + ')'}; +std::list URLInfo::uriReservedAndUnescapedAndHash = + {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', + 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '-', '_', '.', '!', '~', '*', '\'', '(', + ')', ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '#'}; + std::ostream& lightspark::operator<<(std::ostream& s, const URLInfo& u) { s << u.getParsedURL(); @@ -50,11 +74,15 @@ URLInfo::URLInfo(const tiny_string& u) if(colonPos == std::string::npos) invalidReason = MISSING_PROTOCOL; - std::string protocolStr = str.substr(0, colonPos); - std::transform(protocolStr.begin(), protocolStr.end(), protocolStr.begin(), ::tolower); + std::string protocolStr; + if (colonPos != std::string::npos) + { + protocolStr = str.substr(0, colonPos); + std::transform(protocolStr.begin(), protocolStr.end(), protocolStr.begin(), ::tolower); + } protocol = protocolStr; - size_t hostnamePos = colonPos+3; + size_t hostnamePos = colonPos != std::string::npos ? colonPos+3 : std::string::npos; size_t portPos = std::string::npos; size_t pathPos = std::string::npos; size_t queryPos = std::string::npos; @@ -93,8 +121,12 @@ URLInfo::URLInfo(const tiny_string& u) } //Parse the host string - std::string hostnameStr = str.substr(hostnamePos, std::min(std::min(pathPos, portPos), queryPos)-hostnamePos); - std::transform(hostnameStr.begin(), hostnameStr.end(), hostnameStr.begin(), ::tolower); + std::string hostnameStr; + if (hostnamePos != std::string::npos) + { + hostnameStr= str.substr(hostnamePos, std::min(std::min(pathPos, portPos), queryPos)-hostnamePos); + std::transform(hostnameStr.begin(), hostnameStr.end(), hostnameStr.begin(), ::tolower); + } hostname = hostnameStr; port = 0; @@ -287,7 +319,7 @@ bool URLInfo::isSubOf(const URLInfo& url) const } bool URLInfo::isSubPathOf(const tiny_string& parent, const tiny_string& child) { - return child.substr(0, parent.numChars()) == parent; + return child.substr_bytes(0, parent.numBytes()) == parent; } bool URLInfo::isSubDomainOf(const tiny_string& parent, const tiny_string& child) { @@ -332,6 +364,11 @@ bool URLInfo::sameHost(const URLInfo& other) const tiny_string URLInfo::encode(const tiny_string& u, ENCODING type) { + if (type == ENCODE_URI) + return encodeURI(u, uriReservedAndUnescapedAndHash); + else if (type == ENCODE_URICOMPONENT) + return encodeURI(u, uriUnescaped); + tiny_string str; char buf[7]; @@ -355,20 +392,6 @@ tiny_string URLInfo::encode(const tiny_string& u, ENCODING type) //ENCODE_FORM encodes spaces as + instead of %20 else if(type == ENCODE_FORM && *i == ' ') str += '+'; - //Additionally ENCODE_URICOMPONENT and ENCODE_URI don't encode: - //- _ . ! ~ * ' ( ) - else if((type == ENCODE_URI || type == ENCODE_URICOMPONENT) && - (*i == '-' || *i == '_' || *i == '.' || *i == '!' || - *i == '~' || *i == '*' || *i == '\'' || *i == '(' || - *i == ')')) - str += *i; - //Additionally ENCODE_URI doesn't encode: - //; / ? : @ & = + $ , # - else if((type == ENCODE_URI) && - (*i == ';' || *i == '/' || *i == '?' || *i == ':' || - *i == '@' || *i == '&' || *i == '=' || *i == '+' || - *i == '$' || *i == ',' || *i == '#')) - str += *i; // ENCODE_ESCAPE doesn't encode: //@ - _ . * + / else if(type == ENCODE_ESCAPE && @@ -390,8 +413,72 @@ tiny_string URLInfo::encode(const tiny_string& u, ENCODING type) return str; } -std::string URLInfo::decode(const std::string& u, ENCODING type) +tiny_string URLInfo::encodeURI(const tiny_string& u, const std::list& unescapedChars) { + tiny_string res; + CharIterator c = u.begin(); + CharIterator end = u.end(); + while (c != end) + { + if (std::find(unescapedChars.begin(), unescapedChars.end(), *c) == unescapedChars.end()) + { + if ((*c >= 0xD800) && (*c <= 0xDFFF)) + { + res += encodeSurrogatePair(c, end); + } + else + { + res += encodeSingleChar(*c); + } + } + else + { + res += *c; + } + ++c; + } + return res; +} + +tiny_string URLInfo::encodeSurrogatePair(CharIterator& c, const CharIterator& end) +{ + if ((*c < 0xD800) || (*c >= 0xDC00)) + throwError(kInvalidURIError, "encodeURI"); + uint32_t highSurrogate = *c; + ++c; + if ((c == end) || ((*c < 0xDC00) || (*c > 0xDFFF))) + throwError(kInvalidURIError, "encodeURI"); + uint32_t lowSurrogate = *c; + return encodeSingleChar((highSurrogate - 0xD800)*0x400 + + (lowSurrogate - 0xDC00) + 0x10000); +} + +tiny_string URLInfo::encodeSingleChar(uint32_t codepoint) { + char octets[6]; + gint numOctets = g_unichar_to_utf8(codepoint, octets); + tiny_string encoded; + for (int i=0; i& reservedChars) +{ + tiny_string res; + CharIterator c = u.begin(); + CharIterator end = u.end(); + while (c != end) + { + if (*c == '%') + { + CharIterator encodeBegin = c; + uint32_t decoded = decodeSingleChar(c, end); + if (std::find(reservedChars.begin(), reservedChars.end(), decoded) == reservedChars.end()) + { + res += decoded; + } + else + { + CharIterator it = encodeBegin; + while (it != c) + { + res += *it; + ++it; + } + } + } + else + { + res += *c; + ++c; + } + } + + return res; +} + +uint32_t URLInfo::decodeSingleChar(CharIterator& c, const CharIterator& end) +{ + uint32_t decoded = decodeSingleEscapeSequence(c, end); + if ((decoded & 0x80) != 0) { + decoded = decodeRestOfUTF8Sequence(decoded, c, end); + } + return decoded; +} + +uint32_t URLInfo::decodeRestOfUTF8Sequence(uint32_t firstOctet, CharIterator& c, const CharIterator& end) { + unsigned int numOctets = 0; + uint32_t mask = 0x80; + while ((firstOctet & mask) != 0) { + numOctets++; + mask = mask >> 1; + } + if (numOctets <= 1 || numOctets > 4) + throwError(kInvalidURIError, "decodeURI"); + + char *octets = (char *)alloca(numOctets); + octets[0] = firstOctet; + for (unsigned int i=1; i= 0x10FFFF)) + throwError(kInvalidURIError, "decodeURI"); + + return (uint32_t)unichar; +} + +uint32_t URLInfo::decodeSingleEscapeSequence(CharIterator& c, const CharIterator& end) +{ + if (*c != '%') + throwError(kInvalidURIError, "decodeURI"); + ++c; + uint32_t h1 = decodeHexDigit(c, end); + uint32_t h2 = decodeHexDigit(c, end); + return (h1 << 4) + h2; +} + +bool URLInfo::isSurrogateUTF8Sequence(const char *octets, unsigned int numOctets) +{ + // Surrogate code points: 0xD800 - 0xDFFF + // UTF-8 encoded: 0xED 0xA0 0x80 - 0xED 0xBF 0xBF + return (numOctets == 3) && + ((unsigned char)octets[0] == 0xED) && + ((unsigned char)octets[1] >= 0xA0) && + ((unsigned char)octets[1] <= 0xBF); +} + +uint32_t URLInfo::decodeHexDigit(CharIterator& c, const CharIterator& end) +{ + if (c == end || !isxdigit(*c)) + throwError(kInvalidURIError, "decodeURI"); + + gint h = g_unichar_xdigit_value(*c); + assert((h >= 0) && (h < 16)); + ++c; + return (uint32_t) h; +} + bool URLInfo::isRTMP() const { return protocol == "rtmp" || protocol == "rtmpe" || protocol == "rtmps" || diff --git a/src/backends/urlutils.h b/src/backends/urlutils.h index 7c95982..6d1f633 100644 --- a/src/backends/urlutils.h +++ b/src/backends/urlutils.h @@ -35,6 +35,10 @@ class DLL_PUBLIC URLInfo { friend std::ostream& operator<<(std::ostream& s, const URLInfo& u); private: + static std::list uriReservedAndHash; + static std::list uriUnescaped; + static std::list uriReservedAndUnescapedAndHash; + static const uint32_t REPLACEMENT_CHARACTER = 0xFFFD; tiny_string url; //The URL space encoded tiny_string parsedURL; //The URL normalized and space encoded tiny_string protocol; //Part after @@ -51,6 +55,16 @@ private: INVALID_REASON invalidReason; uint16_t port; //Part after first : after hostname bool valid; + static tiny_string encodeURI(const tiny_string& u, const std::list& unescapedChars); + static tiny_string encodeSurrogatePair(CharIterator& c, const CharIterator& end); + static tiny_string encodeSingleChar(uint32_t codepoint); + static tiny_string encodeOctet(char c); + static tiny_string decodeURI(const tiny_string& u, const std::list& reservedChars); + static uint32_t decodeSingleEscapeSequence(CharIterator& c, const CharIterator& end); + static uint32_t decodeSingleChar(CharIterator& c, const CharIterator& end); + static uint32_t decodeRestOfUTF8Sequence(uint32_t firstOctet, CharIterator& c, const CharIterator& end); + static uint32_t decodeHexDigit(CharIterator& c, const CharIterator& end); + static bool isSurrogateUTF8Sequence(const char *octets, unsigned int numOctets); public: URLInfo():invalidReason(IS_EMPTY),valid(false) {}; URLInfo(const tiny_string& u); @@ -109,11 +123,7 @@ public: { return std::string(encode(tiny_string(u), type)); } - static tiny_string decode(const tiny_string& u, ENCODING type=ENCODE_URICOMPONENT) - { - return tiny_string(decode(std::string(u.raw_buf()), type)); - }; - static std::string decode(const std::string& u, ENCODING type=ENCODE_URICOMPONENT); + static tiny_string decode(const std::string& u, ENCODING type=ENCODE_URICOMPONENT); }; }; diff --git a/src/backends/xml_support.cpp b/src/backends/xml_support.cpp index 2aefaee..8d1af9d 100644 --- a/src/backends/xml_support.cpp +++ b/src/backends/xml_support.cpp @@ -40,6 +40,7 @@ void RecoveryDomParser::parse_memory_raw(const unsigned char* contents, size_typ xmlSAXHandlerV1* handler=(xmlSAXHandlerV1*)calloc(1,sizeof(xmlSAXHandlerV1)); initxmlDefaultSAXHandler(handler, 0); + handler->comment = comment; context_->recovery=1; free(context_->sax); context_->sax=(xmlSAXHandler*)handler; @@ -60,7 +61,8 @@ void RecoveryDomParser::parse_memory_raw(const unsigned char* contents, size_typ if(!context_->wellFormed) LOG(LOG_ERROR, "XML data not well formed!"); - doc_ = new RecoveryDocument(context_->myDoc); + if (context_->myDoc) + doc_ = new RecoveryDocument(context_->myDoc); // This is to indicate to release_underlying that we took the // ownership on the doc. context_->myDoc = 0; @@ -74,7 +76,7 @@ void RecoveryDomParser::parse_memory_raw(const unsigned char* contents, size_typ #endif xmlpp::Node* XMLBase::buildFromString(const string& str, - bool ignoreEmptyTextNodes, + bool ignoreEmptyTextNodes, bool *hasParent, const string& default_ns) { string buf = parserQuirks(str); @@ -86,27 +88,42 @@ xmlpp::Node* XMLBase::buildFromString(const string& str, { } xmlpp::Document* doc=parser.get_document(); - if(doc && doc->get_root_node()) + if(doc) { - xmlpp::Element *root = doc->get_root_node(); - // It would be better to remove empty nodes during - // parsing, but xmlpp doesn't offer an interface. - if (ignoreEmptyTextNodes) - removeWhitespaceNodes(root); - addDefaultNamespace(root, default_ns); - return root; + if (!doc->get_root_node()) + { + buf = removeWhitespace(str)+""; + try + { + parser.parse_memory_raw((const unsigned char*)buf.c_str(), buf.size()); + } + catch(const exception& e) + { + } + doc=parser.get_document(); + } + if (doc && doc->get_root_node()) + { + *hasParent = true; + xmlpp::Element *root = doc->get_root_node(); + // It would be better to remove empty nodes during + // parsing, but xmlpp doesn't offer an interface. + if (ignoreEmptyTextNodes) + removeWhitespaceNodes(root); + addDefaultNamespace(root, default_ns); + return root; + } } - - LOG(LOG_ERROR, "XML parsing failed, creating text node"); //If everything fails, create a fake document and add a single text string child + // see 10.3.1 in ECMA 357 if (default_ns.empty()) - buf=""; + buf=""; else - buf=""; + buf=""; parser.parse_memory_raw((const unsigned char*)buf.c_str(), buf.size()); + *hasParent = false; return parser.get_document()->get_root_node()->add_child_text(str); - // TODO: node's parent (root) should be inaccessible from AS code } void XMLBase::addDefaultNamespace(xmlpp::Element *root, const string& default_ns) @@ -136,15 +153,25 @@ void XMLBase::addDefaultNamespaceRecursive(xmlNodePtr node, xmlNsPtr ns) } } -xmlpp::Node* XMLBase::buildCopy(const xmlpp::Node* src) +xmlpp::Node* XMLBase::buildCopy(const xmlpp::Node* src, bool *hasParent) { + const xmlpp::ContentNode* contentnode; const xmlpp::TextNode* textnode=dynamic_cast(src); if(textnode) { - return buildFromString(textnode->get_content(), false); + return buildFromString(textnode->get_content(), false,hasParent); + } + else if ((contentnode = dynamic_cast(src))) + { + // ContentNode but not TextNode => comment, PI or CData + // These can't be root nodes so we add a dummy root. + *hasParent = false; + xmlpp::Element* root = parser.get_document()->create_root_node("dummy_root"); + return root->import_node(contentnode); } else { + *hasParent = true; return parser.get_document()->create_root_node_by_import(src); } } @@ -210,3 +237,25 @@ void XMLBase::removeWhitespaceNodes(xmlpp::Element *node) } } } +tiny_string XMLBase::removeWhitespace(tiny_string val) +{ + bool bwhite = true; + uint32_t start = 0; + CharIterator it = val.begin(); + CharIterator itend = val.begin(); + while (it != val.end()) + { + if (!g_unichar_isspace(*it)) + { + itend=it; + itend++; + bwhite = false; + } + else if (bwhite) + start++; + it++; + } + if (bwhite) + return ""; + return val.substr(start,itend); +} diff --git a/src/backends/xml_support.h b/src/backends/xml_support.h index 5ef59b1..a8a6a5b 100644 --- a/src/backends/xml_support.h +++ b/src/backends/xml_support.h @@ -25,6 +25,7 @@ #include //For xmlCreateFileParserCtxt(). #include +#include "tiny_string.h" namespace lightspark { @@ -57,16 +58,19 @@ protected: LSDomParser parser; xmlpp::Node* buildFromString(const std::string& str, bool ignoreEmptyTextnodes, + bool *hasParent, const std::string& default_ns=std::string()); void addDefaultNamespace(xmlpp::Element *root, const std::string& default_ns); void addDefaultNamespaceRecursive(xmlNodePtr node, xmlNsPtr ns); // Set the root to be a copy of src. If src is a text node, // create a new element node with the same content. - xmlpp::Node* buildCopy(const xmlpp::Node* node); - static std::string parserQuirks(const std::string& str); + xmlpp::Node* buildCopy(const xmlpp::Node* node, bool *hasParent); static std::string quirkCData(const std::string& str); static std::string quirkXMLDeclarationInMiddle(const std::string& str); void removeWhitespaceNodes(xmlpp::Element *node); + tiny_string removeWhitespace(tiny_string val); +public: + static std::string parserQuirks(const std::string& str); }; }; diff --git a/src/compat.h b/src/compat.h index 5934b65..0cc00c3 100644 --- a/src/compat.h +++ b/src/compat.h @@ -116,6 +116,7 @@ _CRTIMP char* __cdecl __MINGW_NOTHROW _strdup (const char*) __MINGW_ATTRIB_MAL //Boolean type with acquire release barrier semantics #define ACQUIRE_RELEASE_FLAG(x) std::atomic_bool x +#define ACQUIRE_RELEASE_VARIABLE(t, x) std::atomic x #define ACQUIRE_READ(x) x.load(std::memory_order_acquire) #define RELEASE_WRITE(x, v) x.store(v, std::memory_order_release) diff --git a/src/main.cpp b/src/main.cpp index d0099bd..6f8d331 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -246,6 +246,7 @@ int main(int argc, char* argv[]) #ifdef PROFILING_SUPPORT " [--profiling-output|-o profiling-file]" << #endif + " [--version|-v]" << " "); exit(1); } @@ -286,7 +287,12 @@ int main(int argc, char* argv[]) { sys->mainClip->setOrigin(url, fileName); sys->parseParametersFromURL(sys->mainClip->getOrigin()); - sandboxType = SecurityManager::REMOTE; + if (sandboxType != SecurityManager::REMOTE && + sys->mainClip->getOrigin().getProtocol() != "file") + { + LOG(LOG_INFO, _("Switching to remote sandbox because of remote url")); + sandboxType = SecurityManager::REMOTE; + } } #ifndef _WIN32 //When running in a local sandbox, set the root URL to the current working dir diff --git a/src/parsing/amf3_generator.cpp b/src/parsing/amf3_generator.cpp index 455cde7..0801c0a 100644 --- a/src/parsing/amf3_generator.cpp +++ b/src/parsing/amf3_generator.cpp @@ -26,6 +26,7 @@ #include "toplevel/XML.h" #include #include +#include "scripting/flash/utils/ByteArray.h" using namespace std; using namespace lightspark; @@ -273,6 +274,7 @@ _R Amf3Deserializer::parseXML(std::vector& objMap, bool leg return _MR(xmlObj); } + _R Amf3Deserializer::parseValue(std::vector& stringMap, std::vector& objMap, std::vector& traitsMap) const @@ -281,33 +283,144 @@ _R Amf3Deserializer::parseValue(std::vector& stringMap, uint8_t marker; if(!input->readByte(marker)) throw ParseException("Not enough data to parse AMF3 object"); + if (input->getCurrentObjectEncoding() == ObjectEncoding::AMF3) + { + switch(marker) + { + case null_marker: + return _MR(getSys()->getNullRef()); + case undefined_marker: + return _MR(getSys()->getUndefinedRef()); + case false_marker: + return _MR(abstract_b(false)); + case true_marker: + return _MR(abstract_b(true)); + case integer_marker: + return parseInteger(); + case double_marker: + return parseDouble(); + case string_marker: + return _MR(Class::getInstanceS(parseStringVR(stringMap))); + case xml_doc_marker: + return parseXML(objMap, true); + case array_marker: + return parseArray(stringMap, objMap, traitsMap); + case object_marker: + return parseObject(stringMap, objMap, traitsMap); + case xml_marker: + return parseXML(objMap, false); + default: + LOG(LOG_ERROR,"Unsupported marker " << (uint32_t)marker); + throw UnsupportedException("Unsupported marker"); + } + + } + else + { + switch(marker) + { + case amf0_number_marker: + return parseDouble(); + case amf0_boolean_marker: + return _MR(abstract_b(input->readByte(marker))); + case amf0_string_marker: + return _MR(Class::getInstanceS(parseStringAMF0())); + case amf0_object_marker: + return parseObjectAMF0(stringMap,objMap,traitsMap); + case amf0_null_marker: + return _MR(getSys()->getNullRef()); + case amf0_undefined_marker: + return _MR(getSys()->getUndefinedRef()); + case amf0_reference_marker: + LOG(LOG_ERROR,"unimplemented marker " << (uint32_t)marker); + throw UnsupportedException("unimplemented marker"); + case amf0_ecma_array_marker: + return parseECMAArrayAMF0(stringMap,objMap,traitsMap); + case amf0_strict_array_marker: + LOG(LOG_ERROR,"unimplemented marker " << (uint32_t)marker); + throw UnsupportedException("unimplemented marker"); + case amf0_date_marker: + LOG(LOG_ERROR,"unimplemented marker " << (uint32_t)marker); + throw UnsupportedException("unimplemented marker"); + case amf0_long_string_marker: + LOG(LOG_ERROR,"unimplemented marker " << (uint32_t)marker); + throw UnsupportedException("unimplemented marker"); + case amf0_xml_document_marker: + return parseXML(objMap, false); + case amf0_typed_object_marker: + LOG(LOG_ERROR,"unimplemented marker " << (uint32_t)marker); + throw UnsupportedException("unimplemented marker"); + case amf0_avmplus_object_marker: + input->setCurrentObjectEncoding(ObjectEncoding::AMF3); + return parseValue(stringMap, objMap, traitsMap); + default: + LOG(LOG_ERROR,"Unsupported marker " << (uint32_t)marker); + throw UnsupportedException("Unsupported marker"); + } + } +} +tiny_string Amf3Deserializer::parseStringAMF0() const +{ + uint16_t strLen; + if(!input->readShort(strLen)) + throw ParseException("Not enough data to parse integer"); + + string retStr; + for(uint32_t i=0;ireadByte(c)) + throw ParseException("Not enough data to parse string"); + retStr.push_back(c); + } + return retStr; +} +_R Amf3Deserializer::parseECMAArrayAMF0(std::vector& stringMap, + std::vector& objMap, + std::vector& traitsMap) const +{ + uint32_t count; + if(!input->readUnsignedInt(count)) + throw ParseException("Not enough data to parse AMF3 array"); + + _R ret=_MR(Class::getInstanceS()); - switch(marker) + //Read name, value pairs + while(count) { - case null_marker: - return _MR(getSys()->getNullRef()); - case undefined_marker: - return _MR(getSys()->getUndefinedRef()); - case false_marker: - return _MR(abstract_b(false)); - case true_marker: - return _MR(abstract_b(true)); - case integer_marker: - return parseInteger(); - case double_marker: - return parseDouble(); - case string_marker: - return _MR(Class::getInstanceS(parseStringVR(stringMap))); - case xml_doc_marker: - return parseXML(objMap, true); - case array_marker: - return parseArray(stringMap, objMap, traitsMap); - case object_marker: - return parseObject(stringMap, objMap, traitsMap); - case xml_marker: - return parseXML(objMap, false); - default: - LOG(LOG_ERROR,"Unsupported marker " << (uint32_t)marker); - throw UnsupportedException("Unsupported marker"); + tiny_string varName = parseStringAMF0(); + if (varName == "") + throw ParseException("empty key in AMF0 ECMA array"); + _R value=parseValue(stringMap, objMap, traitsMap); + value->incRef(); + + ret->setVariableByQName(varName,"",value.getPtr(),DYNAMIC_TRAIT); + count--; } + return ret; } +_R Amf3Deserializer::parseObjectAMF0(std::vector& stringMap, + std::vector& objMap, + std::vector& traitsMap) const +{ + _R ret=_MR(Class::getInstanceS()); + + while (true) + { + tiny_string varName = parseStringAMF0(); + if (varName == "") + { + uint8_t marker = 0; + input->readByte(marker); + if (marker == amf0_object_end_marker ) + return ret; + throw ParseException("empty key in AMF0 object"); + } + _R value=parseValue(stringMap, objMap, traitsMap); + value->incRef(); + + ret->setVariableByQName(varName,"",value.getPtr(),DYNAMIC_TRAIT); + } + return _R(getSys()->getUndefinedRef()); +} + diff --git a/src/parsing/amf3_generator.h b/src/parsing/amf3_generator.h index 360685a..ae2cd69 100644 --- a/src/parsing/amf3_generator.h +++ b/src/parsing/amf3_generator.h @@ -50,6 +50,28 @@ enum markers_type xml_marker = 0xb }; +enum amf0_markers_type +{ + amf0_number_marker = 0x00, + amf0_boolean_marker = 0x01, + amf0_string_marker = 0x02, + amf0_object_marker = 0x03, + amf0_movieclip_marker = 0x04, + amf0_null_marker = 0x05, + amf0_undefined_marker = 0x06, + amf0_reference_marker = 0x07, + amf0_ecma_array_marker = 0x08, + amf0_object_end_marker = 0x09, + amf0_strict_array_marker = 0x0A, + amf0_date_marker = 0x0B, + amf0_long_string_marker = 0x0C, + amf0_unsupported_marker = 0x0D, + amf0_recordset_marker = 0x0E, + amf0_xml_document_marker = 0x0F, + amf0_typed_object_marker = 0x10, + amf0_avmplus_object_marker = 0x11 +}; + class TraitsRef { public: @@ -64,6 +86,7 @@ class Amf3Deserializer private: ByteArray* input; tiny_string parseStringVR(std::vector& stringMap) const; + _R parseObject(std::vector& stringMap, std::vector& objMap, std::vector& traitsMap) const; @@ -76,6 +99,15 @@ private: _R parseInteger() const; _R parseDouble() const; _R parseXML(std::vector& objMap, bool legacyXML) const; + + + tiny_string parseStringAMF0() const; + _R parseECMAArrayAMF0(std::vector& stringMap, + std::vector& objMap, + std::vector& traitsMap) const; + _R parseObjectAMF0(std::vector& stringMap, + std::vector& objMap, + std::vector& traitsMap) const; public: Amf3Deserializer(ByteArray* i):input(i) {} _R readObject() const; diff --git a/src/parsing/tags.cpp b/src/parsing/tags.cpp index 665147d..6cdb962 100644 --- a/src/parsing/tags.cpp +++ b/src/parsing/tags.cpp @@ -24,10 +24,16 @@ #include #include #include +#ifdef __MINGW32__ +#include +#else +#include +#endif #include "scripting/abc.h" #include "parsing/tags.h" #include "backends/geometry.h" #include "backends/security.h" +#include "backends/streamcache.h" #include "swftypes.h" #include "logger.h" #include "compat.h" @@ -35,6 +41,7 @@ #include "scripting/flash/display/BitmapData.h" #include "scripting/flash/text/flashtext.h" #include "scripting/flash/media/flashmedia.h" +#include "backends/audio.h" #undef RGB @@ -383,6 +390,7 @@ DefineSpriteTag::DefineSpriteTag(RECORDHEADER h, std::istream& in, RootMovieClip case SYMBOL_CLASS_TAG: case ABC_TAG: case CONTROL_TAG: + case ACTION_TAG: delete tag; throw ParseException("Control tag inside a sprite. Should not happen."); case FRAMELABEL_TAG: @@ -1181,8 +1189,7 @@ void PlaceObject2Tag::execute(DisplayObjectContainer* parent) const //TODO: support clipping if(ClipDepth!=0) { - LOG(LOG_ERROR,"ClipDepth is not supported"); - return; + LOG(LOG_ERROR,"ClipDepth is not supported, but object is created anyway"); } if(!PlaceFlagHasCharacter && !PlaceFlagMove) @@ -1436,6 +1443,7 @@ ASObject* DefineButtonTag::instance(Class_base* c) const assert_and_throw(state); //The matrix must be set before invoking the constructor state->setLegacyMatrix(i->PlaceMatrix); + state->name = ""; /* * TODO: BlendMode, filerList, PlaceDepth, ColorTransfrom */ @@ -1532,7 +1540,7 @@ FileAttributesTag::FileAttributesTag(RECORDHEADER h, std::istream& in):Tag(h) UB(24,bs); } -DefineSoundTag::DefineSoundTag(RECORDHEADER h, std::istream& in,RootMovieClip* root):DictionaryTag(h,root) +DefineSoundTag::DefineSoundTag(RECORDHEADER h, std::istream& in,RootMovieClip* root):DictionaryTag(h,root),SoundData(new MemoryStreamCache) { LOG(LOG_TRACE,_("DefineSound Tag")); in >> SoundId; @@ -1542,8 +1550,13 @@ DefineSoundTag::DefineSoundTag(RECORDHEADER h, std::istream& in,RootMovieClip* r SoundSize=UB(1,bs); SoundType=UB(1,bs); in >> SoundSampleCount; - //TODO: read and parse actual sound data - ignore(in,h.getLength()-7); + + //TODO: get rid of the temporary copy + unsigned int soundDataLength = h.getLength()-7; + unsigned char *tmp = (unsigned char *)alloca(soundDataLength); + in.read((char *)tmp, soundDataLength); + SoundData->append(tmp, in.gcount()); + SoundData->markFinished(); } ASObject* DefineSoundTag::instance(Class_base* c) const @@ -1556,8 +1569,82 @@ ASObject* DefineSoundTag::instance(Class_base* c) const else retClass=Class::getClass(); - //TODO: use the tag sound data - return new (retClass->memoryAccount) Sound(retClass); + return new (retClass->memoryAccount) Sound(retClass, SoundData, + AudioFormat(getAudioCodec(), getSampleRate(), getChannels())); +} + +LS_AUDIO_CODEC DefineSoundTag::getAudioCodec() const +{ + return (LS_AUDIO_CODEC)SoundFormat; +} + +int DefineSoundTag::getSampleRate() const +{ + switch(SoundRate) + { + case 0: + return 5500; + case 1: + return 11000; + case 2: + return 22000; + case 3: + return 44000; + } + + // not reached + assert(false && "invalid sample rate"); + return 0; +} + +int DefineSoundTag::getChannels() const +{ + return (int)SoundType + 1; +} + +_R DefineSoundTag::getSoundData() const +{ + return SoundData; +} + +std::streambuf *DefineSoundTag::createSoundStream() const +{ + return SoundData->createReader(); +} + +StartSoundTag::StartSoundTag(RECORDHEADER h, std::istream& in):ActionTag(h) +{ + LOG(LOG_TRACE,_("StartSound Tag")); + in >> SoundId >> SoundInfo; +} + +void StartSoundTag::execute(RootMovieClip* root) const +{ + DefineSoundTag *soundTag = \ + dynamic_cast(root->dictionaryLookup(SoundId)); + + if (SoundInfo.SyncStop || SoundInfo.HasEnvelope || SoundInfo.HasLoops || + SoundInfo.HasOutPoint || SoundInfo.HasInPoint) + { + LOG(LOG_NOT_IMPLEMENTED, "StartSoundTag: some modifiers not supported"); + if (SoundInfo.SyncStop) + return; + } + + play(soundTag); +} + +void StartSoundTag::play(const DefineSoundTag *soundTag) const +{ + SoundChannel *schannel = Class::getInstanceS( + soundTag->getSoundData(), + AudioFormat(soundTag->getAudioCodec(), + soundTag->getSampleRate(), + soundTag->getChannels())); + + // SoundChannel thread keeps one reference, which will be + // removed thread is finished + schannel->decRef(); } ScriptLimitsTag::ScriptLimitsTag(RECORDHEADER h, std::istream& in):ControlTag(h) diff --git a/src/parsing/tags.h b/src/parsing/tags.h index 3af0f4d..40d7bb7 100644 --- a/src/parsing/tags.h +++ b/src/parsing/tags.h @@ -31,7 +31,7 @@ namespace lightspark { -enum TAGTYPE {TAG=0,DISPLAY_LIST_TAG,SHOW_TAG,CONTROL_TAG,DICT_TAG,FRAMELABEL_TAG,SYMBOL_CLASS_TAG,ABC_TAG,END_TAG}; +enum TAGTYPE {TAG=0,DISPLAY_LIST_TAG,SHOW_TAG,CONTROL_TAG,DICT_TAG,FRAMELABEL_TAG,SYMBOL_CLASS_TAG,ACTION_TAG,ABC_TAG,END_TAG}; void ignore(std::istream& i, int count); @@ -94,6 +94,17 @@ public: virtual void execute(RootMovieClip* root) const=0; }; +/* + * Initiates an action. Action is executed after a frame is parsed. + */ +class ActionTag: public ControlTag +{ +public: + ActionTag(RECORDHEADER h):ControlTag(h){} + virtual TAGTYPE getType()const{ return ACTION_TAG; } + virtual void execute(RootMovieClip* root) const=0; +}; + class DefineShapeTag: public DictionaryTag { protected: @@ -212,6 +223,8 @@ public: ASObject* instance(Class_base* c=NULL) const; }; +class MemoryStreamCache; + class DefineSoundTag: public DictionaryTag { private: @@ -221,16 +234,28 @@ private: char SoundSize; char SoundType; UI32_SWF SoundSampleCount; + _R SoundData; public: DefineSoundTag(RECORDHEADER h, std::istream& s, RootMovieClip* root); virtual int getId() const { return SoundId; } ASObject* instance(Class_base* c=NULL) const; + LS_AUDIO_CODEC getAudioCodec() const; + int getSampleRate() const; + int getChannels() const; + _R getSoundData() const; + std::streambuf *createSoundStream() const; }; -class StartSoundTag: public Tag +class StartSoundTag: public ActionTag { +private: + UI16_SWF SoundId; + SOUNDINFO SoundInfo; + + void play(const DefineSoundTag *soundTag) const; public: StartSoundTag(RECORDHEADER h, std::istream& s); + virtual void execute(RootMovieClip* root) const; }; class SoundStreamHeadTag: public Tag diff --git a/src/parsing/tags_stub.cpp b/src/parsing/tags_stub.cpp index e1b0365..80162fd 100644 --- a/src/parsing/tags_stub.cpp +++ b/src/parsing/tags_stub.cpp @@ -39,12 +39,6 @@ DefineFontInfoTag::DefineFontInfoTag(RECORDHEADER h, std::istream& in):Tag(h) skip(in); } -StartSoundTag::StartSoundTag(RECORDHEADER h, std::istream& in):Tag(h) -{ - LOG(LOG_NOT_IMPLEMENTED,_("StartSound Tag")); - skip(in); -} - SoundStreamHeadTag::SoundStreamHeadTag(RECORDHEADER h, std::istream& in):Tag(h) { LOG(LOG_NOT_IMPLEMENTED,_("SoundStreamHead Tag")); diff --git a/src/platforms/engineutils.cpp b/src/platforms/engineutils.cpp index 4152b48..6efcfc7 100644 --- a/src/platforms/engineutils.cpp +++ b/src/platforms/engineutils.cpp @@ -99,3 +99,33 @@ void EngineData::showWindow(uint32_t w, uint32_t h) gtk_widget_show(widget); gtk_widget_map(widget); } + +void EngineData::showMouseCursor() +{ + if (!widget) + return; + + gdk_threads_enter(); + GdkWindow* gdkwindow = gtk_widget_get_window(widget); + if (gdkwindow) + gdk_window_set_cursor(gdkwindow, NULL); + gdk_threads_leave(); +} + +void EngineData::hideMouseCursor() +{ + if (!widget) + return; + + gdk_threads_enter(); + GdkCursor* cursor = gdk_cursor_new(GDK_BLANK_CURSOR); + if (cursor) + { + GdkWindow* gdkwindow = gtk_widget_get_window(widget); + if (gdkwindow) + gdk_window_set_cursor(gdkwindow, cursor); + gdk_cursor_unref(cursor); + } + gdk_threads_leave(); +} + diff --git a/src/platforms/engineutils.h b/src/platforms/engineutils.h index ee3d1ab..44cdb6e 100644 --- a/src/platforms/engineutils.h +++ b/src/platforms/engineutils.h @@ -99,8 +99,11 @@ public: assert(!inputHandlerId); inputHandler = ic; gtk_widget_set_can_focus(widget,TRUE); - gtk_widget_add_events(widget,GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | - GDK_POINTER_MOTION_MASK | GDK_EXPOSURE_MASK); + gtk_widget_add_events(widget, + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | + GDK_POINTER_MOTION_MASK | GDK_EXPOSURE_MASK | + GDK_LEAVE_NOTIFY_MASK); inputHandlerId = g_signal_connect(widget, "event", G_CALLBACK(inputDispatch), this); } void removeInputHandler() @@ -141,6 +144,10 @@ public: static void startGTKMain(); static void quitGTKMain(); + + /* show/hide mouse cursor, must be called from the gtk thread */ + void showMouseCursor(); + void hideMouseCursor(); }; }; diff --git a/src/plugin/npscriptobject.cpp b/src/plugin/npscriptobject.cpp index e95ca66..0c528d8 100644 --- a/src/plugin/npscriptobject.cpp +++ b/src/plugin/npscriptobject.cpp @@ -814,8 +814,11 @@ bool NPScriptObject::callExternalHandler(NPP instance, const char* scriptString, //SUCCESS if(!NPVARIANT_IS_OBJECT(resultVariant)) { - //Something very wrong happended, our forged function is not a function! - LOG(LOG_ERROR,"Could not evaluate wrapper function in external interface"); + std::map> npObjectsMap; + NPVariantObject tmp(npObjectsMap, instance, resultVariant); + std::map asObjectsMap; + *(result) = tmp.getASObject(asObjectsMap); + NPN_ReleaseVariantValue(&resultVariant); } else { diff --git a/src/plugin/plugin.cpp b/src/plugin/plugin.cpp index e8338e0..9dd4f82 100644 --- a/src/plugin/plugin.cpp +++ b/src/plugin/plugin.cpp @@ -20,6 +20,7 @@ #include "version.h" #include "backends/security.h" +#include "backends/streamcache.h" #include "plugin/plugin.h" #include "logger.h" #include "compat.h" @@ -63,18 +64,22 @@ NPDownloadManager::NPDownloadManager(NPP _instance):instance(_instance) * \return A pointer to a newly created \c Downloader for the given URL. * \see DownloadManager::destroy() */ -lightspark::Downloader* NPDownloadManager::download(const lightspark::URLInfo& url, bool cached, lightspark::ILoadable* owner) +lightspark::Downloader* NPDownloadManager::download(const lightspark::URLInfo& url, _R cache, lightspark::ILoadable* owner) { // Handle RTMP requests internally, not through NPAPI if(url.isRTMP()) { - return StandaloneDownloadManager::download(url, cached, owner); + return StandaloneDownloadManager::download(url, cache, owner); } + // FIXME: dynamic_cast fails because the linker doesn't find + // typeinfo for FileStreamCache + //bool cached = dynamic_cast(cache.getPtr()) != NULL; + bool cached = false; LOG(LOG_INFO, _("NET: PLUGIN: DownloadManager::download '") << url.getParsedURL() << "'" << (cached ? _(" - cached") : "")); //Register this download - NPDownloader* downloader=new NPDownloader(url.getParsedURL(), cached, instance, owner); + NPDownloader* downloader=new NPDownloader(url.getParsedURL(), cache, instance, owner); addDownloader(downloader); return downloader; } @@ -88,18 +93,19 @@ lightspark::Downloader* NPDownloadManager::download(const lightspark::URLInfo& u * \return A pointer to a newly created \c Downloader for the given URL. * \see DownloadManager::destroy() */ -lightspark::Downloader* NPDownloadManager::downloadWithData(const lightspark::URLInfo& url, const std::vector& data, +lightspark::Downloader* NPDownloadManager::downloadWithData(const lightspark::URLInfo& url, + _R cache, const std::vector& data, const std::list& headers, lightspark::ILoadable* owner) { // Handle RTMP requests internally, not through NPAPI if(url.isRTMP()) { - return StandaloneDownloadManager::downloadWithData(url, data, headers, owner); + return StandaloneDownloadManager::downloadWithData(url, cache, data, headers, owner); } LOG(LOG_INFO, _("NET: PLUGIN: DownloadManager::downloadWithData '") << url.getParsedURL()); //Register this download - NPDownloader* downloader=new NPDownloader(url.getParsedURL(), data, headers, instance, owner); + NPDownloader* downloader=new NPDownloader(url.getParsedURL(), cache, data, headers, instance, owner); addDownloader(downloader); return downloader; } @@ -139,7 +145,7 @@ void NPDownloadManager::destroy(lightspark::Downloader* downloader) * \param[in] _url The URL for the Downloader. */ NPDownloader::NPDownloader(const lightspark::tiny_string& _url, lightspark::ILoadable* owner): - Downloader(_url, false, owner),instance(NULL),cleanupInDestroyStream(true),state(INIT) + Downloader(_url, _MR(new MemoryStreamCache), owner),instance(NULL),cleanupInDestroyStream(true),state(INIT) { } @@ -151,8 +157,8 @@ NPDownloader::NPDownloader(const lightspark::tiny_string& _url, lightspark::ILoa * \param[in] _instance The netscape plugin instance * \param[in] owner The \c LoaderInfo object that keeps track of this download */ -NPDownloader::NPDownloader(const lightspark::tiny_string& _url, bool _cached, NPP _instance, lightspark::ILoadable* owner): - Downloader(_url, _cached, owner),instance(_instance),cleanupInDestroyStream(false),state(INIT) +NPDownloader::NPDownloader(const lightspark::tiny_string& _url, _R _cache, NPP _instance, lightspark::ILoadable* owner): + Downloader(_url, _cache, owner),instance(_instance),cleanupInDestroyStream(false),state(INIT) { NPN_PluginThreadAsyncCall(instance, dlStartCallback, this); } @@ -165,9 +171,10 @@ NPDownloader::NPDownloader(const lightspark::tiny_string& _url, bool _cached, NP * \param[in] _instance The netscape plugin instance * \param[in] owner The \c LoaderInfo object that keeps track of this download */ -NPDownloader::NPDownloader(const lightspark::tiny_string& _url, const std::vector& _data, +NPDownloader::NPDownloader(const lightspark::tiny_string& _url, _R _cache, + const std::vector& _data, const std::list& headers, NPP _instance, lightspark::ILoadable* owner): - Downloader(_url, _data, headers, owner),instance(_instance),cleanupInDestroyStream(false),state(INIT) + Downloader(_url, _cache, _data, headers, owner),instance(_instance),cleanupInDestroyStream(false),state(INIT) { NPN_PluginThreadAsyncCall(instance, dlStartCallback, this); } @@ -313,36 +320,14 @@ void NS_DestroyPluginInstance(nsPluginInstanceBase * aPlugin) // nsPluginInstance::nsPluginInstance(NPP aInstance, int16_t argc, char** argn, char** argv) : nsPluginInstanceBase(), mInstance(aInstance),mInitialized(FALSE),mWindow(0), - mainDownloaderStream(NULL),mainDownloader(NULL),scriptObject(NULL),m_pt(NULL) + mainDownloaderStreambuf(NULL),mainDownloaderStream(NULL), + mainDownloader(NULL),scriptObject(NULL),m_pt(NULL) { LOG(LOG_INFO, "Lightspark version " << VERSION << " Copyright 2009-2013 Alessandro Pignotti and others"); setTLSSys( NULL ); m_sys=new lightspark::SystemState(0, lightspark::SystemState::FLASH); //Files running in the plugin have REMOTE sandbox m_sys->securityManager->setSandboxType(lightspark::SecurityManager::REMOTE); - //Parse OBJECT/EMBED tag attributes - string baseURL; - for(int i=0;iparseParametersFromFlashvars(argv[i]); - } - else if(strcasecmp(argn[i],"base")==0) - { - baseURL = argv[i]; - //This is a directory, not a file - baseURL += "/"; - } - //The SWF file url should be getted from NewStream - } - //basedir is a qualified URL or a path relative to the HTML page - URLInfo page(getPageURL()); - m_sys->mainClip->setBaseURL(page.goToURL(baseURL).getURL()); - - m_sys->downloadManager=new NPDownloadManager(mInstance); int p_major, p_minor, n_major, n_minor; NPN_Version(&p_major, &p_minor, &n_major, &n_minor); @@ -351,6 +336,33 @@ nsPluginInstance::nsPluginInstance(NPP aInstance, int16_t argc, char** argn, cha (NPScriptObjectGW *) NPN_CreateObject(mInstance, &NPScriptObjectGW::npClass); m_sys->extScriptObject = scriptObject->getScriptObject(); scriptObject->m_sys = m_sys; + //Parse OBJECT/EMBED tag attributes + string baseURL; + for(int i=0;iparseParametersFromFlashvars(argv[i]); + } + else if(strcasecmp(argn[i],"base")==0) + { + baseURL = argv[i]; + //This is a directory, not a file + baseURL += "/"; + } + else if(strcasecmp(argn[i],"name")==0) + { + m_sys->extScriptObject->setProperty(argn[i],argv[i]); + } + //The SWF file url should be getted from NewStream + } + //basedir is a qualified URL or a path relative to the HTML page + URLInfo page(getPageURL()); + m_sys->mainClip->setBaseURL(page.goToURL(baseURL).getURL()); + + m_sys->downloadManager=new NPDownloadManager(mInstance); } else LOG(LOG_ERROR, "PLUGIN: Browser doesn't support NPRuntime"); @@ -366,6 +378,8 @@ nsPluginInstance::~nsPluginInstance() setTLSSys(m_sys); if(mainDownloader) mainDownloader->stop(); + if (mainDownloaderStreambuf) + delete mainDownloaderStreambuf; // Kill all stuff relating to NPScriptObject which is still running static_cast(m_sys->extScriptObject)->destroy(); @@ -644,7 +658,8 @@ NPError nsPluginInstance::NewStream(NPMIMEType type, NPStream* stream, NPBool se dl=new NPDownloader(stream->url,m_sys->mainClip->loaderInfo.getPtr()); dl->setLength(stream->end); mainDownloader=dl; - mainDownloaderStream.rdbuf(mainDownloader); + mainDownloaderStreambuf = mainDownloader->getCache()->createReader(); + mainDownloaderStream.rdbuf(mainDownloaderStreambuf); m_pt=new lightspark::ParseThread(mainDownloaderStream,m_sys->mainClip); m_sys->addJob(m_pt); } diff --git a/src/plugin/plugin.h b/src/plugin/plugin.h index a8a5823..4e4962f 100644 --- a/src/plugin/plugin.h +++ b/src/plugin/plugin.h @@ -44,8 +44,11 @@ private: NPP instance; public: NPDownloadManager(NPP i); - lightspark::Downloader* download(const lightspark::URLInfo& url, bool cached, lightspark::ILoadable* owner); - lightspark::Downloader* downloadWithData(const lightspark::URLInfo& url, const std::vector& data, + lightspark::Downloader* download(const lightspark::URLInfo& url, + _R cache, + lightspark::ILoadable* owner); + lightspark::Downloader* downloadWithData(const lightspark::URLInfo& url, + _R cache, const std::vector& data, const std::list& headers, lightspark::ILoadable* owner); void destroy(lightspark::Downloader* downloader); }; @@ -63,8 +66,8 @@ public: STATE state; //Constructor used for the main file NPDownloader(const lightspark::tiny_string& _url, lightspark::ILoadable* owner); - NPDownloader(const lightspark::tiny_string& _url, bool _cached, NPP _instance, lightspark::ILoadable* owner); - NPDownloader(const lightspark::tiny_string& _url, const std::vector& _data, + NPDownloader(const lightspark::tiny_string& _url, _R cache, NPP _instance, lightspark::ILoadable* owner); + NPDownloader(const lightspark::tiny_string& _url, _R cache, const std::vector& _data, const std::list& headers, NPP _instance, lightspark::ILoadable* owner); }; @@ -135,6 +138,7 @@ private: GdkNativeWindow mWindow; int mX, mY; + std::streambuf *mainDownloaderStreambuf; std::istream mainDownloaderStream; NPDownloader* mainDownloader; NPScriptObjectGW* scriptObject; diff --git a/src/scripting/abc.cpp b/src/scripting/abc.cpp index ef1cf30..0b96a18 100644 --- a/src/scripting/abc.cpp +++ b/src/scripting/abc.cpp @@ -23,12 +23,21 @@ #include "compat.h" -#include #include +#ifndef LLVM_36 #include +#endif #include -#include -#ifdef HAVE_DATALAYOUT_H +#ifdef HAVE_IR_DATALAYOUT_H +# include +# include +#else +# include +# include +#endif +#ifdef HAVE_IR_DATALAYOUT_H +# include +#elif defined HAVE_DATALAYOUT_H # include #else # include @@ -39,7 +48,11 @@ #include #endif #include -#include +#ifdef HAVE_IR_VERIFIER_H +# include +#else +# include +#endif #include #include "logger.h" #include "swftypes.h" @@ -49,24 +62,47 @@ #include "swf.h" #include "scripting/toplevel/ASString.h" #include "scripting/toplevel/Date.h" +#include "scripting/toplevel/JSON.h" #include "scripting/toplevel/Math.h" #include "scripting/toplevel/RegExp.h" #include "scripting/toplevel/Vector.h" #include "scripting/toplevel/XML.h" #include "scripting/toplevel/XMLList.h" #include "scripting/flash/accessibility/flashaccessibility.h" +#include "scripting/flash/concurrent/Mutex.h" +#include "scripting/flash/concurrent/Condition.h" #include "scripting/flash/desktop/flashdesktop.h" #include "scripting/flash/display/flashdisplay.h" #include "scripting/flash/display/BitmapData.h" +#include "scripting/flash/display/Graphics.h" +#include "scripting/flash/display/GraphicsBitmapFill.h" +#include "scripting/flash/display/GraphicsEndFill.h" +#include "scripting/flash/display/GraphicsGradientFill.h" +#include "scripting/flash/display/GraphicsPath.h" +#include "scripting/flash/display/GraphicsShaderFill.h" +#include "scripting/flash/display/GraphicsSolidFill.h" +#include "scripting/flash/display/GraphicsStroke.h" +#include "scripting/flash/display/GraphicsTrianglePath.h" +#include "scripting/flash/display/IGraphicsData.h" +#include "scripting/flash/display/IGraphicsFill.h" +#include "scripting/flash/display/IGraphicsPath.h" +#include "scripting/flash/display/IGraphicsStroke.h" #include "scripting/flash/events/flashevents.h" +#include "scripting/flash/filesystem/flashfilesystem.h" #include "scripting/flash/filters/flashfilters.h" #include "scripting/flash/net/flashnet.h" #include "scripting/flash/net/URLRequestHeader.h" #include "scripting/flash/net/URLStream.h" #include "scripting/flash/net/XMLSocket.h" +#include "scripting/flash/net/NetStreamPlayOptions.h" +#include "scripting/flash/net/NetStreamPlayTransitions.h" +#include "scripting/flash/printing/flashprinting.h" #include "scripting/flash/system/flashsystem.h" #include "scripting/flash/sensors/flashsensors.h" #include "scripting/flash/utils/flashutils.h" +#include "scripting/flash/utils/Dictionary.h" +#include "scripting/flash/utils/Proxy.h" +#include "scripting/flash/utils/Timer.h" #include "scripting/flash/geom/flashgeom.h" #include "scripting/flash/external/ExternalInterface.h" #include "scripting/flash/media/flashmedia.h" @@ -75,6 +111,10 @@ #include "scripting/flash/text/flashtext.h" #include "scripting/flash/text/flashtextengine.h" #include "scripting/flash/ui/Keyboard.h" +#include "scripting/flash/ui/Mouse.h" +#include "scripting/flash/ui/ContextMenu.h" +#include "scripting/flash/ui/ContextMenuItem.h" +#include "scripting/flash/ui/ContextMenuBuiltInItems.h" #include "scripting/class.h" #include "exceptions.h" #include "scripting/abc.h" @@ -82,10 +122,10 @@ using namespace std; using namespace lightspark; -static GStaticPrivate is_vm_thread = G_STATIC_PRIVATE_INIT; /* TLS */ +DEFINE_AND_INITIALIZE_TLS(is_vm_thread); bool lightspark::isVmThread() { - return g_static_private_get(&is_vm_thread); + return GPOINTER_TO_INT(tls_get(&is_vm_thread)); } DoABCTag::DoABCTag(RECORDHEADER h, std::istream& in):ControlTag(h) @@ -196,13 +236,11 @@ void ABCVm::registerClasses() builtin->registerBuiltin("Namespace","",Class::getRef()); builtin->registerBuiltin("AS3","",_MR(Class::getInstanceS(AS3))); builtin->registerBuiltin("Date","",Class::getRef()); + builtin->registerBuiltin("JSON","",Class::getRef()); builtin->registerBuiltin("RegExp","",Class::getRef()); builtin->registerBuiltin("QName","",Class::getRef()); builtin->registerBuiltin("uint","",Class::getRef()); builtin->registerBuiltin("Vector","__AS3__.vec",_MR(Template::getTemplate())); - //Some instances must be included, they are not created by AS3 code - builtin->registerBuiltin("Vector$Object","__AS3__.vec",Template::getTemplateInstance(Class::getClass())); - builtin->registerBuiltin("Vector$Number","__AS3__.vec",Template::getTemplateInstance(Class::getClass())); builtin->registerBuiltin("Error","",Class::getRef()); builtin->registerBuiltin("SecurityError","",Class::getRef()); builtin->registerBuiltin("ArgumentError","",Class::getRef()); @@ -234,6 +272,10 @@ void ABCVm::registerClasses() builtin->registerBuiltin("AccessibilityProperties","flash.accessibility",Class::getRef()); builtin->registerBuiltin("AccessibilityImplementation","flash.accessibility",Class::getRef()); + builtin->registerBuiltin("Accessibility","flash.accessibility",Class::getRef()); + + builtin->registerBuiltin("Mutex","flash.concurrent",Class::getRef()); + builtin->registerBuiltin("Condition","flash.concurrent",Class::getRef()); builtin->registerBuiltin("MovieClip","flash.display",Class::getRef()); builtin->registerBuiltin("DisplayObject","flash.display",Class::getRef()); @@ -246,6 +288,20 @@ void ABCVm::registerClasses() builtin->registerBuiltin("Shape","flash.display",Class::getRef()); builtin->registerBuiltin("Stage","flash.display",Class::getRef()); builtin->registerBuiltin("Graphics","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsBitmapFill","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsEndFill","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsGradientFill","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsPath","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsPathCommand","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsPathWinding","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsShaderFill","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsSolidFill","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsStroke","flash.display",Class::getRef()); + builtin->registerBuiltin("GraphicsTrianglePath","flash.display",Class::getRef()); + builtin->registerBuiltin("IGraphicsData","flash.display",InterfaceClass::getRef()); + builtin->registerBuiltin("IGraphicsFill","flash.display",InterfaceClass::getRef()); + builtin->registerBuiltin("IGraphicsPath","flash.display",InterfaceClass::getRef()); + builtin->registerBuiltin("IGraphicsStroke","flash.display",InterfaceClass::getRef()); builtin->registerBuiltin("GradientType","flash.display",Class::getRef()); builtin->registerBuiltin("BlendMode","flash.display",Class::getRef()); builtin->registerBuiltin("LineScaleMode","flash.display",Class::getRef()); @@ -256,10 +312,6 @@ void ABCVm::registerClasses() builtin->registerBuiltin("BitmapData","flash.display",Class::getRef()); builtin->registerBuiltin("Bitmap","flash.display",Class::getRef()); builtin->registerBuiltin("IBitmapDrawable","flash.display",InterfaceClass::getRef()); - builtin->registerBuiltin("GraphicsGradientFill","flash.display", - Class::getStubClass(QName("GraphicsGradientFill","flash.display"))); - builtin->registerBuiltin("GraphicsPath","flash.display", - Class::getStubClass(QName("GraphicsPath","flash.display"))); builtin->registerBuiltin("MorphShape","flash.display",Class::getRef()); builtin->registerBuiltin("SpreadMethod","flash.display",Class::getRef()); builtin->registerBuiltin("InterpolationMethod","flash.display",Class::getRef()); @@ -270,24 +322,17 @@ void ABCVm::registerClasses() builtin->registerBuiltin("BitmapDataChannel","flash.display",Class::getRef()); builtin->registerBuiltin("BitmapFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("BitmapFilterQuality","flash.filters",Class::getRef()); builtin->registerBuiltin("DropShadowFilter","flash.filters",Class::getRef()); builtin->registerBuiltin("GlowFilter","flash.filters",Class::getRef()); - builtin->registerBuiltin("GradientGlowFilter","flash.filters", - Class::getStubClass(QName("GradientGlowFilter","flash.filters"), Class::getRef())); - builtin->registerBuiltin("BevelFilter","flash.filters", - Class::getStubClass(QName("BevelFilter","flash.filters"), Class::getRef())); - builtin->registerBuiltin("ColorMatrixFilter","flash.filters", - Class::getStubClass(QName("ColorMatrixFilter","flash.filters"), Class::getRef())); - builtin->registerBuiltin("BlurFilter","flash.filters", - Class::getStubClass(QName("BlurFilter","flash.filters"), Class::getRef())); - builtin->registerBuiltin("ConvolutionFilter","flash.filters", - Class::getStubClass(QName("ConvolutionFilter","flash.filters"), Class::getRef())); - builtin->registerBuiltin("DisplacementMapFilter","flash.filters", - Class::getStubClass(QName("DisplacementMapFilter","flash.filters"), Class::getRef())); - builtin->registerBuiltin("GradientBevelFilter","flash.filters", - Class::getStubClass(QName("GradientBevelFilter","flash.filters"), Class::getRef())); - builtin->registerBuiltin("ShaderFilter","flash.filters", - Class::getStubClass(QName("ShaderFilter","flash.filters"), Class::getRef())); + builtin->registerBuiltin("GradientGlowFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("BevelFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("ColorMatrixFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("BlurFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("ConvolutionFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("DisplacementMapFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("GradientBevelFilter","flash.filters",Class::getRef()); + builtin->registerBuiltin("ShaderFilter","flash.filters",Class::getRef()); builtin->registerBuiltin("AntiAliasType","flash.text",Class::getRef()); builtin->registerBuiltin("Font","flash.text",Class::getRef()); @@ -303,15 +348,25 @@ void ABCVm::registerClasses() builtin->registerBuiltin("TextFormat","flash.text",Class::getRef()); builtin->registerBuiltin("TextFormatAlign","flash.text",Class::getRef()); builtin->registerBuiltin("TextLineMetrics","flash.text",Class::getRef()); + builtin->registerBuiltin("TextInteractionMode","flash.text",Class::getRef()); builtin->registerBuiltin("StaticText","flash.text",Class::getRef()); builtin->registerBuiltin("ContentElement","flash.text.engine",Class::getRef()); builtin->registerBuiltin("ElementFormat","flash.text.engine",Class::getRef()); builtin->registerBuiltin("FontDescription","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("FontMetrics","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("FontLookup","flash.text.engine",Class::getRef()); builtin->registerBuiltin("FontWeight","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("Kerning","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("LineJustification","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("TextBaseline","flash.text.engine",Class::getRef()); builtin->registerBuiltin("TextBlock","flash.text.engine",Class::getRef()); builtin->registerBuiltin("TextElement","flash.text.engine",Class::getRef()); builtin->registerBuiltin("TextLine","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("TextLineValidity","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("TextJustifier","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("SpaceJustifier","flash.text.engine",Class::getRef()); + builtin->registerBuiltin("EastAsianJustifier","flash.text.engine",Class::getRef()); builtin->registerBuiltin("XMLDocument","flash.xml",Class::getRef()); builtin->registerBuiltin("XMLNode","flash.xml",Class::getRef()); @@ -323,10 +378,8 @@ void ABCVm::registerClasses() builtin->registerBuiltin("Dictionary","flash.utils",Class::getRef()); builtin->registerBuiltin("Proxy","flash.utils",Class::getRef()); builtin->registerBuiltin("Timer","flash.utils",Class::getRef()); - builtin->registerBuiltin("getQualifiedClassName","flash.utils", - _MR(Class::getFunction(getQualifiedClassName))); - builtin->registerBuiltin("getQualifiedSuperclassName","flash.utils", - _MR(Class::getFunction(getQualifiedSuperclassName))); + builtin->registerBuiltin("getQualifiedClassName","flash.utils",_MR(Class::getFunction(getQualifiedClassName))); + builtin->registerBuiltin("getQualifiedSuperclassName","flash.utils",_MR(Class::getFunction(getQualifiedSuperclassName))); builtin->registerBuiltin("getDefinitionByName","flash.utils",_MR(Class::getFunction(getDefinitionByName))); builtin->registerBuiltin("getTimer","flash.utils",_MR(Class::getFunction(getTimer))); builtin->registerBuiltin("setInterval","flash.utils",_MR(Class::getFunction(setInterval))); @@ -334,6 +387,8 @@ void ABCVm::registerClasses() builtin->registerBuiltin("clearInterval","flash.utils",_MR(Class::getFunction(clearInterval))); builtin->registerBuiltin("clearTimeout","flash.utils",_MR(Class::getFunction(clearTimeout))); builtin->registerBuiltin("describeType","flash.utils",_MR(Class::getFunction(describeType))); + builtin->registerBuiltin("escapeMultiByte","flash.utils",_MR(Class::getFunction(escapeMultiByte))); + builtin->registerBuiltin("unescapeMultiByte","flash.utils",_MR(Class::getFunction(unescapeMultiByte))); builtin->registerBuiltin("IExternalizable","flash.utils",InterfaceClass::getRef()); builtin->registerBuiltin("IDataInput","flash.utils",InterfaceClass::getRef()); builtin->registerBuiltin("IDataOutput","flash.utils",InterfaceClass::getRef()); @@ -344,7 +399,8 @@ void ABCVm::registerClasses() builtin->registerBuiltin("Transform","flash.geom",Class::getRef()); builtin->registerBuiltin("Point","flash.geom",Class::getRef()); builtin->registerBuiltin("Vector3D","flash.geom",Class::getRef()); - builtin->registerBuiltin("Matrix3D","flash.geom",Class::getStubClass(QName("Matrix3D", "flash.geom"))); + builtin->registerBuiltin("Matrix3D","flash.geom",Class::getRef()); + builtin->registerBuiltin("PerspectiveProjection","flash.geom",Class::getRef()); builtin->registerBuiltin("EventDispatcher","flash.events",Class::getRef()); builtin->registerBuiltin("Event","flash.events",Class::getRef()); @@ -369,13 +425,24 @@ void ABCVm::registerClasses() builtin->registerBuiltin("DRMStatusEvent","flash.events",Class::getRef()); builtin->registerBuiltin("StageVideoEvent","flash.events",Class::getRef()); builtin->registerBuiltin("StageVideoAvailabilityEvent","flash.events",Class::getRef()); + builtin->registerBuiltin("TouchEvent","flash.events",Class::getRef()); + builtin->registerBuiltin("GestureEvent","flash.events",Class::getRef()); + builtin->registerBuiltin("PressAndTapGestureEvent","flash.events",Class::getRef()); + builtin->registerBuiltin("TransformGestureEvent","flash.events",Class::getRef()); + builtin->registerBuiltin("ContextMenuEvent","flash.events",Class::getRef()); + builtin->registerBuiltin("UncaughtErrorEvent","flash.events",Class::getRef()); + builtin->registerBuiltin("UncaughtErrorEvents","flash.events",Class::getRef()); + builtin->registerBuiltin("VideoEvent","flash.events",Class::getRef()); builtin->registerBuiltin("navigateToURL","flash.net",_MR(Class::getFunction(navigateToURL))); builtin->registerBuiltin("sendToURL","flash.net",_MR(Class::getFunction(sendToURL))); - builtin->registerBuiltin("LocalConnection","flash.net",Class::getStubClass(QName("LocalConnection","flash.net"))); + builtin->registerBuiltin("LocalConnection","flash.net",Class::getRef()); builtin->registerBuiltin("NetConnection","flash.net",Class::getRef()); + builtin->registerBuiltin("NetGroup","flash.net",Class::getRef()); builtin->registerBuiltin("NetStream","flash.net",Class::getRef()); - builtin->registerBuiltin("NetStreamPlayOptions","flash.net",Class::getStubClass(QName("NetStreamPlayOptions","flash.net"))); + builtin->registerBuiltin("NetStreamAppendBytesAction","flash.net",Class::getRef()); + builtin->registerBuiltin("NetStreamPlayOptions","flash.net",Class::getRef()); + builtin->registerBuiltin("NetStreamPlayTransitions","flash.net",Class::getRef()); builtin->registerBuiltin("URLLoader","flash.net",Class::getRef()); builtin->registerBuiltin("URLStream","flash.net",Class::getRef()); builtin->registerBuiltin("URLLoaderDataFormat","flash.net",Class::getRef()); @@ -384,13 +451,17 @@ void ABCVm::registerClasses() builtin->registerBuiltin("URLRequestMethod","flash.net",Class::getRef()); builtin->registerBuiltin("URLVariables","flash.net",Class::getRef()); builtin->registerBuiltin("SharedObject","flash.net",Class::getRef()); + builtin->registerBuiltin("SharedObjectFlushStatus","flash.net",Class::getRef()); builtin->registerBuiltin("ObjectEncoding","flash.net",Class::getRef()); - builtin->registerBuiltin("Socket","flash.net",Class::getStubClass(QName("Socket","flash.net"))); + builtin->registerBuiltin("Socket","flash.net",Class::getRef()); builtin->registerBuiltin("Responder","flash.net",Class::getRef()); builtin->registerBuiltin("XMLSocket","flash.net",Class::getRef()); builtin->registerBuiltin("registerClassAlias","flash.net",_MR(Class::getFunction(registerClassAlias))); builtin->registerBuiltin("getClassByAlias","flash.net",_MR(Class::getFunction(getClassByAlias))); + builtin->registerBuiltin("DRMManager","flash.net.drm",Class::getRef()); + + builtin->registerBuiltin("fscommand","flash.system",_MR(Class::getFunction(fscommand))); builtin->registerBuiltin("Capabilities","flash.system",Class::getRef()); builtin->registerBuiltin("Security","flash.system",Class::getRef()); @@ -398,6 +469,7 @@ void ABCVm::registerClasses() builtin->registerBuiltin("SecurityDomain","flash.system",Class::getRef()); builtin->registerBuiltin("LoaderContext","flash.system",Class::getRef()); builtin->registerBuiltin("System","flash.system",Class::getRef()); + builtin->registerBuiltin("Worker","flash.system",Class::getRef()); builtin->registerBuiltin("SoundTransform","flash.media",Class::getRef()); builtin->registerBuiltin("Video","flash.media",Class