The ILMKlvBuilder interface is provided by the LEAD MPEG-2 Transport Multiplexer to simplify the task of parsing Key Length Value (KLV) data. It can be obtained from the multiplexer by reading the ILMMpg2MxT::KlvBuilder property.
Use the KlvBuilder to build and create private data conforming to SMPTE 336M-2007. There are two standards supported by this interface : Universal Metadata Set and Local Metadata Set.
In this standard, keys are formatted and identified as GIUD values indicated by a 16-bit hexadecimal string.
One example of an application of this standard is the one used for vehicles of type Predator UAV (Unmanned Aerial Vehicle): Basic Universal Metadata Set MISB EG 0104.4
In this standard, keys are formatted and identified as short values indicated by an ULONG type.
One example of an application of this standard is the one used for systems of type UAS (Unmanned Air System): Datalink Local Metadata Set Motion Industry Standards Board (MISB) STD 0601.5
The MISB STD 0902.1 provides a refinement of the 0601.5 standard and separates the local metadata described in 0601.5 into "slow" metadata (which changes less often and should be sent every 10 seconds) and "fast" metadata, which changes every time. For example, the MissionID or the plane's name are considered "slow", because they don't change during the recording. So you can save bandwidth by sending these at rare intervals. On the other hand, the metadata describing the position of the plane is considered "fast", because it changes all the time, so it should be written every time new metadata is generated by the plane's sensor. Also, throughout the standard, the plane is referred to as "platform", since the plane can be in fact an unmanned submarine or some other object other than a plane.
MISB Standard 0102.9 describes how to save Security Metadata using Universal or Local sets. You can save them in either format. Consult the standards to determine which keys and values to write and pass the correct information.
Specifies the key searching options.
typedef enum Mpg2MxT_SearchKey
{
Mpg2MxT_SearchKey_Exact = 1, /* Find only the exact key. The key version number must match. */
Mpg2MxT_SearchKey_AnyVersion = 2, /* Ignore the version number when doing the search. */
Mpg2MxT_SearchKey_DesignatorOnly = 3, /* Find the key by the designator only. Ignore the key representation and version number */
} Mpg2MxT_SearchKey;
An exact match is required. All 16 bytes of the key must match.
For a match to be acceptable, all key bytes must match, with the exception of the version key (the 7th byte).
For a match to be acceptable, the key designator component must match. The key designator is stored in the last 8 bytes of the key.
Specifies the key searching errors.
typedef enum Mpg2MxT_Errors
{
Mpg2MxT_E_KEY_NOT_FOUND = 0x80050010, /* The KLV data was not found */
Mpg2MxT_E_BAD_KEY = 0x80050011, /* The KLV key is bad */
} Mpg2MxT_Errors;
Type | Name | Description |
---|---|---|
long | Count | The number of complete top-level KLV keys contained in the internal interface buffer. An incomplete KLV key will not be included in the count. |
VARIANT | GroupKey | Group key defined by the user that is an independent KLV builder; it can be added to the main KLV Builder. |
float | SlowMmsRateInterval | Ratio of slowness of the Slow MMS data to the Fast MMS data. 10.0 is the default value which mean the slow data will be sent one time for every 10 seconds of Fast Data. If this value is one, both the slow and fast data are sent at the same rate. Valid values are between 0 and 10,000.Call this property once to set the rate and then call the FilterMmsData method after you write all of the data (both slow and fast). The FilterMmsData method performs the actual filtering according to the rate set by this property. Some MMS items change more rapidly than others. When sending MMS data in a bandwidth constrained environment, it is more efficient to dedicate the bulk of the available bandwidth to the rapidly changing values, and include the constant items less often. See MISB STD 0902.1 for more details. |
VARIANT_BOOL | EnableMmsRecommendedSettings | Certain metadata items (strings) can be as much as 127 bytes in length. For efficiency, limit strings to the maximum recommended size of 20 bytes. If EnableMmsRecommendedSettings is VARIANT_TRUE, then the long metatdata will be truncated to the recommended size. Otherwise, the long data will be set. See MISB STD 0902.1 for more details. |
Inserts a 24-bit signed integer value into the builder using the local dataset short key.
A zero-based index of the key's insertion point. Possible values are range from 0 to Count - 1. However, the value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (LONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 24-bit unsigned integer value into the builder using the local dataset short key.
A zero-based index of the key's insertion point. Possible values are range from 0 to Count - 1. However, the value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (ULONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 24-bit signed integer value into the builder.
A zero-based index of the key's insertion point. Possible values are range from 0 to Count - 1. However, the value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (LONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 24-bit unsigned integer value into the builder.
A zero-based index of the key's insertion point. Possible values are range from 0 to Count - 1. However, the value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (ULONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Appends a CRC32 checksum (32 bit) to the end of the builder data.
A hexadecimal string that represents the key.
Specifies a different group key to use for checksum calculations. Use NULL or an empty string to default to the predefined GroupKey.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Appends a 16-bit checksum to the end of the builder data using the MISB Minimum Metadata Set as the local dataset short key.
This is a helper function and is equivalent to: AppendLocalChecksum(1, NULL);
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Resets the internal buffer in the builder, this will delete all the data currently in the buffer.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
Begins building private data-containing KLV packets.
Variant containing the private data.
The amount of data contained in Data.
This method uses the smaller of the DataLength parameter and the actual array size. It is particularly useful from ILMMpgDmxCallback::DataAvailable when processing a source file containing KLV data. Build up the KLV data using this method and then edit the individual keys afterwards. This method appends the supplied data to the internal buffer. Call the Clear method to restart the process. The Data parameter must contain a pointer to a byte array.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] Data is NULL. |
E_INVALIDARG | [0x80070057] Data is not a byte array variant. |
Creates an independent builder for constructing subkeys.
Pointer to a VARIANT that holds the key for SubBuilder. The key will be a 16-byte array.
A pointer to a location to store a new builder interface pointer.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] pVal. is NULL |
Deletes an existing key.
The index of the key to delete. The index is 0-based, so allowed values are 0..Count - 1.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
Use searchFlags to specify whether you require an exact match for the key for which you are looking.
Variant describing which key to look for.
One of the flags in the Mpg2MxT_SearchKey enumeration. These flags tell the parser whether the match should be exact.
Pointer to a VARIANT that will be updated with a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in pKeyData.
Pointer to a VARIANT that will be updated key data. The key data will be a byte array variant regardless of the real format of the key data.
Pointer to a long variable that will be updated with the number of bytes stored in pKeyData. This is the same as the size of the pKeyData variant.
This method goes through the top keys in the buffer and compares them with the key passed in KeyToFind. If the key from the buffer matches exactly or partially (as permitted by searchFlags), then the key found is stored in pKey, the key data is stored in pKeyData and the key length is stored in pDataSize.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] pKey, pKeyData or pDataSize is NULL. |
Mpg2MxT_E_KEY_NOT_FOUND | [0x80050010] There is no key matching KeyToFind and searchFlags. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the pKey or pKeyData variants. |
This method works exactly like FindKey, except that the key to search for is passed as a string, rather than a VARIANT.
String describing which key to look for.
One of the flags in the Mpg2MxT_SearchKey enumeration. These flags tell the parser whether the match should be exact.
Pointer to a VARIANT that will be updated with a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in pKeyData.
Pointer to a VARIANT that will be updated key data. The key data will be a byte array variant regardless of the real format of the key data.
Pointer to a long variable that will be updated with the number of bytes stored in pKeyData. This is the same as the size of the pKeyData variant.
KeyToFind is a string containing a hexadecimal representation of the bytes in the key. Each byte should be represented by two hexadecimal digits. Each digit can be:
'0'..'9' or
'a'..'.f' or
'A'..'F'
Space characters are ignored. For example, "06 0E 2B 34 01 0101 04 07 02 01 0101 05 00 00"; is equivalent to "060E2B34010101040702010101050000".
For more information on each parameter, see the description for FindKey.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] pKey, pKeyData or pDataSize is NULL. |
Mpg2MxT_E_KEY_NOT_FOUND | [0x80050010] There is no key matching KeyToFind and searchFlags. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the pKey or pKeyData variants. |
Mpg2MxT_E_BAD_KEY | [0x80050011] The key string is invalid. A key string should contain a hexadecimal representation of a 16-byte value, with 2 digits per byte (32 digits total). |
Creates a copy of the current data.
Pointer to a variant that is filled with a byte array copy of the current data.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] Data is NULL. |
Mpg2MxT_E_KEY_NOT_FOUND | [0x80050010] There is no key matching KeyToFind and searchFlags. |
E_OUTOFMEMORY | [0x80070057] The array for the copy could not be allocated. |
Enumerates all the keys contained in a private data sample.
The index of the key to retrieve. The index is 0-based, so allowed values are 0..Count - 1.
Pointer to a VARIANT that will be updated with a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in pKeyData.
Pointer to a VARIANT that will be updated key data. The key data will be a byte array variant regardless of the real format of the key data.
Pointer to a long variable that will be updated with the number of bytes stored in pKeyData. This is the same as the size of the pKeyData variant.
This method enumerates all the data passed to AddData.
The method allocates data for the pKey and pKeyData variants. Make sure you free the memory allocated in these variants if your programming language does not do so automatically. For example, VB automatically frees this memory, but C/C++ does not. In C++, free the variant memory by calling VariantClear. Please consult the documentation for your programming language for more information on how to free the variant data.
Examine pKey to find out how to interpret the key data. The IKlvBuilder will not interpret the key data for you. There is no one document describing all the KLV keys that can be found in a stream. You will find various documents describing certain lists of currently defined keys. Each company that generates MPEG-2 transport streams or files can write their own internal keys in a private data stream. At the time of writing this documentation, the following documents contained information on KLV keys and how to interpret their content:
UAV Datalink Local Metadata Set (MISB STD 0601.5 6 October 2011)
Predator UAV Basic Universal Metadata Set (MISB EG 0104.4 14 December 2006)
Interpret key data based on this and other documents. For example:
Key: 06 0E 2B 34 01 0101 04 07 02 01 0101 05 00 00
Is a "User Defined Time Stamp (microseconds since 1970)" in msb bit order and the key should be 8 bytes long. In this case, you should verify that *pDataSize is 8. If *pDataSize is 8, you should convert the 8-byte array into a 64-bit unsigned integer (or a double floating point if your programming language does not support 64-bit integers). You would then convert the 64-bit value into a date and time by counting the microseconds since 1970.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid (< 0). |
E_POINTER | [0x80004003] pKey, pKeyData or pDataSize is NULL. |
Mpg2MxT_E_KEY_NOT_FOUND | [0x80050010] The key was not found (keyIndex >= Count). |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the pKey or pKeyData variants. |
Inserts a new key.
The index of the keys insertion point. The index is 0-based, so allowed values are 0..Count - 1. However, a special value of -1 will append the key to the end of the current data.
VARIANT a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in KeyData.
VARIANT containing key data. The key data will be a byte array variant regardless of the real format of the key data.
Long variable describing the number of bytes stored in KeyData. This is the same as the size of the KeyData variant.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Replaces an existing key.
The index of the key to replace. The index is 0-based, so allowed values are 0..Count - 1.
VARIANT a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in KeyData.
VARIANT containing key data. The key data will be a byte array variant regardless of the real format of the key data.
Long variable describing the number of bytes stored in KeyData. This is the same as the size of the KeyData variant.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Creates an independent builder for constructing subkeys. This builder is referred to as a group and identified by the GroupKey.
A hexadecimal string that defines the Key of the group.
A pointer to a location to store a new builder interface pointer.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] pVal is NULL |
Inserts the group into the builder.
The index of the Groupkey's insertion position. The index is 0-based, However, a special value of -1 appends the group at the end of the set.
A hexadecimal string representing the groups key. This value can be NULL or an empty string to indicate the GroupKey is defined within the group.
The pointer to the group's interface to be added.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] pGroup is NULL |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a string value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (string) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts an 8-bit unsigned integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (BYTE) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 16-bit unsigned integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (USHORT) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 32-bit unsigned integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (ULONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 64-bit unsigned integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (ULONGLONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts an 8-bit signed integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (CHAR) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 16-bit signed integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (SHORT) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 32-bit signed integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (LONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 64-bit signed integer value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (LONGLONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a float value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (FLOAT) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a double value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
The simple value (DOUBLE) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts an array value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A hexadecimal string that represents the key.
VARIANT containing key value, that will be a byte array.
forces the actual size of the data. Specify -1 to use all of the array data.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Appends a 16 bit checksum to the end of the builder data.
A hexadecimal string that represents the key.
Specifies a different group key to use for checksum calculations. Use NULL or an empty string to default to the predefined GroupKey.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts the group into the builder using the local dataset short key.
The index of the Groupkey's insertion position. The index is 0-based, However, a special value of -1 will append the group at the end of the set.
A local dataset ULONG key.
The group interface pointer to be added.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] pGroup is NULL |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a string value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (string) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts an 8-bit unsigned integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (BYTE) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 16-bit unsigned integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (USHORT) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 32-bit unsigned integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (ULONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 64-bit unsigned integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (ULONGLONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts an 8-bit signed integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (CHAR) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 16-bit signed integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (SHORT) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 32-bit signed integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (LONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a 64-bit signed integer value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (LONGLONG) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a float value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (FLOAT) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a double value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (DOUBLE) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts an array value into the builder using the local dataset short key.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
VARIANT containing key value, that will be a byte array.
Actual data size. Specify -1 to use all of the array data.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Appends a 16-bit checksum to the end of the builder data using the local dataset short key.
A local dataset short key.
Specifies a different group key to use for the checksum calculation. Use NULL or an empty string to default to the predefined GroupKey.
The checksum value is used for error detection and it is highly recommended that a 16-bit checksum is included in every Local Data Set packet.
This value is running a 16-bit sum through the entire LDS packet. The sum is composed of the local data set key and the length field that indicates the data size.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a Unicode string value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (string) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts a local Unicode string value into the builder.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
A local dataset ULONG key.
The simple value (string) to be inserted.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Creates an MISB Minimum Metadata Set (MMS) builder.
A pointer to a location to store a new builder interface pointer.
This is a helper function and is equivalent to: CreateGroup(CComBSTR(L"06 0E 2B 34 02 0B 01 01 0E 01 03 01 01 00 00 00"), pVal);
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_POINTER | [0x80004003] pVal is NULL |
Microseconds since 00:00:00 Jan 1, 1970 (UTC).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
UNIX Time Stamp (Tag 2).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
String containing the mission identifier.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Mission ID (Tag 3).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Aircraft heading angle (in degrees) of the longitudinal axis and the North. Should be between 0 and 360.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Platform Heading Angle (Tag 5). see standard MISB STD 0902.1.
This is the horizontal angle. Together with tag 18, this forms the Look Angle, giving the true 3D angle of the plane.
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Plane pitch angle (in degrees, should be between -20 and +20).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, the special value of -1 will append the key at the end of the current data.
Platform Pitch (Tag 6).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Plane roll angle (in degrees, should be between -50 and +50).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Platform Roll (Tag 7).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
String containing the name of the plane model ('Predator", "Reaper", etc). Should be less than 127 characters.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Platform Designation (Tag 10).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
String containing the sensor name ("EO Nose", "EO Spotter", etc). Should be one of the available sensors available for the current PlatformDesignation (Tag 10).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Image Source Sensor (Tag 11).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
String containing the image coordinate system ("Geodetic WGS84", UTM", etc).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
ImageCoordinateSystem (Tag 12).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Sensor Latitude, based on WGS84 ellipsoid in degrees (should be between -90 and +90).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor Latitude (Tag 13).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Sensor Longitude, based on WGS84 ellipsoid in degrees (should be between -180 and +180).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor Longitude (Tag 14).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Sensor altitude compared to the mean sea level (MSL), in meters. Should be between -900 and +19,000.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor True Altitude (Tag 15).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Horizontal field of view of the sensor, in degrees. Should be between 0 and 180.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor Field of View (H) (Tag 16).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Vertical sensor field of view of the sensor, in degrees. Should be between 0 and 180.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor Field of View (V) (Tag 17).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Angle (in degrees) of the sensor to the platform longitudinal axis as seen from above the platform. Should be between 0 and 360.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor Rel. Azimuth Angle (Tag 18).
This is the vertical angle; together with tag 5, this forms the Look Angle, giving the true 3D angle of the plane.
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Elevation angle of the sensor relative to the platform's longitudinal-transverse plane, in degrees. Should be between -180 and +180.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor Relative Elevation Angle (Tag 19).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Roll angle of the sensor, in degrees. Should be between -180 and +180.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Sensor Rel. Roll Angle (Tag 20).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Slant range (distance to target) in meters. Should be between 0 and 5,000,000.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Slant Range (Tag 21).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Width of the target as it appears on the sensor, in meters. Should be between 0 and 10,000.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Target Width (Tag 22).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Latitude of the terrain in the center of the frame based on the WGS84 ellipsoid, in degrees. Should be between -90 and +90.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Frame Center Latitude (Tag 23).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Longitude of the terrain in the center of the frame, based on the WGS84 ellipsoid, in degrees. Should be between -180 and +180.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Frame Center Longitude (Tag 24).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Elevation of the terrain in the center of the frame relative to the mean sea level (MSL), in meters. Should be between -900 and 19000.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Frame Center Elevation (Tag 25).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Inserts the security local metadata set. You will need to pass the byte value, not the string for securityClassification and classifyingCountry encoding, not the strings.
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
Security Classification (Tag 48/1).
Classifying Country (Tag 48/2 ).
Classifying Country andReleasing InstructionsCountry Coding Method5 (Tag 48/3 ).
Security-SCI/SHI Information (Tag 48/4 ).
Caveats (Tag 48/5 ).
Releasing Instructions (Tag 48/6 ).
Object Country Coding Method (Tag 48/12 ).
Object Country Codes (Tag 48/13 ).
Security Metadata Version (Tag 48/22 ).
refer to standards MISB Standard 0102.9, MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Version of the LDS document used to generate the values (0 for pre-release and 1..255 for standards 0601.1 through 0601.255).
The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.
UAS LDS Version (Tag 65).
If you use MISB STD 0601.5, then you should set this to 4. Refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
DISP_E_BADINDEX | [0x8002000B] keyIndex is invalid. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
Instructs the KLV Builder to calculate and append a 16-bit checksum (Tag 1) to the end of the builder data using the values inserted up to this point.
You should call this method AFTER you add all the other values. It is recommended that you generate this checksum to give the receiver the ability to detect whether corruption has occurred during transmission.
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
E_OUTOFMEMORY | [0x8007000E] Could not allocate memory for the new data. |
After writing all of the MMS metadata, call FilterMmsData to filter out the slow data according to the interval set in SlowMmsRateInterval and MISB STD 0902.1.
Flags define the PTS format, and uses the values from Mpg2MxT_WriteFlag enumeration for convenience.
The user passes the current timestamp.
The 0902.1 Standard identifies which tags are considered "slow" tags (so should be sent less often) and which tags should be considered "fast" (and should be sent every time). The SlowMmsRateInterval determines how often the slow data tags should be written. For example, if the SlowMmsRateInterval is 10.0, the slow data will be sent every 10 seconds (which is the recommended behavior in MISB STD 0902.1).
To write data compatible with MISB STD 0902.1), you have two choices:
Filter the data yourself and add slow data every 10 seconds (or however often you wish). In this case, you do not need to call FilterMmsData or set SlowMmsRateInterval.
Add all the data every time, set SlowMmsRateInterval to the desired frequency for the slow data and call FilterMmsData right before calling WriteKlvData to remove the remove the slow tags if less than 'SlowMmsRateInterval' number of seconds have passed since the last time the slow data has been sent.
If this function is not called, all the data will be sent every time WriteKlvData() is called (which means SlowMmsRateInterval will have no effect).
refer to standards MISB STD 0601.5 and 0902.1 for more details.
Return | Description |
---|---|
S_OK | Successful. |
< 0 | An error occurred. |
VFW_E_WRONG_STATE | [0x80040227L] Conversion is stopped. |