NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/libs/ds3d/dataloader/lidarsource/lidar_file_source_impl.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DS3D_DATALOADER_LIDARSOURCE_LIDAR_FILE_SOURCE_IMPL_H
19 #define _DS3D_DATALOADER_LIDARSOURCE_LIDAR_FILE_SOURCE_IMPL_H
20 
21 #include "lidar_file_source.h"
22 #include "lidar_file_config.h"
23 #include "ds3d/common/hpp/profiling.hpp"
24 #include "ds3d/common/impl/impl_frames.h"
25 #include "ds3d/common/helper/memdata.h"
26 #include "ds3d/common/helper/cuda_utils.h"
27 
28 namespace ds3d { namespace impl { namespace lidarsource {
29 
30 using MemPtr = std::unique_ptr<MemData>;
31 
42 class LidarFileSourceImpl : public SyncImplDataLoader {
43 public:
44  LidarFileSourceImpl() = default;
45  ~LidarFileSourceImpl() override = default;
46 
47 protected:
55  ErrCode startImpl(const std::string& content, const std::string& path) override;
64  ErrCode readDataImpl(GuardDataMap& datamap) override;
69  ErrCode flushImpl() final { return ErrCode::kGood; }
75  ErrCode stopImpl() override;
76 
77 private:
81  ErrCode reserveMem(
82  Ptr<BufferPool<MemPtr>>& pool, size_t memSize, uint32_t count, const std::string& name);
83 
84  Ptr<BufferPool<MemPtr>> _bufMem;
85  std::vector<uint8_t> _tmpStrideBuf;
86  Ptr<MemData> _cpuSwapBuf;
87  Config _config;
88  profiling::FileReader _dataReader;
89  uint32_t _bytesPerFrame = 0;
90  uint32_t _bytesStrideFrame = 0;
91  uint32_t _totalNumFrames = 0;
92  uint32_t _totalFrameDuration = 0;
93  uint32_t _readFrameCount = 0;
94  bool _isFirstFrame = true;
95 };
96 
97 }}}
98 
99 #endif
ds3d::impl::lidarsource::LidarFileSourceImpl::stopImpl
ErrCode stopImpl() override
Stop and close all resources.
ds3d::impl::lidarsource::LidarFileSourceImpl::LidarFileSourceImpl
LidarFileSourceImpl()=default
ds3d::BufferPool
Definition: sources/includes/ds3d/common/helper/safe_queue.h:89
ds3d::impl::lidarsource::LidarFileSourceImpl::~LidarFileSourceImpl
~LidarFileSourceImpl() override=default
ds3d::ErrCode::kGood
@ kGood
lidar_file_source.h
ds3d::ErrCode
ErrCode
Definition: sources/includes/ds3d/common/common.h:47
ds3d::impl::lidarsource::LidarFileSourceImpl::readDataImpl
ErrCode readDataImpl(GuardDataMap &datamap) override
Read a frame, create new output datamap and fill the frame into it.
ds3d::impl::lidarsource::LidarFileSourceImpl::flushImpl
ErrCode flushImpl() final
flush all frames, Implementation of this function could be skipped.
Definition: 9.1/sources/libs/ds3d/dataloader/lidarsource/lidar_file_source_impl.h:69
ds3d::Ptr
ShrdPtr< T > Ptr
Definition: sources/includes/ds3d/common/hpp/obj.hpp:37
lidar_file_config.h
ds3d::impl::lidarsource::Config
Definition: sources/libs/ds3d/dataloader/lidarsource/lidar_file_config.h:36
ds3d::impl::lidarsource::LidarFileSourceImpl::startImpl
ErrCode startImpl(const std::string &content, const std::string &path) override
Parse yaml config content and prepare all of the resource ready to fill into each frame datamap.
ds3d::impl::lidarsource::MemPtr
std::unique_ptr< MemData > MemPtr
Definition: sources/libs/ds3d/dataloader/lidarsource/lidar_file_source_impl.h:30
ds3d
Definition: sources/includes/ds3d/common/abi_dataprocess.h:25
ds3d::profiling::FileReader
Definition: sources/includes/ds3d/common/hpp/profiling.hpp:115