]> git.pld-linux.org Git - packages/pcl.git/blob - pcl-tawara.patch
- added fz_api patch, enable Fotonic FZ API support
[packages/pcl.git] / pcl-tawara.patch
1 --- pcl-pcl-1.7.0/tools/CMakeLists.txt.orig     2013-09-15 20:30:42.553276043 +0200
2 +++ pcl-pcl-1.7.0/tools/CMakeLists.txt  2013-09-19 21:27:13.421963621 +0200
3 @@ -230,14 +230,14 @@
4    PCL_ADD_EXECUTABLE (pcl_transform_from_viewpoint ${SUBSYS_NAME} transform_from_viewpoint.cpp)
5    target_link_libraries (pcl_transform_from_viewpoint pcl_common pcl_io pcl_registration)
6  
7 -  find_package(tide QUIET)
8 -  if(Tide_FOUND)
9 -      include_directories(${Tide_INCLUDE_DIRS})
10 -      add_definitions(${Tide_DEFINITIONS})
11 +  find_package(tawara)
12 +  if(Tawara_FOUND)
13 +      include_directories(${Tawara_INCLUDE_DIRS})
14 +      add_definitions(${Tawara_DEFINITIONS})
15        PCL_ADD_EXECUTABLE(pcl_video ${SUBSYS_NAME} pcl_video.cpp)
16        target_link_libraries(pcl_video pcl_common pcl_io pcl_visualization
17 -          ${Tide_LIBRARIES})
18 -  endif(Tide_FOUND)
19 +          ${Tawara_LIBRARIES})
20 +  endif(Tawara_FOUND)
21    
22  
23  endif ()
24 --- pcl-pcl-1.7.0/tools/pcl_video.cpp.orig      2013-07-23 19:21:02.000000000 +0200
25 +++ pcl-pcl-1.7.0/tools/pcl_video.cpp   2013-09-19 21:29:01.191959097 +0200
26 @@ -36,13 +36,13 @@
27  
28  #include <iostream>
29  #include <string>
30 -#include <tide/ebml_element.h>
31 -#include <tide/file_cluster.h>
32 -#include <tide/segment.h>
33 -#include <tide/simple_block.h>
34 -#include <tide/tide_impl.h>
35 -#include <tide/tracks.h>
36 -#include <tide/track_entry.h>
37 +#include <tawara/ebml_element.h>
38 +#include <tawara/file_cluster.h>
39 +#include <tawara/segment.h>
40 +#include <tawara/simple_block.h>
41 +#include <tawara/tawara_impl.h>
42 +#include <tawara/tracks.h>
43 +#include <tawara/track_entry.h>
44  #include <pcl/point_cloud.h>
45  #include <pcl/point_types.h>
46  #include <pcl/io/openni_grabber.h>
47 @@ -74,12 +74,12 @@
48              // cluster's timecode measured in the segment's timecode scale.
49              bpt::ptime blk_start(bpt::microsec_clock::local_time());
50              bpt::time_duration blk_offset = blk_start - cltr_start_;
51 -            tide::BlockElement::Ptr block(new tide::SimpleBlock(1,
52 +            tawara::BlockElement::Ptr block(new tawara::SimpleBlock(1,
53                          blk_offset.total_microseconds() / 10000));
54              // Here the frame data itself is added to the block
55              pcl::PCLPointCloud2 blob;
56              pcl::toPCLPointCloud2(*cloud, blob);
57 -            tide::Block::FramePtr frame_ptr(new tide::Block::Frame(blob.data.begin(),
58 +            tawara::Block::FramePtr frame_ptr(new tawara::Block::Frame(blob.data.begin(),
59                          blob.data.end()));
60              block->push_back(frame_ptr);
61              cluster_->push_back(block);
62 @@ -106,7 +106,7 @@
63                  // Create a new cluster
64                  cltr_start_ = bpt::microsec_clock::local_time();
65                  bpt::time_duration cltr_offset = cltr_start_ - seg_start_;
66 -                cluster_.reset(new tide::FileCluster(
67 +                cluster_.reset(new tawara::FileCluster(
68                              cltr_offset.total_microseconds() / 10000));
69                  cluster_->write(stream_);
70              }
71 @@ -116,13 +116,13 @@
72          {
73              // Write the EBML PCLHeader. This specifies that the file is an EBML
74              // file, and is a Tide document.
75 -            tide::EBMLElement ebml_el;
76 +            tawara::EBMLElement ebml_el;
77              ebml_el.write(stream_);
78  
79              // Open a new segment in the file. This will write some initial meta-data
80              // and place some padding at the start of the file for final meta-data to
81              // be written after tracks, clusters, etc. have been written.
82 -            tide::Segment segment;
83 +            tawara::Segment segment;
84              segment.write(stream_);
85              // Set up the segment information so it can be used while writing tracks
86              // and clusters.
87 @@ -153,11 +153,11 @@
88              segment.info.writing_app("pcl_video");
89  
90              // Set up the tracks meta-data and write it to the file.
91 -            tide::Tracks tracks;
92 +            tawara::Tracks tracks;
93              // Each track is represented in the Tracks information by a TrackEntry.
94              // This specifies such things as the track number, the track's UID and the
95              // codec used.
96 -            tide::TrackEntry::Ptr track(new tide::TrackEntry(1, 1, "pointcloud2"));
97 +            tawara::TrackEntry::Ptr track(new tawara::TrackEntry(1, 1, "pointcloud2"));
98              track->name("3D video");
99              track->codec_name("pcl::PCLPointCloud2");
100              // Adding each level 1 element (only the first occurance, in the case of
101 @@ -183,7 +183,7 @@
102              // seconds being usable.
103              // The first cluster will appear at this point in the file, so it is
104              // recorded in the segment's index for faster file reading.
105 -            segment.index.insert(std::make_pair(tide::ids::Cluster,
106 +            segment.index.insert(std::make_pair(tawara::ids::Cluster,
107                          segment.to_segment_offset(stream_.tellp())));
108  
109              // Set up a callback to get clouds from a grabber and write them to the
110 @@ -195,7 +195,7 @@
111              // Start the first cluster
112              cltr_start_ = bpt::microsec_clock::local_time();
113              bpt::time_duration cltr_offset = cltr_start_ - seg_start_;
114 -            cluster_.reset(new tide::FileCluster(
115 +            cluster_.reset(new tawara::FileCluster(
116                          cltr_offset.total_microseconds() / 10000));
117              cluster_->write(stream_);
118              last_ = pcl::getTime();
119 @@ -224,7 +224,7 @@
120          std::string filename_;
121          std::string title_;
122          std::fstream stream_;
123 -        tide::FileCluster::Ptr cluster_;
124 +        tawara::FileCluster::Ptr cluster_;
125          bpt::ptime seg_start_;
126          bpt::ptime cltr_start_;
127          unsigned int count_;
128 @@ -247,26 +247,26 @@
129              // Open the file and check for the EBML header. This confirms that the file
130              // is an EBML file, and is a Tide document.
131              std::ifstream stream(filename_, std::ios::in);
132 -            tide::ids::ReadResult id = tide::ids::read(stream);
133 -            if (id.first != tide::ids::EBML)
134 +            tawara::ids::ReadResult id = tawara::ids::read(stream);
135 +            if (id.first != tawara::ids::EBML)
136              {
137                  std::cerr << "File does not begin with an EBML header.\n";
138                  return 1;
139              }
140 -            tide::EBMLElement ebml_el;
141 +            tawara::EBMLElement ebml_el;
142              ebml_el.read(stream);
143 -            if (ebml_el.doc_type() != tide::TideDocType)
144 +            if (ebml_el.doc_type() != tawara::TawaraDocType)
145              {
146                  std::cerr << "Specified EBML file is not a Tide document.\n";
147                  return 1;
148              }
149 -            if (ebml_el.read_version() > tide::TideEBMLVersion)
150 +            if (ebml_el.read_version() > tawara::TawaraEBMLVersion)
151              {
152                  std::cerr << "This Tide document requires read version " <<
153                      ebml_el.read_version() << ".\n";
154                  return 1;
155              }
156 -            if (ebml_el.doc_read_version() > tide::TideVersionMajor)
157 +            if (ebml_el.doc_read_version() > tawara::TawaraVersionMajor)
158              {
159                  std::cerr << "This Tide document requires doc read version " <<
160                      ebml_el.read_version() << ".\n";
161 @@ -278,13 +278,13 @@
162              // and read (or build, if necessary) an index of the level 1 elements. With
163              // this index, we will be able to quickly jump to important elements such
164              // as the Tracks and the first Cluster.
165 -            id = tide::ids::read(stream);
166 -            if (id.first != tide::ids::Segment)
167 +            id = tawara::ids::read(stream);
168 +            if (id.first != tawara::ids::Segment)
169              {
170                  std::cerr << "Segment element not found\n";
171                  return 1;
172              }
173 -            tide::Segment segment;
174 +            tawara::Segment segment;
175              segment.read(stream);
176              // The segment's date is stored as the number of nanoseconds since the
177              // start of the millenium. Boost::Date_Time is invaluable here.
178 @@ -298,18 +298,18 @@
179              // one will exist).
180              // We can guarantee that there is at least one in the index because
181              // otherwise the call to segment.read() would have thrown an error.
182 -            std::streampos tracks_pos(segment.index.find(tide::ids::Tracks)->second);
183 +            std::streampos tracks_pos(segment.index.find(tawara::ids::Tracks)->second);
184              stream.seekg(segment.to_stream_offset(tracks_pos));
185              // To be sure, we can check it really is a Tracks element, but this is
186              // usually not necessary.
187 -            id = tide::ids::read(stream);
188 -            if (id.first != tide::ids::Tracks)
189 +            id = tawara::ids::read(stream);
190 +            if (id.first != tawara::ids::Tracks)
191              {
192                  std::cerr << "Tracks element not at indicated position.\n";
193                  return 1;
194              }
195              // Read the tracks
196 -            tide::Tracks tracks;
197 +            tawara::Tracks tracks;
198              tracks.read(stream);
199              // Now we can introspect the tracks available in the file.
200              if (tracks.empty())
201 @@ -334,7 +334,7 @@
202              // reads blocks from the file on demand. This is usually a better
203              // option tham the memory-based cluster when the size of the stored
204              // data is large.
205 -            for (tide::Segment::FileBlockIterator block(segment.blocks_begin_file(stream));
206 +            for (tawara::Segment::FileBlockIterator block(segment.blocks_begin_file(stream));
207                      block != segment.blocks_end_file(stream); ++block)
208              {
209                  bpt::time_duration blk_offset(bpt::microseconds((
210 @@ -354,7 +354,7 @@
211                  // so there is only one frame per block. This is the general
212                  // case; lacing is typically only used when the frame size is
213                  // very small to reduce overhead.
214 -                tide::BlockElement::FramePtr frame_data(*block->begin());
215 +                tawara::BlockElement::FramePtr frame_data(*block->begin());
216                  // Copy the frame data into a serialised cloud structure
217                  pcl::PCLPointCloud2 blob;
218                  blob.height = 480;
219 --- pcl-pcl-1.7.0/tools/pcl_video.cpp.orig      2013-09-20 15:25:35.239248341 +0200
220 +++ pcl-pcl-1.7.0/tools/pcl_video.cpp   2013-09-20 19:03:40.298699215 +0200
221 @@ -36,6 +36,8 @@
222  
223  #include <iostream>
224  #include <string>
225 +#include <boost/uuid/random_generator.hpp>
226 +#include <boost/uuid/uuid.hpp>
227  #include <tawara/ebml_element.h>
228  #include <tawara/file_cluster.h>
229  #include <tawara/segment.h>
230 @@ -61,7 +63,7 @@
231      public:
232          Recorder(std::string const& filename, std::string const& title)
233              : filename_(filename), title_(title),
234 -            stream_(filename, std::ios::in|std::ios::out|std::ios::trunc),
235 +            stream_(filename.c_str(), std::ios::in|std::ios::out|std::ios::trunc),
236              count_(0)
237          {
238          }
239 @@ -246,7 +248,7 @@
240          {
241              // Open the file and check for the EBML header. This confirms that the file
242              // is an EBML file, and is a Tide document.
243 -            std::ifstream stream(filename_, std::ios::in);
244 +            std::ifstream stream(filename_.c_str(), std::ios::in);
245              tawara::ids::ReadResult id = tawara::ids::read(stream);
246              if (id.first != tawara::ids::EBML)
247              {
This page took 0.067735 seconds and 4 git commands to generate.