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

Commit 5566b8e7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I3e5d0cd7,I645f8164

* changes:
  External Camera HAL: Fix prefix length
  Clean up external HAL reference implementation.
parents 71ee6013 91515788
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:
+2 −2
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ const int kMaxDevicePathLen = 256;
constexpr char kDevicePath[] = "/dev/";
constexpr char kPrefix[] = "video";
constexpr int kPrefixLen = sizeof(kPrefix) - 1;
constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen + 1;
constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen - 1;

bool matchDeviceName(int cameraIdOffset, const std::string& deviceName, std::string* deviceVersion,
                     std::string* cameraDevicePath) {