From 31d5bb487a6a245c80fb2154a8eca99c9ff4e6e6 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 12 Apr 2013 16:38:41 +0100 Subject: recovering from compiler NIGHTMARE trying to make static libs: don't forget ldconfig --- rotord/Makefile | 6 ++++-- rotord/ValgrindOut.xml | 51 -------------------------------------------------- rotord/rotor.cpp | 16 +++++++++------- rotord/rotor.h | 20 +++++++++++--------- rotord/vampHost.cpp | 18 +++++++++--------- 5 files changed, 33 insertions(+), 78 deletions(-) delete mode 100644 rotord/ValgrindOut.xml diff --git a/rotord/Makefile b/rotord/Makefile index d153562..6a7f48b 100644 --- a/rotord/Makefile +++ b/rotord/Makefile @@ -1,10 +1,12 @@ # The pre-processor and compiler options. -MY_CFLAGS = -fpermissive -std=c++11 -Wno-error +MY_CFLAGS = -fpermissive -std=c++11 -Wno-error # -I ../ffmpeg # The linker options. -MY_LIBS = -lPocoNet -lPocoXML -lPocoUtil -lPocoFoundation -lvamp-hostsdk -lsndfile -L /usr/local/lib -lavcodec -lavutil -lavformat -lavfilter -lavdevice +MY_LIBS = -lPocoNet -lPocoXML -lPocoUtil -lPocoFoundation -lvamp-hostsdk -lsndfile -L /usr/local/lib -lavcodec -lavformat -lavfilter -lavdevice -lavutil +#MY_LIBS = ../libavcodec/ffmpeg/libavcodec/libavcodec.a ../libavcodec/ffmpeg/libavutil/libavutil.a ../libavcodec/ffmpeg/libavformat/libavformat.a ../libavcodec/ffmpeg/libavfilter/libavfilter.a ../libavcodec/ffmpeg/libavdevice/libavdevice.a -lPocoNet -lPocoXML -lPocoUtil -lPocoFoundation -lvamp-hostsdk +#GAH! HARD! # The pre-processor options used by the cpp (man cpp for more). CPPFLAGS = -Wall diff --git a/rotord/ValgrindOut.xml b/rotord/ValgrindOut.xml deleted file mode 100644 index f0b4b6d..0000000 --- a/rotord/ValgrindOut.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - -4 -memcheck - - - Memcheck, a memory error detector - Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. - Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info - Command: rotord - - -21214 -18095 -memcheck - - - - /usr/bin/valgrind.bin - --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp - --leak-check=yes - --xml=yes - --xml-file=ValgrindOut.xml - - - rotord - - - - - - RUNNING - - - - - - FINISHED - - - - - - - - - - - diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index 2da6a8b..e0c91dd 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -256,7 +256,7 @@ Command_response Render_context::session_command(const std::vector& if (state==IDLE) { output_filename=command[3]; if (command.size()>3) { - output_framerate=ofToFloat(command[4]); +// output_framerate=ofToFloat(command[4]); } add_queue(RENDER); response.status=HTTPResponse::HTTP_OK; @@ -378,7 +378,7 @@ bool Render_context::load_audio(const string &filename,vectorbit_rate = 400000; /* resolution must be a multiple of two */ c->width = 640; - c->height = 250; + c->height = 480; /* frames per second */ c->time_base= (AVRational){1,25}; c->gop_size = 10; /* emit one intra frame every ten frames */ c->max_b_frames=1; c->pix_fmt = PIX_FMT_YUV420P; //AV_PIX_FMT_RGB24 - AVDictionary *options; + AVDictionary *options; //= NULL; causes a forward declaration error!? + options=NULL; /* open it */ if (avcodec_open2(c, codec, &options) < 0) { @@ -685,7 +686,7 @@ bool Video_output::render(const float duration, const float framerate,const stri picture->linesize[2] = c->width / 2; /* encode 1 second of video */ - for(i=0;i<25;i++) { + for(i=0;i<250;i++) { fflush(stdout); /* prepare a dummy image */ /* Y */ @@ -728,10 +729,11 @@ bool Video_output::render(const float duration, const float framerate,const stri free(picture_buf); free(outbuf); + avcodec_close(c); av_free(c); av_free(picture); printf("\n"); return true; -} \ No newline at end of file +} diff --git a/rotord/rotor.h b/rotord/rotor.h index 4bba577..9f0c2e3 100755 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -73,15 +73,17 @@ using Poco::Net::HTTPResponse; extern "C" { - #include "libavcodec/avcodec.h" - #include "libavformat/avformat.h" - #include "libavutil/opt.h" - #include "libavutil/channel_layout.h" - #include "libavutil/common.h" - #include "libavutil/imgutils.h" - #include "libavutil/mathematics.h" - #include "libavutil/samplefmt.h" - + #include + #include + #include + #include + #include + #include + #include + #include + + #include + //#include stops the compiler error but causes a linker error. does libavcodec need to be statically linked? #include #include //#include diff --git a/rotord/vampHost.cpp b/rotord/vampHost.cpp index 2713e38..56d57db 100644 --- a/rotord/vampHost.cpp +++ b/rotord/vampHost.cpp @@ -714,14 +714,14 @@ bool vampHost::Analyser::init(const string &soname,const string &id,const int &_ in_block=0; blocks_processed=0; currentStep=0; - + featureNo=1; return true; } void vampHost::Analyser::process_frame(uint8_t *data,int samples_in_frame){ int sample=0; - + //process the whole frame which may be f>1getIdentifier()<<" processed block "<process(plugbuf, rt); - + for (unsigned int i = 0; i < feat[outputNo].size(); ++i) { features[((float)feat[outputNo][i].timestamp.sec)+(((float)feat[outputNo][i].timestamp.nsec)*.000000001)]=featureNo; featureNo++; } - + //shunt it down for (int i=0;iprocess(plugbuf, rt); - + for (unsigned int i = 0; i < feat[outputNo].size(); ++i) { features[((float)feat[outputNo][i].timestamp.sec)+(((float)feat[outputNo][i].timestamp.nsec)*.000000001)]=featureNo; featureNo++; -- cgit v1.2.3