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

Commit 740c2560 authored by Avichal Rakesh's avatar Avichal Rakesh
Browse files

Clean up external HAL reference implementation.

This CL cleans up the reference external HAL implementation.
Specifically, it makes the following changes:

  - Removes mSupportBufMgr from ExternalCameraDeviceSession as it never
    needed to be used.
  - Makes ExternalCameraOfflineSession final to prevent other classes
    from accidentally inheriting from it. ExternalCameraOfflineSession
    calls the virtual function `close()` on destruction which depends on
    the implementation details of other virtual functions.

Bug: 219974678
Test: Builds successfully
Change-Id: I645f8164cd2426219943d9407f0c282c468c90d3
parent 0bc36943
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -217,10 +217,8 @@ void ExternalCameraDeviceSession::initOutputThread() {
    // Grab a shared_ptr to 'this' from ndk::SharedRefBase::ref()
    std::shared_ptr<ExternalCameraDeviceSession> thiz = ref<ExternalCameraDeviceSession>();

    if (mSupportBufMgr) {
    mBufferRequestThread = std::make_shared<BufferRequestThread>(/*parent=*/thiz, mCallback);
    mBufferRequestThread->run();
    }
    mOutputThread = std::make_shared<OutputThread>(/*parent=*/thiz, mCroppingType,
                                                   mCameraCharacteristics, mBufferRequestThread);
}
+0 −1
Original line number Diff line number Diff line
@@ -365,7 +365,6 @@ class ExternalCameraDeviceSession : public BnCameraDeviceSession, public OutputT

    static HandleImporter sHandleImporter;

    bool mSupportBufMgr;
    std::shared_ptr<BufferRequestThread> mBufferRequestThread;

    /* Beginning of members not changed after initialize() */
+3 −3
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ using ::aidl::android::hardware::camera::device::Stream;
using ::aidl::android::hardware::common::fmq::MQDescriptor;
using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;

class ExternalCameraOfflineSession : public BnCameraOfflineSession,
class ExternalCameraOfflineSession final : public BnCameraOfflineSession,
                                           public virtual RefBase,
                                           public virtual OutputThreadInterface {
  public: