CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
ndi_test.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------------------------
2// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3// This file is part of the AWS CDI-SDK, licensed under the BSD 2-Clause "Simplified" License.
4// License details at: https://github.com/aws/aws-cdi-sdk/blob/mainline/LICENSE
5// -------------------------------------------------------------------------------------------
6
12
13#ifndef NDI_TEST_H__
14#define NDI_TEST_H__
15
16#include <stdbool.h>
17#include <stdint.h>
18
20#include "cdi_log_api.h"
21#include "cdi_os_api.h"
22#include "fifo_api.h"
23#include "cdi_pool_api.h"
24#include "ndi_wrapper.h"
25#include <Processing.NDI.Lib.h>
26
27//*********************************************************************************************************************
28//***************************************** START OF DEFINITIONS AND TYPES ********************************************
29//*********************************************************************************************************************
30
32//#define DISABLE_LINEAR_RX_BUFFER
33
35#define DEFAULT_TX_TIMEOUT (20000)
36
38#define TestConsoleLog SimpleConsoleLog
39
67
122
123//*********************************************************************************************************************
124//******************************************* START OF PUBLIC FUNCTIONS ***********************************************
125//*********************************************************************************************************************
126
132void TestConnectionCallback(const CdiCoreConnectionCbData* cb_data_ptr);
133
141void LogTimestamps(TestConnectionInfo* con_info_ptr, const FrameData* frame_data_ptr,
142 CdiPtpTimestamp* cdi_timestamp_ptr);
143
144#endif // NDI_TEST_H__
This file contains declarations and definitions for the CDI AVM baseline profile 02....
@ kCdiAvmAncillary
Payload contains ancillary data.
Definition cdi_baseline_profile_api.h:38
CdiReturnStatus
Values used for API function return codes.
Definition cdi_core_api.h:189
CdiConnectionStatus
This enumeration is used to indicate the current state of a connection. NOTE: Any changes made here M...
Definition cdi_core_api.h:368
struct CdiConnectionState * CdiConnectionHandle
Type used as the handle (pointer to an opaque structure) for a transmitter or receiver connection....
Definition cdi_core_api.h:166
struct CdiAdapterState * CdiAdapterHandle
Type used as the handle (pointer to an opaque structure) for a network adapter. Each handle represent...
Definition cdi_core_api.h:160
This file declares the public API data types, structures and functions that comprise the CDI log API.
This file contains the declarations for OS functions for creating/managing/freeing threads,...
struct CdiSignalType_t * CdiSignalType
Define portable signal type. Don't use void* here, which prevents the compiler from type checking.
Definition cdi_os_api.h:189
struct CdiThreadID_t * CdiThreadID
Define portable thread type. Separate name from type, otherwise the typedef that follows it will gene...
Definition cdi_os_api.h:312
This file declares the public API data types, structures and functions that comprise the CDI Pool Uti...
struct CdiPoolState * CdiPoolHandle
Type used as the handle (pointer to an opaque structure) for a Memory Pool. Each handle represents a ...
Definition cdi_pool_api.h:97
The declarations in this header file correspond to the definitions in fifo.c.
struct CdiFifoState * CdiFifoHandle
Type used as the handle (pointer to an opaque structure) for a FIFO. Each handle represents a instanc...
Definition fifo_api.h:30
void LogTimestamps(TestConnectionInfo *con_info_ptr, const FrameData *frame_data_ptr, CdiPtpTimestamp *cdi_timestamp_ptr)
If enabled using the command line option, log timestamps for every frame.
Definition ndi_test.c:329
void TestConnectionCallback(const CdiCoreConnectionCbData *cb_data_ptr)
Definition ndi_test.c:314
The declarations in this header file correspond to the definitions in ndi_wrapper....
Structure that aggregates the audio, video, and ancillary data structures into a single structure.
Definition cdi_baseline_profile_01_00_api.h:189
A structure of this type is passed as the parameter to CdiCoreConnectionCallback()....
Definition cdi_core_api.h:377
A structure of this type is used to configure the type of log method that is being used....
Definition cdi_log_api.h:63
A structure for holding a PTP timestamp defined in seconds and nanoseconds. This PTP time as defined ...
Definition cdi_core_api.h:331
A structure for storing all info related to a NDI frame, and a specific connection,...
Definition ndi_wrapper.h:48
A structure for storing all info related to a specific connection, including test settings,...
Definition ndi_test.h:73
CdiThreadID ndi_thread_id
NDI thread ID.
Definition ndi_test.h:94
CdiPoolHandle ndi_video_pool_handle
NDI video pool handle.
Definition ndi_test.h:107
CdiAdapterHandle adapter_handle
CDI adapter Handle.
Definition ndi_test.h:75
NDIlib_recv_instance_t pNDI_recv
NDI receiver pointer.
Definition ndi_test.h:102
CdiPtpTimestamp connection_start_time
Start time for the connection. For TX this is the time of the first payload sent. For RX it is the ti...
Definition ndi_test.h:114
CdiSignalType payload_callback_signal
Signal to indicate when a payload has been delivered.
Definition ndi_test.h:80
CdiLogMethodData log_method_data
CDI log method.
Definition ndi_test.h:74
uint64_t total_audio_samples
Total number of audio samples processed.
Definition ndi_test.h:115
double cdi_audio_period_fraction_ns
Audio CDI period fractional portion in uS.
Definition ndi_test.h:120
CdiSignalType connection_state_change_signal
Signal used for connection state changes.
Definition ndi_test.h:83
uint64_t payload_start_time
Payload start time, used by Tx Callback functions.
Definition ndi_test.h:88
volatile CdiConnectionStatus connection_status
Current status of the connection.
Definition ndi_test.h:84
CdiAvmBaselineConfig last_baseline_config[kCdiAvmAncillary]
Baseline AVM configuration[CdiBaselineAvmPayloadType]. Used to log changes to AVM.
Definition ndi_test.h:110
CdiReturnStatus ndi_thread_rs
NDI thread return status.
Definition ndi_test.h:95
double cdi_video_period_fraction_ns
Video CDI period fractional portion in nS.
Definition ndi_test.h:119
int payload_cb_count
Number of times payload callback function has been invoked. NOTE: This variable is used by multiple t...
Definition ndi_test.h:92
CdiFifoHandle payload_fifo_handle
Payload FIFO Handle.
Definition ndi_test.h:99
CdiPoolHandle ndi_audio_pool_handle
NDI audio pool handle.
Definition ndi_test.h:106
CdiPoolHandle ndi_frame_data_pool_handle
Memory Pool Handle.
Definition ndi_test.h:98
volatile bool payload_error
true if Tx callback got a payload error.
Definition ndi_test.h:81
CdiConnectionHandle connection_handle
The connection handle returned by CdiRawTxCreate().
Definition ndi_test.h:76
TestSettings test_settings
Test settings data structure provided by the user.
Definition ndi_test.h:78
uint32_t total_video_frames
Total number of video frames processed.
Definition ndi_test.h:116
NDIlib_send_instance_t pNDI_send
NDI sender pointer.
Definition ndi_test.h:105
void * adapter_tx_buffer_ptr
Adapter's Tx buffer pointer.
Definition ndi_test.h:86
uint64_t total_video_duration_ns
Total video duration in nanoseconds.
Definition ndi_test.h:117
CdiSignalType ndi_thread_signal
NDI thread signal.
Definition ndi_test.h:96
CdiFifoHandle callback_fifo_handle
Callback FIFO Handle.
Definition ndi_test.h:100
A structure that holds all the test settings for a connection as set from the command line.
Definition ndi_test.h:44
const char * local_adapter_ip_str
The local network adapter IP address.
Definition ndi_test.h:45
bool ndi_tx
Enable NDI transmitter.
Definition ndi_test.h:55
const char * remote_adapter_ip_str
The remote network adapter IP address.
Definition ndi_test.h:48
const char * ndi_source_ip
The NDI source IP address.
Definition ndi_test.h:61
bool ndi_rx
Enable NDI receiver.
Definition ndi_test.h:54
bool show_ndi_sources
Show NDI sources and stop.
Definition ndi_test.h:53
int anc_data_stream_id
CDI ancilllary data stream ID.
Definition ndi_test.h:58
int num_transactions
The number of transactions in the test.
Definition ndi_test.h:49
const char * ndi_source_name
The NDI source name.
Definition ndi_test.h:60
int audio_stream_id
CDI audio stream ID.
Definition ndi_test.h:57
int tx_timeout
The transmit timeout in microseconds for a Tx payload.
Definition ndi_test.h:50
int dest_port
The destination port number.
Definition ndi_test.h:47
bool log_timestamps
Output timestamp information to console.
Definition ndi_test.h:65
const char * ndi_source_url
The NDI source URL address.
Definition ndi_test.h:62
const char * bind_ip_addr_str
IP address to bind to.
Definition ndi_test.h:46
bool use_efa
Whether to use EFA adapter.
Definition ndi_test.h:51
bool use_ndi_timestamps
Use NDI timestamps for CDI output instead of internally generating them.
Definition ndi_test.h:64
int video_stream_id
CDI video stream ID.
Definition ndi_test.h:56