Program Listing for File keyframe-header.h

Return to documentation for file (include\metadata\keyframe-header.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include "metadata/metadata-header.h"

namespace gpa {
namespace serialization {
namespace metadata {

enum KeyframeHeaderVersions : uint32_t {
    VERSION_1,
    VERSION_2,  // added flags to indicate deferred-capture keyframe
    VERSION_3,  // added frameNumber field
    VERSION_4,  // added subcapture data offset field
    VERSION_COUNT,
};

enum KeyframeFlagBits : uint32_t {
    DEFAULT_KEYFRAME_BIT = 0x0,
    DEFERRED_CAPTURE_KEYFRAME_BIT = 0x1,
    SUB_CAPTURE_KEYFRAME_BIT = 0x2,
};

using KeyframeFlags = uint32_t;

struct KeyframeHeaderVer1 : public Header
{
    union
    {
        uint64_t timestamp;
        uint64_t beginKeyframeTimestamp;
    };
    uint64_t endKeyframeTimestamp;
    uint64_t nextKeyframeOffset;
    uint32_t version;
};

struct KeyframeHeaderVer2 : public KeyframeHeaderVer1
{
    KeyframeFlags flags;
};

struct KeyframeHeaderVer3 : public KeyframeHeaderVer2
{
    int64_t frameNumber;
};

struct KeyframeHeaderVer4 : public KeyframeHeaderVer3
{
    uint64_t subcaptureDataStartOffset;
};

using KeyframeHeaderBase = KeyframeHeaderVer1;  // Should always point to the first version
using KeyframeHeader = KeyframeHeaderVer4;      // Should always point to the latest version

}  // namespace metadata
}  // namespace serialization
}  // namespace gpa