IRC Log Viewer » #firebreath » 2012-12-10

IRC Nick Time (GMT-7) Message
jshanab 09:12 good morning everyone. I need a suggestion. I have a video player that allows you to specify a start and end and it exports a video clip. This takes a long time and I would like to allow the user to continue on. If they change the page, it wants to destroy the plugin. What is the best way to handle such a situation? Hand a URL to the browser and get it downloading?
taxilian 09:12 jshanab: there is no reliable way to do something like that in the browser in the background; you would probably have to launch an external process to handle it
well, I guess you could navigate to the url and have the browser download, yeah
jshanab 09:12 Thanks. is it possible for the plugin to live on after I leave the page and self detruct when it is done?
taxilian 09:12 no
jshanab 09:12 What if... I had a singleton class atttached to the static initialize and the plugin instance submits to the singlton.? I suppose both the from and too page would have to have a plugin. Probably work only on single process :-(
taxilian 09:12 the plugin may kill the process
the browser, I mean
jshanab 09:12 I guess at this point I have two a few chocies. Block the destruction until download is complete, cancel the download, submit to browser to handle for me
taxilian 09:12 blocking the destruction won't work; your process will be killed on some browsers
you could also launch another process
jshanab 09:12 I can? I didn't know that. seems a bit scary (security wise)
taxilian 09:12 well, be careful what you do with it
and to support IE you may need to add keys to the registry during install to allow it to launch in medium instead of low integrity
jshanab 09:12 Seems like the best thing to do is return the URL to JS and let it do a downlaod. Most cross-platform and cross-browser
taxilian 09:12 could be
jshanab 09:12 On a brighter note, I got the Mac version built and loaded. It pulls data and decodes it but crashes loading the .png for a texture ;-(
taxilian 09:12 hehe
jshanab 10:12 I am a bit unclear on adding the resources.
jshanab 10:12 Got it :-)
jshanab 10:12 how do i set up textures and other one time stuff in an openGL mac plugin. Is there something other than drawinCGLcontext to override or do i just use a firsttime flag?
taxilian 10:12 I have no idea
jshanab 10:12 I think i found it. it is not used in the basic media player example. Overloading copyCGLContextForPixelFormat. Odd name
taxilian 10:12 welcome to Cocoa =] odd names are the norm
jshanab 11:12 The only thing more fun is mixing it with c++ ;-) When i do, my .mm player, can the cocoa code see my c enums in the common header?
types and defines yes but object memebers requires a function call foo_>bar(). Are there friends in the cocoa world?
diorcety 12:12 hi
taxilian 12:12 g'morning
diorcety 12:12 I didn't find the another, if firebreath handle the shared_ptr of a const object? (disabling setter and non const function)?
taxilian 12:12 I'm sorry, I don't understand the question
diorcety 12:12 for exemple i want a const object actually i register only getter instead of getter/setter. does Firebreath know how handle boost::shared_ptr<const stuff> ?
taxilian 12:12 in what case? with JSAPI?
diorcety 12:12 yes
taxilian 12:12 do you have a code sample of what you're trying to do and doesn't seem to work?
diorcety 12:12 actually it is working. follow the fact that my object is constant or not i register getter/setter or getter... i'm wondering if there is better solution using boost::shared_ptr<const Object>... if firebreath handles that or not
taxilian 12:12 the only thing we use a shared_ptr for as far as JSAPI is concerned is referencing other JSAPI objects
if you want a read-only property just pass in null for the setter
or use registerAttribute
diorcety 12:12 ok that all that i want know
Added to this why it is mandatory to use VariantList for return value for a list (for getter for exemple)?
jshanab 13:12 I have modeled the player part of my plugin after the BasicMediaPlayer except i am trying to use ICA. I found that i still have to select FBMAC_USE_COREANIMATION to get it to compile but it is now setting the autoinvalidate rate. However it never calls my DrawInContext
taxilian 13:12 diorcety: it's been awhile since I last played with the return values; I think it was because you can't specialize a template based on the return value
hmm; that might not be it either. I don't remember exactly
but long story short it's not possible to set it up so that the return value can be any stl type of any of the allowed types; bascially it has to be a type that can be converted to an FB::variant
ahh, I remember; it's because when you get from variant to the page it has to be one of the types that we know.
so I could make it be any type, but it has to be one of a finite list of types, I can't do it based on just any type
diorcety 13:12 can you tell me the where is the code handling that?
taxilian 13:12 handling which exactly?
the JSAPIAuto stuff? or the conversion from variant to send into the page? or the conversion from one type to another in variant?
diorcety 13:12 variant to send into the pag
taxilian 13:12 NPVariantUtils
in NPAPICore
at least for NPAPI browsers
and for ActiveX:
jshanab 14:12 I test the BasicMediaPlayer and it works on Mac. My code does not. Is there a time limit from the point where you set autoInvalidate to the first time you are ready to draw. I cannot get it to call me back at all
jshanab 15:12 taxilian. I am having a tought time getting drawing on osx. I can'r get it to call the drawInCGLContext. Funny part is if I navigate away from the page, before the onWindowDetach is called, I get called back for a few times before it is destroyed. almost like something is dealocked
danzik17 15:12 quick question - am i using FB::variant_map_of correctly? pretty sure i am per the docs, but getting an error:
taxilian 16:12 jshanab: I don't know
danzik17: to be honest, I'm not sure; I don't think I've ever used variant_map_of
jshanab 16:12 taxilian. i am stepping thru PluginWindowMac. The timer is scheduled but It never fires.
jshanab 16:12 taxilian. I need to modify that statement. It is created but never scheduled
taxilian 16:12 huh
we've used it before...
jshanab 16:12 The BasicMediaPlayer works and IS using ICA. Something about "not on main thread" I am afraid. garbage in garbage out and i am feeding something garbage :-(
I am trying to find out where/who calls the scheduleTimer() func
i am thinking that somehow i maybe am using a default implementation in a base class instead of a derived class
danzik17 16:12 is there a way to return null/undefined to JS from a method an returning FB::VariantMap?
jshanab 16:12 taxilian. it looks like the timer and timer callback are not actually used. The breakpoints are not hit in BadicMediaPlayer. I do not know why it works, this is a bit confusing for me. I got one more thing to try before I give up for the work day
jshanab 17:12 taxilian. I Did figure out why it is not working for me. It is the requirement that the NStimer be on the same loop as that which created the context . the selector must also be on that same main thread. So i need to refactor after dinner. I don't know how that will effect my having multiple videos on a page. It seems like there needs to be a few more scheduled on main thread type things.
taxilian 18:12 I'm not sure