* Early version of Bezilla-gcc4 plugin, very raw at this stage.

* Disable ActionScript functions toLowerCase and createTextField so that the plugin is able to display videos on www.youtube.com.
This commit is contained in:
Adrian Panasiuk
2009-03-13 23:06:03 +00:00
parent 80569ab561
commit 48e1019306

View File

@@ -1,7 +1,25 @@
Binary files clean-gnash/--library=stdc++ and gnash-0.8.4-3/--library=stdc++ differ
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/backend/render_handler_agg.cpp gnash-0.8.4-3/backend/render_handler_agg.cpp
--- clean-gnash/backend/render_handler_agg.cpp 2009-03-06 02:03:25.000000000 +0000
+++ gnash-0.8.4-3/backend/render_handler_agg.cpp 2009-03-07 13:22:03.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/adipe.h cp-gn084/adipe.h
--- clean-gn084/adipe.h 1970-01-01 00:00:00.000000000 +0000
+++ cp-gn084/adipe.h 2009-03-13 18:10:19.000000000 +0000
@@ -0,0 +1,15 @@
+#ifndef __ADIPE_H_
+#define __ADIPE_H_
+
+
+#define QQ_LVL 6
+
+#define QQ(x) do { \
+ if ( (x) <= QQ_LVL ) \
+ fprintf(stderr,"QQ %s \t%d \t%s\n", \
+ __FILE__, __LINE__, \
+ __PRETTY_FUNCTION__); \
+ } while(0)
+
+#endif
+
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/backend/render_handler_agg.cpp cp-gn084/backend/render_handler_agg.cpp
--- clean-gn084/backend/render_handler_agg.cpp 2009-03-13 18:18:09.000000000 +0000
+++ cp-gn084/backend/render_handler_agg.cpp 2009-03-13 18:10:21.000000000 +0000
@@ -1658,13 +1658,19 @@
const std::vector<agg::path_storage>& agg_paths,
const std::vector<line_style> &line_styles, const cxform& cx,
@@ -134,9 +152,9 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
}
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/gui/dump.cpp gnash-0.8.4-3/gui/dump.cpp
--- clean-gnash/gui/dump.cpp 2009-03-06 02:03:16.000000000 +0000
+++ gnash-0.8.4-3/gui/dump.cpp 2009-03-07 13:22:07.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/gui/dump.cpp cp-gn084/gui/dump.cpp
--- clean-gn084/gui/dump.cpp 2009-03-13 18:18:06.000000000 +0000
+++ cp-gn084/gui/dump.cpp 2009-03-13 18:10:31.000000000 +0000
@@ -28,6 +28,9 @@
#include "log.h"
@@ -171,7 +189,18 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
}
bool
@@ -245,9 +256,13 @@
@@ -200,7 +211,9 @@
}
// advance movie now
- Gui::advance_movie(this);
+ if (_sh1->fEnableRendering)
+ Gui::advance_movie(this);
+
writeFrame();
// check if we've reached a timeout
@@ -245,9 +258,13 @@
void
DumpGui::writeFrame()
{
@@ -188,7 +217,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
_framecount++;
}
else {
@@ -263,13 +278,39 @@
@@ -263,13 +280,40 @@
// This should never be empty.
assert (!_fileOutput.empty());
@@ -226,6 +255,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ _ble_data_size = 0x1000 * 3000; //XXX
+ _ble_data = (char*)mmap((caddr_t)0, _ble_data_size, PROT_READ|PROT_WRITE,
+ MAP_SHARED, _ble_fd, 0);
+ _sh1 = reinterpret_cast<struct Sh1_t*>(_ble_data);
+ if (_ble_data == (void*) -1)
+ {
+ perror("mmap");
@@ -234,7 +264,15 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
// Yes, this should go to cout. The user needs to know this
// information in order to process the file. Print out in a
@@ -288,7 +329,8 @@
@@ -281,6 +325,7 @@
}
+
void
DumpGui::setRenderHandlerSize(int width, int height)
{
@@ -288,7 +333,8 @@
assert(height > 0);
assert(_agg_renderer != NULL);
@@ -244,17 +282,18 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
return;
}
@@ -304,7 +346,8 @@
@@ -304,7 +350,9 @@
if (newBufferSize != _offscreenbuf_size) {
try {
- _offscreenbuf.reset(new unsigned char[newBufferSize]);
+ //_offscreenbuf.reset(new unsigned char[newBufferSize]);
+ _offscreenbuf=((unsigned char*)_ble_data);
+ //_offscreenbuf=((unsigned char*)_ble_data);
+ _offscreenbuf= reinterpret_cast<unsigned char*>(&_sh1->fRest);
log_debug("DUMP-AGG: %i bytes offscreen buffer allocated", newBufferSize);
}
catch (std::bad_alloc &e)
@@ -322,7 +365,8 @@
@@ -322,7 +370,8 @@
}
static_cast<render_handler_agg_base *> (_agg_renderer)->init_buffer
@@ -264,10 +303,26 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
_offscreenbuf_size,
_width,
_height,
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/gui/dump.h gnash-0.8.4-3/gui/dump.h
--- clean-gnash/gui/dump.h 2009-03-06 02:03:15.000000000 +0000
+++ gnash-0.8.4-3/gui/dump.h 2009-03-07 13:22:07.000000000 +0000
@@ -70,7 +70,8 @@
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/gui/dump.h cp-gn084/gui/dump.h
--- clean-gn084/gui/dump.h 2009-03-13 18:18:06.000000000 +0000
+++ cp-gn084/gui/dump.h 2009-03-13 18:10:31.000000000 +0000
@@ -32,6 +32,15 @@
typedef bool (*callback_t)(void*, int, void *data);
+
+/* Copy in plugin.cpp */
+struct Sh1_t
+{
+ int fEnableRendering;
+ char fRest[1];
+};
+
+
class DSOEXPORT DumpGui : public Gui
{
public:
@@ -70,7 +79,8 @@
// is destroyed on reset and when it goes out of scope (including on
// stack unwinding after an exception), so there is no need to delete
// it.
@@ -277,20 +332,21 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
int _offscreenbuf_size; /* size of window (bytes) */
@@ -82,6 +83,10 @@
@@ -82,6 +92,11 @@
std::string _fileOutput; /* path to output file */
std::ofstream _fileStream; /* stream for output file */
+ FILE *_file;
+ char *_ble_data;
+ struct Sh1_t * _sh1;
+ unsigned _ble_data_size;
+ int _ble_fd;
void init_dumpfile(); /* convenience method to create dump file */
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/gui/gnash.cpp gnash-0.8.4-3/gui/gnash.cpp
--- clean-gnash/gui/gnash.cpp 2009-03-06 02:03:15.000000000 +0000
+++ gnash-0.8.4-3/gui/gnash.cpp 2009-03-07 13:22:07.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/gui/gnash.cpp cp-gn084/gui/gnash.cpp
--- clean-gn084/gui/gnash.cpp 2009-03-13 18:18:06.000000000 +0000
+++ cp-gn084/gui/gnash.cpp 2009-03-13 18:10:34.000000000 +0000
@@ -28,6 +28,8 @@
#include "arg_parser.h"
#include "utility.h" // for clamp
@@ -300,7 +356,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
#ifdef HAVE_FFMPEG_AVCODEC_H
extern "C" {
# include "ffmpeg/avcodec.h"
@@ -427,9 +429,25 @@
@@ -427,9 +429,26 @@
}
@@ -316,6 +372,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
int
gnash_main(int argc, char *argv[])
{
+ //debugger("elo");
+ struct sigaction sa;
+ sa.sa_flags=0;
+ sa.sa_handler=sighandler;
@@ -326,9 +383,14 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
gnash::Player player;
// Enable native language support, i.e. internationalization
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/libbase/shm.cpp gnash-0.8.4-3/libbase/shm.cpp
--- clean-gnash/libbase/shm.cpp 2009-03-06 02:03:04.000000000 +0000
+++ gnash-0.8.4-3/libbase/shm.cpp 2009-03-07 13:22:08.000000000 +0000
@@ -461,3 +480,4 @@
return player.run(argc, argv, infiles.front().c_str(), url.c_str());
}
+
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libbase/shm.cpp cp-gn084/libbase/shm.cpp
--- clean-gn084/libbase/shm.cpp 2009-03-13 18:18:04.000000000 +0000
+++ cp-gn084/libbase/shm.cpp 2009-03-13 18:10:46.000000000 +0000
@@ -136,7 +136,10 @@
return true;
@@ -405,9 +467,9 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
# endif
# endif // end of HAVE_SHMAT
}
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/libbase/utf8.h gnash-0.8.4-3/libbase/utf8.h
--- clean-gnash/libbase/utf8.h 2009-03-06 02:03:04.000000000 +0000
+++ gnash-0.8.4-3/libbase/utf8.h 2009-03-07 13:22:08.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libbase/utf8.h cp-gn084/libbase/utf8.h
--- clean-gn084/libbase/utf8.h 2009-03-13 18:18:04.000000000 +0000
+++ cp-gn084/libbase/utf8.h 2009-03-13 18:10:46.000000000 +0000
@@ -21,8 +21,13 @@
#ifndef UTF8_H
#define UTF8_H
@@ -422,9 +484,9 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
#include <boost/cstdint.hpp> // for C99 int types
/// Utilities to convert between std::string and std::wstring.
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/libbase/utility.h gnash-0.8.4-3/libbase/utility.h
--- clean-gnash/libbase/utility.h 2009-03-06 02:03:04.000000000 +0000
+++ gnash-0.8.4-3/libbase/utility.h 2009-03-07 13:22:08.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libbase/utility.h cp-gn084/libbase/utility.h
--- clean-gn084/libbase/utility.h 2009-03-13 18:18:03.000000000 +0000
+++ cp-gn084/libbase/utility.h 2009-03-13 18:10:46.000000000 +0000
@@ -61,7 +61,7 @@
// Using a possible built-in pi constant M_PI, which is not in
// the C++ standard, has no conceivable advantage, so we will use this
@@ -434,9 +496,69 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
// Commonly-used inlined mathematical functions are defined in
// namespace gnash::utility so that it's clear where they
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/libcore/edit_text_character.h gnash-0.8.4-3/libcore/edit_text_character.h
--- clean-gnash/libcore/edit_text_character.h 2009-03-06 02:03:13.000000000 +0000
+++ gnash-0.8.4-3/libcore/edit_text_character.h 2009-03-07 13:22:14.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libcore/asobj/String_as.cpp cp-gn084/libcore/asobj/String_as.cpp
--- clean-gn084/libcore/asobj/String_as.cpp 2009-03-13 18:18:05.000000000 +0000
+++ cp-gn084/libcore/asobj/String_as.cpp 2009-03-13 18:12:16.000000000 +0000
@@ -1,3 +1,4 @@
+#include <adipe.h>
// string.cpp: ActionScript "String" class, for Gnash.
//
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -165,8 +166,10 @@
as_object(getStringInterface()),
_string(s)
{
- std::wstring wstr = utf8::decodeCanonicalString(_string, _vm.getSWFVersion());
- init_member(NSV::PROP_LENGTH, wstr.size(), as_prop_flags::dontDelete|as_prop_flags::dontEnum); // can override though
+ //QQ(2);
+ //std::wstring wstr = utf8::decodeCanonicalString(_string, _vm.getSWFVersion());
+ init_member(NSV::PROP_LENGTH, /*wstr.size()*/s.size() * sizeof(wchar_t), as_prop_flags::dontDelete|as_prop_flags::dontEnum); // can override though
+ //QQ(2);
}
@@ -785,21 +788,35 @@
static as_value
string_ctor(const fn_call& fn)
{
+ //QQ(1);
std::string str;
if (fn.nargs )
{
+ //QQ(3);
str = fn.arg(0).to_string();
+ //QQ(3);
}
if ( ! fn.isInstantiation() )
{
- return as_value(str);
+ //QQ(3);
+ as_value ret = as_value(str);
+ //if (QQ_LVL >= 4)
+ //fprintf(stderr, "str: '%s'\n", str.c_str());
+ //QQ(3);
+ return ret;
}
- boost::intrusive_ptr<String_as> obj = new String_as(str);
+ //QQ(3);
+ String_as *er = new String_as(str);
+ //QQ(3);
+ boost::intrusive_ptr<String_as> obj = er;
+ //QQ(3);
- return as_value(obj.get());
+ as_value ret = as_value(obj.get());
+ //QQ(1);
+ return ret;
}
static boost::intrusive_ptr<builtin_function>
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libcore/edit_text_character.h cp-gn084/libcore/edit_text_character.h
--- clean-gn084/libcore/edit_text_character.h 2009-03-13 18:18:05.000000000 +0000
+++ cp-gn084/libcore/edit_text_character.h 2009-03-13 18:12:18.000000000 +0000
@@ -18,6 +18,12 @@
#ifndef GNASH_EDIT_TEXT_CHARACTER_H
#define GNASH_EDIT_TEXT_CHARACTER_H
@@ -450,9 +572,9 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
#include "character.h" // for inheritance
#include "edit_text_character_def.h" // for inlines and typedefs
#include "styles.h" // for fill_style and line_style
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/libcore/movie_root.cpp gnash-0.8.4-3/libcore/movie_root.cpp
--- clean-gnash/libcore/movie_root.cpp 2009-03-06 02:03:14.000000000 +0000
+++ gnash-0.8.4-3/libcore/movie_root.cpp 2009-03-07 13:22:14.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libcore/movie_root.cpp cp-gn084/libcore/movie_root.cpp
--- clean-gn084/libcore/movie_root.cpp 2009-03-13 18:18:05.000000000 +0000
+++ cp-gn084/libcore/movie_root.cpp 2009-03-13 18:12:19.000000000 +0000
@@ -921,7 +921,9 @@
// Get current mouse coordinates
@@ -464,9 +586,132 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
point world_mouse(PIXELS_TO_TWIPS(x), PIXELS_TO_TWIPS(y));
boost::int32_t xoffset = world_mouse.x - world_origin.x;
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/plugin/mozilla-sdk/include/npapi.h gnash-0.8.4-3/plugin/mozilla-sdk/include/npapi.h
--- clean-gnash/plugin/mozilla-sdk/include/npapi.h 2009-03-06 02:03:24.000000000 +0000
+++ gnash-0.8.4-3/plugin/mozilla-sdk/include/npapi.h 2009-03-07 13:22:20.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libcore/swf_function.cpp cp-gn084/libcore/swf_function.cpp
--- clean-gn084/libcore/swf_function.cpp 2009-03-13 18:18:05.000000000 +0000
+++ cp-gn084/libcore/swf_function.cpp 2009-03-13 18:12:30.000000000 +0000
@@ -1,3 +1,5 @@
+extern "C" void debugger(const char*);
+#include <adipe.h>
//
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
@@ -371,7 +373,14 @@
try
{
//ActionExec exec(*m_action_buffer, *our_env, m_start_pc, m_length, fn.result, m_with_stack, m_is_function2);
+ static int QQi = 0;
+ ++ QQi;
+ //QQ(2);
+ //fprintf(stderr, "QQi = %d\n", QQi);
+ //if (QQi == 95)
+ //debugger("QQi == 95");
ActionExec exec(*this, *our_env, &result, fn.this_ptr.get());
+ //QQ(2);
exec();
}
catch (ActionLimitException& ale) // expected and sane
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libcore/vm/ASHandlers.cpp cp-gn084/libcore/vm/ASHandlers.cpp
--- clean-gn084/libcore/vm/ASHandlers.cpp 2009-03-13 18:18:05.000000000 +0000
+++ cp-gn084/libcore/vm/ASHandlers.cpp 2009-03-13 18:12:36.000000000 +0000
@@ -1,3 +1,5 @@
+#include <adipe.h>
+extern "C" void debugger(const char*);
// ASHandlers.cpp: ActionScript handlers, for Gnash.
//
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -441,6 +443,11 @@
catch (ActionParserException& e) {
log_swferror(_("Malformed action code: %s"), e.what());
}
+ catch (std::bad_cast &b)
+ {
+ fprintf(stderr, "error, type = %d\n", (int)type);
+ debugger("melo");
+ }
}
void
@@ -3314,6 +3321,11 @@
nargs = available_args;
}
+ //fprintf(stderr, "method name : %s\n", method_name.to_string().c_str());
+ //fprintf(stderr, "method object/func : %s\n", obj_value.to_string().c_str());
+ //fprintf(stderr, "method nargs: %d\n", nargs);
+
+
IF_VERBOSE_ACTION (
log_action(_(" method name: %s"), method_name);
@@ -3322,6 +3334,10 @@
);
std::string method_string = method_name.to_string();
+ if (strcmp("toLowerCase", method_name.to_string().c_str()) == 0)
+ method_string = "elomelo320";
+ if (strcmp("createTextField", method_name.to_string().c_str()) == 0)
+ method_string = "elomelo320";
as_value method_val;
boost::intrusive_ptr<as_object> obj = obj_value.to_object();
@@ -3418,19 +3434,25 @@
std::auto_ptr< std::vector<as_value> > args ( new std::vector<as_value> );
args->reserve(nargs);
for (size_t i=0; i<nargs; ++i) args->push_back(env.pop());
+ //QQ(2);
as_value result = call_method(method_val, &env, this_ptr,
args, super);
+ //QQ(2);
env.push(result);
+ //QQ(2);
// Now, if there was an exception, proceed to the end of the block.
if (result.is_exception())
{
+ //QQ(2);
thread.skipRemainingBuffer();
+ //QQ(2);
}
// This is to check stack status after call method
//log_debug(_("at doActionCallMethod() end, stack: ")); env.dump_stack();
+ //QQ(2);
}
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/libcore/vm/ActionExec.cpp cp-gn084/libcore/vm/ActionExec.cpp
--- clean-gn084/libcore/vm/ActionExec.cpp 2009-03-13 18:18:05.000000000 +0000
+++ cp-gn084/libcore/vm/ActionExec.cpp 2009-03-13 18:12:36.000000000 +0000
@@ -1,3 +1,5 @@
+extern "C" void debugger(const char*);
+#include <adipe.h>
// ActionExec.cpp: ActionScript execution, for Gnash.
//
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -264,7 +266,18 @@
break;
}
- ash.execute(static_cast<SWF::action_type>(action_id), *this);
+ //QQ(2);
+ static int QQi=0;
+ ++ QQi;
+ //fprintf(stderr, "ELO action_id = 0x%x\n", (int)action_id);
+ //fprintf(stderr, "%s \t%d QQi = %d\n", __FILE__, __LINE__, QQi);
+ //SWF::action_type nn = SWF::ACTION_SETREGISTER;
+ SWF::action_type mm = static_cast<SWF::action_type>(action_id);
+ //QQ(3);
+ //if (QQi == 19166)
+ //debugger("QQi == 19166");
+ ash.execute(mm, *this);
+ //QQ(2);
#if 1 // See bugs: #20974, #21069, #20996.
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/plugin/mozilla-sdk/include/npapi.h cp-gn084/plugin/mozilla-sdk/include/npapi.h
--- clean-gn084/plugin/mozilla-sdk/include/npapi.h 2009-03-13 18:18:08.000000000 +0000
+++ cp-gn084/plugin/mozilla-sdk/include/npapi.h 2009-03-13 18:12:56.000000000 +0000
@@ -23,6 +23,14 @@
#pragma pack(1)
#endif
@@ -493,9 +738,9 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
# endif
#endif
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/plugin/mozilla-sdk/include/obsolete/protypes.h gnash-0.8.4-3/plugin/mozilla-sdk/include/obsolete/protypes.h
--- clean-gnash/plugin/mozilla-sdk/include/obsolete/protypes.h 2009-03-06 02:03:24.000000000 +0000
+++ gnash-0.8.4-3/plugin/mozilla-sdk/include/obsolete/protypes.h 2009-03-07 13:22:20.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/plugin/mozilla-sdk/include/obsolete/protypes.h cp-gn084/plugin/mozilla-sdk/include/obsolete/protypes.h
--- clean-gn084/plugin/mozilla-sdk/include/obsolete/protypes.h 2009-03-13 18:18:08.000000000 +0000
+++ cp-gn084/plugin/mozilla-sdk/include/obsolete/protypes.h 2009-03-13 18:12:56.000000000 +0000
@@ -114,7 +114,8 @@
#if !defined(XP_BEOS) && !defined(VMS)
@@ -527,9 +772,9 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
#else
typedef long int32;
#endif
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/plugin/plugin.cpp gnash-0.8.4-3/plugin/plugin.cpp
--- clean-gnash/plugin/plugin.cpp 2009-03-06 02:03:24.000000000 +0000
+++ gnash-0.8.4-3/plugin/plugin.cpp 2009-03-07 13:22:21.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/plugin/plugin.cpp cp-gn084/plugin/plugin.cpp
--- clean-gn084/plugin/plugin.cpp 2009-03-13 18:18:08.000000000 +0000
+++ cp-gn084/plugin/plugin.cpp 2009-03-13 18:12:57.000000000 +0000
@@ -1,4 +1,4 @@
-//
+
@@ -607,13 +852,14 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
if (_childpid > 0)
{
// it seems that waiting after a SIGINT hangs firefox
@@ -500,9 +524,214 @@
@@ -500,9 +524,233 @@
/// to setup the window. This may get called multiple times by each
/// instantiated object, so it can't do much but window specific
/// setup here.
+
+#include <typeinfo>
+#include <Window.h>
+#include <Region.h>
+#include <Bitmap.h>
+
+
@@ -627,7 +873,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ if (fShowing)
+ {
+ //fread(myBuffer, myBufferSz, 1, fl);
+ fBitmap->SetBits(reinterpret_cast<void*>(fEloData),
+ fBitmap->SetBits(reinterpret_cast<void*>(&fSh1->fRest),
+ fEloImgDataSz, 0, B_RGBA32);
+ MovePenTo(BPoint(0,0));
+ DrawBitmap(fBitmap); //XXX potrzebne ?
@@ -642,6 +888,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+EloView::EloView(char *name, int width, int height, int fd, nsPluginInstance *plugin)
+: BView(BRect(0,0,width-1,height-1), name, B_FOLLOW_ALL, B_WILL_DRAW),
+ fEloData(NULL),
+ fSh1(NULL),
+ fEloFd(fd),
+ fShowing(false),
+ fPlugin(plugin),
@@ -696,6 +943,8 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ perror("close");
+ }
+
+ CancelThread();
+
+ if (pthread_cond_destroy(&fMxCnd.fCnd) != 0)
+ printf("pthread_cond_destroy error\n");
+ if (pthread_mutex_destroy(&fMxCnd.fMx) != 0)
@@ -739,10 +988,21 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ //pthread_testcancel();
+ if (fExiting != 0)
+ pthread_exit(NULL);
+ usleep(40);
+ usleep(40000);
+ LockLooper();
+ Invalidate();
+
+ BRegion breg;
+ GetClippingRegion(&breg);
+ //if (breg.CountRects() != 0)
+ //fprintf(stderr, "countrects %d\n", breg.CountRects());
+
+ if (fSh1->fEnableRendering)
+ Invalidate();
+
+ fSh1->fEnableRendering = breg.CountRects() != 0;
+
+ UnlockLooper();
+
+ }
+
+ pthread_cleanup_pop(false);
@@ -767,6 +1027,8 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ PROT_READ|PROT_WRITE, MAP_SHARED, fEloFd, 0);
+ if (fEloData == (char*)-1)
+ perror("error mmap");
+ fSh1 = reinterpret_cast<struct Sh1_t*>(fEloData);
+ fSh1->fEnableRendering = true;
+ if (pthread_create(&fPt, NULL, EloViewThread, this) != 0)
+ printf("error pthread_create\n");
+ }
@@ -813,6 +1075,8 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ }
+
+ _bview = new EloView("mmello", aWindow->width, aWindow->height, _hostvidfd, this);
+
+
+ std::cout << "aWindow " << aWindow->width << "x"
+ << aWindow->height << std::endl;
+ //XXX should use windowless mode
@@ -822,7 +1086,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
if(!aWindow)
{
cout << __FUNCTION__ << ": ERROR: Window handle was bogus!" << endl;
@@ -588,7 +817,7 @@
@@ -588,7 +836,7 @@
}
#endif
@@ -831,7 +1095,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
return NPERR_NO_ERROR;
}
@@ -634,7 +863,7 @@
@@ -634,7 +882,7 @@
}
/// \brief Return how many bytes we can read into the buffer
@@ -840,7 +1104,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
nsPluginInstance::WriteReady(NPStream * /* stream */ )
{
#if 0
@@ -647,8 +876,8 @@
@@ -647,8 +895,8 @@
/// \brief Read the data stream from Mozilla/Firefox
///
/// For now we read the bytes and write them to a disk file.
@@ -851,7 +1115,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
void * buffer)
{
@@ -853,7 +1082,8 @@
@@ -853,7 +1101,8 @@
if ( ! _cookieFile.empty() ) {
cout << " dumpCookies: file " << _cookieFile << " should be unlinked!" << endl;
}
@@ -861,7 +1125,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
// Linking problems...
//#ifdef HAVE_XPCOM
@@ -961,9 +1191,47 @@
@@ -961,9 +1210,47 @@
}
@@ -909,7 +1173,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
string procname;
char *gnash_env = std::getenv("GNASH_PLAYER");
#ifdef GNASH_XPI_PLUGIN
@@ -973,7 +1241,8 @@
@@ -973,7 +1260,8 @@
#endif // def GNASH_XPI_PLUGIN
if (gnash_env == NULL) {
procname = GNASHBINDIR;
@@ -919,7 +1183,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
}
else
{
@@ -1000,6 +1269,8 @@
@@ -1000,6 +1288,8 @@
// 0 For reading, 1 for writing.
int p2c_pipe[2];
int c2p_pipe[2];
@@ -928,7 +1192,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
int ret = pipe(p2c_pipe);
if (ret == -1)
@@ -1014,6 +1285,13 @@
@@ -1014,6 +1304,13 @@
cout << "ERROR: child to parent pipe() failed: " << strerror(errno) << endl;
}
@@ -942,7 +1206,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
/*
Setup the command line for starting Gnash
@@ -1022,10 +1300,18 @@
@@ -1022,10 +1319,18 @@
// Prepare width, height and window ID variables
const size_t buf_size = 30;
char xid[buf_size], width[buf_size], height[buf_size], hostfd[buf_size];
@@ -961,7 +1225,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
// Prepare Actionscript variables (e.g. Flashvars).
vector<string> paramvalues;
@@ -1054,18 +1340,19 @@
@@ -1054,18 +1359,19 @@
ADD NEW ARGUMENTS
*/
@@ -985,7 +1249,14 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
// Height and width
argv[argc++] = "-j";
@@ -1081,6 +1368,15 @@
@@ -1075,12 +1381,22 @@
// Url of the root movie
argv[argc++] = "-u";
+ // XXX czasami jest pusty ?
argv[argc++] = _swf_url.c_str();
// Host FD
argv[argc++] = "-F";
argv[argc++] = hostfd;
@@ -995,13 +1266,13 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ //argv[argc++] = hostvidfd;
+
+ // this limits to 25 FPS XXX
+ argv[argc++] = "-d";
+ argv[argc++] = "40";
+ //argv[argc++] = "-d";
+ //argv[argc++] = "40";
+
// Base URL is the page that the SWF is embedded in. It is
// by Gnash for resolving relative URLs in the movie. If the
// embed tag "base" is specified, its value overrides the -U
@@ -1099,6 +1395,7 @@
@@ -1099,6 +1415,7 @@
}
argv[argc++] = "-";
@@ -1009,7 +1280,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
argv[argc++] = 0;
assert(argc <= maxargc);
@@ -1129,13 +1426,21 @@
@@ -1129,13 +1446,21 @@
<< endl;
}
@@ -1032,7 +1303,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
cout << "Forked successfully, child process PID is "
@@ -1144,7 +1449,8 @@
@@ -1144,7 +1469,8 @@
_ichan = g_io_channel_unix_new(c2p_pipe[0]);
g_io_channel_set_close_on_unref(_ichan, true);
@@ -1042,7 +1313,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
return;
}
@@ -1162,15 +1468,32 @@
@@ -1162,15 +1488,32 @@
}
// close standard input and direct read-fd1 to standard input
@@ -1076,7 +1347,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
// Experiments show seventy or eighty file descriptors open in
// typical cases. Rather than close all the thousands of possible file
// descriptors, we start after stderr and keep closing higher numbers
@@ -1181,7 +1504,8 @@
@@ -1181,7 +1524,8 @@
for ( ; numfailed < 10; anfd++)
{
if ( anfd == c2p_pipe[1] ) continue; // don't close this
@@ -1086,7 +1357,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
ret = close (anfd);
if (ret < 0) numfailed++;
else
@@ -1241,6 +1565,12 @@
@@ -1241,6 +1585,12 @@
exit (-1);
}
@@ -1099,9 +1370,9 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
const char*
nsPluginInstance::getCurrentPageURL() const
{
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/plugin/plugin.h gnash-0.8.4-3/plugin/plugin.h
--- clean-gnash/plugin/plugin.h 2009-03-06 02:03:24.000000000 +0000
+++ gnash-0.8.4-3/plugin/plugin.h 2009-03-07 13:22:21.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/plugin/plugin.h cp-gn084/plugin/plugin.h
--- clean-gn084/plugin/plugin.h 2009-03-13 18:18:08.000000000 +0000
+++ cp-gn084/plugin/plugin.h 2009-03-13 18:12:57.000000000 +0000
@@ -19,10 +19,26 @@
#ifndef __PLUGIN_H__
#define __PLUGIN_H__
@@ -1144,11 +1415,17 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
#ifdef HAVE_GTK2
#include <gtk/gtk.h>
#endif
@@ -64,6 +82,45 @@
@@ -64,6 +82,52 @@
extern PRLock *playerMutex;
extern PRCondVar *playerCond;
+
+/* Copy in dump.cpp */
+struct Sh1_t
+{
+ int fEnableRendering;
+ char fRest[1];
+};
+
+//XXX probably should use DSOLOCAL
+class EloView : public BView
@@ -1156,6 +1433,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
+ void Draw(BRect updateRect);
+ BBitmap *fBitmap;
+ char* fEloData;
+ struct Sh1_t *fSh1;
+ unsigned fEloImgDataSz;
+ unsigned fEloDataSz;
+ int fEloFd;
@@ -1190,7 +1468,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
class DSOLOCAL nsPluginInstance : public nsPluginInstanceBase
{
public:
@@ -82,13 +139,14 @@
@@ -82,13 +146,14 @@
uint16_t *stype);
NPError DestroyStream(NPStream * stream, NPError reason);
@@ -1207,7 +1485,7 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
private:
@@ -129,6 +187,12 @@
@@ -129,6 +194,12 @@
int _streamfd;
GIOChannel* _ichan;
int _ichanWatchId;
@@ -1220,8 +1498,8 @@ diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x
pid_t _childpid;
int _filefd;
diff -Nur -x 'Makefile*' -x '*.m4' -x configure -x 'config.*' -x '*libltdl*' -x '*.1' -x configurelog -x configure.ac -x ltmain.sh clean-gnash/sys/shm.h gnash-0.8.4-3/sys/shm.h
--- clean-gnash/sys/shm.h 1970-01-01 00:00:00.000000000 +0000
+++ gnash-0.8.4-3/sys/shm.h 2009-03-07 13:22:21.000000000 +0000
diff -Naur -x 'Makefile*' -x '*.m4' -x '*autom4te.cache*' -x '*.rej' -x config.guess -x config.sub -x configure -x '*.1' -x '*.diff' -x libltdl -x ltmain.sh clean-gn084/sys/shm.h cp-gn084/sys/shm.h
--- clean-gn084/sys/shm.h 1970-01-01 00:00:00.000000000 +0000
+++ cp-gn084/sys/shm.h 2009-03-13 18:12:58.000000000 +0000
@@ -0,0 +1 @@
+#warning "dummy sys/shm.h"