DamonOehlman / videoproc

Draw video frames to a canvas and analyse / modify pixel data
10 stars 1 forks source link

How to destroy a videoprocessor #10

Open balupton opened 10 years ago

balupton commented 10 years ago

I'd like to be able to switch a videprocessor from a grayscale filter to a blue filter (I've already coded up the blue filter).

However I'm unsure how I destroy the videoproc instance to make way for the new videoproc instance with the new filter.

DamonOehlman commented 10 years ago

Good question - I'll need to implement something to allow a video proc to be cleanup properly.

With regards to changing filters, would you prefer to be able to leave the videoproc instance around and clear existing filters and add a new one instead of going through reinitialization again?

balupton commented 10 years ago

With regards to changing filters, would you prefer to be able to leave the videoproc instance around and clear existing filters and add a new one instead of going through reinitialization again?

That would be ideal.

Good question - I'll need to implement something to allow a video proc to be cleanup properly.

That would be needed eventually...

DamonOehlman commented 10 years ago

Yeah, I'll leave this issue open until the cleanup stuff is taken care of.

I have exposed the filters array from the processor returned from the videoproc call. Direct manipulation of the processor.filters should change how filters are applied, e.g.:

processor.filters = [ require('bluefilter'); ];

NOTE: At this stage you can't modify processor.filter but I might add an attribute that does simply replace the contents of the filters array so you get this functionality too....