video - Draw on canvas from within C++ XPCOM code -


is possible draw on element c++ xpcom add-on? (long time ago probably) 1 object of nsidomcanvasrenderingcontext2d interface , use ti's method putimagedata_explicit in order draw image on canvas. nowadays, nsidomcanvasrenderingcontext2d hides , have no clue how achieve this.

in general - there way render video (let's obtained remote host) add-on on web-page?

any advice appreciated. thank

there putimagedata_explicit now. protected member.

  • you may cheat system , break encapsulation purposes, e.g. deriving , downcasting (and protected members yours).
  • or hard way, , use putimagedata while having mess around imagedata , errorresult.

downcasting protected member:

#include <string> #include <iostream>  class base {   protected:     std::string myname() {       return "base";     } }; class derived : public base {   public:     std::string myname() {       return base::myname();     } };  int main() {   base *base = new base();   derived* derived = static_cast<derived*>(base);   std::cout << derived->myname() << std::endl;   delete base;   return 0; } 

ps: works, because still holds true sizeof(base) == sizeof(derived). don't want modify size, e.g. adding data members or such, unless you're fan of segfault , heap corruption ;)


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -