diff options
| -rwxr-xr-x | rotord/src/libavwrapper.cpp | 6 | ||||
| -rw-r--r-- | rotord/src/nodes_drawing.h | 22 | ||||
| -rwxr-xr-x | rotord/src/rotor.cpp | 2 |
3 files changed, 16 insertions, 14 deletions
diff --git a/rotord/src/libavwrapper.cpp b/rotord/src/libavwrapper.cpp index 180032d..b97467b 100755 --- a/rotord/src/libavwrapper.cpp +++ b/rotord/src/libavwrapper.cpp @@ -371,8 +371,8 @@ int libav::decoder::seekToFrame(int targetFrameIndex) return -1; avcodec_flush_buffers(pCtx); - if (! readNextFrame(targetFrameIndex)) - return -1; + //if (! readNextFrame(targetFrameIndex)) + // return -1; return targetFrameIndex; } @@ -911,7 +911,7 @@ bool libav::exporter::record(std::string filename){ video_st = NULL; audio_st = NULL; - fmt->video_codec=AV_CODEC_ID_MPEG4; + fmt->video_codec=AV_CODEC_ID_H264; //AV_CODEC_ID_MPEG4 if (fmt->video_codec != AV_CODEC_ID_NONE) { video_st = add_stream(oc, &video_codec, fmt->video_codec); diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h index 497fa25..d91ad87 100644 --- a/rotord/src/nodes_drawing.h +++ b/rotord/src/nodes_drawing.h @@ -41,25 +41,27 @@ namespace Rotor { } private: }; - class Hello_draw: public Draw_node { + class Text: public Draw_node { public: - Hello_draw(){ - //no title or description as it isn't intended for the user + Text(){ + title="Text"; + description="Draws text"; + create_attribute("text","Text to draw","Text","hello, world!"); }; - Hello_draw(map<string,string> &settings) { + Text(map<string,string> &settings):Text() { base_settings(settings); }; - ~Hello_draw(){}; - Hello_draw* clone(map<string,string> &_settings) { return new Hello_draw(_settings);}; + ~Text(){}; + Text* clone(map<string,string> &_settings) { return new Text(_settings);}; void vector_output(cairo_t * cr,const Frame_spec &frame){ cairo_text_extents_t te; - cairo_set_source_rgb (cr, 1.0, 0.0, 0.0); + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); cairo_select_font_face (cr, "Georgia", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); - cairo_set_font_size (cr, 50); - cairo_text_extents(cr, "hello, world!", &te); + cairo_set_font_size (cr, 250); + cairo_text_extents(cr, attributes["text"]->value.c_str(), &te); cairo_move_to (cr,(frame.w-te.width)/2,(frame.h-te.height)/2); - cairo_show_text (cr, "hello, world!"); + cairo_show_text (cr, attributes["text"]->value.c_str()); cairo_fill(cr); } private: diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp index 23f82d7..616e128 100755 --- a/rotord/src/rotor.cpp +++ b/rotord/src/rotor.cpp @@ -34,7 +34,7 @@ Node_factory::Node_factory(){ add_type("random",new Random()); //nodes_drawing.h add_type("shape",new Shape()); - add_type("hello",new Hello_draw()); + add_type("text",new Text()); add_type("waves",new Waves()); //nodes_filters.h add_type("blur",new Blur()); |
