libxcoder  5.2.0
ni_lat_meas.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * Copyright (C) 2022 NETINT Technologies
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to deal
7  * in the Software without restriction, including without limitation the rights
8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  * copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18  * SOFTWARE.
19  *
20  ******************************************************************************/
21 
22 /*!*****************************************************************************
23  * \file ni_lat_meas.h
24  *
25  * \brief Utility definitions for measuring frame/packet processing time in
26  * NETINT video processing devices
27  ******************************************************************************/
28 
29 #pragma once
30 
31 #include <stdint.h>
32 
33 typedef struct _ni_lat_meas_q_entry_t
34 {
35  uint64_t abs_timenano;
36  int64_t ts_time;
38 
39 typedef struct _ni_lat_meas_q_t
40 {
45 
46 // NI latency measurement queue operations
48 
49 void ni_lat_meas_q_destroy(ni_lat_meas_q_t *frame_time_q);
50 
51 void *ni_lat_meas_q_add_entry(ni_lat_meas_q_t *frame_time_q, uint64_t abs_time,
52  int64_t ts_time);
53 
54 uint64_t ni_lat_meas_q_check_latency(ni_lat_meas_q_t *frame_time_q,
55  uint64_t abs_time, int64_t ts_time);
_ni_lat_meas_q_t::front
int front
Definition: ni_lat_meas.h:41
ni_lat_meas_q_check_latency
uint64_t ni_lat_meas_q_check_latency(ni_lat_meas_q_t *frame_time_q, uint64_t abs_time, int64_t ts_time)
Check latency of a frame referenced by its timestamp.
Definition: ni_lat_meas.c:201
_ni_lat_meas_q_entry_t
Definition: ni_lat_meas.h:33
_ni_lat_meas_q_t
Definition: ni_lat_meas.h:39
_ni_lat_meas_q_entry_t::abs_timenano
uint64_t abs_timenano
Definition: ni_lat_meas.h:35
ni_lat_meas_q_add_entry
void * ni_lat_meas_q_add_entry(ni_lat_meas_q_t *frame_time_q, uint64_t abs_time, int64_t ts_time)
Add a new entry to latency queue.
Definition: ni_lat_meas.c:181
_ni_lat_meas_q_t::last_benchmark_time
uint64_t last_benchmark_time
Definition: ni_lat_meas.h:42
ni_lat_meas_q_t
struct _ni_lat_meas_q_t ni_lat_meas_q_t
_ni_lat_meas_q_t::capacity
int capacity
Definition: ni_lat_meas.h:41
ni_lat_meas_q_entry_t
struct _ni_lat_meas_q_entry_t ni_lat_meas_q_entry_t
ni_lat_meas_q_create
ni_lat_meas_q_t * ni_lat_meas_q_create(int capacity)
Create a latency measurement queue object of a given capacity.
Definition: ni_lat_meas.c:52
_ni_lat_meas_q_t::rear
int rear
Definition: ni_lat_meas.h:41
ni_lat_meas_q_destroy
void ni_lat_meas_q_destroy(ni_lat_meas_q_t *frame_time_q)
Destroy a latency measurement queue object.
Definition: ni_lat_meas.c:97
_ni_lat_meas_q_t::size
int size
Definition: ni_lat_meas.h:41
_ni_lat_meas_q_t::array
ni_lat_meas_q_entry_t * array
Definition: ni_lat_meas.h:43
_ni_lat_meas_q_entry_t::ts_time
int64_t ts_time
Definition: ni_lat_meas.h:36