summaryrefslogtreecommitdiff
path: root/rotord
diff options
context:
space:
mode:
Diffstat (limited to 'rotord')
-rw-r--r--rotord/graph.cpp7
-rw-r--r--rotord/rendercontext.cpp1
-rwxr-xr-xrotord/rotor.h2
-rwxr-xr-xrotord/rotord.cpp79
-rwxr-xr-xrotord/rotord.h21
5 files changed, 10 insertions, 100 deletions
diff --git a/rotord/graph.cpp b/rotord/graph.cpp
index a6e1603..e3b0669 100644
--- a/rotord/graph.cpp
+++ b/rotord/graph.cpp
@@ -32,6 +32,13 @@ bool Graph::signal_render(string &signal_xml,const float framerate) {
return false;
}
bool Graph::video_render(const string &output_filename,const string &audio_filename,const float framerate,float& progress) {
+ vector<Node*> loaders=find_nodes("video_loader");
+ for (auto i:loaders){
+ if (!dynamic_cast<Video_loader*>(i)->isLoaded) {
+ cerr<<"Rotor: all loaders must be populated before rendering"<<endl;
+ return false;
+ }
+ }
if (find_node("video_output")) {
Video_output *video_output=dynamic_cast<Video_output*>(find_node("video_output"));
return video_output->render(duration,framerate,output_filename,audio_filename,progress,outW,outH);
diff --git a/rotord/rendercontext.cpp b/rotord/rendercontext.cpp
index c1ddf53..1e0fe1e 100644
--- a/rotord/rendercontext.cpp
+++ b/rotord/rendercontext.cpp
@@ -36,6 +36,7 @@ void Render_context::runTask() {
}
else {
//an error occurred: TODO have to clean up allocated data. autoptr?
+ cerr<<"Rotor: render failed"<<endl;
state=IDLE;
}
}
diff --git a/rotord/rotor.h b/rotord/rotor.h
index 93fab03..7409f19 100755
--- a/rotord/rotor.h
+++ b/rotord/rotor.h
@@ -641,10 +641,10 @@ namespace Rotor {
bool load(const string &filename);
Image *output(const Frame_spec &frame);
Video_loader* clone(map<string,string> &_settings) { return new Video_loader(_settings);};
+ bool isLoaded;
private:
libav::decoder player;
Image image;
- bool isLoaded;
};
class Video_cycler: public Image_node {
//cycles through video inputs in order
diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp
index 00872de..65ab6bd 100755
--- a/rotord/rotord.cpp
+++ b/rotord/rotord.cpp
@@ -1,73 +1,5 @@
#include "rotord.h"
-/*
-ultimately- audio analysis request will spawn a task - there will be another call that will check progress
-
-audio analysis will be saved - to a file? into a db?
-
-for now - dump analysis into the http request
-
-architecture - running rendering process
-
-main vamp library segmenter, beat detector
-
-http://127.0.0.1:9000/vamp/qm-vamp-plugins/qm-segmenter/01.wav
-
-Running plugin: "qm-segmenter"...
-Using block size = 26460, step size = 8820
-Plugin accepts 1 -> 1 channel(s)
-Sound file has 2 (will mix/augment if necessary)
-Output is: "segmentation"
-Done
-./rotord: symbol lookup error: /usr/local/lib/vamp/qm-vamp-plugins.so: undefined symbol: clapack_dgetrf
-
-http://www.codeproject.com/Articles/252827/Learning-Poco-A-simple-HTTP-server
-
-next:
-load a movie and retreive frames
-save a movie
-
-how do we deal with frames in libavcodec - can we request a frame by number
-how do we deal with resolution
-
-
-avcodec class
-what does it have to do?
-
--open files (could be video, audio, or both)
--process files i.e. thumbnail the audio or do audio analysis, make a no-keyframe proxy of a movie
--retrieve video frames (with caching- what's the best way to approach this)
-
-just for a quick think through: signal data is trivial: 1 floating point number per frame.
-to store a whole uncompressed video track for a 3 minute @ 720.25p in RGB \= 12GB
-caching the whole thing isn't a goer
-
-
-*/
-
-/*
-RotorRequestHandler::RotorRequestHandler(const std::string& format): _format(format){
-}
-
-void RotorRequestHandler::handleRequest(HTTPServerRequest& request,HTTPServerResponse& response) {
-
- Timestamp now;
- std::string dt(DateTimeFormatter::format(now, _format));
-
- response.setChunkedTransferEncoding(true);
- response.setContentType("text/html");
-
- std::ostream& ostr = response.send();
- ostr << "<html><head><title>RotorServer powered by "
- "POCO C++ Libraries</title>";
- ostr << "</head>";
- ostr << "<body><p style=\"text-align: center; "
- "font-size: 48px;\">";
- ostr << dt;
- ostr << "</p></body></html>";
-}
-*/
-
RenderContextHandler::RenderContextHandler(const std::string _content,const HTTPServerResponse::HTTPStatus _status){
content=_content;
status=_status;
@@ -90,7 +22,6 @@ void RenderContextHandler::handleRequest(HTTPServerRequest& request,HTTPServerRe
HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPServerRequest& request){
- cerr<<"starting http response block"<<endl;
Logger& logger = Logger::get("Rotor");
Poco::URI theuri=Poco::URI(request.getURI());
@@ -191,14 +122,8 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
}
sc.push_back(body);
- //Rotor::Command_response response=((Poco::AutoPtr<Rotor::Render_context>)task)->session_command(sc);
- cerr<<"calling render context refcount: "<<((Poco::AutoPtr<Rotor::Render_context>)task)->referenceCount()<<endl;
((Poco::AutoPtr<Rotor::Render_context>)task)->session_command(sc,XML,status);
- //this deadlocks after a render, why?
-
- //content=response.description;
- //status=response.status;
-
+
}
}
}
@@ -260,8 +185,6 @@ void RotorServer::handleHelp(const std::string& name, const std::string& value){
int RotorServer::main(const std::vector<std::string>& args){
if (!_helpRequested) {
-
-
unsigned short port;
xmlIO xml;
diff --git a/rotord/rotord.h b/rotord/rotord.h
index 819cfb6..2fb7808 100755
--- a/rotord/rotord.h
+++ b/rotord/rotord.h
@@ -69,27 +69,6 @@ using Poco::AutoPtr;
#include "rotor.h"
-/*
-class RotorRequestHandler: public HTTPRequestHandler
-{
- public:
- RotorRequestHandler(const std::string& format);
- void handleRequest(HTTPServerRequest& request,HTTPServerResponse& response);
- private:
-
- std::string _format;
-};
-
-class AudioAnalyserHandler: public HTTPRequestHandler
-{
- public:
- AudioAnalyserHandler(const vampHost::Settings& _settings);
- void handleRequest(HTTPServerRequest& request,HTTPServerResponse& response);
- private:
- vampHost::Settings settings;
-};
-*/
-
class RenderContextHandler: public HTTPRequestHandler
{