Sun 19 Aug 2007 04:41:45 PM UTC, original submission:
I'm trying to load Gnash plugin for firefox into Konqueror directly, as I can do with libflashplayer.so.
Konqueror can't load Gnash this way, but I tried to debug it.
Konq is using an app called nspluginviewer, wich is a KPart plugin, to render the netscape plugins onto the webpage.
I downloaded kdebase sourcecode, to see how nspluginviewer is working (It is placed in ./nsplugin/viewer) and added some lines to debug the error.
an example of init code follows:
___________________________________
// initialize plugin
NPError error = _NP_Initialize(&_nsFuncs, &_pluginFuncs);
kdDebug(1431) << "_NP_Initialize(" << &_nsFuncs << ", " << &_pluginFuncs << ") return value = " << error << endl;
CHECK(Initialize,error);
_____________________________________________
(there are other lines modified)
And, when I try to see youtube.com, Konqueror prints this onto the shell (without crashing):
_________________________________________
1 - XSetErrorHandler
2 - parseCommandLine
3 - create QXtEventLoop
4 - create KApplication
nspluginviewer (Qt/Xt): 5 - app.dcopClient
nspluginviewer (Qt/Xt): 6 - dcop->registerAs
nspluginviewer (Qt/Xt): 7 - new NSPluginViewer
nspluginviewer (Qt/Xt): 8 - app.exec()
nspluginviewer (plugin): NSPluginViewer::NewClass( /home/deavid/.mozilla/plugins/libgnashplugin.so)
nspluginviewer (plugin): Plugin library /home/deavid/.mozilla/plugins/libgnashplugin.so loaded!
nspluginviewer (plugin): NSPluginClass::Initialize()
nspluginviewer (plugin): NSPluginClass _pluginFuncs.size = 60
nspluginviewer (plugin): NSPluginClass _nsFuncs.size = 88
nspluginviewer (plugin): NSPluginClass _nsFuncs require 88
nspluginviewer (plugin): _NP_Initialize(0x80d3100, 0x80d30c4) return value = 3
nspluginviewer: Result of
nspluginviewer (plugin): Init exited with 3
nspluginviewer (plugin): Error when loading plugin.
nspluginviewer (plugin): ERROR: Can't create plugin class; id: konqueror-14284 ; plugin: /home/deavid/.mozilla/plugins/libgnashplugin.so
nspluginviewer (plugin): NSPluginClass::shutdown error=true
nspluginviewer (plugin): NSPluginViewer::shutdown
nspluginviewer (plugin): NSPluginViewer::~NSPluginViewer
_____________________________________
I searched for that error number, 3. The error numbers are listed in napi.h :
_______________________________________
#define NPERR_BASE 0
#define NPERR_NO_ERROR (NPERR_BASE + 0)
#define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
#define NPERR_INVALID_PARAM (NPERR_BASE + 9)
#define NPERR_INVALID_URL (NPERR_BASE + 10)
#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
#define NPERR_NO_DATA (NPERR_BASE + 12)
#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
___________________________________________________
Then, 3 means: NPERR_INVALID_FUNCTABLE_ERROR
Time to search Gnash plugin. I have a HEAD release from 2-3 days ago. The init code from Gnash, plugin.cpp:
__________________________________________________
NPError
NS_PluginInitialize()
{
NPError err = NPERR_NO_ERROR;
PRBool supportsXEmbed = PR_TRUE;
NPNToolkitType toolkit;
// Make sure that the browser supports functionality we need
err = CallNPN_GetValueProc(NPNFuncs.getvalue, NULL,
NPNVSupportsXEmbedBool,
(void *)&supportsXEmbed);
if (err != NPERR_NO_ERROR || !supportsXEmbed) {
cout << "No xEmbed support in this Mozilla version!" << endl;
return NPERR_INCOMPATIBLE_VERSION_ERROR;
} else {
cout << "xEmbed supported in this Mozilla version" << endl;
}
.
.
.
______________________________________________
But note that, konqueror is not printing nothing about xEmbed. This means, that the code is return early.
I think it is exiting in plugin/mozilla-sdk/np_entry.cpp
______________________________________________
DSOEXPORT static NPError fillNetscapeFunctionTable(NPNetscapeFuncs* aNPNFuncs)
{
if(aNPNFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
if(HIBYTE(aNPNFuncs->version) > NP_VERSION_MAJOR)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
if(aNPNFuncs->size < sizeof(NPNetscapeFuncs))
return NPERR_INVALID_FUNCTABLE_ERROR; // *** IN THIS LINE
.
.
.
___________________________________________
I tried to increase the number in aNPNFuncs->size by 80 bytes, and now, the error changes. (If I increase it in 75 bytes, the error is the same)
I don't know why. nspluginviewer says that sizeof(NPNetscapeFuncs) is equal to 88 bytes and Gnash plugin, 88 is a value lower than sizeof(NPNetscapeFuncs).
Well, after compiling nspluginviewer with +80 bits for aNPNFucns, I get this error:
___________________________________________
1 - XSetErrorHandler
2 - parseCommandLine
3 - create QXtEventLoop
4 - create KApplication
nspluginviewer (Qt/Xt): 5 - app.dcopClient
nspluginviewer (Qt/Xt): 6 - dcop->registerAs
nspluginviewer (Qt/Xt): 7 - new NSPluginViewer
nspluginviewer (Qt/Xt): 8 - app.exec()
nspluginviewer (plugin): NSPluginViewer::NewClass( /home/deavid/.mozilla/plugins/libgnashplugin.so)
nspluginviewer (plugin): Plugin library /home/deavid/.mozilla/plugins/libgnashplugin.so loaded!
nspluginviewer (plugin): NSPluginClass::Initialize()
nspluginviewer (plugin): NSPluginClass _pluginFuncs.size = 60
nspluginviewer (plugin): NSPluginClass _nsFuncs.size = 168
nspluginviewer (plugin): NSPluginClass _nsFuncs require 88
nspluginviewer (plugin): g_NPN_GetValue(), variable=14
No xEmbed support in this Mozilla version!
nspluginviewer (plugin): _NP_Initialize(0x80d31d8, 0x80d319c) return value = 8
nspluginviewer: Result of
nspluginviewer (plugin): Init exited with 8
nspluginviewer (plugin): Error when loading plugin.
nspluginviewer (plugin): ERROR: Can't create plugin class; id: konqueror-19270 ; plugin: /home/deavid/.mozilla/plugins/libgnashplugin.so
nspluginviewer (plugin): NSPluginClass::shutdown error=true
nspluginviewer (plugin): NSPluginViewer::shutdown
nspluginviewer (plugin): NSPluginViewer::~NSPluginViewer
_____________________________________________
8 means NPERR_INCOMPATIBLE_VERSION_ERROR.
Now I can get the "No xEmbed support in this Mozilla version!" message. (like Opera)
By the way, I tested Opera with gnash. It does not work, but it prints in the console:
__________________________________________
No xEmbed support in this Mozilla version!
opera: Plug-in 19895 is not responding. It will be closed.
opera: Define environment variable OPERA_KEEP_BLOCKED_PLUGIN to keep blocked plug-ins.
__________________________________________
I hope that report helps,
David.
|