CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
The declarations in this header file correspond to the definitions in cdi_utility_api.c and are meant to provide access to helpful SDK data structures and functions that are not part of the core API functionality. More...
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | CdiEnumStringKey |
Type used for holding arrays of enums and related string representations. More... | |
Macros | |
#define | CDI_INTERFACE |
Specify C linkage when compiling as C++ and define API interface export for Windows. | |
#define | CDI_INVALID_ENUM_VALUE (-1) |
Used to define an invalid enum found. | |
Enumerations | |
enum | CdiEnumStringKeyType { kKeyAdapterType , kKeyBufferType , kKeyConnectionProtocolType , kKeyLogMethod , kKeyLogComponent , kKeyLogLevel , kKeyConnectionStatus , kKeyTestUnit } |
Enums used to indicate which key-value array a function is to access. More... | |
enum | CdiConnectionProtocolType { kProtocolTypeRaw , kProtocolTypeAvm } |
This enumeration is used in the CdiConnectionState structure to indicate what connection layer is being used. More... | |
Functions | |
CDI_INTERFACE const CdiEnumStringKey * | CdiUtilityKeyGetArray (CdiEnumStringKeyType key_type) |
CDI_INTERFACE const char * | CdiUtilityEnumValueToString (const CdiEnumStringKey *key_array, int enum_value) |
CDI_INTERFACE int | CdiUtilityStringToEnumValue (const CdiEnumStringKey *key_array, const char *name_str) |
CDI_INTERFACE const char * | CdiUtilityKeyEnumToString (CdiEnumStringKeyType key_type, int enum_value) |
CDI_INTERFACE int | CdiUtilityKeyStringToEnum (CdiEnumStringKeyType key_type, const char *name_str) |
CDI_INTERFACE uint32_t | CdiUtilityPtpToRtp (const CdiPtpTimestamp *ptp_timestamp_ptr, uint32_t sample_rate) |
Function used to convert a PTP timestamp into an RTP timestamp. | |
CDI_INTERFACE uint64_t | CdiUtilityPtpTimestampToMicroseconds (const CdiPtpTimestamp *timestamp_ptr) |
static const char * | CdiUtilityBoolToString (bool b) |
The declarations in this header file correspond to the definitions in cdi_utility_api.c and are meant to provide access to helpful SDK data structures and functions that are not part of the core API functionality.
This enumeration is used in the CdiConnectionState structure to indicate what connection layer is being used.
Enumerator | |
---|---|
kProtocolTypeRaw | Raw connection. |
kProtocolTypeAvm | Audio, Video and Metadata (AVM) connection. |
enum CdiEnumStringKeyType |
Enums used to indicate which key-value array a function is to access.
NOTE: Update CdiUtilityKeyGetArray in cdi_utility_api.c whenever an entry is added to this table.
Enumerator | |
---|---|
kKeyAdapterType | Key for CdiAdapterTypeSelection. |
kKeyBufferType | Key for CdiBufferType. |
kKeyConnectionProtocolType | Key for CdiConnectionProtocolType. |
kKeyLogMethod | Key for CdiLogMethod. |
kKeyLogComponent | Key for CdiLogComponent. |
kKeyLogLevel | Key for CdiLogLevel. |
kKeyConnectionStatus | Key for CdiConnectionStatus. |
kKeyTestUnit | Key for CdiTestUnitName. |
|
inlinestatic |
Convenience function to return the human readable string associated with the given boolean value.
b | The value to convert. |
CDI_INTERFACE const char * CdiUtilityEnumValueToString | ( | const CdiEnumStringKey * | key_array, |
int | enum_value ) |
Convert an enum value to a string.
key_array | Pointer to array enum/string key pairs to use for the conversion. |
enum_value | Value to convert to a string. |
CDI_INTERFACE const char * CdiUtilityKeyEnumToString | ( | CdiEnumStringKeyType | key_type, |
int | enum_value ) |
Function used to convert an enum value to a string.
key_type | Enum from CdiEnumStringKeyType which indicates which key-value array to search for enum_value. |
enum_value | Value to convert to a string. |
CDI_INTERFACE const CdiEnumStringKey * CdiUtilityKeyGetArray | ( | CdiEnumStringKeyType | key_type | ) |
Function used to get a pointer to a key-value array of a type specified by key_type.
key_type | Enum from CdiEnumStringKeyType which indicates which key-value array to return. |
CDI_INTERFACE int CdiUtilityKeyStringToEnum | ( | CdiEnumStringKeyType | key_type, |
const char * | name_str ) |
Function used to convert a string to a matching enum value.
key_type | Enum from CdiEnumStringKeyType which indicates which key-value array to search for name_str. |
name_str | Pointer to string name of enumerated value. |
CDI_INTERFACE uint64_t CdiUtilityPtpTimestampToMicroseconds | ( | const CdiPtpTimestamp * | timestamp_ptr | ) |
Convert the specified PTP timestamp into microseconds.
timestamp_ptr | Pointer to PTP timestamp to convert. |
CDI_INTERFACE uint32_t CdiUtilityPtpToRtp | ( | const CdiPtpTimestamp * | ptp_timestamp_ptr, |
uint32_t | sample_rate ) |
Function used to convert a PTP timestamp into an RTP timestamp.
ptp_timestamp_ptr | A pointer to a PTP timestamp consisting of seconds and nanoseconds; |
sample_rate | A sample rate value in Hz for the number of samples per second used for the RTP units. |
CDI_INTERFACE int CdiUtilityStringToEnumValue | ( | const CdiEnumStringKey * | key_array, |
const char * | name_str ) |
Convert a string to a matching enum value.
key_array | Pointer to array enum/string key pairs to use for the conversion. |
name_str | Pointer to string name of enumerated value. |