CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
This file contains declarations and definitions for the CDI AVM baseline profile API functions. More...
Go to the source code of this file.
Data Structures | |
struct | CdiAvmBaselineProfileVersion |
Structure containing the version information common to audio, video, and metadata in the baseline configuration structure. More... | |
struct | CdiAvmBaselineConfigCommon |
Structure that is common to all baseline profile versions. This allows the APIs to determine payload type and profile version. Once that has been determined, the structure can then be used by baseline version specific logic where it is cast to the appropriate type. More... | |
struct | CdiAvmVTableApi |
Type used to hold V-table of APIs that must be implemented by baseline profiles. More... | |
Macros | |
#define | CDI_BASELINE_AVM_PAYLOAD_TYPE_ENUM_COUNT (kCdiAvmAncillary) |
Macro used to determine number of enumerated values in CdiBaselineAvmPayloadType, without having to add a "kCdiAvmLast" enum value. | |
Typedefs | |
typedef struct CdiAvmBaselineConfig | CdiAvmBaselineConfig |
Forward reference of structure to create pointers later. | |
typedef bool(* | CdiMakeBaselineConfigurationPtr) (const CdiAvmBaselineConfigCommon *baseline_config_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr) |
Prototype of function used to make a baseline configuration string from a configuration structure. | |
typedef bool(* | CdiParseBaselineConfigurationPtr) (const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_config_ptr) |
Prototype of function used to parse a baseline configuration string and generate a configuration structure. | |
typedef CdiReturnStatus(* | CdiAvmGetBaselineUnitSizePtr) (const CdiAvmBaselineConfigCommon *baseline_config_ptr, int *payload_unit_size_ptr) |
Prototype of function used to get baseline unit size. | |
typedef const CdiEnumStringKey *(* | CdiAvmKeyGetArrayPtr) (CdiAvmBaselineEnumStringKeyTypes key_type) |
Prototype of function used to get enum/string table for the specified key. | |
Enumerations | |
enum | CdiBaselineAvmPayloadType { kCdiAvmNotBaseline , kCdiAvmVideo , kCdiAvmAudio , kCdiAvmAncillary } |
Payload types used in CdiAvmRxData. NOTE: Any changes made here MUST also be made to "payload_type_key_array" in cdi_utility_api.c and "avm_uri_strings" in baseline_profile.c. More... | |
enum | CdiAvmBaselineEnumStringKeyTypes { kKeyAvmPayloadType , kKeyAvmVideoSamplingType , kKeyAvmVideoAlphaChannelType , kKeyAvmVideoBitDepthType , kKeyAvmVideoColorimetryType , kKeyAvmVideoTcsType , kKeyAvmVideoRangeType , kKeyAvmAudioChannelGroupingType , kKeyAvmAudioSampleRateType } |
Enums used to indicate which key-value array a function is to access. More... | |
Functions | |
CDI_INTERFACE CdiReturnStatus | CdiAvmRegisterBaselineProfile (CdiBaselineAvmPayloadType media_type, const char *profile_version_str, CdiAvmVTableApi *vtable_api_ptr) |
Register a baseline profile. | |
CDI_INTERFACE CdiReturnStatus | CdiAvmMakeBaselineConfiguration (const CdiAvmBaselineConfig *baseline_config_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr) |
CDI_INTERFACE CdiReturnStatus | CdiAvmMakeBaselineConfiguration2 (const CdiAvmBaselineConfigCommon *baseline_config_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr) |
New version of the existing CdiAvmMakeBaselineConfiguration() API that supports a generic extensible baseline configuration structure. For more details see CdiAvmMakeBaselineConfiguration(). | |
CDI_INTERFACE CdiReturnStatus | CdiAvmParseBaselineConfiguration (const CdiAvmConfig *config_ptr, CdiAvmBaselineConfig *baseline_config_ptr) |
Converts from the AVM configuration structure to the CDI baseline configuration structure if possible. This is to be called on the receive side if the CdiAvmConfig structure is provided to the registered receive payload callback function. This function must be called whenever the config_ptr is non-NULL as the first step in determining the stream's configuration. If kCdiStatusOk is returned, then the configuration belongs to the CDI baseline profile described by the structure filled in at baseline_config_ptr. A code other than kCdiStatusOk is returned when the configuration is not recognized as a supported baseline profile. An AVM configuration not convertible to a CDI baseline configuration must be parsed by an application-specific function. | |
CDI_INTERFACE CdiReturnStatus | CdiAvmParseBaselineConfiguration2 (const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_config_ptr) |
CDI_INTERFACE CdiReturnStatus | CdiAvmGetBaselineUnitSize (const CdiAvmBaselineConfig *baseline_config_ptr, int *payload_unit_size_ptr) |
Gets the unit size in bits for transmission of the media as specified by the configuration structure. | |
CDI_INTERFACE CdiReturnStatus | CdiAvmGetBaselineUnitSize2 (const CdiAvmBaselineConfigCommon *baseline_config_ptr, int *payload_unit_size_ptr) |
New version of the existing CdiAvmGetBaselineUnitSize() API that supports a generic extensible baseline configuration structure. For more details see CdiAvmGetBaselineUnitSize(). | |
CDI_INTERFACE const char * | CdiAvmKeyEnumToString (CdiAvmBaselineEnumStringKeyTypes key_type, int enum_value, const CdiAvmBaselineProfileVersion *version_ptr) |
CDI_INTERFACE int | CdiAvmKeyStringToEnum (CdiAvmBaselineEnumStringKeyTypes key_type, const char *name_str, const CdiAvmBaselineProfileVersion *version_ptr) |
CDI_INTERFACE const CdiEnumStringKey * | CdiAvmKeyGetArray (CdiAvmBaselineEnumStringKeyTypes key_type, const CdiAvmBaselineProfileVersion *version_ptr) |
CDI_INTERFACE bool | CdiAvmParseBaselineVersionString (const char *version_str, CdiAvmBaselineProfileVersion *ret_version_ptr) |
CDI_INTERFACE CdiReturnStatus | CdiAvmValidateBaselineVersionString (CdiBaselineAvmPayloadType media_type, const char *version_str, CdiAvmBaselineProfileVersion *ret_version_ptr) |
This file contains declarations and definitions for the CDI AVM baseline profile API functions.
typedef CdiReturnStatus(* CdiAvmGetBaselineUnitSizePtr) (const CdiAvmBaselineConfigCommon *baseline_config_ptr, int *payload_unit_size_ptr) |
Prototype of function used to get baseline unit size.
baseline_config_ptr | A pointer to common baseline configuration data. |
payload_unit_size_ptr | Address where to write returned unit size. |
typedef const CdiEnumStringKey *(* CdiAvmKeyGetArrayPtr) (CdiAvmBaselineEnumStringKeyTypes key_type) |
Prototype of function used to get enum/string table for the specified key.
key_type | Enumerated key type. |
typedef bool(* CdiMakeBaselineConfigurationPtr) (const CdiAvmBaselineConfigCommon *baseline_config_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr) |
Prototype of function used to make a baseline configuration string from a configuration structure.
baseline_config_ptr | A pointer to common baseline configuration data. |
config_ptr | A pointer to AVM configuration data. |
payload_unit_size_ptr | Address where to write returned payload unit size. |
typedef bool(* CdiParseBaselineConfigurationPtr) (const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_config_ptr) |
Prototype of function used to parse a baseline configuration string and generate a configuration structure.
config_ptr | A pointer to AVM configuration data. |
baseline_config_ptr | A pointer to common baseline configuration data. |
Enums used to indicate which key-value array a function is to access.
NOTE: Update CdiAvmKeyGetArray() in baseline_profile.c whenever an entry is added to this table.
Enumerator | |
---|---|
kKeyAvmPayloadType | Keys that contain one set of unique data (not specific to a profile or version). See CdiAvmKeyGetArray(). Key for CdiAvmPayloadType |
kKeyAvmVideoSamplingType | Keys used by video profiles. See EnumStringKeyTypeToPayloadType(). Key for CdiAvmVideoSampling |
kKeyAvmVideoAlphaChannelType | Key for CdiAvmVideoAlphaChannel. |
kKeyAvmVideoBitDepthType | Key for CdiAvmVideoBitDepth. |
kKeyAvmVideoColorimetryType | Key for CdiAvmColorimetry. |
kKeyAvmVideoTcsType | Key for CdiAvmVideoTcs. |
kKeyAvmVideoRangeType | Key for CdiAvmVideoRange. |
kKeyAvmAudioChannelGroupingType | Key for CdiAvmAudioChannelGrouping. |
kKeyAvmAudioSampleRateType | Key for CdiAvmAudioSampleRate. |
Payload types used in CdiAvmRxData. NOTE: Any changes made here MUST also be made to "payload_type_key_array" in cdi_utility_api.c and "avm_uri_strings" in baseline_profile.c.
CDI_INTERFACE CdiReturnStatus CdiAvmGetBaselineUnitSize | ( | const CdiAvmBaselineConfig * | baseline_config_ptr, |
int * | payload_unit_size_ptr ) |
Gets the unit size in bits for transmission of the media as specified by the configuration structure.
baseline_config_ptr | The address of a configuration structure whose unit size is of interest. |
payload_unit_size_ptr | Pointer to location where the unit bit length is to be written. |
CDI_INTERFACE const char * CdiAvmKeyEnumToString | ( | CdiAvmBaselineEnumStringKeyTypes | key_type, |
int | enum_value, | ||
const CdiAvmBaselineProfileVersion * | version_ptr ) |
Function used to convert an enum value to a string.
key_type | Enum which indicates which key-value array to search for enum_value. |
enum_value | Value to convert to a string. |
version_ptr | Pointer to profile version to use. If NULL, profile version 01.00 is used. |
CDI_INTERFACE const CdiEnumStringKey * CdiAvmKeyGetArray | ( | CdiAvmBaselineEnumStringKeyTypes | key_type, |
const CdiAvmBaselineProfileVersion * | version_ptr ) |
Function used to get a pointer to a key-value array of a type specified by key_type.
key_type | Enum from EnumStringKeyTypes which indicates which key-value array to return. |
version_ptr | Pointer to profile version to use. If NULL, profile version 01.00 is used. |
CDI_INTERFACE int CdiAvmKeyStringToEnum | ( | CdiAvmBaselineEnumStringKeyTypes | key_type, |
const char * | name_str, | ||
const CdiAvmBaselineProfileVersion * | version_ptr ) |
Function used to convert a string to a matching enum value.
key_type | Enum which indicates which key-value array to search for name_str. |
name_str | Pointer to string name of enumerated value. |
version_ptr | Pointer to profile version to use. If NULL, profile version 01.00 is used. |
CDI_INTERFACE CdiReturnStatus CdiAvmMakeBaselineConfiguration | ( | const CdiAvmBaselineConfig * | baseline_config_ptr, |
CdiAvmConfig * | config_ptr, | ||
int * | payload_unit_size_ptr ) |
Converts from the simple, constrained baseline configuration structures to the more general purpose CdiAvmConfig structure used in the AVM interface. This is useful on the transmit side for streams that comply with the baseline CDI profile for inter-vendor compatibility.
NOTE: Newly created data structures that are passed in to this function should be properly initialized before being programmed with user values. Use memset or a zero structure initializer (= {0}) to set the whole structure to zero before setting the desired members to the actual values required.
baseline_config_ptr | Address of the source configuration structure. |
config_ptr | Address of where to write the resulting AVM configuration structure. |
payload_unit_size_ptr | Address of where to write the payload unit size which is used by the transmit packetizer. This value should be passed in the unit_size member of the payload_config_ptr->core_config_data structure when calling CdiAvmTxPayload(). |
CDI_INTERFACE CdiReturnStatus CdiAvmParseBaselineConfiguration | ( | const CdiAvmConfig * | config_ptr, |
CdiAvmBaselineConfig * | baseline_config_ptr ) |
Converts from the AVM configuration structure to the CDI baseline configuration structure if possible. This is to be called on the receive side if the CdiAvmConfig structure is provided to the registered receive payload callback function. This function must be called whenever the config_ptr is non-NULL as the first step in determining the stream's configuration. If kCdiStatusOk is returned, then the configuration belongs to the CDI baseline profile described by the structure filled in at baseline_config_ptr. A code other than kCdiStatusOk is returned when the configuration is not recognized as a supported baseline profile. An AVM configuration not convertible to a CDI baseline configuration must be parsed by an application-specific function.
config_ptr | Pointer to the AVM configuration structure provided to the registered receive payload callback function. |
baseline_config_ptr | Address where baseline configuration structure parameters are written to when the return code is kCdiStatusOk. When the return code is kCdiStatusProfileNotSupported, then only payload_type is written. For any other return code no parameters are written. |
CDI_INTERFACE CdiReturnStatus CdiAvmParseBaselineConfiguration2 | ( | const CdiAvmConfig * | config_ptr, |
CdiAvmBaselineConfigCommon * | baseline_config_ptr ) |
New version of the existing CdiAvmParseBaselineConfiguration() API that supports a generic extensible baseline configuration structure. For more details see CdiAvmParseBaselineConfiguration().
CDI_INTERFACE bool CdiAvmParseBaselineVersionString | ( | const char * | version_str, |
CdiAvmBaselineProfileVersion * | ret_version_ptr ) |
Converts a string representing a baseline configuration structure version number in the form of "xx.yy" into a structure with major and minor members.
version_str | The source string to convert. |
ret_version_ptr | The address of the structure to write the version numbers into. |
CDI_INTERFACE CdiReturnStatus CdiAvmRegisterBaselineProfile | ( | CdiBaselineAvmPayloadType | media_type, |
const char * | profile_version_str, | ||
CdiAvmVTableApi * | vtable_api_ptr ) |
Register a baseline profile.
media_type | Enum which indicates the type of payload data (ie. video, audio or ancillary data). |
profile_version_str | Pointer to profile version string. Must be in "xx.xx" format. |
vtable_api_ptr | Pointer to V-table to use for required baseline profile APIs. |
CDI_INTERFACE CdiReturnStatus CdiAvmValidateBaselineVersionString | ( | CdiBaselineAvmPayloadType | media_type, |
const char * | version_str, | ||
CdiAvmBaselineProfileVersion * | ret_version_ptr ) |
Parses a baseline configuration version number from a string of the form of "xx.yy". When the string represents a registered baseline configuration version, writes the version numbers into the provided output structure.
media_type | Enum which indicates the type of payload data (ie. video, audio or ancillary data). |
version_str | The source string to convert. |
ret_version_ptr | The address of the structure to write the version numbers into. |