Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65b2b5dc authored by Okan Arikan's avatar Okan Arikan Committed by android-build-merger
Browse files

Merge "Floor height API changes." into oc-dr1-dev

am: 2717eaba

Change-Id: Id5783b9713cda9a5b1c62499a29322af3e86630c
parents 44a70e99 2717eaba
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -36,16 +36,23 @@ typedef struct __attribute__((packed, aligned(16))) DvrPoseAsync {
  int64_t timestamp_ns;
  // Bitmask of DVR_POSE_FLAG_* constants that apply to this pose.
  //
  // If DVR_POSE_FLAG_VALID is not set, the pose is indeterminate.
  // If DVR_POSE_FLAG_INVALID is set, the pose is indeterminate.
  uint64_t flags;
  // Reserved padding to 128 bytes.
  uint8_t pad[16];
} DvrPoseAsync;

enum {
  DVR_POSE_FLAG_VALID = (1UL << 0),       // This pose is valid.
  DVR_POSE_FLAG_HEAD = (1UL << 1),        // This pose is the head.
  DVR_POSE_FLAG_CONTROLLER = (1UL << 2),  // This pose is a controller.
  DVR_POSE_FLAG_INVALID = (1UL << 0),       // This pose is invalid.
  DVR_POSE_FLAG_INITIALIZING = (1UL << 1),  // The pose delivered during
                                            // initialization and it may not be
                                            // correct.
  DVR_POSE_FLAG_3DOF =
      (1UL << 2),  // This pose is derived from 3Dof sensors. If
                   // this is not set, pose is derived using
                   // 3Dof and 6Dof sensors.
  DVR_POSE_FLAG_FLOOR_HEIGHT_INVALID =
      (1UL << 3),  // If set the floor height is invalid.
};

// Represents a sensor pose sample.
@@ -70,8 +77,14 @@ typedef struct __attribute__((packed, aligned(16))) DvrPose {
  // Timestamp for the measurement in nanoseconds.
  int64_t timestamp_ns;

  // Padding to 96 bytes so the size is a multiple of 16.
  uint8_t padding[8];
  // The combination of flags above.
  uint64_t flags;

  // The current floor height. May be updated at a lower cadence than pose.
  float floor_height;

  // Padding to 112 bytes so the size is a multiple of 16.
  uint8_t padding[12];
} DvrPose;

__END_DECLS
+3 −3
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ namespace android {
namespace dvr {

// Increment when the layout for the buffers change.
enum : uint32_t { kSharedBufferLayoutVersion = 1 };
enum : uint32_t { kSharedBufferLayoutVersion = 2 };

// Note: These buffers will be mapped from various system processes as well
// as VrCore and the application processes in a r/w manner.
@@ -24,7 +24,7 @@ enum : uint32_t { kSharedBufferLayoutVersion = 1 };

// Sanity check for basic type sizes.
static_assert(sizeof(DvrPoseAsync) == 128, "Unexpected size for DvrPoseAsync");
static_assert(sizeof(DvrPose) == 96, "Unexpected size for DvrPose");
static_assert(sizeof(DvrPose) == 112, "Unexpected size for DvrPose");
static_assert(sizeof(DvrVsync) == 32, "Unexpected size for DvrVsync");
static_assert(sizeof(DvrConfig) == 16, "Unexpected size for DvrConfig");

@@ -85,7 +85,7 @@ struct __attribute__((packed, aligned(16))) DvrVsyncPoseBuffer {
  uint8_t padding[12];
};

static_assert(sizeof(DvrVsyncPoseBuffer) == 1136,
static_assert(sizeof(DvrVsyncPoseBuffer) == 1152,
              "Unexpected size for DvrVsyncPoseBuffer");

// The keys for the dvr global buffers.