diff options
Diffstat (limited to 'rotord/src/rotor.h')
| -rw-r--r-- | rotord/src/rotor.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index 2d66d51..82d7f37 100644 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -90,6 +90,10 @@ Requirements #include "cvimage.h" #include "libavwrapper.h" +static std::string media_dir; +static std::string graph_dir; +static std::string output_dir; + //using namespace cv; namespace Rotor { //forward declarations @@ -243,13 +247,14 @@ namespace Rotor { attributes[_attr]=new Attribute(_desc,_title,_value,_vals); }; void create_attribute(string *alias,const string &_attr,const string &_desc,const string &_title,const string &_value,std::vector<std::string> _vals={}) { - attributes[_attr]=new Attribute(_desc,_title,_value,_vals); + create_attribute(_attr,_desc,_title,_value,_vals); alias=&(attributes[_attr]->value); }; void create_attribute(int *alias,const string &_attr,const string &_desc,const string &_title,const string &_value,std::vector<std::string> _vals={}) { - attributes[_attr]=new Attribute(_desc,_title,_value,_vals); + create_attribute(_attr,_desc,_title,_value,_vals); alias=&(attributes[_attr]->intVal); }; + virtual void init_attribute(const string &attr){}; string description; string type; string ID; @@ -492,6 +497,11 @@ namespace Rotor { logger.error("Video_loader failed to load "+filename); return false; } + void init_attribute(const string &attr){ + if (attr=="filename") { + load(media_dir+attributes[attr]->value); + } + }; Image *output(const Frame_spec &frame){ if (isLoaded){ float clipframerate=(parameters["framerate"]->value==0.0f?player.get_framerate():parameters["framerate"]->value); @@ -570,6 +580,7 @@ namespace Rotor { libav::video_decoder player; int lastframe; Image in1,in2,in2t,temp; //for blend frames; + string *filename; }; class Video_output: public Image_node { //Video_output 'presents' the output movie. Aspect ratio, bars, fadein/fadeout would happen here |
