NVIDIA DeepStream SDK API Reference

7.0 Release
gstnvtimesynch.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef __GST_NVTIMESYNC_H__
14 #define __GST_NVTIMESYNC_H__
15 
16 #include <gst/gst.h>
17 #include "nvstreammux.h"
18 #include "nvstreammux_batch.h"
19 #include "nvstreammux_pads.h"
20 #include <unordered_map>
21 #include <mutex>
22 
24 {
25 
26  public:
27  NvTimeSync(GstElement* el)
28  : plugin(el), pipelineLatency(0), upstreamLatency(0),
29  minFpsDuration(0),
30  segments(), mutex()
31  {}
32 
33 
35  void removing_old_buffer(BufferWrapper* buffer);
36 
49  void SetPipelineLatency(GstClockTime latency);
50 
55  void SetUpstreamLatency(GstClockTime latency);
56 
57  GstClockTime GetUpstreamLatency();
58 
59  GstClockTime GetCurrentRunningTime();
60 
61  void SetSegment(unsigned int stream_id, const GstSegment* segment);
62 
64 
66 
67 
68  uint64_t GetBufferRunningTime(uint64_t pts, unsigned int stream_id);
69 
70  private:
71  GstElement* plugin;
72  GstClockTime pipelineLatency;
73  GstClockTime upstreamLatency;
74  GstClockTime minFpsDuration;
75  GstClockTime bufferWasEarlyByTime;
76  std::unordered_map<unsigned int, GstSegment*> segments;
77  std::mutex mutex;
78 };
79 
80 
81 #endif
NvTimeSync::GetCurrentRunningTime
GstClockTime GetCurrentRunningTime()
nvstreammux.h
NvTimeSync::get_buffer_earlyby_time
NanoSecondsType get_buffer_earlyby_time()
NvTimeSync::NvTimeSync
NvTimeSync(GstElement *el)
Definition: gstnvtimesynch.h:27
BufferWrapper
Definition: nvstreammux_pads.h:92
NvTimeSync::GetUpstreamLatency
GstClockTime GetUpstreamLatency()
BUFFER_TS_STATUS
BUFFER_TS_STATUS
Definition: nvstreammux_pads.h:66
NvTimeSync::removing_old_buffer
void removing_old_buffer(BufferWrapper *buffer)
NvTimeSync::get_synch_info
BUFFER_TS_STATUS get_synch_info(BufferWrapper *buffer)
NvTimeSync::SetOperatingMinFpsDuration
void SetOperatingMinFpsDuration(NanoSecondsType min_fps_dur)
NvTimeSync::SetSegment
void SetSegment(unsigned int stream_id, const GstSegment *segment)
NvTimeSync::GetBufferRunningTime
uint64_t GetBufferRunningTime(uint64_t pts, unsigned int stream_id)
NanoSecondsType
std::chrono::duration< double, std::nano > NanoSecondsType
Definition: nvstreammux_pads.h:22
NvTimeSync::SetPipelineLatency
void SetPipelineLatency(GstClockTime latency)
Set the downstream latency Note: Currently the whole pipelineLatency value is used in timesynch logic...
NvTimeSync::SetUpstreamLatency
void SetUpstreamLatency(GstClockTime latency)
Set the upstream latency.
ISynchronizeBuffer
Definition: nvstreammux_pads.h:342
nvstreammux_batch.h
NvTimeSync
Definition: gstnvtimesynch.h:23
nvstreammux_pads.h