IRC Log Viewer » #firebreath » 2012-08-28

IRC Nick Time (GMT-7) Message
Xrymz 06:08 hi all
can i get usb device id by FireBreath?
dougma 06:08 Xrymz: sure.
Xrymz 06:08 how?
can u tell me how i can do that)
dougma 06:08 Firebreath is a framework for writing browser plugins.
but your plugin can do pretty much whatever you want.
so Firebreath can't help you get usb device id.
reichi 06:08 i guess that's not what he expected ;)
Nilsor 07:08 taxilian_away
Hi
nooo,
he's away.
that makes me a sad panda.
reichi 07:08 he should be around soon
it's like 7 am or so for him
he usually drops in in about an hour
johannes 07:08 you could also post your q / comment anyways, maybe others can help, too ... or become excited and stay around to see the answer :-D
Nilsor 07:08 okay well then
i want to trigger WM_PAINT on a windowless plugin when i want.
npn_invalidaterect and npn_forceredraw doesnt work.
at all.
taxilian 08:08 he left
Binbo 08:08 vlc plugin has a js API method which returning its own state (opening,playing etc). If i called that method asynchronously from firebreath let say for every 300-400 ms, does that affecting the video?
taxilian 09:08 how should I know? that's a vlc question
reichi 09:08 Binbo: why would you do that?
iirc recent vlc version raise proper events
when things change
(without any guarantee)
but this is definitley the wrong place, you should ask at #videolan ;)
chances are very low you'll find anyone who as a clue of the npapi plugin though
Binbo 09:08 reichi : I just want to get the change of state from within my firebreath plugin
bcoz it acts as a control plugin
reichi 09:08 that sounds wrong :/
Binbo 09:08 is there any proper method than polling?
since I dont want to let vlc plugin to do the thing
reichi 09:08 you could register your plugin on the events of the vlc plugin
which i would see as "more proper"
but your concept sounds weird :/
http://wiki.videolan.org/Documentation:WebPlugin#Root_object
here you can see all the events
and how to register handlers
you could implement the required event handling methods in your firebreath plugin and expose them to javascript
and then register them via invoke to your vlc browser plugin
but as said, the whole concept seems potentially broken to me
or conceptionally
Binbo 09:08 which concept?
reichi 09:08 using npapi to control another npapi
why would you do that?
;)
why not just use javascript to proxy the stuff, e.g.
Binbo 09:08 my firebreath plugin is also registering information to another machine (a management machine) using socket. One of those is the time taken for the video to load.
reichi 09:08 that takes a lot of crazyness out of your solution
Binbo 09:08 the reason i'm not using js is becoz it does not support multithreading
reichi 09:08 no
that's not what i mean
example
vlc = $.("#video)
vlc.addEventListener("MediaPlayerOpening", myCustomCallback, false)
function myCustomCallback(dunnoTheArgs){ $.('#firebreathPlugin').onMediaPlayerOpening(); }
whenever vlc changes something
your plugin will know
without things that are very very magical
you could still go the way i explained initially
and use the a proper invoke to register a method of your firebreath plugin as callback
Binbo 09:08 ohh did u mean makes js to signal the fb plugin? sorry my english is not good
reichi 09:08 yes
use javsascript to forward the vlc events
to your own plugin
Binbo 09:08 can it pass a value?
reichi 09:08 sure, why not?
$.('#firebreathPlugin').onMediaPlayerOpening("someRandomString", true, anotherFunction);
would work
for example
if your firebreath plugin can handle that
Binbo 09:08 thanks a lot! i'm going to learn and try it now
reichi 09:08 start with something simple
Binbo 09:08 ok =)
reichi 09:08 if you create a FB project you'll get some very primitive demo code
which is quite a good start imo
Binbo 09:08 haha after reading back ur example now I mostly understand on what are you trying to say =p
reichi 09:08 it's not mine
ah
that example
Binbo 09:08 example above =)
reichi 09:08 yeah, that's probably mine :)
taxilian 09:08 you could even have your FB plugin emit the javascript code if you wanted
Binbo 10:08 taxilian : is that mean I can protect it from being exposed ?
taxilian 10:08 once it's in the page, it's exposed
even if you happen to have compiled it into your dll code
Binbo 10:08 oh, "emit" = "write" ? I mean when client view the page source, does it shown ?
taxilian 10:08 in page source? no. however, once javascript is evaluated in the page context you can see it using browser tools
in the case of chrome, it'll be visible in the javascript debugging tools
Binbo 10:08 i see
so it basically protect it from average user =p
but great input!
reichi 10:08 oh man
that reminds me of some really crappy "javascript based security"
taxilian 10:08 you can protect it from the average user simply by minifying it, my friend
Binbo 10:08 may I know the link so I can refer?
lol
taxilian 10:08 !wiki evaluatejavascript
FireBreathBot 10:08 5 results found. Note: Results limited to 8
"class FB BrowserHost evaluateJavaScript": http://tinyurl.com/8r6466g
"class FB Npapi NpapiBrowserHost evaluateJavaScript": http://tinyurl.com/8hhrygj
"class FB BrowserHost evaluateJavaScript (2)": http://tinyurl.com/97mowzp
"class FB ActiveX ActiveXBrowserHost evaluateJavaScript": http://tinyurl.com/92w4koe
"Old Versions": http://tinyurl.com/9bsmpqg
taxilian 10:08 !lmgt minify javascript
links for both
.lmgt minify javascript
FireBreathBot 10:08 Let me google that for you: http://tinyurl.com/9mg5984
Binbo 10:08 thanks =)
reichi 10:08 ify ou want it to be magic you can still do it by using invoke, i think
taxilian 10:08 yeah; it's a little trickier, but it can be done all from c++
reichi 10:08 but i wouldn't start that way
as debugging will get a lot harder for you, too
but it's nice for hiding things ;)
Binbo 10:08 yeah i'm planning to use the js method first. Then I will do the invoke method if I got more time left =)
taxilian 10:08 lol
that's a good one
"time left" after finishing a project
LOL
Binbo 10:08 running out of time =p
reichi 10:08 rofl
i never heard of anyone suceeding in that task
+c
NEVER
nilsor 10:08 taxilian
taxilian 10:08 nilsor
nilsor 10:08 uuuh yeah
success!
hello, first of all
mh if you have some time id like to ask you something
since there is probably nobody around on the net even close to your knowledget about plugins
taxilian 10:08 I'll answer if I can
nilsor 10:08 thanks
to be honest, its not directly FB related
taxilian 10:08 incidentally, if you ask when I'm not around I can always have FireBreathBot save my response for you
and he'll tell you when you next say something in this channel
nilsor 10:08 ill promise to use FB with my next plugin
yet my current question is more a generic one
okay i got a windowless plugin
taxilian 10:08 as to triggering a WM_PAINT if it's a windowed plugin you just use the standard windows API calls
nilsor 10:08 arg
taxilian 10:08 if it's windowed
nilsor 10:08 it isnt
unfortunately
because i need to overla
y
taxilian 10:08 tell me what you've tried and what you're seeing
nilsor 10:08 okay summarized in very few sentences
im having a directshow graph renderd within my plugin
that needs to be windowless
casual dshow renderer does not support rendering in anything but a HWND
so i took up with a source code from another one that is around, rendered into a D2D surface
and modified it to work with a HDC instead of a HWND
taxilian 10:08 true, but you can render to a pixel buffer insetad
nilsor 10:08 yet it has to render every 40ms
and to finish
i can only render it within WM_PAINT in handleevent
cause else the HDC seems to be gone
taxilian 10:08 that is correct
nilsor 10:08 and im not able to re-trigger a WM_PAINT on my winless every 40ms
taxilian 10:08 first question: are you using FireBreath or no?
nilsor 10:08 i have to add that i use some old sample code
for this project, not
taxilian 10:08 why?
nilsor 10:08 will go with the next one
well
when i started with plugins i didnt know about FB
and put all my stuff into mozilla sdk samples
got used to it, well, like that
worked for all my plugins
except for this one
taxilian 11:08 fair enough, I suppose. this would just work if you were using FireBreath, though, and the examples I could give you would be easier to understand
directshow is running on another thread, correct?
nilsor 11:08 yes
but
i made Dshow pass the video data to me
over a callback i defined
taxilian 11:08 and are you trying to call NPN_InvalidateRect from that thread?
nilsor 11:08 no
im calling invalidate rect from a plugin thread
i started another thread
taxilian 11:08 okay
but it's not the main thread
nilsor 11:08 which calls it every 40s
yes
40ms
taxilian 11:08 that won't work
nilsor 11:08 for 25frames/s
i see
taxilian 11:08 you can only call NPN_ functions on the main thread
with only one or two exceptions
nilsor 11:08 thats a good hint
so
taxilian 11:08 so you'll have to get your call over to the main thread
nilsor 11:08 npn_async
blabla call
taxilian 11:08 FireBreath does this for you; you'll have to do it yourself
nilsor 11:08 dat firebreath
i have to try once.
taxilian 11:08 here is the kicker, though: Safari 5.1 and later on windows doesn't support NPN_PluginThreadAsyncCall
nilsor 11:08 oO
whatever, doesnt matter to me luckily
just using firefox
taxilian 11:08 it's also been known to not work properly on Opera
if you don't care about those, you're probably okay
nilsor 11:08 yep
taxilian 11:08 if you do, I can help you figure out the workaround
nilsor 11:08 its an integrated solution
taxilian 11:08 it involves using a message HWND
ok
nilsor 11:08 ah
taxilian 11:08 that should help
nilsor 11:08 another question just came up my mind
taxilian 11:08 it happens
nilsor 11:08 for debugging i use an old firefox version
3.5
because its debuggable with visual studio
taxilian 11:08 about:config search for ipc and turn it off
nilsor 11:08 i do not know why it only works with that version
taxilian 11:08 you can actually debug with other versions as well, you just need to connect to the correct process
!wiki debugging
FireBreathBot 11:08 8 results found. Note: Results limited to 8
taxilian 11:08 details should be on that page
FireBreathBot 11:08 "Debugging Plugins": http://tinyurl.com/3c4z6jy
"Building on Mac OS X": http://tinyurl.com/82cnrvf
nilsor 11:08 i have visual studio starting my firefox with the webpage
FireBreathBot 11:08 "Build Configurations": http://tinyurl.com/3gyqmz9
nilsor 11:08 so its already connected by default
FireBreathBot 11:08 "Logging": http://tinyurl.com/3vwtmwa
"Re: Debugging Plugins": http://tinyurl.com/7yv8g2l
taxilian 11:08 that won't work with ipc turned on; if you turn it off it will work, but test both ways 'cause sometimes ipc changes the timing
FireBreathBot 11:08 "Building on Windows": http://tinyurl.com/3hfm45t
taxilian 11:08 the reason it doesn't work is that firefox starts another process that your plugin runs in
it's usually best to start firefox yourself and then attach; even that won't work for debugging startup issues, though
nilsor 11:08 good ol plugin-container.exe i guess
FireBreathBot 11:08 "Using FireBreath": http://tinyurl.com/77o7w36
taxilian 11:08 yep
FireBreathBot 11:08 "Building on Linux": http://tinyurl.com/6uenz9z
taxilian 11:08 but as I said; you can turn that feature off by disabling ipc
nilsor 11:08 nice
again, another question came up my mind
hopefully the last
my work was based on mozilla sdk samples
i guess you know them
taxilian 11:08 yes
nilsor 11:08 with a winless sample
they render into a HDC
in CPlugin::handleEvent
from some research i saw
that after firefox 4
they render into a pixelmap
yet i didnt find any example
where they actually use it
i think they are all very outdated or i wasnt able to find them
so okay
that wasnt a question yet
do you use it in fb?
where to find a sample on that pixmap thingie
taxilian 11:08 I haven't seen any examples supporting a pixelmap; there is a proposal for an async drawing model that includes the ability to draw with a pixelmap; I don't know for sure if support has actually made it into firefox or not, but nobody else has committed to supporting it AFAIK
nilsor 11:08 okay so i probably that approach
*drop
so my only chance is to have a proper re-triggering of paint
taxilian 11:08 I have an example of doing that with an hDC if you want it, though
nilsor 11:08 well i think that wouldnt help me
since my problem is in maintaining a HDC
the rendering itself works fine on the HDC aslong its valid
taxilian 11:08 even with the pixelmap you'd have the same issue
nilsor 11:08 yeah
hehe
so ill try with asyncthreadplugin call
thank you already very much for your help!
are you doing FB alone? as lonesome developer?
taxilian 11:08 good luck
well, not entirely alone; many of those in this room slip in patches and minor fixes
but no other major developers have been active for over a year
nilsor 11:08 and is there potential to use it in a commercial manner?
taxilian 11:08 it's BSD licensed
so you can use it however you want
nilsor 11:08 so you get nothing apart from donations
taxilian 11:08 well, my last 3 or 4 jobs have been directly related to it, including the current one
but yes
I've thought of a few ways I could commercialize it, and I occasionally do subcontract work with it, but I dont' really have time
I'd love to rewrite quite a few parts of it to clean things up; cleaner drawing model (including a pixelmap type option) is high on my list of abstractions to add, but it's not important for what I'm doing commercially so I havent' found the time
nilsor 11:08 i see
i hope to get to work with it
taxilian 11:08 you're welcome to join the effort if you want ;-) it's less and less common to find people who understand the NPAPI underneith
that's the problem with success, I suppose; FireBreath works well enough that people don't need to know how it works :-P
nilsor 11:08 !
for me it'd be the other way around if i used it now
im used to using all the npn functions
taxilian 11:08 you would like FireBreath; it saves you a lot of hassle
but it is good to understand what is being covered
nilsor 11:08 you know, once you got used to it
i hope to migrate my current project into fb
when i got the time
taxilian 11:08 for most projects it isn't too bad
but I understand how that goes
nilsor 11:08 its btw not a commercial one but not my hobby project either
its part of a research project
funded by the european nation
taxilian 11:08 what are you doing with it?
nilsor 11:08 ah, video stuff
next generation hybrid media
taxilian 11:08 I caught that part from directshow =
=]
nilsor 11:08 :)
i dont know how much im allowed to tell
using plugins doesnt seem to much information
no magic involved with dshow either
taxilian 11:08 hehe. fair enough
nilsor 11:08 well, once we finish with our documents
they get released sooner or later anyways
http://hbbnext.eu/index.php
if i migrate parts to FB sooner or later, it will have a mention in a report
taxilian 11:08 ahh. looks interesting
people talk about how html5 video has removed the need for plugins that do video and I laugh and laugh
brb\
nilsor 11:08 !!
indeed
taxilian 11:08 some days I hate debugging problems in a multithreaded environment
(other days everything works and I don't have to)
nilsor 11:08 threads..
if something does not work and i have no clue why
i always assume its related to threads
and im mostly right
taxilian 11:08 hehe.
I have two threads that could both spawn an image processing command; they shouldn't ever be able to do so at the same time, but apparently they are managing anyway
since there is only one instance of the processor…. crashy crashy
nilsor 11:08 bang
threads..are so much fun.
not.
whats your task in your current job
taxilian 11:08 heh. that's a difficult question. I am a developer for GradeCam, Inc; my task? do whatever needs doing that nobody else is better qualified for with an emphasis on doing the things that I'm the best qualified for (such as fixing and adding features to the plugin, as I'm doing now)
nilsor 11:08 !wiki GradeCam
FireBreathBot 11:08 2 results found. Note: Results limited to 8
"FireBreath Home": http://tinyurl.com/4b2zp7h
"FireBreath Users": http://tinyurl.com/8eqkhg4
taxilian 11:08 gradecam.com
nilsor 11:08 yeah i found it
well
interesting
*cough*
haha!
okay
im out
thanks for your help
ill keep you updated!
JuanDaugherty 12:08 does fb use non-header boost?
taxilian 12:08 yes; threads and system both need compiled code
JuanDaugherty 12:08 thx, no reason not to use latest?
taxilian 12:08 that's what I'm using