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
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)
8 - find_package(tide QUIET)
10 - include_directories(${Tide_INCLUDE_DIRS})
11 - add_definitions(${Tide_DEFINITIONS})
12 + find_package(tawara QUIET)
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
20 + ${Tawara_LIBRARIES})
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
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>
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(),
62 block->push_back(frame_ptr);
63 cluster_->push_back(block);
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_);
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_);
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
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");
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
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
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())));
129 // Set up a callback to get clouds from a grabber and write them to the
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();
140 std::string filename_;
142 std::fstream stream_;
143 - tide::FileCluster::Ptr cluster_;
144 + tawara::FileCluster::Ptr cluster_;
145 bpt::ptime seg_start_;
146 bpt::ptime cltr_start_;
148 @@ -245,30 +245,30 @@
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)
160 std::cerr << "File does not begin with an EBML header.\n";
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)
169 - std::cerr << "Specified EBML file is not a Tide document.\n";
170 + std::cerr << "Specified EBML file is not a Tawara document.\n";
173 - if (ebml_el.read_version() > tide::TideEBMLVersion)
174 + if (ebml_el.read_version() > tawara::TawaraEBMLVersion)
176 - std::cerr << "This Tide document requires read version " <<
177 + std::cerr << "This Tawara document requires read version " <<
178 ebml_el.read_version() << ".\n";
181 - if (ebml_el.doc_read_version() > tide::TideVersionMajor)
182 + if (ebml_el.doc_read_version() > tawara::TawaraVersionMajor)
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";
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)
198 std::cerr << "Segment element not found\n";
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 @@
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)
220 std::cerr << "Tracks element not at indicated position.\n";
224 - tide::Tracks tracks;
225 + tawara::Tracks tracks;
227 // Now we can introspect the tracks available in the file.
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
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)
237 bpt::time_duration blk_offset(bpt::microseconds((
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;
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
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>
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),
267 @@ -248,7 +248,7 @@ class Player
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)