24
24
#include < vrs/IndexRecord.h>
25
25
26
26
namespace rerun_vrs {
27
+ struct FrameNumberDataLayout : public vrs ::AutoDataLayout {
28
+ vrs::DataPieceValue<uint64_t > frameNumber{" frame_number" };
29
+
30
+ vrs::AutoDataLayoutEnd endLayout;
31
+ };
32
+
27
33
RerunFramePlayer::RerunFramePlayer (vrs::StreamId id, rerun::RecordingStream& rec)
28
34
: id_{id}, rec_{rec} {}
29
35
@@ -34,29 +40,26 @@ namespace rerun_vrs {
34
40
return false ;
35
41
36
42
rec_.set_time_seconds (" timestamp" , record.timestamp );
43
+ if (record.recordType == vrs::Record::Type::DATA) {
44
+ auto & config = getExpectedLayout<FrameNumberDataLayout>(layout, blockIndex);
45
+ uint64_t frame_number;
46
+ if (config.frameNumber .get (frame_number))
47
+ rec_.set_time_sequence (" frame_number" , frame_number);
48
+ }
37
49
38
- /* std::cout << "onDataLayoutRead " << std::endl; */
39
- std::ostringstream buffer;
40
- layout.printLayoutCompact (buffer);
41
- /* std::cout << buffer.str() << std::endl; */
42
50
// TODO write this information to a markdown file
51
+ /* std::ostringstream buffer; */
52
+ /* layout.printLayoutCompact(buffer); */
53
+ /* std::cout << buffer.str() << std::endl; */
43
54
44
- // TODO figure out image width and height ?
45
-
46
- /* descriptions_.setDescription(record.recordType, blockIndex, text); */
47
- /* if (firstImage_ && record.recordType == Record::Type::CONFIGURATION) { */
48
- /* vrs::DataPieceString* deviceType =
49
- * layout.findDataPieceString("device_type"); */
50
- /* if (deviceType != nullptr) { */
51
- /* widget_->setDeviceType(deviceType->get()); */
52
- /* } */
53
- /* } */
54
55
return true ; // read next blocks, if any
55
56
}
56
57
57
58
bool RerunFramePlayer::onImageRead (
58
- const vrs::CurrentRecord& record, size_t /* blockIndex*/ , const vrs::ContentBlock& contentBlock
59
+ const vrs::CurrentRecord& record, size_t /* blockIndex*/ ,
60
+ const vrs::ContentBlock& contentBlock
59
61
) {
62
+ /* std::cout << "onImageRead" << std::endl; */
60
63
/* std::cout << "onImageRead" << std::endl; */
61
64
const auto & spec = contentBlock.image ();
62
65
std::shared_ptr<vrs::utils::PixelFrame> frame;
0 commit comments