CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
cdi_baseline_profile_api.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
7#ifndef CDI_BASELINE_PROFILE_API_H__
8#define CDI_BASELINE_PROFILE_API_H__
9
16#include <stdbool.h>
17
18#include "cdi_avm_api.h"
19
20//*********************************************************************************************************************
21//***************************************** START OF DEFINITIONS AND TYPES ********************************************
22//*********************************************************************************************************************
23
26typedef struct {
27 int major;
28 int minor;
30
40
43#define CDI_BASELINE_AVM_PAYLOAD_TYPE_ENUM_COUNT (kCdiAvmAncillary)
44
52
74
77
87typedef bool (*CdiMakeBaselineConfigurationPtr)(const CdiAvmBaselineConfigCommon* baseline_config_ptr,
88 CdiAvmConfig* config_ptr, int* payload_unit_size_ptr);
97typedef bool (*CdiParseBaselineConfigurationPtr)(const CdiAvmConfig* config_ptr,
98 CdiAvmBaselineConfigCommon* baseline_config_ptr);
99
109 int* payload_unit_size_ptr);
110
118typedef const CdiEnumStringKey* (*CdiAvmKeyGetArrayPtr)(CdiAvmBaselineEnumStringKeyTypes key_type);
119
130
131//*********************************************************************************************************************
132//******************************************* START OF PUBLIC FUNCTIONS ***********************************************
133//*********************************************************************************************************************
134
145 const char* profile_version_str,
146 CdiAvmVTableApi* vtable_api_ptr);
147
167 CdiAvmConfig* config_ptr, int* payload_unit_size_ptr);
168
174 CdiAvmConfig* config_ptr, int* payload_unit_size_ptr);
175
197 CdiAvmBaselineConfig* baseline_config_ptr);
198
204 CdiAvmBaselineConfigCommon* baseline_config_ptr);
205
216 int* payload_unit_size_ptr);
217
223 int* payload_unit_size_ptr);
224
234CDI_INTERFACE const char* CdiAvmKeyEnumToString(CdiAvmBaselineEnumStringKeyTypes key_type, int enum_value,
235 const CdiAvmBaselineProfileVersion* version_ptr);
236
247 const CdiAvmBaselineProfileVersion* version_ptr);
248
258 const CdiAvmBaselineProfileVersion* version_ptr);
259
269CDI_INTERFACE bool CdiAvmParseBaselineVersionString(const char* version_str,
270 CdiAvmBaselineProfileVersion* ret_version_ptr);
271
283 const char* version_str, CdiAvmBaselineProfileVersion* ret_version_ptr);
284
285
286#endif // CDI_BASELINE_PROFILE_API_H__
This file declares the public API data types, structures and functions that comprise the CDI audio,...
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.
Definition baseline_profile.c:333
const CdiEnumStringKey *(* CdiAvmKeyGetArrayPtr)(CdiAvmBaselineEnumStringKeyTypes key_type)
Prototype of function used to get enum/string table for the specified key.
Definition cdi_baseline_profile_api.h:118
CDI_INTERFACE CdiReturnStatus CdiAvmValidateBaselineVersionString(CdiBaselineAvmPayloadType media_type, const char *version_str, CdiAvmBaselineProfileVersion *ret_version_ptr)
Definition baseline_profile.c:419
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...
Definition baseline_profile.c:264
CdiBaselineAvmPayloadType
Payload types used in CdiAvmRxData. NOTE: Any changes made here MUST also be made to "payload_type_ke...
Definition cdi_baseline_profile_api.h:34
@ kCdiAvmAncillary
Payload contains ancillary data.
Definition cdi_baseline_profile_api.h:38
@ kCdiAvmAudio
Payload contains audio data.
Definition cdi_baseline_profile_api.h:37
@ kCdiAvmNotBaseline
Payload contains data for some type other than baseline profile.
Definition cdi_baseline_profile_api.h:35
@ kCdiAvmVideo
Payload contains video data.
Definition cdi_baseline_profile_api.h:36
CDI_INTERFACE CdiReturnStatus CdiAvmMakeBaselineConfiguration(const CdiAvmBaselineConfig *baseline_config_ptr, CdiAvmConfig *config_ptr, int *payload_unit_size_ptr)
Definition baseline_profile.c:234
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 baseli...
Definition baseline_profile.c:339
CdiReturnStatus(* CdiAvmGetBaselineUnitSizePtr)(const CdiAvmBaselineConfigCommon *baseline_config_ptr, int *payload_unit_size_ptr)
Prototype of function used to get baseline unit size.
Definition cdi_baseline_profile_api.h:108
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 ...
Definition baseline_profile.c:241
CDI_INTERFACE int CdiAvmKeyStringToEnum(CdiAvmBaselineEnumStringKeyTypes key_type, const char *name_str, const CdiAvmBaselineProfileVersion *version_ptr)
Definition baseline_profile.c:363
CDI_INTERFACE const char * CdiAvmKeyEnumToString(CdiAvmBaselineEnumStringKeyTypes key_type, int enum_value, const CdiAvmBaselineProfileVersion *version_ptr)
Definition baseline_profile.c:353
CdiAvmBaselineEnumStringKeyTypes
Enums used to indicate which key-value array a function is to access.
Definition cdi_baseline_profile_api.h:58
@ kKeyAvmVideoTcsType
Key for CdiAvmVideoTcs.
Definition cdi_baseline_profile_api.h:67
@ kKeyAvmAudioChannelGroupingType
Key for CdiAvmAudioChannelGrouping.
Definition cdi_baseline_profile_api.h:71
@ kKeyAvmVideoBitDepthType
Key for CdiAvmVideoBitDepth.
Definition cdi_baseline_profile_api.h:65
@ kKeyAvmPayloadType
Keys that contain one set of unique data (not specific to a profile or version). See CdiAvmKeyGetArra...
Definition cdi_baseline_profile_api.h:60
@ kKeyAvmAudioSampleRateType
Key for CdiAvmAudioSampleRate.
Definition cdi_baseline_profile_api.h:72
@ kKeyAvmVideoSamplingType
Keys used by video profiles. See EnumStringKeyTypeToPayloadType().
Definition cdi_baseline_profile_api.h:63
@ kKeyAvmVideoRangeType
Key for CdiAvmVideoRange.
Definition cdi_baseline_profile_api.h:68
@ kKeyAvmVideoAlphaChannelType
Key for CdiAvmVideoAlphaChannel.
Definition cdi_baseline_profile_api.h:64
@ kKeyAvmVideoColorimetryType
Key for CdiAvmColorimetry.
Definition cdi_baseline_profile_api.h:66
CDI_INTERFACE const CdiEnumStringKey * CdiAvmKeyGetArray(CdiAvmBaselineEnumStringKeyTypes key_type, const CdiAvmBaselineProfileVersion *version_ptr)
Definition baseline_profile.c:373
CDI_INTERFACE CdiReturnStatus CdiAvmParseBaselineConfiguration2(const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_config_ptr)
Definition baseline_profile.c:270
CDI_INTERFACE bool CdiAvmParseBaselineVersionString(const char *version_str, CdiAvmBaselineProfileVersion *ret_version_ptr)
Definition baseline_profile.c:391
CDI_INTERFACE CdiReturnStatus CdiAvmRegisterBaselineProfile(CdiBaselineAvmPayloadType media_type, const char *profile_version_str, CdiAvmVTableApi *vtable_api_ptr)
Register a baseline profile.
Definition baseline_profile.c:198
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.
Definition cdi_baseline_profile_api.h:87
bool(* CdiParseBaselineConfigurationPtr)(const CdiAvmConfig *config_ptr, CdiAvmBaselineConfigCommon *baseline_config_ptr)
Prototype of function used to parse a baseline configuration string and generate a configuration stru...
Definition cdi_baseline_profile_api.h:97
CdiReturnStatus
Values used for API function return codes.
Definition cdi_core_api.h:189
#define CDI_INTERFACE
Specify C linkage when compiling as C++ and define API interface export for Windows.
Definition cdi_utility_api.h:34
Structure that is common to all baseline profile versions. This allows the APIs to determine payload ...
Definition cdi_baseline_profile_api.h:48
CdiBaselineAvmPayloadType payload_type
Indicates which payload type.
Definition cdi_baseline_profile_api.h:49
CdiAvmBaselineProfileVersion version
Baseline profile version.
Definition cdi_baseline_profile_api.h:50
Structure that aggregates the audio, video, and ancillary data structures into a single structure.
Definition cdi_baseline_profile_01_00_api.h:189
Structure containing the version information common to audio, video, and metadata in the baseline con...
Definition cdi_baseline_profile_api.h:26
int major
The major number part; this increments to indicate breaking changes.
Definition cdi_baseline_profile_api.h:27
int minor
The minor number part; this increments for trivial, non-breaking changes (e.g., corrections).
Definition cdi_baseline_profile_api.h:28
This is the generic AVM configuration structure which describes the format of each stream.
Definition cdi_avm_api.h:113
Type used to hold V-table of APIs that must be implemented by baseline profiles.
Definition cdi_baseline_profile_api.h:123
int structure_size
Number of bytes in the baseline configuration structure.
Definition cdi_baseline_profile_api.h:128
CdiAvmKeyGetArrayPtr key_get_array_ptr
Function pointer used to get key/string array.
Definition cdi_baseline_profile_api.h:127
CdiAvmGetBaselineUnitSizePtr get_unit_size_ptr
Function pointer used to get unit size.
Definition cdi_baseline_profile_api.h:126
CdiMakeBaselineConfigurationPtr make_config_ptr
Function pointer used to make configuration string.
Definition cdi_baseline_profile_api.h:124
CdiParseBaselineConfigurationPtr parse_config_ptr
Function pointer used to parse configuration string.
Definition cdi_baseline_profile_api.h:125
Type used for holding arrays of enums and related string representations.
Definition cdi_utility_api.h:46