CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
baseline_profiles_2_00.c File Reference

This file contains the functions and other definitions that comprise the CDI AVM baseline profile. More...

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cdi_baseline_profile_01_00_api.h"
#include "cdi_logger_api.h"
#include "utilities_api.h"

Functions

static const CdiEnumStringKeyKeyGetArray (CdiAvmBaselineEnumStringKeyTypes key_type)
 Update EnumStringKeyTypes in cdi_utility_api.h whenever an entry is added to this function's switch statement.
 
static bool GetVideoUnitSize (const CdiAvmBaselineConfig *baseline_config_ptr, int *payload_unit_size_ptr)
 
static bool MakeBaselineVideoConfiguration (const CdiAvmBaselineConfigCommon *baseline_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr)
 
static bool GetAudioUnitSize (const CdiAvmBaselineConfig *baseline_config_ptr, int *payload_unit_size_ptr)
 
static bool MakeBaselineAudioConfiguration (const CdiAvmBaselineConfigCommon *baseline_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr)
 
static bool GetAncillaryDataUnitSize (const CdiAvmBaselineConfig *baseline_config_ptr, int *payload_unit_size_ptr)
 
static bool MakeBaselineAncillaryDataConfiguration (const CdiAvmBaselineConfigCommon *baseline_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr)
 
static bool ParseBaselineVideoConfiguration (const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_ptr)
 
static bool ParseBaselineAudioConfiguration (const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_ptr)
 
static bool ParseBaselineAncillaryDataConfiguration (const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_ptr)
 
static CdiReturnStatus GetBaselineUnitSize (const CdiAvmBaselineConfigCommon *baseline_ptr, int *payload_unit_size_ptr)
 See CdiAvmGetBaselineUnitSize().
 
CdiReturnStatus RegisterAvmBaselineProfiles_2_00 (void)
 Register baseline profile 02.00.
 

Variables

static const char * profile_version_video_str = "02.00"
 
static const char * profile_version_audio_str = "02.00"
 
static const char * profile_version_ancillary_data_str = "02.00"
 
static const CdiEnumStringKey video_sampling_key_array []
 Enum/string keys for CdiAvmVideoSampling.
 
static const CdiEnumStringKey alpha_channel_key_array []
 Enum/string keys for CdiAvmVideoAlphaChannel.
 
static const CdiEnumStringKey tcs_key_array []
 Enum/string keys for CdiAvmVideoTcs.
 
static const CdiEnumStringKey range_key_array []
 Enum/string keys for CdiAvmVideoRange.
 
static const CdiEnumStringKey video_bit_depth_key_array []
 Enum/string keys for CdiAvmVideoBitDepth.
 
static const CdiEnumStringKey colorimetry_key_array []
 Enum/string keys for CdiAvmColorimetry.
 
static const CdiEnumStringKey audio_channel_grouping_key_array []
 Enum/string keys for CdiAvmAudioChannelGrouping.
 
static const CdiEnumStringKey audio_sample_rate_key_array []
 Enum/string keys for CdiAvmAudioSampleRate.
 

Detailed Description

This file contains the functions and other definitions that comprise the CDI AVM baseline profile.

Function Documentation

◆ GetAncillaryDataUnitSize()

static bool GetAncillaryDataUnitSize ( const CdiAvmBaselineConfig * baseline_config_ptr,
int * payload_unit_size_ptr )
static

Returns the number of bits that comprise the smallest number of bits that should be kept together for transmitting ancillary data.

Parameters
baseline_config_ptrPointer to the config structure with the specifics of the ancillary data format whose unit size is to be returned.
payload_unit_size_ptrPointer to where the unit size is to be written.
Returns
false if the configuration is not valid enough to determine the unit size, true otherwise.

◆ GetAudioUnitSize()

static bool GetAudioUnitSize ( const CdiAvmBaselineConfig * baseline_config_ptr,
int * payload_unit_size_ptr )
static

Returns the number of bits that evenly fit audio samples into bytes. It includes the samples for all of the channels in the stream.

Parameters
baseline_config_ptrPointer to the config structure with the specifics of the audio format whose unit size is to be returned.
payload_unit_size_ptrPointer to where the unit size is to be written.
Returns
false if the configuration is not valid enough to determine the unit size, true otherwise.

◆ GetVideoUnitSize()

static bool GetVideoUnitSize ( const CdiAvmBaselineConfig * baseline_config_ptr,
int * payload_unit_size_ptr )
static

Returns the number of bits that evenly fit video pixels into bytes. This is explained in ST 2110-20 and these values are in the tables, though they're expressed in units of bytes.

Parameters
baseline_config_ptrPointer to the config structure with the specifics of the video format whose unit size is to be returned.
payload_unit_size_ptrPointer to where the unit size is to be written.
Returns
false if the configuration is not valid enough to determine the unit size, true otherwise.

◆ MakeBaselineAncillaryDataConfiguration()

static bool MakeBaselineAncillaryDataConfiguration ( const CdiAvmBaselineConfigCommon * baseline_ptr,
CdiAvmConfig * config_ptr,
int * payload_unit_size_ptr )
static

Populates the provided generic configuration structure with the information from an ancillary data baseline configuration structure.

Parameters
baseline_ptrPointer to the source configuration; its payload_type must be kCdiAvmAncillary.
config_ptrAddress of where the generic configuration is to be written.
payload_unit_size_ptrPointer to where the payload unit size is to be written.
Returns
true if the conversion was successful, false if it failed.

◆ MakeBaselineAudioConfiguration()

static bool MakeBaselineAudioConfiguration ( const CdiAvmBaselineConfigCommon * baseline_ptr,
CdiAvmConfig * config_ptr,
int * payload_unit_size_ptr )
static

Populates the provided generic configuration structure with the information from an audio baseline configuration structure.

Parameters
baseline_ptrPointer to the source configuration; its payload_type must be kCdiAvmAudio.
config_ptrAddress of where the generic configuration is to be written.
payload_unit_size_ptrPointer to where the payload unit size is to be written.
Returns
true if the conversion was successful, false if it failed.

◆ MakeBaselineVideoConfiguration()

static bool MakeBaselineVideoConfiguration ( const CdiAvmBaselineConfigCommon * baseline_ptr,
CdiAvmConfig * config_ptr,
int * payload_unit_size_ptr )
static

Populates the provided generic configuration structure with the information from a video baseline configuration structure.

Parameters
baseline_ptrPointer to the source configuration; its payload_type must be kCdiAvmVideo.
config_ptrAddress of where the generic configuration is to be written.
payload_unit_size_ptrPointer to where the payload unit size is to be written.
Returns
true if the conversion was successful, false if it failed.

◆ ParseBaselineAncillaryDataConfiguration()

static bool ParseBaselineAncillaryDataConfiguration ( const CdiAvmConfig * config_ptr,
CdiAvmBaselineConfigCommon * baseline_ptr )
static

Attempts to interpret a generic AVM configuration structure and convert it into a baseline configuration structure for ancillary data. Unknown parameters do not result in failure but do cause warnings to be logged in order to handle forward compatiblity as gracefully as possible.

Parameters
config_ptrPointer to the source generic configuration structure.
baseline_ptrAddress where the resulting video baseline configuration data will be written.
Returns
true if the conversion was successful, false if a failure was encountered.

◆ ParseBaselineAudioConfiguration()

static bool ParseBaselineAudioConfiguration ( const CdiAvmConfig * config_ptr,
CdiAvmBaselineConfigCommon * baseline_ptr )
static

Attempts to interpret a generic AVM configuration structure and convert it into a baseline configuration structure for audio. Unknown parameters do not result in failure but do cause warnings to be logged in order to handle forward compatiblity as gracefully as possible.

Parameters
config_ptrPointer to the source generic configuration structure.
baseline_ptrAddress where the resulting video baseline configuration data will be written.
Returns
true if the conversion was successful, false if a failure was encountered.

◆ ParseBaselineVideoConfiguration()

static bool ParseBaselineVideoConfiguration ( const CdiAvmConfig * config_ptr,
CdiAvmBaselineConfigCommon * baseline_ptr )
static

Attempts to interpret a generic AVM configuration structure and convert it into a baseline configuration structure for video. Unknown parameters do not result in failure but do cause warnings to be logged in order to handle forward compatiblity as gracefully as possible.

Parameters
config_ptrPointer to the source generic configuration structure.
baseline_ptrAddress where the resulting video baseline configuration data will be written.
Returns
true if the conversion was successful, false if a failure was encountered.

◆ RegisterAvmBaselineProfiles_2_00()

CdiReturnStatus RegisterAvmBaselineProfiles_2_00 ( void )

Register baseline profile 02.00.

Returns
kCdiStatusOk if ok. kCdiStatusArraySizeExceeded if array size has been exceeded, otherwise kCdiStatusFatal.

Variable Documentation

◆ alpha_channel_key_array

const CdiEnumStringKey alpha_channel_key_array[]
static
Initial value:
= {
{ kCdiAvmAlphaUnused, "Unused" },
{ kCdiAvmAlphaUsed, "Used" },
}
@ kCdiAvmAlphaUsed
For every set of video sample pixels there is an alpha pixel of the same bit depth and format being s...
Definition cdi_baseline_profile_01_00_api.h:44
@ kCdiAvmAlphaUnused
Alpha channel not being used.
Definition cdi_baseline_profile_01_00_api.h:36
#define CDI_INVALID_ENUM_VALUE
Used to define an invalid enum found.
Definition cdi_utility_api.h:38

Enum/string keys for CdiAvmVideoAlphaChannel.

◆ audio_channel_grouping_key_array

const CdiEnumStringKey audio_channel_grouping_key_array[]
static
Initial value:
= {
{ kCdiAvmAudioM, "SMPTE2110.(M)" },
{ kCdiAvmAudioDM, "SMPTE2110.(DM)" },
{ kCdiAvmAudioST, "SMPTE2110.(ST)" },
{ kCdiAvmAudioLtRt, "SMPTE2110.(LtRt)" },
{ kCdiAvmAudio51, "SMPTE2110.(51)" },
{ kCdiAvmAudio71, "SMPTE2110.(71)"},
{ kCdiAvmAudio222, "SMPTE2110.(222)" },
{ kCdiAvmAudioSGRP, "SMPTE2110.(SGRP)" },
}
@ kCdiAvmAudioST
Standard stereo (left, right).
Definition cdi_baseline_profile_01_00_api.h:154
@ kCdiAvmAudioLtRt
Matrix stereo (Left Total, Right Total).
Definition cdi_baseline_profile_01_00_api.h:155
@ kCdiAvmAudio222
22.2 Surround (SMPTE ST 2036-2, Table 1).
Definition cdi_baseline_profile_01_00_api.h:158
@ kCdiAvmAudioM
Mono.
Definition cdi_baseline_profile_01_00_api.h:152
@ kCdiAvmAudioDM
Dual mono (M1, M2).
Definition cdi_baseline_profile_01_00_api.h:153
@ kCdiAvmAudio71
7.1 Surround (L, R, C, LFE, Lss, Rss, Lrs, Rrs).
Definition cdi_baseline_profile_01_00_api.h:157
@ kCdiAvmAudio51
5.1 Surround (L, R, C, LFE, Ls, Rs),
Definition cdi_baseline_profile_01_00_api.h:156
@ kCdiAvmAudioSGRP
One SDI audio group (1, 2, 3, 4).
Definition cdi_baseline_profile_01_00_api.h:159

Enum/string keys for CdiAvmAudioChannelGrouping.

◆ audio_sample_rate_key_array

const CdiEnumStringKey audio_sample_rate_key_array[]
static
Initial value:
= {
}
@ kCdiAvmAudioSampleRate48kHz
48 kHz audio sample rate.
Definition cdi_baseline_profile_01_00_api.h:165
@ kCdiAvmAudioSampleRate96kHz
96 kHz audio sample rate.
Definition cdi_baseline_profile_01_00_api.h:166

Enum/string keys for CdiAvmAudioSampleRate.

◆ colorimetry_key_array

const CdiEnumStringKey colorimetry_key_array[]
static
Initial value:
= {
}
@ kCdiAvmVidColorimetryBT2020
Recommendation ITU-R BT.2020-2.
Definition cdi_baseline_profile_01_00_api.h:60
@ kCdiAvmVidColorimetryXYZ
ISO 11664-1 section titled "1931 Observer".
Definition cdi_baseline_profile_01_00_api.h:64
@ kCdiAvmVidColorimetryST2065_3
Academy Density Exchange Encoding (ADX) in SMPTE ST 2065-3.
Definition cdi_baseline_profile_01_00_api.h:63
@ kCdiAvmVidColorimetryST2065_1
SMPTE ST 2065-1 Academy Color Encoding Specification (ACES)
Definition cdi_baseline_profile_01_00_api.h:62
@ kCdiAvmVidColorimetryBT709
Recommendation ITU-R BT.709-6.
Definition cdi_baseline_profile_01_00_api.h:59
@ kCdiAvmVidColorimetryBT2100
Recommendation ITU-R BT.2100 Table 2 titled "System colorimetry".
Definition cdi_baseline_profile_01_00_api.h:61
@ kCdiAvmVidColorimetryBT601
Recommendation ITU-R BT.601-7.
Definition cdi_baseline_profile_01_00_api.h:58

Enum/string keys for CdiAvmColorimetry.

◆ profile_version_ancillary_data_str

const char* profile_version_ancillary_data_str = "02.00"
static

The current version of the baseline ancillary data profile. This value is always sent with AVM configuration structures for ancillary data.

◆ profile_version_audio_str

const char* profile_version_audio_str = "02.00"
static

The current version of the baseline audio profile. This value is always sent with AVM configuration structures for audio.

◆ profile_version_video_str

const char* profile_version_video_str = "02.00"
static

The current version of the baseline video profile. This value is always sent with AVM configuration structures for video.

◆ range_key_array

const CdiEnumStringKey range_key_array[]
static
Initial value:
= {
{ kCdiAvmVidRangeNarrow, "NARROW" },
{ kCdiAvmVidRangeFullProtect, "FULLPROTECT" },
{ kCdiAvmVidRangeFull, "FULL" },
}
@ kCdiAvmVidRangeFullProtect
Invalid in the context of ITU Rec BT.2100. In other contexts corresponds to ranges set in STMPE RP 20...
Definition cdi_baseline_profile_01_00_api.h:88
@ kCdiAvmVidRangeNarrow
When paired with ITU Rec BT.2100 sets values to ranges specified in table 9 of ITU Rec BT....
Definition cdi_baseline_profile_01_00_api.h:86
@ kCdiAvmVidRangeFull
When paired with ITU Rec BT.2100 sets values to ranges specified in table 9 of ITU Rec BT....
Definition cdi_baseline_profile_01_00_api.h:91

Enum/string keys for CdiAvmVideoRange.

◆ tcs_key_array

const CdiEnumStringKey tcs_key_array[]
static
Initial value:
= {
{ kCdiAvmVidTcsSDR, "SDR" },
{ kCdiAvmVidTcsPQ, "PQ" },
{ kCdiAvmVidTcsHLG, "HLG" },
{ kCdiAvmVidTcsLinear, "LINEAR" },
{ kCdiAvmVidTcsBT2100LINPQ, "BT2100LINPQ" },
{ kCdiAvmVidTcsBT2100LINHLG, "BT2100LINHLG" },
{ kCdiAvmVidTcsST2065_1, "ST2065-1" },
{ kCdiAvmVidTcsST428_1, "ST428-1" },
{ kCdiAvmVidTcsDensity, "DENSITY" },
}
@ kCdiAvmVidTcsDensity
Video streams of density encoded samples such as those defined in SMPTE ST 2065-3.
Definition cdi_baseline_profile_01_00_api.h:78
@ kCdiAvmVidTcsBT2100LINHLG
HLG with floating point representation. Recommendation ITU-R BT.2100-0.
Definition cdi_baseline_profile_01_00_api.h:75
@ kCdiAvmVidTcsSDR
Standard Dynamic Range video streams. Recommendation ITU-R BT.2020.
Definition cdi_baseline_profile_01_00_api.h:70
@ kCdiAvmVidTcsST428_1
Video stream using transfer characteristic specified in SMPTE ST 428-1.
Definition cdi_baseline_profile_01_00_api.h:77
@ kCdiAvmVidTcsHLG
Hybrid Log-Gamma (HLG) high dynamic range. Recommendation ITU-R BT.2100.
Definition cdi_baseline_profile_01_00_api.h:72
@ kCdiAvmVidTcsLinear
Linear encoded floating point samples (dept=16f) all values fall in range 0.0 - 1....
Definition cdi_baseline_profile_01_00_api.h:73
@ kCdiAvmVidTcsST2065_1
Video stream of linear encoded floating point as specified in SMPTE ST 2065-1.
Definition cdi_baseline_profile_01_00_api.h:76
@ kCdiAvmVidTcsPQ
Perceptual Quantization (PQ) high dynamic range. Recommendation ITU-R BT.2100.
Definition cdi_baseline_profile_01_00_api.h:71
@ kCdiAvmVidTcsBT2100LINPQ
PQ with floating point representation. Recommendation ITU-R BT.2100-0.
Definition cdi_baseline_profile_01_00_api.h:74

Enum/string keys for CdiAvmVideoTcs.

◆ video_bit_depth_key_array

const CdiEnumStringKey video_bit_depth_key_array[]
static
Initial value:
= {
{ kCdiAvmVidBitDepth8, "8bit" },
{ kCdiAvmVidBitDepth10, "10bit" },
{ kCdiAvmVidBitDepth12, "12bit" },
}
@ kCdiAvmVidBitDepth10
10 bit integer samples
Definition cdi_baseline_profile_01_00_api.h:51
@ kCdiAvmVidBitDepth8
8 bit integer samples
Definition cdi_baseline_profile_01_00_api.h:50
@ kCdiAvmVidBitDepth12
12 bit integer samples
Definition cdi_baseline_profile_01_00_api.h:52

Enum/string keys for CdiAvmVideoBitDepth.

◆ video_sampling_key_array

const CdiEnumStringKey video_sampling_key_array[]
static
Initial value:
= {
{ kCdiAvmVidYCbCr444, "YCbCr-4:4:4" },
{ kCdiAvmVidYCbCr422, "YCbCr-4:2:2" },
{ kCdiAvmVidRGB, "RGB" },
}
@ kCdiAvmVidRGB
SMPTE 2110 RGB (linear) video sample format.
Definition cdi_baseline_profile_01_00_api.h:31
@ kCdiAvmVidYCbCr444
SMPTE 2110 4:4:4 YUV video sample format.
Definition cdi_baseline_profile_01_00_api.h:29
@ kCdiAvmVidYCbCr422
SMPTE 2110 4:2:2 YUV video sample format.
Definition cdi_baseline_profile_01_00_api.h:30

Enum/string keys for CdiAvmVideoSampling.