23 #include "retriever_thread.h"
25 #include <fvcams/camera.h>
26 #include <fvutils/ipc/shm_image.h>
27 #include <utils/time/tracker.h>
28 #include <fvutils/writers/seq_writer.h>
29 #include <fvutils/writers/jpeg.h>
30 #include <fvmodels/color/lookuptable.h>
35 using namespace fawkes;
36 using namespace firevision;
51 std::string cfg_name, std::string cfg_prefix)
52 :
Thread(
"FvRetrieverThread",
Thread::OPMODE_WAITFORWAKEUP),
56 cfg_prefix_ = cfg_prefix;
57 camera_string_ = camera_string;
58 set_name(
"FvRetrieverThread_%s", cfg_name_.c_str());
76 e.
append(
"FvRetrieverThread::init() failed");
81 if ( asprintf(&imgbufname,
"retriever_%s", cfg_name_.c_str()) == -1 ) {
82 throw Exception(
"Cannot allocate buffer name");
89 throw Exception(
"Shared memory segment not valid");
108 std::string save_path;
112 save_path = (
"recorded_images");
115 seq_writer->
set_path( save_path.c_str() );
125 if (
config->
get_bool(
"/firevision/retriever/use_time_tracker") ) {
127 __ttc_capture = __tt->
add_class(
"Capture");
128 __ttc_memcpy = __tt->
add_class(
"Memcpy");
129 __ttc_dispose = __tt->
add_class(
"Dispose");
138 for (
unsigned int u = 100; u < 150; ++u) {
139 for (
unsigned int v = 100; v < 150; ++v) {
140 ycm->
set(128, u, v, C_ORANGE);
144 __cam_has_timestamp_support =
true;
154 __cam_has_timestamp_support =
false;
190 if ( (++__loop_count % 200) == 0 ) {
198 if (__cam_has_timestamp_support) {