IRC Log Viewer » #firebreath » 2013-05-15

IRC Nick Time (GMT-7) Message
Bor0 04:05 hello. is there a neat way to expose plugin version through JSAPI? e.g. I want something like javascript:plugin().getPluginVersion() which will show me the PLUGIN_VERSION value set from PluginConfig.cmake
reichi 04:05 you could simply build it yourself :)
dunno if there is actually something built in
but i would guess it isn't
Bor0 04:05 so I cannot read variables from PluginConfig.cmake through .cpp
taxilian 09:05 reichi: for future reference, global/config.h has most of hte constants from pluginconfig in it
[Outcast] 10:05 is there a global var that is a pointer to the API instance
taxilian 10:05 not unless you create one
because "the api instance" is one of potentially many
all instances of the plugin are in the same process, so a global variable would just get overridden; how do you know which one it is?
[Outcast] 10:05 i see
is there away to get the current API instance?
taxilian 10:05 "current"
what exactly does current mean?
you mean the one belonging to the instance that created the object you're currently in?
[Outcast] 10:05 do to some of the other libs I am having to use. I trying to figure out how to access the API instance from a static function
taxilian 10:05 there is no "current" api instance to the process
all are current
so you'll have to find some way to identify it
you'll have to pass something in
[Outcast] 10:05 my hands are tied due to definition of the call back for the other third party lib
is there a way to do something similar to python's func(*args, **kwargs)?
I know there are templates
taxilian 10:05 you could pass in a map I suppose
most callbacks allow you to pass a void* for data to be used
[Outcast] 10:05 will look
I am still learning.
I am just trying get logging to the javascript console for debugging
due to the way they wrote lib it requires a function pointer
taxilian 10:05 do *not* do that in production
it's not performant
[Outcast] 10:05 in pjsips documentation is show that you have to use function pointers
or they do in the examples.
taxilian 10:05 that's not uncommon for a callback
but most of the time something requiring a function pointer callback will let you pass in somewhere an opaque pointer so that you can get state information on the other side
[Outcast] 11:05 here is the function definition: void on_call_media_state(pjsua_call_id call_id);
only one arg
taxilian 11:05 is that the function pointer, or the one that triggers the call?
[Outcast] 11:05 function pointer
taxilian 11:05 and what is call_id?
[Outcast] 11:05 int
I have an idea
I found a more complete definition void(* pjsua_callback::on_call_media_state)(pjsua_call_id call_id)
I might be able to overload the pjsua_callback class. Unless pjsua_callback is just a namespace.
[Outcast] 11:05 its a struct.
krishna-- 13:05 taxilian: you had suggested that to check for webserver name (to restrict plugin access to only one webserver) using m_host->getDOMWindow()->getLocation(). which would be the best place to put this check? is plugin::createJSAPI() the right place to return NULL?
taxilian 14:05 you can't return null
you could use securityzones and set the default zone to not allow anything (or much) but then change it after you check the location
krishna-- 14:05 is there documentation on securityzones on fb.org? i will check
got the doc
checking
taxilian 14:05 no idea if there are or not; someone said they were going to write some, don't remember if they did
krishna-- 14:05 http://www.firebreath.org/display/documentation/Security+Zones
dcherman 14:05 taxilian: http://www.firebreath.org/display/documentation/Security+Zones - lurking ftw, i had no idea this even existed
rolled my own naive version when i wrote my plugin a while back
taxilian 14:05 lol
you might also like JSAPIPRoxy
no docs for that yet, I don't think
but someone should write some
it wraps another JSAPI object… the purpose being that you can then change out the guts of what is given to the browser at any time
krishna-- 14:05 ok
i will check on JSAPIProxy
there are so many classes ... i am just getting things to work by trial and error :)
taxilian 14:05 well, when you want to do something ask me and I'll tell if you if it's already been done =]
and/or search the irc logs and the firebreath website
krishna-- 14:05 will do
dcherman 14:05 taxilian: in that case, do you know of any existing FB plugins to enforce focus on a given browser window and tab? =P
taxilian 14:05 you can't do that
not in a cross platform way
might be doable in windows, but only through hacks
dcherman 14:05 actually only care about windows
taxilian 14:05 with the right hacks, guesswork, and the browser manufacturer not changing any details you might manage it, then
krishna-- 14:05 i think extensions might be able to do that
taxilian 14:05 but as a general rule we only add functionality to firebreath that is portable, and what you want to do isn't possible on mac
krishna-- 14:05 taxilian: when i close the browsertab of chrome, plugin::~pluginAPI() destructor is not called, do you know how i can clean the things i created in the JSAPIAuto object?
taxilian 14:05 that probably means that you have a circular reference to the shared_ptr
are you using boost::functions?
krishna-- 14:05 yeah threads
i spawn a thread when handling a call from browser's jacascript into the plugin
aah i am passing this pointer when creating the thread
that is ref'ing it?
taxilian 14:05 if you aren't careful when creating a boost::function or a thread they can hold onto a shared_ptr sometimes
I don't know if they'll grab it automaitcally or if you'd have to do a shared_from_this
I think there is a shutdown() method on the JSAPI objects, though
krishna-- 14:05 ok
checking on shutdown()
i guess shutdown is also not called if there is a reference
taxilian 14:05 hmm. that's a bug, then
krishna-- 14:05 let me just confirm
do you know if there is a /proc like thing on osx? want to check on open fds for the plugin chrome process
taxilian 14:05 … why not just use ps?
krishna-- 14:05 i am closing an fd in shutdown()
want to check if it is indeed closed ... to confirm if shutdown() is called
ps will not show that right? let me check
on linux i would just do ls /proc/<pid>/fd
taxilian 14:05 ahh
why not just enable logging?
then you could add a log message there
krishna-- 14:05 yeah ... i will have to go through the learning curve of logging for that (i saw a log4cpp module)
taxilian 14:05 there are docs on the website
it's not too hard
krishna-- 14:05 yep
ok
dast 16:05 hi, i can't solve conversion of boost::filesystem::path to string. i'm getting "unresolved external symbol" every time
don't oyu , please, know, what's this about? i googled only something about boost version
i added by add_boost_library(filesystem)
#include <boost/filesystem.hpp>
error LNK2019: unresolved external symbol "void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class std::codecvt<wchar_t,char,int> const &)" ([email protected][email protected]@[email protected]@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@[email protected][email protected]@@Z) referenced in function "void _
taxilian 16:05 dast: pathObj.string()
dast 16:05 thanks...thats, what i tried
and get this error
i also tried boost::filesystem::canonical(pathObj).string() ....same result
(boost i updated from git...firebreath submodule)
JR_ 20:05 Hi all, getting FireBreathWin.def : warning LNK4022: cannot find unique match for symbol 'DllCanUnloadNow' and FireBreathWin.def : warning LNK4022: cannot find unique match for symbol 'DllGetClassObject'
when compiling. The offending library is C:\eworkspace\webrtc_xmpp_plugin\plugin\third_party\libjingle\trunk\build\Release\lib\directshow_baseclasses.lib
Appreciate any tips to resolve the error. Unfortunately, I cannot exclude directshow_baseclasses.lib as the entire video processing is based on it.
JR_ 21:05 Resolved the issue by commenting DllCanUnloadNow and DllGetClassObject in libjingle\trunk\third_party\winsdk_samples\src\Samples\multimedia\directshow\baseclasses\dllentry.cpp.