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

IRC Nick Time (GMT-7) Message
tarang 00:07 hi..
taxilian 00:07 hi
tarang 00:07 how to add sqlite.h file in this plugins or in which file add
plz
taxilian 00:07 please forgive me if I'm being rude… but do you actually know c++?
tarang 00:07 ok
taxilian 00:07 that was a yes or no question; I don't think "ok" answers it =]
it was not intended to be a sarcastic or rhetorical question
I am trying to understand where you are coming from, because aparently my previous attempts to help you are not helping
tarang 00:07 yes
i know c++
taxilian 00:07 okay. I am likely not understanding your question, then; obviously you add sqlite.h with an #include statement
tarang 00:07 #include sqlite.h but error come not found sqlite.h.
but i also add this file
taxilian 00:07 where did you put the sqlite source relative to your project?
tarang 00:07 Header Files folder within Testplugins
taxilian 00:07 okay; it's probably easier if you avoid putting spaces in your folder names, but you can probably make it work anyway
!wiki libraries
FireBreathBot 00:07 8 results found. Note: Results limited to 8
"Using Libraries": http://goo.gl/cUVa6
"Re: Feedback": http://goo.gl/xZWWc
"Building on Mac OS X": http://goo.gl/iQ1mh
"Documentation To-Do": http://goo.gl/XzBGF
"Ideas": http://goo.gl/7QuAp
"FireBreath 1.5.0RC1 Released!": http://goo.gl/lppMa
"Helpful Links": http://goo.gl/vDlMu
"FireBreath 1.5.0 Released!": http://goo.gl/xzf0Y
taxilian 00:07 look at "Using Libraries"
include_directories is the command you put in your cmake files to add header file search paths
tarang 00:07 ok i just try
taxilian 00:07 the question you wanted to ask at the beginning was how to add include directories or how to add to the header search paths
I realize that it's hard working in a foreign language :-/ unfortunately unless your native language is Russian I can't help you much in that way
taxilian 00:07 well, it's after midnight here and I need some sleep
good luck
there is a lot of good information on the firebreath.org website; look around if you get stuck again
also look at the examples
both in the codebase and the ones linked to from the web page
someone-noone 02:07 hello!
someone-noone 02:07 Still trying to draw YUV frames on mac and still getting trouble.
Here is a code that i'm using: http://pastebin.com/Pk6FkMnv
And here is some results of drawing: http://cl.ly/2E3n2M0a0v3d0g2X2M2N http://cl.ly/1R3k29261i341K461m22 http://cl.ly/1m423r2F03422d3V3d45
dodo_ 02:07 i have built an npapi plugin using firebreath, i want to deploy this npapi as a chrome extension which i also managed to get working well. my plugin loads an external dll using loadlibrary on windows or dlopen in Mac the problem i have is that both loadlibrary and dlopen can't find my extranl dll even if it is the same directory where my firebreath plugin is. any ideas?
someone-noone 02:07 Also i put i breakpoint to check if data-varaible values are really random. Yes, it is.
So i see on the screen some mixable picture, but not 16x16 different pixels
I've read about that GL_TEXTURE_RECTANGLE_ARB is for textures that are having power-of-two dimension. So it looks like that problem is there, but my picture data is 16x16 (power of two), so it shouldn't be any problems here.
So, my goal is to see 16x16 different pixels on the screen, if someone have time, please help.
dodo_: can you show the code that you are trying to load library?
dodo_ 03:07 someone-noone: sure one sec
someone-noone: http://pastebin.com/HxRQCmGt
someone-noone: i do not specify full path expecting it to use same path as npapi
someone-noone 03:07 first, try to specify to full path. It will show you if the problem is in the path.
dodo_ 03:07 i did try full path
with full path it works fine
someone-noone 03:07 so, the problem is in the path
dodo_ 03:07 the problem is i do not know the full path when the extension is installed
someone-noone 03:07 likely, path is the path of browser executable
you can even check it(the real path of application), by calling some C function... forgot it name, but you may google for it
you, may also install your library to some system path on Windows
on mac you can put your library into bundle
read this article http://www.firebreath.org/display/documentation/Using+Libraries
dodo_ 03:07 on windows to puth it on windows path would require and external installation and admin privilege. my dll is packed inside the crx so i need to find a way to know the path to where the extension was deployed.
someone-noone 03:07 you may have access to %APPDATA%
but, actually i'm not windows specialist. But i know that this problem is solvable
dodo_ 03:07 so in Mac how would you do this? i want to pack my dylib library with my npapi plugin into a chome extension crx file
and get the npapu plugin to load the dylib library
and get the npapi plugin to load the dylib library
someone-noone 03:07 on mac you should put all libraries into Contents/Frameworks
in your bundle
and use install_name_tool to correct pathes
on windows you may specify path during installation of plugin if you don't want to use admin privelleges
dodo_ 03:07 sorry for this question waht/where is "Contents/Frameworks"?
someone-noone 03:07 in your bundle (your_plugin_name.plugin)
your_plugin_name.plugin/Contents/Frameworks
your_plugin_name.plugin is a simple directory
in finder you may right-click on it choose "Show package's content"
dodo_ 03:07 got it thanks
if i need to install drivers as well, how do you suggest i do this on Mac?
someone-noone 03:07 drivers = libraries?
what extension do they have?
if .a or .dylib, than yes
or even .Framework
dodo_ 03:07 .kext
its device drivers
that my npapi talks to
someone-noone 03:07 unfortunately, i don't know, because never used them. I've googled this http://grafikdesign.wordpress.com/2008/02/23/how-do-i-install-a-kext-file/, but i'm not sure that this technique is correct
someone-noone 06:07 I'm trying to run prep2010x64.cmd on my windows 7 virtual machine. I've shared the fb folder between two OS's. When i run the script i'm getting cmake error which is telling me that original path in CMakeCache (mac path) is not equal to current path (windows path)
linearray 06:07 deleted build directory
?
someone-noone 06:07 no
linearray 06:07 try that
someone-noone 06:07 but i will do it everytime i need to switch os
can i avoid this?
linearray 06:07 probably not at all
well
you can have two build dirs :)
someone-noone 06:07 it's an idea :)
someone-noone 09:07 taxilian: hello, have a minute?
taxilian 09:07 hey, whats up?
dodo_: you can get the path to the plugin dll and then use that to figure out where your other DLL is
someone-noone 09:07 can you look at my issue with open gl?
taxilian 09:07 is this windows or mac?
someone-noone 09:07 mac
taxilian 09:07 where are you getting plugin_width and plugin_height?
someone-noone 09:07 i did it before uint32_t plugin_width = CGRectGetWidth([self bounds]); uint32_t plugin_height = CGRectGetHeight([self bounds]);
just imagine that it is before that code
taxilian 09:07 I would add some logging or set a breakpoint and make sure that width and height is correct
someone-noone 09:07 also this code is a - (void)drawInCGLContext:(CGLContextObj)ctx pixelFormat:(CGLPixelFormatObj)pf forLayerTime:(CFTimeInterval)t displayTime:(const CVTimeStamp *)ts function
taxilian 09:07 if it's not that I really don't know; I don't actually know how to do opengl
never done it
someone-noone 09:07 it's correct
the problem is that i see "mix of colors", not 16x16 random pixels
taxilian 09:07 ahh. yeah, I haven't a clue
someone-noone 10:07 okay, then do you know another methods to draw YUV frames on browser?
with CG or QD
taxilian 10:07 in Mac? you could use CoreGraphics, sure
someone-noone 10:07 does it have any restrictions?
taxilian 10:07 like what?
someone-noone 10:07 like architecture
or performace penalties?
performance *
taxilian 10:07 nothing significant; you can only draw when instructed is the biggest one
but you can call invalidate to ask it to instruct you to draw
someone-noone 10:07 i guess that is ok
then, another question: mac plugin is windowless: am i rigth?
right*
taxilian 10:07 yes
though aparently Chrome ICA doesn't composit, so it may as well be windowed
just as an FYI
someone-noone 10:07 so i can't use with SDL...
taxilian 10:07 I've never used SDL, so I have no idea
if SDL can work in a "draw only when I tell you and draw to this CGContext" then you can
someone-noone 10:07 i can import NSWindow to SDl texture
but if there no NSWindow in plugin it doesn't have any sense
taxilian 10:07 you definitely don't get a NSWindow
someone-noone 10:07 so this way is impossible. Sorry for annoying, but i have one more :) : aren't windows plugins windowless?
another words: can import HWND to SDL_Surface
can i *
taxilian 10:07 windows plugins *can* be windowless
but dont' have to be
and generally aren't by default in FireBreath
someone-noone 10:07 this is good news
taxilian 10:07 I don't know of a reason that you wouldn't be able to do that
someone-noone 10:07 i don't need. Backwards i need windowed plugin
so i can pass HWND to SDL and it will do all work for me
taxilian 10:07 here is a rough example of how to draw with CoreGraphics
https://gist.github.com/1099740
that's using a normal RGB buffer, but you can probably do it with YUV instead
cf_scoped_ptr is not a normal class, just one I use for convenience sometimes
someone-noone 10:07 thanks
i hope it can YUV. Because converting to RGB, unfortunately, is forbidden for my tasl
task*
taxilian 10:07 well, in some cases you'll have to; if you use SDL it'll sometimes have to convert it
it'll just do it for you
possibly with a shader, possibly not
you can even find assembly code to do it in a more optimized fashion
FireBreathBot 10:07 Commit 1fcc879 on master by Jonathan "Duke" Leto: "Allow the project directory to be a symlink" http://goo.gl/8SWZA
Commit 4941b3d on master by Richard Bateman: "Merge pull request #27 from letolabs/symlinks
someone-noone 10:07 yeah
i need to use shaders, you're right
taxilian 10:07 it's actually not as expensive as most people assume to do the conversion; unless you've already benchmarked and seen that it's a problem, I wouldn't be that paranoid about it
someone-noone 10:07 probably the best way to solve my task is manually convert from YUV to RGB with shader and then draw
i've benchmarked it
taxilian 10:07 and what algorithm did you use?
someone-noone 10:07 ffmpeg sws_scale
i'm not sure which of them they're using, but i guess it's one of the fastest
taxilian 10:07 I'm not familiar with how that one works
one would hope
someone-noone 10:07 this function converts image from one type to another with scaling
taxilian 10:07 well, the shader approach is definitely not a bad one, but getting it to work on all machines can be painful
jshanab_wcw 10:07 If you get SDL-1.3 working, I wanna know about it!
someone-noone 10:07 also my goal is to be better than flash player, so i must it
i will get working SDL-1.3 on windows, probably or i will do it in a manual DirectX way
taxilian 10:07 the fastest way I know of to convert from YUV to RGB is to create three char[256] arrays; initialize them with the values for all possible inputs, then as you loop through you don't do any math, just lookups in arrays
so you do the math the first time when you init, but it's fast on the recurring
jshanab_wcw 10:07 I played with the shader, one thing that may be nice id nvidia's tool that compiles to different card outputs
I played with SDL-1.3 for days. Got it working great for short times and single usage, very fast. but it was randomly so unstable i had to rip it out :-(
someone-noone 10:07 taxilian: probably it's a good solution
taxilian 10:07 granted, it's quite possible that a shader would be faster, but hard to say
you could also do the same thing in assembly to get more speed
someone-noone 10:07 what does assembly mean? asm ?
taxilian 10:07 yes
someone-noone 10:07 i even can put these arrays to the graphic card
jshanab_wcw 10:07 Ther is a second performance bottleneck that can occur with/without the shader. with shader yuv is 2 bytes/pixel IO tot he card, RGBA is 4
someone-noone 10:07 Afaik, VRAM is faster then RAM
taxilian 10:07 well, it is when you're on the card; not sure if you're using that from the computer
someone-noone 10:07 jshanab_wcw: was you able to convert YUV to RGB? Or all your tries was ineffective?
on mac, on CA you can bind buffer on VRAM with opengl
jshanab_wcw 10:07 I have done the YUV to RGB 3 ways. DirectX surface to backbuffer in HW, SW_Scale, and opengl shader, in which I got one video only, I am doing mutiple vidos on a single page
someone-noone 10:07 but why are you doing it if SDL-1.3 can do it for you? Is it so buggy?
jshanab_wcw 10:07 sdl-1.3 gives you multiple windows instead of a single overlay like in 1.2. I could get 14 cameras on one page scroll it etc, but got to a singl camera and come back or start a second browser and SDL_Init() fails with access violatiions. I could not figure a way around it after 3+ days and the sdl list can be awfully quiet
someone-noone 10:07 you may do a hack
jshanab_wcw 10:07 I really wanted the sdl-1.3 route to work as it would help my later migrations to android, mac, etc.
someone-noone 10:07 let me think several minutes
forget it for mac :)
jshanab_wcw 10:07 The access violations were all over the place in the sdl code. I tried dll and static. etc
someone-noone 10:07 access violation when you're trying to SDL_Init ?
jshanab_wcw 10:07 I need to work on the mac port soon, but i have no harware. I installed snowleopard in Virtualbox on linux no problem but i cant get it to work in Vb or even Vmware on windows7
someone-noone 10:07 mac plugins are windowless, so you can't use SDL-1.3 for it
Actually, i was playing with SDL-1.2. And window can be created only on firefox
jshanab_wcw 10:07 YUP! No problem with the simple application, (that running moose thing on streaming textures) but when in my plugin I cannot get it to be stable. It may be because of the dependency it has on stderr and stdin( i was told)
someone-noone 10:07 what dependency?
jshanab_wcw 10:07 I do not understand what you mean by windowless, you mean there is no window handle so you have to create your own window?
someone-noone 10:07 nearly, there is no window handle and it cannot be created
tell me about stderr\stdin dependency?
jshanab_wcw 10:07 Some of the access violations were in the attempt to initialize the keyboard and input system. Even thought I was doing an SDL_Init(SDL_INIT_VIDEO)
So how do you draw in mac?
taxilian 10:07 jshanab_wcw: there are two different modes; you can use CoreGraphics, in which case all you get is a CGContextRef (no window) or you can use CoreAnimation (only on ff4+) and you get a CALayer but no NSView or window
someone-noone 10:07 you may tell also about QuickDraw and CAI :))
taxilian 10:07 QuickDraw does not exist
you will forget you ever heard of it please
someone-noone 10:07 :)
taxilian 10:07 ICA works pretty much just like CA but with an extra call to invalidate, so I lump it in with CA
someone-noone 10:07 jshanab_wcw: but why are you think that problem is in the stderr ?
at this moment i'm trying to draw with CA. But i've spent 1 week and have no result. There was a lot of different problems, the last one is the funniest :)
jshanab_wcw 10:07 Someine on the sdl list was suggesting that the access violation could be caused by windows not providing access to it while in a plugin. like I said i could not solve it after 3 days.
someone-noone 10:07 but after today's speak with taxilian i'll will try fast YUV to RGB conversation that he recommended to me
taxilian 10:07 jshanab_wcw: if that were the case you could create a child HWND inside the one the browser gives you and you'd have complete control of it
jshanab_wcw 10:07 I may play on wekend, but for now i was forced to remove it and move on :-(
someone-noone 10:07 use mercurial\git\subversion it may save your nerves
:)
taxilian 10:07 I ordered a computer (VM server) Wed night… all the parts will be here on Monday….except the CPI
CPU
grrr
jshanab_wcw 11:07 Taxilian. I tried that sperate child window. Still the same issue. i have begun to think that maybe using opengl and directx at the same time is a bit much for my video card
taxilian 11:07 you're running all the SDL stuff on a different thread, right?
jshanab_wcw 12:07 yup, 1 thread per video and I have them protected with mutexes. Seems to work great within a process, I may have to see if there needs to be a cross browser resource protection
s/cross browser/cross process/
taxilian 12:07 huh. yeah, I don't know
jshanab_wcw 12:07 I just had to move on for now. :-(
taxilian 12:07 anyone had any issues with Firefox 5.0.1 on mac?
someone-noone 16:07 when onDrawCG event is called?
every time it can draw on surface?
taxilian 16:07 whenever the browser tells us to draw
assuming you're handlign the CoreGraphicsDraw iwth that function
if you want it to get called you should call InvalidateWindow
someone-noone 16:07 actually calling it, but doesn't see any effect. wait, possible i should remove some old CA stuff...
taxilian 16:07 make sure you disable CA or it may choose that instead of CG
someone-noone 16:07 yeah, i did it in PluginConfig.cmake
taxilian 16:07 did you rerun the prep script?
someone-noone 16:07 no
okay :)
taxilian 16:07 changes to pluginconfig only take effect after you rerun prep
someone-noone 16:07 always forgetting)
made prepmac.sh, clean and build and still no effect
taxilian 16:07 you could also try deleting the build dir
someone-noone 16:07 i've put a breakpoint to my DrawCG event
taxilian 16:07 sometimes that helps
someone-noone 16:07 huh, ok
taxilian 16:07 but you may also be handling the event incorrectly or something
someone-noone 16:07 may be...
i've connected it in BEGIN_EVENT_TABLE
seems like all is fine :)
taxilian 16:07 pastebin it to me
the event table block
someone-noone 16:07 http://pastebin.com/TPMChBpH
taxilian 16:07 huh. looks like it should work to me
and you definitely have CG enabled in your pluginconfig?
someone-noone 16:07 yes
taxilian 16:07 dunno then
someone-noone 16:07 and disabled anothers
except Cocoa and Carbon :)
someone-noone 16:07 hm, after removing build it started to work correctly
taxilian 16:07 some changes just don't fully clean up, I guess
someone-noone 16:07 now, i see garbage instead of picture
code is that you've provided to me
http://pastebin.com/KV1eGiXd here is mine
vp->bitmap is rgb24 picture
is a problem in vp->bitmap?
or i again made a mistake?
taxilian 16:07 the CGBitmapContext is expecting a 32 bit rgbx
someone-noone 16:07 okay, will change it...
ah..i was thinking that 4*8 = 24.. haha :)
taxilian 16:07 not usually
only for really small values of 8
someone-noone 16:07 :)
this code seems to work wrong if image w\h is less than plugin
then plugin's width\height *
not less, but bigger
if image's w\h > plugin's w\h then i see corrupted image
if less, everything going fine
taxilian 16:07 strange; the code should scale it to the same size as the plugin
someone-noone 16:07 will make one more test to approve this
seems i was right
firing 17:07 Hey all I'm trying to do something really simple with my plugin: open a local program and write a text file to a folder on computer
What im trying to figure out is if I can just use the standard C++ methods
for example to write to a file: Import iostream and fstream in mypluginAPI.cpp
and then use ofstream myfile; myfile.open ...etc
?
taxilian 17:07 firing: in general, yes
but in IE you may have some trouble
because IE loads plugins in protected mode
so make sure you test with UAC mode on
someone-noone 17:07 finally, i did it!
RGB video player is completed
taxilian 17:07 someone-noone: well done =]
someone-noone 17:07 probably, i can do it now with CA
i found some additional mistakes
in the code that i seemd to work correct
taxilian 17:07 ahh
firing 17:07 o ok thanks. for some rsn im getting an error when i try it
taxilian 17:07 firing: what kind of error? and where are you trying to write?
and what os / browser
someone-noone 17:07 what about full screen in core graphics?
is it done manually?
taxilian 17:07 yes
someone-noone 17:07 sounds hopeful :)
firing 17:07 Im getting error in VB2010: 'ostream' is undefined
even though i imported
for win7/chrome
taxilian 17:07 that's a compiler error
you say you "imported"
what does that mean?
firing 17:07 sorry i meant i added #include iostream and fstream at begginigng
taxilian 17:07 okay; and did you use std::ostream or import the std namespace anywhere?
(btw, for those who don't know, you should never import a namespace in a .h file)
firing 18:07 No I did not do not. will try it. (new to c++ prog)
this is a cpp file btw (mypluginAPI.cpp)
taxilian 18:07 to use ostream, then, you need to do either std::ostream wherever you want to use it, add a "using std::ostream" line at the top, or add a "using namespace std" line at the top
compiler errors are not going to have anything to do with this being a plugin, as a general rule
someone-noone 18:07 CA unfortunately still have negative result
firing 18:07 O ok thanks!
someone-noone 18:07 i think i will forget for YUV 2 RGBA conversation for a while, i found how it can be done on shader so i will do it one day in future
now will focus to extend functionality of player and windows version
someone-noone 18:07 good night!
taxilian 18:07 sleep well =]
someone-noone 18:07 and thanks for help!