|
NVIDIA DeepStream SDK API Reference
|
7.1 Release
|
Go to the documentation of this file.
24 #ifndef __NVSTREAMMUX_H__
25 #define __NVSTREAMMUX_H__
28 #include <unordered_map>
58 pads_got_eos_and_empty_in_q = 0;
62 num_surfaces_per_frame = 1;
64 extra_throttle_wait_time = std::chrono::microseconds(0);
65 got_first_buffer =
false;
67 debug_iface = a_debug_iface;
75 batch_policy =
BatchPolicy(cfg, &inputs, debug_iface);
81 frame_num_reset_on_eos = reset;
85 frame_num_reset_on_stream_reset = reset;
387 std::unordered_map<unsigned int, SinkPad *> inputs;
390 unsigned int num_queues_empty;
391 unsigned int num_sources_idle;
392 unsigned int pads_got_eos_and_empty_in_q;
393 unsigned int num_pads_eos;
394 unsigned int num_surfaces;
395 std::condition_variable cv;
396 std::condition_variable cv_throttle_wait;
400 std::mutex mutex_throttle_wait;
405 std::multimap<int, int> sources;
409 unsigned long frame_duration_nsec;
410 unsigned long cur_frame_pts;
415 unsigned int num_surfaces_per_frame;
418 bool got_first_buffer;
419 bool frame_num_reset_on_eos =
false;
420 bool frame_num_reset_on_stream_reset =
false;
void set_batch_size(unsigned int size)
set batch_policy.set_batch_size()
bool push_loop(NvDsBatchBufferWrapper *out_buf, NvDsBatchMeta *)
unsigned int get_config_batch_size()
return batch_policy.get_config_batch_size()
unsigned int get_num_surfaces_per_frame()
Get the class var num_surfaces_per_frame.
unsigned int total_buf_available
unsigned int get_remaining_unbatched_buffers_from_all_sources()
Get the remaining unbatched ready buffers from all sources.
void reset_pad(SinkPad *pad)
Reset a pad for streaming.
void remove_pad(unsigned int id)
NanoSecondsType get_min_fps_duration()
Get the Batch Policy minimum fps duration calculated from min overall fps config.
void apply_throttle(bool stop_when_input_buffer=false)
Apply the throttle delay and wait for the time (max-fps cfg) or until a new buffer come in.
void set_policy(BatchPolicyConfig cfg)
bool push_batch(NvDsBatchBufferWrapper *out_buf, SourcePad *src_pad)
void set_frame_num_reset_on_stream_reset(bool reset)
void update_pad_mimetype(unsigned int id, PAD_MIME_TYPE mime_type)
void set_frame_duration(unsigned long)
SOURCE_STATE get_pad_state(SinkPad *sinkPad)
bool get_all_pads_eos()
Get all_pads_eos.
virtual void add_sink(SinkPad *pad)
virtual void add_buffer(unsigned int pad_id, BufferWrapper *buffer)
virtual bool handle_eos(SINK_EVENT et, unsigned int source_id, EventWrapper *event)
void set_num_surfaces_per_frame(unsigned int num)
Set the class var num_surfaces_per_frame and batch_policy.set_num_surfaces()
void set_frame_num_reset_on_eos(bool reset)
void handle_ready_pause()
virtual bool handle_flush_stop(SINK_EVENT et, unsigned int source_id, EventWrapper *event)
PAD_MIME_TYPE get_pad_mimetype(unsigned int id)
unsigned int get_source_id_with_earliest_buffer()
ISynchronizeBuffer * synch_buffer
void set_synch_buffer_iface(ISynchronizeBuffer *synch_buffer_iface)
Set the user interface for buffer synchronization Note: This API shall be called before set_policy()
unsigned int copy_batch(NvDsBatchBufferWrapper *out_buf, NvDsBatchMeta *)
virtual void notify_all()
virtual bool handle_eos_cascaded(SINK_EVENT et, unsigned int source_id, EventWrapper *event)
void set_pts_offset(gulong offset)
std::chrono::duration< double, std::nano > NanoSecondsType
void set_synch_buffer_iface(ISynchronizeBuffer *synch_buffer_iface)
virtual bool handle_stream_reset(SINK_EVENT et, unsigned int source_id, EventWrapper *event)
virtual void remove_sink(SinkPad pad)
void set_batch_push_timeout(unsigned int timeout)
set batch_policy.set_batch_push_timeout()
virtual bool handle_segment(SINK_EVENT et, unsigned int source_id, EventWrapper *event)
void add_pad(unsigned int id, SinkPad *pad)
void set_all_pads_eos(bool eos)
Set all_pads_eos.
SinkPad * get_pad(unsigned int pad_id)
unsigned int get_batch_size()
return batch_policy.get_batch_size()
NvStreamMux(SourcePad *srcpad, INvStreammuxDebug *a_debug_iface=nullptr)
std::chrono::time_point< std::chrono::steady_clock, NanoSecondsType > TimePoint