NVIDIA DeepStream SDK API Reference

9.2 Release
sources/gst-plugins/gst-nvdsvideotemplate/ds-sparse4d/utils/dump_utils.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025-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 DUMP_UTILS_H
19 #define DUMP_UTILS_H
20 
21 #include <iostream>
22 #include <fstream>
23 #include <string>
24 #include "gstnvdsmeta.h"
25 #include "nvbufsurface.h"
26 #include "log_utils.h"
27 #include <sys/stat.h>
28 #include <unistd.h>
29 #include "tensor.h"
30 
46 void DumpNvBufSurface(NvBufSurface *in_surface,
47  NvDsBatchMeta *batch_meta,
48  const std::string& image_name,
49  guint frame_num,
50  GstVideoFormat video_fmt,
51  void*& scratch_nvbuf_surface,
52  bool batched_mode = true,
53  PrettyLogger* logger = nullptr);
54 
67 bool dump_tensor(const Tensor& tensor,
68  const std::string& image_name,
69  bool batched_mode = true,
70  PrettyLogger* logger = nullptr);
71 
72 #endif /* DUMP_UTILS_H */
DumpNvBufSurface
void DumpNvBufSurface(NvBufSurface *in_surface, NvDsBatchMeta *batch_meta, const std::string &image_name, guint frame_num, GstVideoFormat video_fmt, void *&scratch_nvbuf_surface, bool batched_mode=true, PrettyLogger *logger=nullptr)
Dumps NvBufSurface data to file.
PrettyLogger
Definition: sources/gst-plugins/gst-nvdsvideotemplate/ds-sparse4d/utils/log_utils.h:57
NvBufSurface
Holds information about batched buffers.
Definition: includes/nvbufsurface.h:602
tensor.h
log_utils.h
_NvDsBatchMeta
Holds information about a formed batch containing frames from different sources.
Definition: includes/nvdsmeta.h:264
Tensor
Structure to store tensor information.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/ds-sparse4d/utils/tensor.h:40
dump_tensor
bool dump_tensor(const Tensor &tensor, const std::string &image_name, bool batched_mode=true, PrettyLogger *logger=nullptr)
Dump tensor as a raw data file.
logger
Logger logger