MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ close_run()

void MayaFlux::Kinesis::Discrete::IntervalScanner::close_run ( uint32_t start,
uint32_t end,
std::vector< Interval > & out )
private

Definition at line 71 of file IntervalScan.cpp.

72{
73 if (m_config.emit_on_close) {
74 out.emplace_back(clamped_sub(start, m_config.padding), std::min(m_total, end + m_config.padding));
75 return;
76 }
77 uint32_t padded_start { 0 };
78 if (m_pend_valid) {
79 const int32_t gap = static_cast<int32_t>(start) - static_cast<int32_t>(m_pend_end);
80 if (gap < static_cast<int32_t>(2U * m_config.padding)) {
81 const int32_t half_gap = gap >= 0 ? gap / 2 : -((-gap + 1) / 2);
82 const auto padded_end = static_cast<uint32_t>(static_cast<int32_t>(m_pend_end) + half_gap);
83 padded_start = half_gap >= 0
84 ? clamped_sub(start, static_cast<uint32_t>(half_gap))
85 : start + static_cast<uint32_t>(-half_gap);
86 out.emplace_back(m_pend_start, padded_end);
87 } else {
88 const uint32_t padded_end = std::min(m_total, m_pend_end + m_config.padding);
89 padded_start = clamped_sub(start, m_config.padding);
90 out.emplace_back(m_pend_start, padded_end);
91 }
92 } else {
93 padded_start = clamped_sub(start, m_config.padding);
94 }
95 m_pend_valid = true;
96 m_pend_start = padded_start;
97 m_pend_end = end;
98}

References m_config, m_pend_end, m_pend_start, m_pend_valid, and m_total.

Referenced by flush(), and push().

Here is the caller graph for this function: