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.c File Reference

This file contains definitions and functions for the NDI-CDI Converter application. More...

#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "cdi_baseline_profile_02_00_api.h"
#include "cdi_core_api.h"
#include "cdi_logger_api.h"
#include "cdi_os_api.h"
#include "fifo_api.h"
#include "cdi_pool_api.h"
#include "test_common.h"
#include "utilities_api.h"
#include "ndi_test.h"
#include "ndi_wrapper.h"
#include <Processing.NDI.Lib.h>

Macros

#define TX_BUFFER_SIZE   (3840 * 2160 * 3)
 Assume 4k, 8-bit video frame is maximum payload size.
 
#define DEFAULT_FRAME_DATA_POOL_SIZE   (100)
 Default memory pool size.
 
#define DEFAULT_CALLBACK_FIFO_SIZE   (100)
 Default FrameData callback FIFO size.
 
#define DEFAULT_PAYLOAD_FIFO_SIZE   (100)
 Default FrameData payload FIFO size.
 

Functions

CdiReturnStatus NdiReceiverToCdiTransmitter (TestConnectionInfo *con_info_ptr)
 External reference.
 
CdiReturnStatus CdiReceiverToNdiTransmitter (TestConnectionInfo *con_info_ptr)
 External reference.
 
void PrintHelp (void)
 
static bool ParseCommandLine (int argc, const char **argv, TestSettings *test_settings_ptr)
 
void TestConnectionCallback (const CdiCoreConnectionCbData *cb_data_ptr)
 
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.
 
int main (int argc, const char **argv)
 

Detailed Description

This file contains definitions and functions for the NDI-CDI Converter application.

Function Documentation

◆ LogTimestamps()

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.

Parameters
con_info_ptrPointer to test connection information.
frame_data_ptrPointer to frame data.
cdi_timestamp_ptrPointer to CDI timestamp to log.

◆ main()

int main ( int argc,
const char ** argv )

C main entry function.

Parameters
argcNumber of command line arguments.
argvPointer to array of pointers to command line arguments.
Returns
0 on success, otherwise 1 indicating a failure occurred.

◆ ParseCommandLine()

static bool ParseCommandLine ( int argc,
const char ** argv,
TestSettings * test_settings_ptr )
static

Parse command line and write to the specified TestSettings structure.

Parameters
argcNumber of command line arguments.
argvPointer to array of pointers to command line arguments.
test_settings_ptrAddress where to write returned settings.
Returns
true if successful, otherwise false.

◆ PrintHelp()

void PrintHelp ( void )

Output command line help message.

◆ TestConnectionCallback()

void TestConnectionCallback ( const CdiCoreConnectionCbData * cb_data_ptr)

Handle the connection callback.

Parameters
cb_data_ptrPointer to core connection callback data.