[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, master, updated. a0146c39c456fc46d4ec
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] [SCM] Gnash branch, master, updated. a0146c39c456fc46d4ecba6e52ff7fceed4df844 |
Date: |
Fri, 22 Oct 2010 08:09:33 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".
The branch, master has been updated
via a0146c39c456fc46d4ecba6e52ff7fceed4df844 (commit)
via 9dd505c3c345f1684ec386ebe4205f04ae8917c8 (commit)
via aa491f3d6c7aa524fa02b9b8b1780f705e0ae604 (commit)
via 4f852bb7e5426d6372f18ff907b02a7044ff28e7 (commit)
via 0e1ca11775abbc79a3e65b1395862884c15d6a8c (commit)
via 6018972db8a8ac0db5a90fbb53b7d08c9cd5c212 (commit)
via 006c37491c49d762701f213f58c7f8eb6b6bf8f9 (commit)
via c6fc1605aeebec39d92dc10c45be6fc25f3fc7fa (commit)
via 6d3bb42c7cc204909cf4ad0f20d4754aaa35db28 (commit)
via 0debb5fd1a39271037654018819160741aa4d4cf (commit)
via accc8fec49afe2790c1e9fadcfc0c0d2413c5a05 (commit)
from e9cade9463fba67c994acd81ecace31c694c7b0d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=a0146c39c456fc46d4ecba6e52ff7fceed4df844
commit a0146c39c456fc46d4ecba6e52ff7fceed4df844
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 09:38:03 2010 +0200
Drop obsolete script.
diff --git a/libcore/asobj/flash/gen-as3.sh b/libcore/asobj/flash/gen-as3.sh
deleted file mode 100755
index 7b118e7..0000000
--- a/libcore/asobj/flash/gen-as3.sh
+++ /dev/null
@@ -1,293 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-# This script generates header file and C++ source file templates
-# for an ActionScript class. It depends on the doc/C/NOTES file for
-# data. It takes a single argument, which is the name of the class,
-# like "./gen-files.sh Camera".
-#
-# This script is only of use to developers, so it's "as is". Your
-# mileage may vary.
-
-if test x"$1" = "x"; then
- echo "Usage: $0 <classname>" >&2
- exit 1
-fi
-
-# Top level path
-# Add some newlines to make sed;ing and grep'ing easier.
-namespace="`basename $PWD`"
-class=`basename $1 | sed -e "s:.html::"`
-#sed -e "s/<div/\n<div/g" -e "s/<t/\n<t/g" -e "s/<a /\n<a /g" -e
"s/ /\n /g"
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Camera.html
> tmp.html
-
-sed -e "s/<div/\n<div/g" -e "s/<t/\n<t/g" -e "s/<a /\n<a /g" -e
"s/ /\n /g" $1 > tmp.html
-dos2unix -q tmp.html
-
-# extract the properties from the web page
-props="`sed -e '1,/MainContent/ d' -e '/Method Detail/,$d' tmp.html | grep
"detailHeaderName" | sed -e 's:^.*detailHeaderName">::' -e 's:<.*::' | tr -s
'\n' ' '`"
-# extract the methods from the web page
-methods="`sed -e '1,/methodDetail/ d' -e
'/(summaryTableTitle|propertyDetail|eventDetail|ExamplesSummary|Event)/,$d'
tmp.html | grep "detailHeaderName" | sed -e 's:^.*detailHeaderName">::' -e
's:<.*::' | tr -s '\n' ' '`"
-# extract the methods from the web page
-events="`sed -e '1,/eventDetail/ d' -e '/(propertyDetail|Property Detail)/,$d'
tmp.html | grep "detailHeaderName" | sed -e 's:^.*detailHeaderName">::' -e
's:<.*::' | tr -s '\n' ' '`"
-
-# ignore the package-detail files
-if test x"${class}" = x"package-detail" -o x"${class}" = x"package"; then
- exit
-fi
-
-# display what we found
-echo "Class: $class"
-props_blanks=`echo $props | tr -d ' '`
-if test x"$props_blanks" != x; then
- echo " Properties: \"$props\""
-fi
-meth_blanks=`echo $methods | tr -d ' '`
-if test x"$meth_blanks" != x; then
- echo " Methods: \"$methods\""
-fi
-
-
-asname=${class}
-lowname=`echo ${asname} | tr '[A-Z]' '[a-z]'`
-upname=`echo ${asname} | tr '[a-z]' '[A-Z]'`
-outname=${asname}_as3.h
-srcname=${asname}_as3.cpp
-
-if test -f ${outname}; then
- echo ${outname} exists!
-# mv -f ${outname} ${outname}.orig
- exit 1;
-fi
-
-if test -f ${srcname}; then
- echo ${srcname} exists!
-# mv -f ${srcname} ${outname}.orig
- exit 1;
-fi
-
-###############################################################
-# Start by generating the header file for this class
-#
-rm -f ${outname}
-cat <<EOF>>${outname}
-// ${outname}: ActionScript 3 "${asname}" class, for Gnash.
-//
-// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef GNASH_ASOBJ3_${upname}_H
-#define GNASH_ASOBJ3_${upname}_H
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include "fn_call.h"
-
-// Forward declarations
-class as_object;
-
-namespace gnash {
-namespace {
- as_object* get${asname}Interface();
-}
-
-class ${asname}_as3: public as_object
-{
-
-public:
-
- ${asname}_as3()
- :
- as_object(get${asname}Interface())
- {}
-
-};
-
-/// Initialize the global ${asname} class
-void ${lowname}_class_init(as_object& global);
-
-} // gnash namespace
-
-// GNASH_ASOBJ3_${upname}_H
-#endif
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: t
-// End:
-
-EOF
-##############################################################
-# now generate the source file
-#
-
-# start with the header part
-cat <<EOF>>${srcname}
-// ${srcname}: ActionScript "${asname}" class, for Gnash.
-//
-// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include "${namespace}/${asname}_as3.h"
-#include "log.h"
-#include "fn_call.h"
-#include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
-
-namespace gnash {
-
-// Forward declarations
-namespace {
-EOF
-for i in $methods; do
-# DO NOT CONVERT CASE, SWF7+ is case-sensitive
-newi=`echo $i | sed -e 's/)//g'` # | tr '[A-Z]' '[a-z]'
-cat <<EOF>>${srcname}
- as_value ${lowname}_${newi}(const fn_call& fn);
-EOF
-done
-cat <<EOF>>${srcname}
- as_value ${lowname}_ctor(const fn_call& fn);
- void attach${asname}Interface(as_object& o);
- void attach${asname}StaticInterface(as_object& o);
- as_object* get${asname}Interface();
-
-}
-
-// extern (used by Global.cpp)
-void ${lowname}_class_init(as_object& global)
-{
- static boost::intrusive_ptr<builtin_function> cl;
-
- if (!cl) {
- cl = new builtin_function(&${lowname}_ctor, get${asname}Interface());
- attach${asname}StaticInterface(*cl);
- }
-
- // Register _global.${asname}
- global.init_member("${asname}", cl.get());
-}
-
-namespace {
-
-void
-attach${asname}Interface(as_object& o)
-{
-EOF
-# now process the methods
-for i in $methods; do
- # DO NOT CONVERT CASE, SWF7+ is case-sensitive
- newi=`echo $i | sed -e 's/()//g'` # | tr '[A-Z]' '[a-z]'
- cat <<EOF>>${srcname}
- o.init_member("${newi}", new builtin_function(${lowname}_${newi}));
-EOF
-done
-cat <<EOF>>${srcname}
-}
-
-void
-attach${asname}StaticInterface(as_object& o)
-{
-
-}
-
-as_object*
-get${asname}Interface()
-{
- static boost::intrusive_ptr<as_object> o;
- if ( ! o ) {
- o = new as_object();
- attach${asname}Interface(*o);
- }
- return o.get();
-}
-EOF
-
-for i in $methods; do
-# DO NOT CONVERT CASE, SWF7+ is case-sensitive
-newi=`echo $i | sed -e 's/)//g'` # | tr '[A-Z]' '[a-z]'
-cat <<EOF>>${srcname}
-
-as_value
-${lowname}_${newi}(const fn_call& fn)
-{
- boost::intrusive_ptr<${asname}_as3> ptr =
- ensureType<${asname}_as3>(fn.this_ptr);
- UNUSED(ptr);
- log_unimpl (__FUNCTION__);
- return as_value();
-}
-EOF
-done
-
-cat <<EOF>>${srcname}
-
-as_value
-${lowname}_ctor(const fn_call& fn)
-{
- boost::intrusive_ptr<as_object> obj = new ${asname}_as3;
-
- return as_value(obj.get()); // will keep alive
-}
-
-} // anonymous namespace
-} // gnash namespace
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: t
-// End:
-
-EOF
-
-rm -f tmp.html
http://git.savannah.gnu.org/cgit//commit/?id=9dd505c3c345f1684ec386ebe4205f04ae8917c8
commit 9dd505c3c345f1684ec386ebe4205f04ae8917c8
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 09:37:54 2010 +0200
Drop silly log_unimpl.
diff --git a/libmedia/gst/AudioInputGst.cpp b/libmedia/gst/AudioInputGst.cpp
index fec1447..d3bbadb 100644
--- a/libmedia/gst/AudioInputGst.cpp
+++ b/libmedia/gst/AudioInputGst.cpp
@@ -82,8 +82,8 @@ AudioInputGst::AudioInputGst()
audioCreateSaveBin(_globalAudio);
}
-AudioInputGst::~AudioInputGst() {
- log_unimpl("Audio Input destructor");
+AudioInputGst::~AudioInputGst()
+{
}
void
http://git.savannah.gnu.org/cgit//commit/?id=aa491f3d6c7aa524fa02b9b8b1780f705e0ae604
commit aa491f3d6c7aa524fa02b9b8b1780f705e0ae604
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 09:29:23 2010 +0200
Clean up.
diff --git a/libcore/vm/ActionExec.cpp b/libcore/vm/ActionExec.cpp
index d385662..ba06d38 100644
--- a/libcore/vm/ActionExec.cpp
+++ b/libcore/vm/ActionExec.cpp
@@ -16,8 +16,6 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h" // USE_DEBUGGER
@@ -34,7 +32,6 @@
#include "SWF.h"
#include "ASHandlers.h"
#include "as_environment.h"
-#include "debugger.h"
#include "SystemClock.h"
#include "CallStack.h"
@@ -59,14 +56,8 @@
#endif
-
namespace gnash {
-//static LogFile& dbglogfile = LogFile::getDefaultInstance();
-#ifdef USE_DEBUGGER
-static Debugger& debugger = Debugger::getDefaultInstance();
-#endif
-
ActionExec::ActionExec(const Function& func, as_environment& newEnv,
as_value* nRetVal, as_object* this_ptr)
:
@@ -288,16 +279,6 @@ ActionExec::operator()()
break;
}
-
-#ifdef USE_DEBUGGER
- debugger.setFramePointer(code.getFramePointer(pc));
- debugger.setEnvStack(&env);
- if (debugger.isTracing())
- {
- debugger.disassemble();
- }
-#endif
-
#if DEBUG_STACK
IF_VERBOSE_ACTION (
log_action(_("After execution: PC %d, next PC %d, "
@@ -310,15 +291,13 @@ ActionExec::operator()()
// Do some housecleaning on branch back
- if ( next_pc <= pc )
- {
+ if (next_pc <= pc) {
// Check for script limits hit.
// See: http://www.gnashdev.org/wiki/index.php/ScriptLimits
if (clock.elapsed() > maxTime) {
boost::format fmt(_("Time exceeded"));
throw ActionLimitException(fmt.str());
}
-
// TODO: Run garbage collector ? If stack isn't too big ?
}
@@ -327,14 +306,14 @@ ActionExec::operator()()
}
}
- catch (ActionLimitException& ex) {
+ catch (const ActionLimitException&) {
// Class execution should stop (for this frame only?)
// Here's were we should pop-up a window to prompt user about
// what to do next (abort or not ?)
cleanupAfterRun(); // we expect inconsistencies here
throw;
}
- catch (ActionScriptException& ex) {
+ catch (const ActionScriptException&) {
// An unhandled ActionScript exception was thrown.
cleanupAfterRun();
@@ -346,7 +325,6 @@ ActionExec::operator()()
return;
}
- // TODO: catch other exceptions ?
cleanupAfterRun();
@@ -374,25 +352,22 @@ bool
ActionExec::processExceptions(TryBlock& t)
{
- switch (t._tryState)
- {
-
+ switch (t._tryState) {
case TryBlock::TRY_TRY:
{
- if (env.stack_size() && env.top(0).is_exception())
- {
+ if (env.stack_size() && env.top(0).is_exception()) {
#ifdef GNASH_DEBUG_TRY
as_value ex = env.top(0);
ex.unflag_exception();
- log_debug("TRY block: Encountered exception (%s). Set PC to
catch.", ex);
+ log_debug("TRY block: Encountered exception (%s). "
+ "Set PC to catch.", ex);
#endif
// We have an exception. Don't execute any more of the try
// block and process exception.
pc = t._catchOffset;
t._tryState = TryBlock::TRY_CATCH;
- if (!t._hasName)
- {
+ if (!t._hasName) {
// Used when exceptions are thrown in functions.
// Tests in misc-mtasc.all/exception.as
as_value ex = env.pop();
@@ -401,8 +376,7 @@ ActionExec::processExceptions(TryBlock& t)
getVM(env).setRegister(t._registerIndex, ex);
}
}
- else
- {
+ else {
#ifdef GNASH_DEBUG_TRY
log_debug("TRY block: No exception, continuing as normal.");
#endif
@@ -431,8 +405,7 @@ ActionExec::processExceptions(TryBlock& t)
// If we are here, there should have been an exception
// in 'try'.
- if (env.stack_size() && env.top(0).is_exception())
- {
+ if (env.stack_size() && env.top(0).is_exception()) {
// This was thrown in "try". Remove it from
// the stack and remember it so that
// further exceptions can be caught.
@@ -444,8 +417,7 @@ ActionExec::processExceptions(TryBlock& t)
log_debug("CATCH block: top of stack is an exception (%s)",
ex);
#endif
- if (t._hasName && !t._name.empty())
- {
+ if (t._hasName && !t._name.empty()) {
// If name isn't empty, it means we have a catch block.
// We should set its argument to the exception value.
setLocalVariable(t._name, ex);
@@ -472,8 +444,7 @@ ActionExec::processExceptions(TryBlock& t)
log_debug("FINALLY: TryBlock name = %s", t._name);
#endif
// If the exception is here, we have thrown in catch.
- if (env.stack_size() && env.top(0).is_exception())
- {
+ if (env.stack_size() && env.top(0).is_exception()) {
t._lastThrow = env.pop();
#ifdef GNASH_DEBUG_TRY
@@ -501,8 +472,7 @@ ActionExec::processExceptions(TryBlock& t)
// If there's no exception here, we can execute the
// rest of the code. If there is, it will be caught
// by the next TryBlock or stop execution.
- if (env.stack_size() && env.top(0).is_exception())
- {
+ if (env.stack_size() && env.top(0).is_exception()) {
// Check for exception handlers straight away
stop_pc = t._afterTriedOffset;
#ifdef GNASH_DEBUG_TRY
@@ -514,8 +484,7 @@ ActionExec::processExceptions(TryBlock& t)
_tryList.pop_back();
return true;
}
- else if (t._lastThrow.is_exception())
- {
+ else if (t._lastThrow.is_exception()) {
// Check for exception handlers straight away
stop_pc = t._afterTriedOffset;
#ifdef GNASH_DEBUG_TRY
@@ -562,18 +531,15 @@ ActionExec::cleanupAfterRun()
vm.setSWFVersion(_origExecSWFVersion);
- IF_VERBOSE_MALFORMED_SWF
- (
+ IF_VERBOSE_MALFORMED_SWF(
// check if the stack was smashed
- if ( _initialStackSize > env.stack_size() )
- {
+ if (_initialStackSize > env.stack_size()) {
log_swferror(_("Stack smashed (ActionScript compiler bug, or "
- "obfuscated SWF).Taking no action to fix (as expected)."));
+ "obfuscated SWF).Taking no action to fix (as expected)."));
}
- else if ( _initialStackSize < env.stack_size() )
- {
- log_swferror(_("%d elements left on the stack after block
execution. "),
- env.stack_size() - _initialStackSize);
+ else if (_initialStackSize < env.stack_size()) {
+ log_swferror(_("%d elements left on the stack after block "
+ "execution."), env.stack_size() - _initialStackSize);
}
);
@@ -586,14 +552,11 @@ void
ActionExec::skip_actions(size_t offset)
{
- for(size_t i=0; i<offset; ++i)
- {
-#if 1
+ for (size_t i = 0; i < offset; ++i) {
// we need to check at every iteration because
// an action can be longer then a single byte
- if ( next_pc >= stop_pc )
- {
- IF_VERBOSE_MALFORMED_SWF (
+ if (next_pc >= stop_pc) {
+ IF_VERBOSE_MALFORMED_SWF(
log_swferror(_("End of DoAction block hit while skipping "
"%d action tags (pc:%d, stop_pc:%d) "
"(WaitForFrame, probably)"), offset, next_pc,
@@ -602,23 +565,20 @@ ActionExec::skip_actions(size_t offset)
next_pc = stop_pc;
return;
}
-#endif
// Get the opcode.
- boost::uint8_t action_id = code[next_pc];
+ const boost::uint8_t action_id = code[next_pc];
// Set default next_pc offset, control flow action handlers
// will be able to reset it.
- if ((action_id & 0x80) == 0)
- {
+ if ((action_id & 0x80) == 0) {
// action with no extra data
- next_pc++;
+ ++next_pc;
}
- else
- {
+ else {
// action with extra data
- boost::int16_t length = code.read_int16(next_pc+1);
- assert( length >= 0 );
+ const boost::int16_t length = code.read_int16(next_pc + 1);
+ assert(length >= 0);
next_pc += length + 3;
}
}
@@ -706,14 +666,12 @@ ActionExec::pushTryBlock(TryBlock t)
stop_pc = t._catchOffset;
_tryList.push_back(t);
-
}
void
ActionExec::pushReturn(const as_value& t)
{
- if (retval)
- {
+ if (retval) {
*retval = t;
}
_returning = true;
@@ -724,7 +682,8 @@ ActionExec::adjustNextPC(int offset)
{
const int tagPos = offset + static_cast<int>(pc);
if (tagPos < 0) {
- log_unimpl(_("Jump outside DoAction tag requested (offset %d before
tag start)"), -tagPos);
+ log_unimpl(_("Jump outside DoAction tag requested (offset %d "
+ "before tag start)"), -tagPos);
return;
}
next_pc += offset;
@@ -734,23 +693,22 @@ void
ActionExec::dumpActions(size_t from, size_t to, std::ostream& os)
{
size_t lpc = from;
- while (lpc < to)
- {
+ while (lpc < to) {
// Get the opcode.
- boost::uint8_t action_id = code[lpc];
+ const boost::uint8_t action_id = code[lpc];
os << " PC:" << lpc << " - EX: " << code.disasm(lpc) << std::endl;
// Set default next_pc offset, control flow action handlers
// will be able to reset it.
- if ((action_id & 0x80) == 0)
- {
+ if ((action_id & 0x80) == 0) {
// action with no extra data
- lpc++;
- } else {
+ ++lpc;
+ }
+ else {
// action with extra data
- boost::int16_t length = code.read_int16(lpc+1);
- assert( length >= 0 );
+ const boost::int16_t length = code.read_int16(lpc + 1);
+ assert(length >= 0);
lpc += length + 3;
}
http://git.savannah.gnu.org/cgit//commit/?id=4f852bb7e5426d6372f18ff907b02a7044ff28e7
commit 4f852bb7e5426d6372f18ff907b02a7044ff28e7
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 09:17:43 2010 +0200
Minor cleanups.
diff --git a/libcore/MovieFactory.cpp b/libcore/MovieFactory.cpp
index d0fdcb0..02221d6 100644
--- a/libcore/MovieFactory.cpp
+++ b/libcore/MovieFactory.cpp
@@ -106,7 +106,6 @@ MovieFactory::makeMovie(std::auto_ptr<IOChannel> in, const
std::string& url,
// Try to load a movie from the given url, if we haven't
// loaded it already. Add it to our library on success, and
// return a pointer to it.
-//
boost::intrusive_ptr<movie_definition>
MovieFactory::makeMovie(const URL& url, const RunResources& runResources,
const char* real_url, bool startLoaderThread,
diff --git a/libcore/MovieFactory.h b/libcore/MovieFactory.h
index de9278f..e59ac76 100644
--- a/libcore/MovieFactory.h
+++ b/libcore/MovieFactory.h
@@ -82,9 +82,9 @@ public:
/// If not NULL, use POST method (only valid for HTTP).
/// NOTE: when POSTing, the movies library won't be used.
static DSOEXPORT boost::intrusive_ptr<movie_definition> makeMovie(
- const URL& url,
- const RunResources& runResources, const char* real_url = NULL,
- bool startLoaderThread = true, const std::string* postdata = NULL);
+ const URL& url, const RunResources& runResources,
+ const char* real_url = 0, bool startLoaderThread = true,
+ const std::string* postdata = 0);
/// Load a movie from an already opened stream.
//
@@ -111,9 +111,8 @@ public:
/// is initialized. Initializing the VirtualMachine requires a target
/// SWF version, which can be found in the SWF header.
static DSOEXPORT boost::intrusive_ptr<movie_definition> makeMovie(
- std::auto_ptr<IOChannel> in,
- const std::string& url, const RunResources& runResources,
- bool startLoaderThread);
+ std::auto_ptr<IOChannel> in, const std::string& url,
+ const RunResources& runResources, bool startLoaderThread);
/// Clear the MovieFactory resources
//
http://git.savannah.gnu.org/cgit//commit/?id=0e1ca11775abbc79a3e65b1395862884c15d6a8c
commit 0e1ca11775abbc79a3e65b1395862884c15d6a8c
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 09:07:41 2010 +0200
SWF8+ is fairly well supported, so don't claim it's unimplemented.
diff --git a/libcore/parser/SWFMovieDefinition.cpp
b/libcore/parser/SWFMovieDefinition.cpp
index 24e11f3..3b23623 100644
--- a/libcore/parser/SWFMovieDefinition.cpp
+++ b/libcore/parser/SWFMovieDefinition.cpp
@@ -285,24 +285,17 @@ SWFMovieDefinition::readHeader(std::auto_ptr<IOChannel>
in,
m_version = (header >> 24) & 255;
if ((header & 0x0FFFFFF) != 0x00535746
- && (header & 0x0FFFFFF) != 0x00535743)
- {
+ && (header & 0x0FFFFFF) != 0x00535743) {
// ERROR
log_error(_("gnash::SWFMovieDefinition::read() -- "
"file does not start with a SWF header"));
return false;
- }
+ }
const bool compressed = (header & 255) == 'C';
IF_VERBOSE_PARSE(
log_parse(_("version: %d, file_length: %d"), m_version, m_file_length);
- )
-
- if (m_version > 7)
- {
- log_unimpl(_("SWF%d is not fully supported, trying anyway "
- "but don't expect it to work"), m_version);
- }
+ );
if (compressed) {
#ifndef HAVE_ZLIB_H
http://git.savannah.gnu.org/cgit//commit/?id=6018972db8a8ac0db5a90fbb53b7d08c9cd5c212
commit 6018972db8a8ac0db5a90fbb53b7d08c9cd5c212
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 09:07:28 2010 +0200
Improve AVM2 message.
diff --git a/libcore/swf/tag_loaders.cpp b/libcore/swf/tag_loaders.cpp
index 686b21f..dd5ba6b 100644
--- a/libcore/swf/tag_loaders.cpp
+++ b/libcore/swf/tag_loaders.cpp
@@ -413,12 +413,8 @@ file_attributes_loader(SWFStream& in, TagType tag,
movie_definition& m,
}
if (flags.as3) {
- log_debug("This SWF uses AVM2");
-#ifndef ENABLE_AVM2
- /// Log an error if this build can't interpret AS3.
- log_error(_("This SWF file requires AVM2, which was not enabled at "
- "compile time."));
-#endif
+ log_unimpl(_("This SWF file requires AVM2: there will be no "
+ "ActionScript interpretation"));
}
else log_debug("This SWF uses AVM1");
http://git.savannah.gnu.org/cgit//commit/?id=006c37491c49d762701f213f58c7f8eb6b6bf8f9
commit 006c37491c49d762701f213f58c7f8eb6b6bf8f9
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 09:07:17 2010 +0200
Rearrange.
diff --git a/libcore/MovieFactory.cpp b/libcore/MovieFactory.cpp
index b8d7772..d0fdcb0 100644
--- a/libcore/MovieFactory.cpp
+++ b/libcore/MovieFactory.cpp
@@ -38,11 +38,130 @@
#include "MovieLibrary.h"
#include "fontlib.h"
-namespace gnash
+namespace gnash {
+
+namespace {
+ /// Get type of file looking at first bytes
+ FileType getFileType(IOChannel& in);
+
+ boost::intrusive_ptr<SWFMovieDefinition> createSWFMovie(
+ std::auto_ptr<IOChannel> in, const std::string& url,
+ const RunResources& runResources, bool startLoaderThread);
+
+ boost::intrusive_ptr<BitmapMovieDefinition> createBitmapMovie(
+ std::auto_ptr<IOChannel> in, const std::string& url,
+ const RunResources& r, FileType type);
+
+ boost::intrusive_ptr<movie_definition> createNonLibraryMovie(
+ const URL& url, const RunResources& runResources,
+ const char* reset_url, bool startLoaderThread,
+ const std::string* postdata);
+}
+
+MovieLibrary MovieFactory::movieLibrary;
+
+boost::intrusive_ptr<movie_definition>
+MovieFactory::makeMovie(std::auto_ptr<IOChannel> in, const std::string& url,
+ const RunResources& runResources, bool startLoaderThread)
+{
+ boost::intrusive_ptr<movie_definition> ret;
+
+ assert(in.get());
+
+ // see if it's a jpeg or an swf
+ FileType type = getFileType(*in);
+
+ switch (type) {
+ case GNASH_FILETYPE_JPEG:
+ case GNASH_FILETYPE_PNG:
+ case GNASH_FILETYPE_GIF:
+ {
+ if (!startLoaderThread) {
+ log_unimpl(_("Requested to keep from completely loading "
+ "a movie, but the movie in question is an "
+ "image, for which we don't yet have the "
+ "concept of a 'loading thread'"));
+ }
+ ret = createBitmapMovie(in, url, runResources, type);
+ break;
+ }
+
+
+ case GNASH_FILETYPE_SWF:
+ ret = createSWFMovie(in, url, runResources, startLoaderThread);
+ break;
+
+ case GNASH_FILETYPE_FLV:
+ log_unimpl(_("FLV can't be loaded directly as a movie"));
+ return ret;
+
+ default:
+ log_error(_("unknown file type (%s)"), type);
+ break;
+ }
+
+ return ret;
+}
+
+// Try to load a movie from the given url, if we haven't
+// loaded it already. Add it to our library on success, and
+// return a pointer to it.
+//
+boost::intrusive_ptr<movie_definition>
+MovieFactory::makeMovie(const URL& url, const RunResources& runResources,
+ const char* real_url, bool startLoaderThread,
+ const std::string* postdata)
{
+ boost::intrusive_ptr<movie_definition> mov;
+
+ // Use real_url as label for cache if available
+ const std::string& cache_label = real_url ? URL(real_url).str() :
url.str();
+
+ // Is the movie already in the library? (don't check if we have post data!)
+ if (!postdata) {
+ if (movieLibrary.get(cache_label, &mov)) {
+ log_debug(_("Movie %s already in library"), cache_label);
+ return mov;
+ }
+ }
+
+ // Try to open a file under the filename, but DO NOT start
+ // the loader thread now to avoid IMPORT tag loaders from
+ // calling createMovie() again and NOT finding
+ // the just-created movie.
+ mov = createNonLibraryMovie(url, runResources, real_url, false, postdata);
+
+ if (!mov) {
+ log_error(_("Couldn't load library movie '%s'"), url.str());
+ return mov;
+ }
+
+ // Movie is good, add to the library, but not if we used POST
+ if (!postdata) {
+ movieLibrary.add(cache_label, mov.get());
+ log_debug(_("Movie %s (SWF%d) added to library"),
+ cache_label, mov->get_version());
+ }
+ else {
+ log_debug(_("Movie %s (SWF%d) NOT added to library (resulted from "
+ "a POST)"), cache_label, mov->get_version());
+ }
-namespace // anonymous
+ /// Now complete the load if the movie is an SWF movie
+ //
+ /// This is a no-op except for SWF movies.
+ if (startLoaderThread) mov->completeLoad();
+
+ return mov;
+}
+
+void
+MovieFactory::clear()
{
+ movieLibrary.clear();
+}
+
+namespace {
/// Get type of file looking at first bytes
FileType
@@ -117,7 +236,6 @@ getFileType(IOChannel& in)
// Create a SWFMovieDefinition from an SWF stream
// NOTE: this method assumes this *is* an SWF stream
-//
boost::intrusive_ptr<SWFMovieDefinition>
createSWFMovie(std::auto_ptr<IOChannel> in, const std::string& url,
const RunResources& runResources, bool startLoaderThread)
@@ -207,112 +325,7 @@ createNonLibraryMovie(const URL& url, const RunResources&
runResources,
}
-
-} // anonymous namespace
-
-
-MovieLibrary MovieFactory::movieLibrary;
-
-boost::intrusive_ptr<movie_definition>
-MovieFactory::makeMovie(std::auto_ptr<IOChannel> in, const std::string& url,
- const RunResources& runResources, bool startLoaderThread)
-{
- boost::intrusive_ptr<movie_definition> ret;
-
- assert(in.get());
-
- // see if it's a jpeg or an swf
- FileType type = getFileType(*in);
-
- switch (type) {
- case GNASH_FILETYPE_JPEG:
- case GNASH_FILETYPE_PNG:
- case GNASH_FILETYPE_GIF:
- {
- if (!startLoaderThread) {
- log_unimpl(_("Requested to keep from completely loading "
- "a movie, but the movie in question is an "
- "image, for which we don't yet have the "
- "concept of a 'loading thread'"));
- }
- ret = createBitmapMovie(in, url, runResources, type);
- break;
- }
-
-
- case GNASH_FILETYPE_SWF:
- ret = createSWFMovie(in, url, runResources, startLoaderThread);
- break;
-
- case GNASH_FILETYPE_FLV:
- log_unimpl(_("FLV can't be loaded directly as a movie"));
- return ret;
-
- default:
- log_error(_("unknown file type (%s)"), type);
- break;
- }
-
- return ret;
-}
-
-// Try to load a movie from the given url, if we haven't
-// loaded it already. Add it to our library on success, and
-// return a pointer to it.
-//
-boost::intrusive_ptr<movie_definition>
-MovieFactory::makeMovie(const URL& url, const RunResources& runResources,
- const char* real_url, bool startLoaderThread,
- const std::string* postdata)
-{
- boost::intrusive_ptr<movie_definition> mov;
-
- // Use real_url as label for cache if available
- std::string cache_label = real_url ? URL(real_url).str() : url.str();
-
- // Is the movie already in the library? (don't check if we have post data!)
- if (!postdata) {
- if (movieLibrary.get(cache_label, &mov)) {
- log_debug(_("Movie %s already in library"), cache_label);
- return mov;
- }
- }
-
- // Try to open a file under the filename, but DO NOT start
- // the loader thread now to avoid IMPORT tag loaders from
- // calling createMovie() again and NOT finding
- // the just-created movie.
- mov = createNonLibraryMovie(url, runResources, real_url, false, postdata);
-
- if (!mov) {
- log_error(_("Couldn't load library movie '%s'"), url.str());
- return mov;
- }
-
- // Movie is good, add to the library, but not if we used POST
- if (!postdata) {
- movieLibrary.add(cache_label, mov.get());
- log_debug(_("Movie %s (SWF%d) added to library"),
- cache_label, mov->get_version());
- }
- else {
- log_debug(_("Movie %s (SWF%d) NOT added to library (resulted from "
- "a POST)"), cache_label, mov->get_version());
- }
-
- /// Now complete the load if the movie is an SWF movie
- //
- /// This is a no-op except for SWF movies.
- if (startLoaderThread) mov->completeLoad();
-
- return mov;
-}
-
-void
-MovieFactory::clear()
-{
- movieLibrary.clear();
-}
+} // unnamed namespace
} // namespace gnash
http://git.savannah.gnu.org/cgit//commit/?id=c6fc1605aeebec39d92dc10c45be6fc25f3fc7fa
commit c6fc1605aeebec39d92dc10c45be6fc25f3fc7fa
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 08:54:50 2010 +0200
Don't clear fontlib automatically, as it's cleared anyway when we exit.
diff --git a/libcore/MovieFactory.cpp b/libcore/MovieFactory.cpp
index ba34774..b8d7772 100644
--- a/libcore/MovieFactory.cpp
+++ b/libcore/MovieFactory.cpp
@@ -312,7 +312,6 @@ void
MovieFactory::clear()
{
movieLibrary.clear();
- fontlib::clear();
}
} // namespace gnash
http://git.savannah.gnu.org/cgit//commit/?id=6d3bb42c7cc204909cf4ad0f20d4754aaa35db28
commit 6d3bb42c7cc204909cf4ad0f20d4754aaa35db28
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 08:54:32 2010 +0200
Clean up.
diff --git a/libcore/MovieFactory.cpp b/libcore/MovieFactory.cpp
index 01ada19..ba34774 100644
--- a/libcore/MovieFactory.cpp
+++ b/libcore/MovieFactory.cpp
@@ -52,38 +52,33 @@ getFileType(IOChannel& in)
char buf[3];
- if (in.read(buf, 3) < 3)
- {
+ if (in.read(buf, 3) < 3) {
log_error(_("Can't read file header"));
in.seek(0);
return GNASH_FILETYPE_UNKNOWN;
}
// This is the magic number {0xff, 0xd8, 0xff} for JPEG format files
- if (std::equal(buf, buf + 3, "\xff\xd8\xff"))
- {
+ if (std::equal(buf, buf + 3, "\xff\xd8\xff")) {
in.seek(0);
return GNASH_FILETYPE_JPEG;
}
// This is the magic number for any PNG format file
// buf[3] == 'G' (we didn't read so far)
- if (std::equal(buf, buf + 3, "\x89PN"))
- {
+ if (std::equal(buf, buf + 3, "\x89PN")) {
in.seek(0);
return GNASH_FILETYPE_PNG;
}
// This is the magic number for any GIF format file
- if (std::equal(buf, buf + 3, "GIF"))
- {
+ if (std::equal(buf, buf + 3, "GIF")) {
in.seek(0);
return GNASH_FILETYPE_GIF;
}
// This is for SWF (FWS or CWS)
- if (std::equal(buf, buf + 3, "FWS") || std::equal(buf, buf + 3, "CWS"))
- {
+ if (std::equal(buf, buf + 3, "FWS") || std::equal(buf, buf + 3, "CWS")) {
in.seek(0);
return GNASH_FILETYPE_SWF;
}
@@ -96,20 +91,17 @@ getFileType(IOChannel& in)
// Check if it is an swf embedded in a player (.exe-file)
if (std::equal(buf, buf + 2, "MZ")) {
- if ( 3 > in.read(buf, 3) )
- {
+ if (in.read(buf, 3) < 3) {
log_error(_("Can't read 3 bytes after an MZ (.exe) header"));
in.seek(0);
return GNASH_FILETYPE_UNKNOWN;
}
- while ((buf[0]!='F' && buf[0]!='C') || buf[1]!='W' || buf[2]!='S')
- {
+ while ((buf[0]!='F' && buf[0]!='C') || buf[1]!='W' || buf[2]!='S') {
buf[0] = buf[1];
buf[1] = buf[2];
buf[2] = in.read_byte();
- if (in.eof())
- {
+ if (in.eof()) {
log_error(_("Could not find SWF inside an exe file"));
in.seek(0);
return GNASH_FILETYPE_UNKNOWN;
@@ -167,13 +159,11 @@ createBitmapMovie(std::auto_ptr<IOChannel> in, const
std::string& url,
}
Renderer* renderer = r.renderer();
-
- ret = new BitmapMovieDefinition(im, renderer, url);
-
+ ret = new BitmapMovieDefinition(im, renderer, url);
return ret;
}
- catch (ParserException& e) {
+ catch (const ParserException& e) {
log_error(_("Parsing error: %s"), e.what());
return ret;
}
@@ -185,38 +175,36 @@ createNonLibraryMovie(const URL& url, const RunResources&
runResources,
const char* reset_url, bool startLoaderThread,
const std::string* postdata)
{
-
- boost::intrusive_ptr<movie_definition> ret;
-
- std::auto_ptr<IOChannel> in;
-
- const StreamProvider& streamProvider = runResources.streamProvider();
-
- const RcInitFile& rcfile = RcInitFile::getDefaultInstance();
-
- if (postdata) {
- in = streamProvider.getStream(url, *postdata, rcfile.saveLoadedMedia());
- }
- else in = streamProvider.getStream(url, rcfile.saveLoadedMedia());
-
- if ( ! in.get() )
- {
- log_error(_("failed to open '%s'; can't create movie"), url);
- return ret;
- }
- if (in->bad())
- {
- log_error(_("streamProvider opener can't open '%s'"), url);
- return ret;
- }
-
- std::string movie_url = reset_url ? reset_url : url.str();
- ret = MovieFactory::makeMovie(in, movie_url, runResources,
- startLoaderThread);
-
- return ret;
-
+ boost::intrusive_ptr<movie_definition> ret;
+
+ std::auto_ptr<IOChannel> in;
+
+ const StreamProvider& streamProvider = runResources.streamProvider();
+
+ const RcInitFile& rcfile = RcInitFile::getDefaultInstance();
+
+ if (postdata) {
+ in = streamProvider.getStream(url, *postdata,
rcfile.saveLoadedMedia());
+ }
+ else in = streamProvider.getStream(url, rcfile.saveLoadedMedia());
+
+ if (!in.get()) {
+ log_error(_("failed to open '%s'; can't create movie"), url);
+ return ret;
+ }
+
+ if (in->bad()) {
+ log_error(_("streamProvider opener can't open '%s'"), url);
+ return ret;
+ }
+
+ const std::string& movie_url = reset_url ? reset_url : url.str();
+ ret = MovieFactory::makeMovie(in, movie_url, runResources,
+ startLoaderThread);
+
+ return ret;
+
}
@@ -229,21 +217,19 @@ boost::intrusive_ptr<movie_definition>
MovieFactory::makeMovie(std::auto_ptr<IOChannel> in, const std::string& url,
const RunResources& runResources, bool startLoaderThread)
{
- boost::intrusive_ptr<movie_definition> ret;
+ boost::intrusive_ptr<movie_definition> ret;
- assert(in.get());
+ assert(in.get());
- // see if it's a jpeg or an swf
- FileType type = getFileType(*in);
+ // see if it's a jpeg or an swf
+ FileType type = getFileType(*in);
- switch (type)
- {
+ switch (type) {
case GNASH_FILETYPE_JPEG:
case GNASH_FILETYPE_PNG:
case GNASH_FILETYPE_GIF:
{
- if ( startLoaderThread == false )
- {
+ if (!startLoaderThread) {
log_unimpl(_("Requested to keep from completely loading "
"a movie, but the movie in question is an "
"image, for which we don't yet have the "
@@ -285,10 +271,8 @@ MovieFactory::makeMovie(const URL& url, const
RunResources& runResources,
std::string cache_label = real_url ? URL(real_url).str() : url.str();
// Is the movie already in the library? (don't check if we have post data!)
- if (!postdata)
- {
- if ( movieLibrary.get(cache_label, &mov) )
- {
+ if (!postdata) {
+ if (movieLibrary.get(cache_label, &mov)) {
log_debug(_("Movie %s already in library"), cache_label);
return mov;
}
@@ -300,21 +284,18 @@ MovieFactory::makeMovie(const URL& url, const
RunResources& runResources,
// the just-created movie.
mov = createNonLibraryMovie(url, runResources, real_url, false, postdata);
- if (!mov)
- {
+ if (!mov) {
log_error(_("Couldn't load library movie '%s'"), url.str());
return mov;
}
- // Movie is good, add to the library
- if (!postdata) // don't add if we POSTed
- {
+ // Movie is good, add to the library, but not if we used POST
+ if (!postdata) {
movieLibrary.add(cache_label, mov.get());
log_debug(_("Movie %s (SWF%d) added to library"),
cache_label, mov->get_version());
}
- else
- {
+ else {
log_debug(_("Movie %s (SWF%d) NOT added to library (resulted from "
"a POST)"), cache_label, mov->get_version());
}
http://git.savannah.gnu.org/cgit//commit/?id=0debb5fd1a39271037654018819160741aa4d4cf
commit 0debb5fd1a39271037654018819160741aa4d4cf
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 08:54:24 2010 +0200
ObjectURI is a struct.
diff --git a/libcore/event_id.h b/libcore/event_id.h
index 1d43b9a..d1b1190 100644
--- a/libcore/event_id.h
+++ b/libcore/event_id.h
@@ -26,7 +26,7 @@
// Forward declarations
namespace gnash {
- class ObjectURI;
+ struct ObjectURI;
}
namespace gnash {
http://git.savannah.gnu.org/cgit//commit/?id=accc8fec49afe2790c1e9fadcfc0c0d2413c5a05
commit accc8fec49afe2790c1e9fadcfc0c0d2413c5a05
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 22 08:54:10 2010 +0200
ObjectURI is a struct.
diff --git a/libcore/DisplayList.h b/libcore/DisplayList.h
index c006cb1..a1ffc03 100644
--- a/libcore/DisplayList.h
+++ b/libcore/DisplayList.h
@@ -44,7 +44,7 @@
namespace gnash {
class SWFCxForm;
class Renderer;
- class ObjectURI;
+ struct ObjectURI;
}
namespace gnash {
-----------------------------------------------------------------------
Summary of changes:
libcore/DisplayList.h | 2 +-
libcore/MovieFactory.cpp | 322 ++++++++++++++++-----------------
libcore/MovieFactory.h | 11 +-
libcore/asobj/flash/gen-as3.sh | 293 ------------------------------
libcore/event_id.h | 2 +-
libcore/parser/SWFMovieDefinition.cpp | 13 +-
libcore/swf/tag_loaders.cpp | 8 +-
libcore/vm/ActionExec.cpp | 122 ++++---------
libmedia/gst/AudioInputGst.cpp | 4 +-
9 files changed, 211 insertions(+), 566 deletions(-)
delete mode 100755 libcore/asobj/flash/gen-as3.sh
hooks/post-receive
--
Gnash
- [Gnash-commit] [SCM] Gnash branch, master, updated. a0146c39c456fc46d4ecba6e52ff7fceed4df844,
Benjamin Wolsey <=