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

Commit db972333 authored by Steven Moreland's avatar Steven Moreland
Browse files

EvsResult: resolve TODOs.

Changed usage of enum to bitfield<enum>.

Bug: 34109806
Test: compiles
Change-Id: I69303b3e954ab4ea90f5b6f4ed28edc0cbdce120
parent 8324e693
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -48,14 +48,14 @@ EvsCamera::EvsCamera(const char *id) {

    // Set up dummy data for testing
    if (mDescription.cameraId == kCameraName_Backup) {
        mDescription.hints                  = UsageHint::USAGE_HINT_REVERSE;
        mDescription.hints                  = static_cast<uint32_t>(UsageHint::USAGE_HINT_REVERSE);
        mDescription.vendorFlags            = 0xFFFFFFFF;   // Arbitrary value
        mDescription.defaultHorResolution   = 320;          // 1/2 NTSC/VGA
        mDescription.defaultVerResolution   = 240;          // 1/2 NTSC/VGA
    }
    else if (mDescription.cameraId == kCameraName_RightTurn) {
        // Nothing but the name and the usage hint
        mDescription.hints                  = UsageHint::USAGE_HINT_RIGHT_TURN;
        mDescription.hints                  = static_cast<uint32_t>(UsageHint::USAGE_HINT_RIGHT_TURN);
    }
    else {
        // Leave empty for a minimalist camera description without even a hint
@@ -149,7 +149,7 @@ Return<EvsResult> EvsCamera::startVideoStream(const ::android::sp<IEvsCameraStre
    return EvsResult::OK;
}

Return<EvsResult> EvsCamera::doneWithFrame(uint32_t frameId, const hidl_handle& bufferHandle)  {
Return<EvsResult> EvsCamera::doneWithFrame(uint32_t /* frameId */, const hidl_handle& bufferHandle)  {
    ALOGD("doneWithFrame");
    std::lock_guard<std::mutex> lock(mAccessLock);

+5 −7
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ enum UsageHint : uint32_t {
    USAGE_HINT_REVERSE      = 0x00000001,
    USAGE_HINT_LEFT_TURN    = 0x00000002,
    USAGE_HINT_RIGHT_TURN   = 0x00000004,
    // remaining bits are reserved for future use
};


@@ -49,7 +48,7 @@ enum UsageHint : uint32_t {
 */
struct CameraDesc {
    string              cameraId;
    UsageHint   hints;                  // Bit flags (legal to | values together) (TODO: b/31702236)
    bitfield<UsageHint> hints;                  // Mask of usage hints
    uint32_t            vendorFlags;            // Opaque value from driver
    uint32_t            defaultHorResolution;   // Units of pixels
    uint32_t            defaultVerResolution;   // Units of pixels
@@ -90,7 +89,6 @@ enum DisplayState : uint32_t {


/* Error codes used in EVS HAL interface. */
/* TODO:  Adopt a common set of function return codes */
enum EvsResult : uint32_t {
    OK = 0,
    INVALID_ARG,