IRC Log Viewer » #firebreath » 2010-12-04

IRC Nick Time (GMT-7) Message
Sinisa 02:12 hello everyone :-)
anyone experienced in plugin-on-mac development? i'm looking at some solutions of swapping image rendered from OpenGL offscreen buffer, into CGContextRef
gotta work with at least 40-50fps
(as offscreen renders a lot faster than that)
I remember amackera mentioned he did something like that, but I see he's away :(
btw, I was able to flush gl context directly onto WindowRef (CarbonCG mode), and still have rest of firefox GUI working + flash content in the page as well, but I wasn't able to do clipping and/or change insertion point of flushed content
if there is a solution to do that instead of copy-from-gl-into-cgcontextref, that would be the best option
Sinisa 02:12 one more question, how do i detect in FB which event model & drawing model is supported? how do I know if I am to use Cocoa CG or Carbon CG, or Cocoa CA / Carbon CA for drawing?
kalev_ 02:12 I think all of these questions are for amackera_away
and hello too :)
Sinisa 02:12 hey man
thanks for response
ok, a bit different issue: I've just copied plugin to my old macbookpro with Leopard - and plugin in Firefox is listed (about:plugins), but is not starting up when I open a page
and just tried Chrome 8 (installed it on 10.5), but same thing
I've set that plugin starts a pop-up with gl drawing, for testing, so it runs fine on 10.6 on all 3 browsers (FF,Safari,Ch), but not on 10.5
and I've compiled it for 10.5 arch
and for i386
kalev_ 02:12 try running "otool -L" on your plugin binary in Leopard; it should tell you if you have any deps missing
Sinisa 02:12 ah ok thanks, let me try now
kalev_ 02:12 it's showing up in about:plugins because the .plist files are in the place, but that doesn't really say if the plugin itself is working
Sinisa 02:12 just to check, I am now in /Library/Internet Plug-Ins/ where .plugin is copied, I ran otool -L pluginfilename.plugin
but it says invalid argument, can't map file
kalev_ 02:12 pluginfilename.plugin is a directory and should have a .so or .dylib (can't remember which exactly) in it somewhere
Sinisa 02:12 ah ok, just like .app
kalev_ 02:12 try running otool -L on the .so or .dylib file.
Sinisa 02:12 I can see only unix executable in it
can otool work on it/?
kalev_ 02:12 sure
Sinisa 02:12 listed about 16-17 libs, apparently all there
nothing missing
current versions are all higher than compatibility versions
kalev_ 02:12 and did it say that it's i386 architecture? (just to doublecheck)
Sinisa 02:12 it prints only frameworks & dylibs
dont see that info about arch
in xcode, info on target, I see only i386, 10.5 sdk, and build only active arch
kalev_ 02:12 'file' command should show arch in that case
Sinisa 02:12 Mach-O bundle i386
kalev_ 02:12 I'm out of ideas then, might be some issue with event / drawing model which prevents it from loading
my plugin doesn't do any drawing, so I wouldn't know.
you might want to try the example plugin and see if it works on Leopard
Sinisa 02:12 yeah, I would guess it should be some event-model issue
will try see how it goe
goes
kalev_ 02:12 for what it's worth, I'm building my plugin like this and it works on Leopard:
./prepmac.sh projects/ build/ -DWITH_SYSTEM_BOOST=YES -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64"
cd build
cmake --build . --config Release
Sinisa 02:12 oh ok so you build universal package?
i386 and 64bit
kalev_ 02:12 yep, that way I have one binary which works on both Leopard and Snow Leopard
Sinisa 02:12 32bit should work on SL as well, or am I wrong?
since I can see this plugin in SL, and it's 32bit
problem is I'm linking to other libs, QT for instance is 32bit only (as far as I know)
and I need it to get image from iSight
OpenCV was 64bit only, managed to compile it as 32bit
lot of my own libs, gui / render engine in gl are 32bit compiled
can't compile now all of it in both archs
kalev_ 02:12 I think it's possible to download two versions of Qt: one of them is ppc + i386 and the other is i386 + x86_64 universal
I don't really remember the details any more (haven't had to do anything on Mac for a while), but there were some browsers on Snow Leopard that wanted to load the 64 bit plugin
maybe it was even Safari that defaulted to 64 bit?
Sinisa 03:12 could be, I would assume apple wants to push cocoa & 64bit development
Sinisa 05:12 hey, question about drawing in CG mode, I need to draw CGImage into CGContextRef of provided browser window (Cocoa or Carbon, doesn't matter, it's CG): I've added draw function in on-paint event, and I can see it's called (I've added message box to popup if painting), but I see nothing painted. are there any rules about how to paint image in browser's CG context?
for instance, I have CGImage that's filled with RGB pixels [20,20,20] (close to black). and I use CGContextDrawImage to draw it in browser window's CGContextRef i retreived from FB Cocoa/Carbon CG window.
but I don't see it anywhere
are there any examples of how to draw it in FB?
jshanab_wcw 09:12 Good morning. After 3-4 days of trying to get an activeX control to work in IE and suffering critisim that we don't support safari,chrome and Firefox, I am trying firebreath. It looks awsome, just the ticket for our application. I have run the tutorial and watched the videos and I have a few questions.
Will firebreath be a good choice for a live555 streaming based video player and when it comes time to add 20 cpp files in various subdirectories to the project, am I correct in assuming i cannot add them in the Visual studio? I need instead to put them in the CMAke and regenerate the build dir?
taxilian 09:12 jshanab_wcw: yes, you are correct
firebreath is indeed awesome
but you do have to do things "the cmake way"
it sounds like firebreath would be a great fit for your need, though; there are definitely challenges with drawing in the browser, but they will be about the same as they would have been in a raw activex control
learn to use the cmake file (GLOB ....) function (examples in both the example projects, the firebreath cmake files, and in the fbgen genereated skeleton) and it'll save you a lot of time with selecting specific files
jshanab_wcw 09:12 Thanks for answering. Hey, I have a lot of source and headers that are used in the server side part of this code that are also used in the plugin side. What is the best way to "share" these between the two. We are using svn, i could export or i could symlink, or I could just copy it in?
taxilian 09:12 Saturdays are generally slow around here; I'm about to leave for school, but I'll be on and off throughout the day.
jshanab_wcw 09:12 I come from much more Linux and GNU than visual studio, but i am mandated to windows. :-(
taxilian 09:12 if it were me, I would probably check them out in a relative dir
then you just have to know where the dir is relative to your firebreath project dir
so you could have fbproj/MyPlugin
and ext/LibDir
might even be good to put those in a seperate cmake project
and add_directory(../../ext/LibDir)
and add include directories
jshanab_wcw 09:12 Like the boost is?
taxilian 09:12 it's a little tricky to figure out the cmake syntax at first, but once you figure it out it's not bad
yeah, much like that
you could even pretty easily copy one of the boost CMakeLists.txt files, since those are about as simple as it gets
jshanab_wcw 09:12 Ok, well I have done autobuilds with make, cmake cannot be worse than that :-)
taxilian 09:12 then you just statically link them by doing a target_link_libraries
lol. certainly not worse, but definitely different
as a unix guy, I don't think you'll have too much trouble
the main problem is that the docs aren't real fantastic; you have to understand the system to a certain point before the docs start really making sense
jshanab_wcw 09:12 Thanks. I will probably catch you when you get back form school, have fun and thanks again
taxilian 09:12 but there are a lot of examples you can use to help bootstrap
well, I'll be at school all day... finals in a week. I'll be online there, however
jshanab_wcw 10:12 Where are the examples?
taxilian 10:12 any CMakeLists.txt file in the project =]
but if you tell me what you're looking for I can suggest a particular place, since I wrote most of it
jshanab_wcw 10:12 k, thanks
taxilian 10:12 there are also 2 plugin examples
in the examples/ dir
you found the docs how to build those?
anyway, it's all there
gotta run; be back in probably 30 minutes
good luck
jshanab_wcw 10:12 I will look, I figured those are just the ones created by the tutorial. The next step is a tutorial or discussion of large projects i guess ....:-)
taxilian 10:12 the examples actually have a lot more in them than you get from the tutorial project
I figure you can create that yourself =]
basically, prep2010.cmd examples will generate the buildex/ dir
jshanab_wcw 10:12 ooooh, "basicediaPlayer" !
taxilian 10:12 yeah, it's a simple WMP wrapper
but has some useful things in it
check out the recent http://colonelpanic.net blogs as well
there is one about drawing on windows that you'll want to read
and using source control that tells you how to put the project outside of firebreath root
be back later, good luck. there are others here who can help, but they're usually pretty dormant on saturdays
jshanab_wcw 10:12 sweet. Yeah, i did the prep2010 a 1/2 hour ago, very smooth (somewhat reminissant of ruby, but a "back" would be nice)
taxilian 10:12 Back?
Not real familiar with ruby
jshanab_wcw 10:12 Oh, after i hit return on the name and it asked for something else, I wanted to change the name. (I just hit cntrl-C and started over, but thought some way of going back a step would be nice)
It has a get you run once to create an entire working app you then modify
taxilian 10:12 Hmm. Well, eventually we'll have a web vet
Ver
And if you run it again it defaults to the last entered values
Hmm
I see your point though
jshanab_wcw 10:12 right, I didn't realize at the time this is run "early and often"
taxilian 10:12 Fbgen is not
Only
Only prep scripts
Sorry, I'm on a cell phone now, so it's hard to type ;)
jshanab_wcw 10:12 Don't ever get rid of the command line when you create a web or gui! I think it needs to be the basic way always
k, TTYL
taxilian 10:12 I won't
jshanab_wcw 10:12 :-) Thanks for the work done, this is awsome! I just need to remove windows specific code and I am golden
taxilian 10:12 The web might not even be free, though it will not be expensive. More to encourage project donations. Will definitely be much more customizable
jshanab_wcw 10:12 windows specific code in OUR stuff
taxilian 10:12 Cool. Good luck!
jshanab_wcw 10:12 Quick Q. When I say "firebreaath\prep2010.cmd projects build" can i [option #1] instead say "firebreaath\prep2010.cmd projects\projectname build" and therby have my other source in a dir like projects\common level so i can reference it as ../common/foo.h without it trying to build it? or [Option #2] I can put it there and just not have a CMakeLists.txt file in the common directory. If...
...none of above respond with -1 (cell phone friendly question)
taxilian 10:12 if you don't have a CMakeLists.txt file in the directory which is under projects it is fine
if you do, it will try to treet that as a plugin dir
jshanab_wcw 15:12 Is there a clean in the prep scripts? i am now getting CMake Error: PluginConfig.cmake does not exist an i think it was from when I had the plugin directive in my cmake for my common directory
taxilian 15:12 just delete the build dir
do you have a directory in your projects/ dir that has a CMakeLists.txt but no PluginConfig.cmkae?
jshanab_wcw 16:12 The prep creates the build ?
taxilian 16:12 yes
the prep script runs cmake
jshanab_wcw 16:12 thanks
i am fighting "PluginConfig.cmake does not exist" on my common directory
taxilian 16:12 can you pastebin me your cmake output?
jshanab_wcw 16:12 sure!
taxilian 16:12 or fpaste, or whatever you prefer =]
jshanab_wcw 16:12 http://pastebin.com/yKTxKm9s
taxilian 16:12 you'll have to move common to another location
you could put it inside your plugin dir if you want
but anything with a CMakeLists.txt file in the project dir it'll assume is a plugin
jshanab_wcw 16:12 I am using the "add_subdirectory(../common/Archiver) in the project's CMake
taxilian 16:12 I guess that could probably be safely changed to look at PluginConfig.cmake, and I'm willing to do that, but you'd have to switch to a non-release build
it's not your code that is including it
firebreath searches the projects dir for plugin projects
jshanab_wcw 16:12 Oh, maybe i do not need the top level build in the common
taxilian 16:12 anything with a cmakelists it thinks is a plugin project
that would work too... as long as there isn't a CMakeLists.txt file in common/ it should work
jshanab_wcw 16:12 The error went away but The actual source and header files don't show up in the solution, is htat normal?
taxilian 16:12 depends on how your cmakelists file works
are you doing an add_library?
jshanab_wcw 16:12 I saw that in boost but didnt do that cause it is statically linked, more like the boost system instead of thread.
taxilian 16:12 boost thread is (in firebreath) statically linked
jshanab_wcw 16:12 it is still compiling :-)
taxilian 16:12 add_library is what creates the project that generates a binary
most likely link will fail
jshanab_wcw 16:12 Hey i really like your video's. great quality and sound quality. Did you use camtasia?
taxilian 16:12 your headers are there, so it should compile fine
jshanab_wcw 16:12 ok, i will try add_library
taxilian 16:12 I used Jing
I would love to use camtasia, but I don't have a license
I could use donation money to get one, but currently I'm saving most of that to pay for web hosting
might get a jing pro license
I should probably do more of those as well, but I barely found time to do those
jshanab_wcw 16:12 Well, I was telling my boss that if this works as well as it seems to, I am definitly making a donation!
taxilian 16:12 that would be awesome
and, for the record, it actually works better than it seems to ;-) (because you're not using half of the features)
nah, we've had a lot of fun with this project
it's been really rewarding to see it taking off lately
I'm also willing to consider support options for those making significant contributions (phone support, etc)
jshanab_wcw 16:12 cool, we have a really tight deadline (BTW, where are you?, I saw russian)
taxilian 16:12 Utah
USA
jshanab_wcw 16:12 I am in sunny chicago (not)
taxilian 16:12 right now is a pretty bad time to try to get any real support out of me, since I'm just going into the week before finals
but I'm around here usually
cool
jshanab_wcw 16:12 I understand, i took a new job and am not having time to finish my masters project. It has a dec 17th deadline, i am so screwed :-(. I was altering the linux kernel
taxilian 17:12 ouch
jshanab_wcw 17:12 I may be able to finish it this spring or summer then I have to figure out how to take classes that dropped off the time limit if i want the degree. Really sucks all classes are complete, but they drop them off after 4 years if final draft no in
taxilian 17:12 yeah, I'm in a rush to finish my B.S. before I start losing my classes as well... 'course, I took those 10 years ago, just out of highschool
jshanab_wcw 17:12 I started my masters early , then got a job, and took 2 years off, then found out from someone they had a limit. Then went back for 1 semester and then got laid off from Pelco. 6 monthes without a job and now I have relocated from Fresno, CA to Chicago IL ack!
taxilian 17:12 ouch
that'll do it =]
jshanab_wcw 17:12 It is freaking cold
taxilian 17:12 Lol. Pretty nippy here as well
Did you get your project building?
jshanab_wcw 17:12 I bought my first jacket in 20 years when i moved here. My co workers laughed and said, thats not a jacket... like old movie "thats not a knife..."
kinda, still bitching a bit about a file or two
Wohoo, much furthor. thanks. Now there are sub,sub folders to include
Soooo. Looking forward to success. When i have three diferent plugins for the linux,mac, and windows arches, do i just place them on the server and the browser user agent will make sure to get the right one?
taxilian 17:12 lol
you wish
you should be able to have one plugin that will work on all three, though, no?
granted, three different binaries
install is the most annoying part of plugin development
the best way on windows to install (IMO) is to use an MSI
firebreath has integrated WiX support
lol
jshanab_wcw 17:12 I was doing a CAB file and it was kicking my butt, I like MSI, I do not even know what WiX is yet
taxilian 17:12 well, technically I think you can package an MSI inside a CAB file
which might not be a bad way to go (jury is still out, I've had weird issues with CAB files)
WiX is Windows Installer XML
it's an open source project for creating MSIs
microsoft uses it
jshanab_wcw 17:12 Well the example generated test page is interesting in that it just specifies a mime type, ours had the CLSID and Codebase directives and is awfull
taxilian 17:12 yeah, I don't like using CLSID, so I set it up to use mimetype
that just maps to the CLSID in the registry is all
jshanab_wcw 17:12 our problem, that plauged us was we copied to another web server and when a machine went between the two different web servers with the same info and plugin, it triggered a re-install loop and just hosed it
taxilian 17:12 weird
sounds like a activex permissions issue
jshanab_wcw 17:12 The CLSID was the same but the microsoft doc says it looks up by CODEBASE, that the CLSID is used to load the class, not check for the plugin
yeah, but after fighting it for 3-4 days we just threw in the towel
taxilian 17:12 I've never messed with CODEBASE
then again, I don't try to use CAB files to install
MSI isn't as "user-friendly", but I'd rather have it work
jshanab_wcw 17:12 the "CAB" template in visual studio 2008 is pathetic and seems to create bad cab files using the OSD files. I think it was for .net and never really for c++
taxilian 17:12 probably
FB_GitHubBot 19:12 FireBreath: firebreath-1.3 Richard Bateman * 4cf1d8b (1 files in 1 dirs): FireBreath will now expect both a CMakeLists.txt and a PluginConfig.cmake in plugin directories; if both are not found, it will not be added as a plugin project dir
FireBreath: firebreath-1.3 Richard Bateman * 2bb5f7c (1 files in 1 dirs): Merge branch 'firebreath-1.3' of github.com:firebreath/FireBreath into firebreath-1.3
FireBreath: firebreath-1.3 commits f69b877...2bb5f7c - http://bit.ly/gatszT
FireBreath: master Richard Bateman * 2f490e1 (1 files in 1 dirs): FireBreath will now expect both a CMakeLists.txt and a PluginConfig.cmake in plugin directories; if both are not found, it will not be added as a plugin project dir ... - http://bit.ly/eSo6bB
taxilian 19:12 jshanab_wcw: the latest in Git (for both master and firebreath-1.3) now have a fix for the cmake issue you were experiencing earlier with "can't find pluginconfig.cmake"
Sinisa 21:12 hi there
anyone experienced in FB-on-Mac?
I'm trying to draw a sample bitmap, generated from code using CGBitmapContextCreateImage(...), which created valid image, onto browser's CGContextRef provided by FB window class
however, I see nothing drawn. I've filled RGBA pixels in bitmap to be 255,0,0,255, (so it's pure red, non-transparent), and verified that CGBitmapContextCreateImage has created valid image (can retreive valid width & height of the image, etc.)
I'm drawing it in FB event FB::RefreshEvent
and I'm positive it's called at least once
(got log entry)
but it apparently enters only once into this event handler, even if I move window around, resize it etc.
anyone experienced with this?
I'm newbie in CoreGraphics drawing
Sinisa 22:12 it's weird, I've installed timer, 60fps rate, and in log file I see it's been drawn, but still see nothing on browser window... and it should be pure-red filled image 444x303 pixels
after each draw I test for drawn image size and it returns valid size
taxilian 22:12 Sinisa: I saw your message this morning
but I don't know; Amackera would probably be the one to ask
he'll likely be back on Monday
Sinisa 22:12 hey man, ok, thanks for info
taxilian 22:12 sorry :-/
Sinisa 22:12 no problem, actually it would be nice that I solve a problem once on my own ;-)))
taxilian 22:12 =] would be awesome if you could put some of the info you learn on the wiki
I'm just not a UI guy
Sinisa 22:12 will do
write a big entry there
taxilian 22:12 I know the javascript side of things backwords and fowards, which is why it is all so solid
Sinisa 22:12 will also make a sample opengl pplugin
taxilian 22:12 but not so much on the UI side of things
Sinisa 22:12 understood
for windows is so much easier
basically there is no issue with drawing onto a hwnd
from different thread
all works fine
but mac osx is killing me
this is really huge disappointment - i would expect apple will at least give better support to opengl than microsoft
taxilian 22:12 yeah, I can imagine
well, the issue isn't really apple per se
Sinisa 22:12 as opengl is competitor to microsoft, and apple has no other api like gl
taxilian 22:12 it's more that the browser model was never really designed for hardware acceleration
in apple's stuff you have great AGL support; you just have to use CoreAnimation
you can probably determine which event model you are given, btw, by figuring out what type of PluginWindow you have
Sinisa 22:12 it wasn't in windows too ;-) but at least windows gives you a hwnd, and you can flush all the content directly into it - regardless where that hwnd is, if it's clipped, half-visible, fully visible...
taxilian 22:12 yeah, but you can't do hardware acceleration windowless like you (usually) can on mac
Sinisa 22:12 I actually managed on OSX to flush gl content onto browser window, in limited area and have the rest of browser function properly
BUT - i could not change pivot point of that content
taxilian 22:12 I don't even know what that means :-P
Sinisa 22:12 it means I could draw with gl without swapping into CG/CA, on browser window
but, i could draw it only at bottom-left corner of the browser window
i could not change where bottom-left corner (destination) will be
taxilian 22:12 yeah
Sinisa 22:12 so it is possible to draw directly
without copy-to-cg/ca
taxilian 22:12 that's a browser limitation for historical reasons
oh, really?
interesting
Sinisa 22:12 yes
i initialized agl context, and bound it to browser, but limited flushing area
taxilian 22:12 you might be able to use the clipping rect, etc, to manually figure out where the bottom left corner should be
Sinisa 22:12 however I could not move that area around the window
taxilian 22:12 wait, is that on firefox?
Sinisa 22:12 yes
taxilian 22:12 oh
yeah, you can do it on firefox
it'll be effectively windowed
i.e. doesn't participate in the DOM order
but that method won't work on Safari or Chrome
Sinisa 23:12 yeah
taxilian 23:12 because you're in a different process
so that's the method that I think amackera uses on firefox, and then on chrome and safari he uses CoreAnimation
and has to do the swapping on 10.5 in chrome, since that doesn't support coreanimation
btw, you can use this for easier casting of PluginWindow: http://www.firebreath.org/display/documentation/class%20FB%20PluginEventSource%20get_as
Sinisa 23:12 apple should do something about this, having 2 event methods, and 4 (!?) drawing methods - that's not standard... that's a mess!
taxilian 23:12 and this to check the type: http://www.firebreath.org/display/documentation/class FB PluginEventSource validType
well, the're working on standardizing it
Sinisa 23:12 ok thanks
taxilian 23:12 Firefox 4 will support CoreAnimation
and they will all be cocoa going forward
it's just that you still have to support the old way while they switch to something that's good
that's the problem that has been plaguing plugin devs for years
anyway, I gotta go to bed now
11pm here
Sinisa 23:12 yeah, but still, this is OSX version 10.6... soon 10.7.... it should already be standard long time ago.
ok man
taxilian 23:12 you'd think
Sinisa 23:12 take care
taxilian 23:12 I'll not be online tomorrow, it's Sunday for me (day for church and family), but I'll be back on Monday
you too
good luck