IRC Log Viewer » #firebreath » 2011-02-22

IRC Nick Time (GMT-7) Message
zmichl 06:02 hi guys
I'm trying to call FB plugin method from BHO on Windows, but without success. I'm guessing that I need to export that function, right?
Here is an dumpbin /exports output of my plugin:
4 0 00071275 DllCanUnloadNow
5 1 000713F0 DllGetClassObject
6 2 00071766 DllInstall
7 3 00071662 DllRegisterServer
8 4 000716E4 DllUnregisterServer
1 5 0000F6D4 NP_GetEntryPoints
2 6 0000F6ED NP_Initialize
3 7 0000F706 NP_Shutdown
so what is the best way to make my method visible?
neilg_ 07:02 Morning/afternoon all!
Got my first Mac plugin working yesterday. :)
jshanab_wcw 07:02 Morning, Congratulations
neilg_ 08:02 Thanks! Firebreath is very, very awesome
Now to create an OpenGL context - which, as far as I can tell, requires that I use either QuickDraw (which is deprecated) or CoreAnimation. So CoreAnimation it is!
jshanab_wcw 08:02 Or...SFML. I am playing with thaat now for video
neilg_ 08:02 SFML isn't a solution for me (I already have a full game engine that now works on the mac) - but it's good to hear you have something working!
I assume that to get that working, you create a CoreAnimation plugin through Firebreath and then create a CAOpenGLLayer in SFML and pass that in?
jshanab_wcw 08:02 Ah, I didn't and don't know about CoreAnimation. I have my player create an app window decode a fram of viseo and apply it to a sprite and display, about 6-8 lines for SFML. What I am doing now is attempting to attach a fragment shader so I can pas yuv data to the card and let the card convert and scale
neilg_ 08:02 Oh, okay, so your player isn't embedded on the page?
jshanab_wcw 08:02 Yes, I have had up to 12 instances on a web page. they are just objects in html with my mimetype
I mean yes it is embedded
neilg_ 08:02 So how do you get your app window embedded on the page?
That's what I've been reading about lately - trying to figure out how to get this all to work. :)
jshanab_wcw 08:02 I juast pass it down fromt he API tot he plugin and then to the player. from api to plugin i pass the FB::PluginWindow*. Then in my player I use void CLivePlayer::SetWnd(FB::PluginWindow* win)
FB::PluginWindowWin* wnd = reinterpret_cast<FB::PluginWindowWin*>(win);
wnd_ = wnd->getHWND();
then for SFML i have a variable of RenderWindow called App_ and I just "App_.Create(wnd_);" then dray and display it as needed
neilg_ 08:02 Oh, oh - I thought you had this working on the mac. Right, you have it working the same way I do on Windows
Unfortunately it seems to be quite a lot more complicated on the mac :(
jshanab_wcw 08:02 oh, well i will be interested in seeing what you did if possible, this needs to be proted to mac and l,inux...
neilg_ 08:02 I think once I've figured it out we'll put together an article on what we had to do. :)
jshanab_wcw 08:02 thanks, that would be cool
taxilian 09:02 zmichl: If you want to create a new dll export youll need to copy the .def file from gen_templates/ to your plugin dir and add it there
neilg_: Youll have to support at least quickdraw and coreanimation
Coreanimation is not avail on 32 bit
Quickdraw not avail on 64
Look at the page on the wiki for matri
I recommend you use 1.5 branch with new mac pluginwindows
neilg_ 09:02 ...really?!
I'm looking at the matrix, it doesn't make mention that CoreAnimation doesn't work on 32-bit. In fact, that's very surprising given you can target 32-bit with CoreAnimation. :-/
I was wondering about upgrading to 1.5 already though. :)
jshanab_wcw 09:02 brave soul
neilg_ 09:02 Okay, so I'm going to take your recommendation though, I'll upgrade to 1.5
zmichl 09:02 taxilian: the .def file should I copy to the plugin sources dir (projects/myplugin/), right?
taxilian 09:02 neilg_: well, let me be more specific
in the minute I'm on a computer
only safari 32 bit supports coreanimation
and chrome on 10.6 and later
zmichl: yes
neilg_: however, chrome on 10.5 and firefox 32 bit both work with QuickDraw
1.5 is most likely stable at the moment, and I don't usually push things even to master unless I believe them to be stable. they just have less testing
the main thing with 1.5 is there are some breaking changes in the cmake
but they are very good changes
neilg_ 09:02 What bothers me about QuickDraw is that it's been deprecated and, in fact, the documentation for it has been removed from the Mozilla wiki. That puts me off supporting it!
taxilian 09:02 gotta run to class now, bbl
neilg_ 09:02 Sure, have fun!
taxilian 09:02 neilg_: well, it's either that or CoreGraphics if you want to support firefox < 4.0
neilg_ 09:02 I don't think I can create OpenGL with CoreGraphics (from what I've read)
taxilian 09:02 That's why I said QuickDraw
Too bad, really, since you can always get coregraphics
The other option is to render with ogl offscreen and then blit
neilg_ 09:02 Hmm. I'd thought about that too and I'd rather avoid that. I mean, if it turns out that I have to then I have to - but hopefully we're fine with CoreAnimation. So long as it's supported (and it is, at least as far as I can) on the latest builds of Safari and Chrome then it's probably not a problem to say people need Firefox 4. It won't be used by many people until next September in any case...
Invalidating Core Animation at that - but it seems like they're pretty much the same except we have to deal with an extra message
Radicand_ 10:02 howdy
neilg_ 10:02 Hey
Radicand 10:02 qq- i had to reinstall windows and changed my username, so my build paths for the .sln are wacked. what's the suggested solution to fix them?
neilg_ 10:02 Regenerate them using your prep script
taxilian 10:02 delete your build dir first
stuartmorgan 10:02 taxilian: Chrome on 10.5 supports Invalidating Core Animation
Radicand 10:02 CMake Error at src/3rdParty/boost/libs/thread/CMakeLists.txt:19 (include):
include could not find load file:
keep getting that error when i run prep
stuartmorgan 10:02 neilg_: Is 10.5 support important to you? If so, I'd make sure to test on 10.5
neilg_: many plugin vendors have been supporting CA only for 10.6, I gather because of CA bugs in 10.5 of some kind
taxilian 10:02 Radicand: are you on the master branch?
Radicand 10:02 yeah
taxilian 10:02 are you on the mailing list?
Radicand 10:02 no
should i be using a different branch?
taxilian 10:02 you may want to read this email, then:
neilg_ 10:02 I don't believe 10.5 is important to us, no. We've built everything against the 10.6 SDK in any case!
stuartmorgan 10:02 neilg_: btw, I don't think there was every any documentation for doing what you want with QD anyway; it was always a hack
taxilian 10:02 Radicand: you're welcome to stay on that branch, but there are some breaking changes as it is no longer the same as 1.4, it's now started on 1.5
Radicand 10:02 gotcha
thanks, switching to 1.4 works
zmichl 10:02 taxilian: so I added that method to the .def file and now I can see in the dumpbin output. But still can't import it to the BHO (error LNK2019: unresolved external symbol _mytest referenced in function...)
neilg_ 10:02 stuartmorgan: That's pretty much what I've figured out from what I've read. CoreGraphics seems awesome but I need OpenGL. It seems like the only officially supported way to do this is CoreAnimation - and that has its own problems!
taxilian 10:02 zmichl: that's not really a firebreath question, and I'm not an expert on dll exports; you'll want to do some research on that
sorry :-/
Radicand 10:02 one more dumb question; what's the best place to define where i have a linker dep (*.lib) so i don't have to edit properties-linker-input constantly?
stuartmorgan 10:02 neilg_: Yes, CA is the only fully accelerated way that works going forward, and if you are fine with 10.6 only and waiting for Firefox 4, there's really no reason to do QD
taxilian 10:02 Radicand: see
Radicand 10:02 you're the man
zmichl 10:02 taxilian: ok, thanks for your export advice ;)
neilg_ 10:02 stuartmorgan: I'm glad you spoke about this because I've been doing a fair amount of research for the past few days and that's pretty much exactly where I'd gotten to. I was hoping that people in this channel would know more - it seems to be quite arcane right now. :)
taxilian 10:02 so I'm toying with the idea of building in support for opengl and possibly directx directly in FireBreath; so you could basically have a function (or maybe event) come into the plugin that basically says "these are the models I support, what do you want?" and the plugin responds "I want opengl", and it sets everything up; on CoreAnimation it uses a CA context, CG it does offscreen buffer, etc
you could also support CG: if there is no CG support it creates CG on top of QD
stuartmorgan 10:02 I've been trying to get Josh to do an overview doc for MDC--a sort of "So you want to write a Mac plugin"--but he hasn't had time. Maybe I'll just post one somewhere
taxilian 10:02 then it runs the message loop itself and tells you when to draw, and you configure how often that should be
I'd really love to see more references to FireBreath on MDC, but I don't know if we'd ever get them to agree =]
neilg_ 10:02 That would be amazing given the amount of people that come in here wanting to do graphics from within plugins. I would certainly work with you in doing that
What's MDC?
Mac Developer... Community perhaps?
stuartmorgan 10:02 Mozilla's docs
taxilian 10:02 Mozilla Developer Center
stuartmorgan 10:02 e.g.,
Huh, they renamed it MDN (except the <title>) it looks like
taxilian 10:02 and there is a link to us from there, because I put one there, but I didn't feel like I could just inject references to us all over =]
stuartmorgan 10:02 There's a sample project for Mac there, but there's no good overview of the models
jshanab_wcw 10:02 uys, I am a bit of a neophyte when it comes to MAC , but why can't we use SFML, It is suppose to be cross platform.
taxilian 10:02 jshanab_wcw: I don't know enough about SFML to know if that's possible or not
stuartmorgan 10:02 jshanab_wcw: I doubt it understands NPAPI model negotiation
taxilian 10:02 there are some pretty significant differences between drawing in the browser and in a normal mac app, though
jshanab_wcw 10:02 Indeed, i am a bit stuck on the pixel shader and Laruent only likes email and is 8-9 hours off from me
taxilian 10:02 stuartmorgan: out of curiosity, where are you located?
stuartmorgan 10:02 CA
taxilian 10:02 cool. recently we've started finally seeing a few more people from the US around here =] for awhile there were, like, 3 people in the US who ever came around =]
neilg_ 10:02 Guilty
jshanab_wcw 10:02 ( and i was a few of them for a while) I was in CA, now in Il
taxilian 10:02 it's nice to have people in the US in here for a couple of reasons. One is that for most of the people outside of the US, English was a second language, which while they all write fairly well in English still means that they aren't very good candidates for writing documentation =] another is that people in the US are closer in timezone to me
though Canada is similar that way
I can start looking at making a set of PluginWindow objects that will give us more help in negotiating drawing if I can get some code examples for plugins that use the various models. I just dont' know a lot about the implementation. amackera, neilg_, I think you two may be the only ones in here that have done a whole lot with it, though I could be forgetting someone
it's hard to keep track of firebreath development and which features are in which versions and also keep track of everyone in the room and what they work with =]
jshanab_wcw 10:02 While it sounds like we have some OpenGL people here, I am getting an error and it is ticking me off. I am using glslDevil to step thru my code and I get GL_INVALID_OPERATION when it calls glGetProgramObjectARB(1). which compiled and linked fine earlier in the code
neilg_ 10:02 Sure, I'm absolutely willing to help out with that. On Windows it's actually fairly straightforward too!
taxilian 10:02 neilg_: if you can get me some sample code I can try to come up with some ideas
jshanab_wcw: I don't know anything helpful about that :-(
neilg_ 10:02 Okay, I'll put something together for you later :)
jshanab_wcw 10:02 Thanks, oh well
neilg_ 11:02 jshanab_wcw: Don't you mean glUseProgramObjectARB?
And, at that, I suspect you actually want glUseProgram if you have a driver that support OGL 2.1
jshanab_wcw 11:02 yes. It was part of SFML that when a param is not found, it clears the program out and then continues. So i got past that temporarily ,but I just cannot seem to connect the C++ code properly tot he glsl
sabotaged|wk 11:02 so out of curiosity, what thread does onload occur from in javascript?
taxilian 11:02 javascript only has one thread
all access to javascript is on the main thread
sabotaged|wk 11:02 so when you call InvokeAsync for firing onload, it will happen on the same thread, just some time later?
taxilian 11:02 if you call it from the main thread, then yes
it just schedules it to be run
that's another (of many) reason to never block the main thread
sabotaged|wk 11:02 ok. i was thinking of assuming that if onPluginReady was fired, my javascript code had registered for its callbacks. but not so since onload gets fired async, just before onPluginReady
taxilian 11:02 true. you could call it syncrhonously if you want
sabotaged|wk 11:02 guess i'll just stick with an explicit "i'm done registering all my callbacks" method
dan2 12:02 taxilian, you said it was okay to put a weak pointer to a plugin instance in a static right?
kylehuff 12:02 pardon any spam that may result; I just finally got around to setting up ZNC, not entirely sure I've got it setup correctly...
jshanab_wcw 14:02 I think i have forgotten some syntax. I am getting plugin().testEvent() is not a function
dan2 14:02 question
am I supposed to create a new JSAPI from the plugin every time I want to send a javascript event?
dan2 14:02 call getRootJSAPI?
taxilian 14:02 dan2: getRootJSAPI doesn't recreate it
it caches it
so yes, you should call that any time you need a reference to it. (I just responded to your email also)
you should never call that until after onPluginReady, however, or your JSAPI object may get created without the browserhost object
if you don't need that, then it's okay
it will call createJSAPI on your plugin object the first time you call it, thereafter it will return the previously created instance
dan2: yes, it should be okay to keep a weak_ptr to a plugin object in a static
kylehuff: ZNC is pretty nice, is it not?
jshanab_wcw: did you registerEvent("testEvent", ...)?
jshanab_wcw 14:02 taxilian. yeah, it is all still in there. It is acting very strange working from some test pages and not others. I think it is bad html or other plugin crashing and unloading issues, I am rolling back a bit to find out
taxilian 19:02 darn. our cmake patch got pushed to 2.8.5
FB_GitHubBot 19:02 FireBreath: cmake_patch Richard Bateman * f95854b (2 files in 2 dirs): Made changes to work with patched cmake. Hopefully this patch will be in cmake 2.8.4 -
FB_GitHubBot 22:02 FireBreath: master Richard Bateman * a50e954 (9 files in 9 dirs): Added folders for those IDEs that support it -