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

Commit 502cd6c4 authored by Jiwen 'Steve' Cai's avatar Jiwen 'Steve' Cai
Browse files

Define dvrTrackingCameraDestroy API

It actually makes more sense to have a dedicated Destroy method rather
than reuse dvrTrackingCameraStop.

Bug: 78173557
Bug: 78171546
Test: dvr_tracking-test
Change-Id: I689c2328fe8b4aa80cb3678fee38ced6617adaca
parent 8ca09fb9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,10 @@ int dvrTrackingCameraCreate(DvrTrackingCamera**) {
  return -ENOSYS;
}

void dvrTrackingCameraDestroy(DvrTrackingCamera*) {
  ALOGE("dvrTrackingCameraDestroy is not implemented.");
}

int dvrTrackingCameraStart(DvrTrackingCamera*, DvrWriteBufferQueue*) {
  ALOGE("dvrTrackingCameraCreate is not implemented.");
  return -ENOSYS;
+1 −0
Original line number Diff line number Diff line
@@ -371,6 +371,7 @@ typedef int (*DvrPerformanceSetSchedulerPolicyPtr)(

// dvr_tracking.h
typedef int (*DvrTrackingCameraCreatePtr)(DvrTrackingCamera** out_camera);
typedef void (*DvrTrackingCameraDestroyPtr)(DvrTrackingCamera* camera);
typedef int (*DvrTrackingCameraStartPtr)(DvrTrackingCamera* camera,
                                         DvrWriteBufferQueue* write_queue);
typedef int (*DvrTrackingCameraStopPtr)(DvrTrackingCamera* camera);
+1 −0
Original line number Diff line number Diff line
@@ -184,5 +184,6 @@ DVR_V1_API_ENTRY(PoseClientDataReaderDestroy);

// Tracking
DVR_V1_API_ENTRY(TrackingCameraCreate);
DVR_V1_API_ENTRY(TrackingCameraDestroy);
DVR_V1_API_ENTRY(TrackingCameraStart);
DVR_V1_API_ENTRY(TrackingCameraStop);
+5 −0
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ typedef struct DvrWriteBufferQueue DvrWriteBufferQueue;
// @return Zero on success, or negative error code.
int dvrTrackingCameraCreate(DvrTrackingCamera** out_camera);

// Destroys a DvrTrackingCamera handle.
//
// @param camera The DvrTrackingCamera of interest.
void dvrTrackingCameraDestroy(DvrTrackingCamera* camera);

// Starts the DvrTrackingCamera.
//
// On successful return, all DvrReadBufferQueue's associated with the given
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ class DvrTrackingTest : public DvrApiTest {};

TEST_F(DvrTrackingTest, NotImplemented) {
  ASSERT_TRUE(api_.TrackingCameraCreate != nullptr);
  ASSERT_TRUE(api_.TrackingCameraDestroy != nullptr);
  ASSERT_TRUE(api_.TrackingCameraStart != nullptr);
  ASSERT_TRUE(api_.TrackingCameraStop != nullptr);