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