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

Commit 672dc1a8 authored by Marie White's avatar Marie White Committed by android-build-merger
Browse files

Merge "Add api's to dvr_pose to retrieve data from sensord" into oc-mr1-dev

am: 3a54e9f4

Change-Id: Icfb6b0c4f6eec7f03f35068d4b341cf2e172ccb6
parents 83a4bd5c 3a54e9f4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ srcs = [
    "dvr_display_manager.cpp",
    "dvr_hardware_composer_client.cpp",
    "dvr_performance.cpp",
    "dvr_pose.cpp",
    "dvr_surface.cpp",
    "dvr_vsync.cpp",
]
+7 −0
Original line number Diff line number Diff line
@@ -9,6 +9,13 @@

struct ANativeWindow;

typedef struct DvrReadBuffer DvrReadBuffer;
typedef struct DvrReadBufferQueue DvrReadBufferQueue;
typedef struct DvrWriteBuffer DvrWriteBuffer;
typedef void (*DvrReadBufferQueueBufferAvailableCallback)(void* context);
typedef void (*DvrReadBufferQueueBufferRemovedCallback)(DvrReadBuffer* buffer,
                                                        void* context);

struct DvrWriteBufferQueue {
  using ProducerQueue = android::dvr::ProducerQueue;

+30 −0
Original line number Diff line number Diff line
#include "include/dvr/dvr_pose.h"

#include <memory>

#include <private/dvr/buffer_hub_queue_client.h>
#include <private/dvr/pose_client_internal.h>

#include "dvr_buffer_queue_internal.h"

using android::dvr::ConsumerQueue;

int dvrPoseClientGetDataReader(DvrPoseClient* client,
                               DvrPoseRawDataType data_type,
                               DvrReadBufferQueue** queue_out) {
  if (!client || !queue_out)
    return -EINVAL;

  ConsumerQueue* consumer_queue;
  int status = android::dvr::dvrPoseClientGetDataReaderHandle(client,
                                                              data_type,
                                                              &consumer_queue);
  if (status != 0) {
    ALOGE("dvrPoseClientGetDataReader: Failed to get queue: %d", status);
    return status;
  }

  std::shared_ptr<ConsumerQueue> consumer_queue_ptr{consumer_queue};
  *queue_out = new DvrReadBufferQueue(consumer_queue_ptr);
  return 0;
}
+10 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ typedef uint64_t DvrSurfaceUpdateFlags;
typedef struct DvrDisplayManager DvrDisplayManager;
typedef struct DvrSurfaceState DvrSurfaceState;
typedef struct DvrPoseClient DvrPoseClient;
typedef struct DvrPoseDataCaptureRequest DvrPoseDataCaptureRequest;
typedef struct DvrVSyncClient DvrVSyncClient;
typedef struct DvrVirtualTouchpad DvrVirtualTouchpad;

@@ -246,6 +247,15 @@ typedef int (*DvrPoseClientGetControllerPtr)(DvrPoseClient* client,
                                             DvrPoseAsync* out_pose);
typedef int (*DvrPoseClientSensorsEnablePtr)(DvrPoseClient* client,
                                             bool enabled);
typedef int (*DvrPoseClientDataCapturePtr)(DvrPoseClient* client,
    const DvrPoseDataCaptureRequest* request);
typedef int (*DvrPoseClientDataReaderDestroyPtr)(DvrPoseClient* client,
                                                 DvrPoseRawDataType data_type);

// dvr_pose.h
typedef int (*DvrPoseClientGetDataReaderPtr)(DvrPoseClient* client,
                                             DvrPoseRawDataType data_type,
                                             DvrReadBufferQueue** read_queue);

// services/vr/virtual_touchpad/include/dvr/virtual_touchpad_client.h

+5 −0
Original line number Diff line number Diff line
@@ -166,3 +166,8 @@ DVR_V1_API_ENTRY(WriteBufferQueueCreate);

// Gets an ANativeWindow from DvrWriteBufferQueue.
DVR_V1_API_ENTRY(WriteBufferQueueGetANativeWindow);

// Pose client
DVR_V1_API_ENTRY(PoseClientGetDataReader);
DVR_V1_API_ENTRY(PoseClientDataCapture);
DVR_V1_API_ENTRY(PoseClientDataReaderDestroy);
Loading