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

Commit e67b58ee authored by Ryan Prichard's avatar Ryan Prichard Committed by Automerger Merge Worker
Browse files

Merge changes Ib3ae6b55,If6dd5edb,If562374c into main am: ce6c3119

parents 12a28013 ce6c3119
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ using namespace hardware::cas::V1_0;
using namespace hardware::cas::native::V1_0;
using DrmBufferType = hardware::drm::V1_0::BufferType;
using BufferInfo = ACodecBufferChannel::BufferInfo;
using BufferInfoIterator = std::vector<const BufferInfo>::const_iterator;
using BufferInfoIterator = std::vector<BufferInfo>::const_iterator;

ACodecBufferChannel::~ACodecBufferChannel() {
    if (mCrypto != nullptr && mDealer != nullptr && mHeapSeqNum >= 0) {
@@ -59,7 +59,7 @@ ACodecBufferChannel::~ACodecBufferChannel() {
}

static BufferInfoIterator findClientBuffer(
        const std::shared_ptr<const std::vector<const BufferInfo>> &array,
        const std::shared_ptr<const std::vector<BufferInfo>> &array,
        const sp<MediaCodecBuffer> &buffer) {
    return std::find_if(
            array->begin(), array->end(),
@@ -67,7 +67,7 @@ static BufferInfoIterator findClientBuffer(
}

static BufferInfoIterator findBufferId(
        const std::shared_ptr<const std::vector<const BufferInfo>> &array,
        const std::shared_ptr<const std::vector<BufferInfo>> &array,
        IOMX::buffer_id bufferId) {
    return std::find_if(
            array->begin(), array->end(),
@@ -97,7 +97,7 @@ ACodecBufferChannel::ACodecBufferChannel(
}

status_t ACodecBufferChannel::queueInputBuffer(const sp<MediaCodecBuffer> &buffer) {
    std::shared_ptr<const std::vector<const BufferInfo>> array(
    std::shared_ptr<const std::vector<BufferInfo>> array(
            std::atomic_load(&mInputBuffers));
    BufferInfoIterator it = findClientBuffer(array, buffer);
    if (it == array->end()) {
@@ -138,7 +138,7 @@ status_t ACodecBufferChannel::queueSecureInputBuffer(
    if (!hasCryptoOrDescrambler() || mDealer == nullptr) {
        return -ENOSYS;
    }
    std::shared_ptr<const std::vector<const BufferInfo>> array(
    std::shared_ptr<const std::vector<BufferInfo>> array(
            std::atomic_load(&mInputBuffers));
    BufferInfoIterator it = findClientBuffer(array, buffer);
    if (it == array->end()) {
@@ -352,7 +352,7 @@ status_t ACodecBufferChannel::attachEncryptedBuffer(
        size_t numSubSamples,
        const sp<MediaCodecBuffer> &buffer,
        AString* errorDetailMsg) {
    std::shared_ptr<const std::vector<const BufferInfo>> array(
    std::shared_ptr<const std::vector<BufferInfo>> array(
            std::atomic_load(&mInputBuffers));
    BufferInfoIterator it = findClientBuffer(array, buffer);
    if (it == array->end()) {
@@ -473,7 +473,7 @@ status_t ACodecBufferChannel::attachEncryptedBuffer(

status_t ACodecBufferChannel::renderOutputBuffer(
        const sp<MediaCodecBuffer> &buffer, int64_t timestampNs) {
    std::shared_ptr<const std::vector<const BufferInfo>> array(
    std::shared_ptr<const std::vector<BufferInfo>> array(
            std::atomic_load(&mOutputBuffers));
    BufferInfoIterator it = findClientBuffer(array, buffer);
    if (it == array->end()) {
@@ -495,7 +495,7 @@ void ACodecBufferChannel::pollForRenderedBuffers() {
}

status_t ACodecBufferChannel::discardBuffer(const sp<MediaCodecBuffer> &buffer) {
    std::shared_ptr<const std::vector<const BufferInfo>> array(
    std::shared_ptr<const std::vector<BufferInfo>> array(
            std::atomic_load(&mInputBuffers));
    bool input = true;
    BufferInfoIterator it = findClientBuffer(array, buffer);
@@ -517,7 +517,7 @@ status_t ACodecBufferChannel::discardBuffer(const sp<MediaCodecBuffer> &buffer)
}

void ACodecBufferChannel::getInputBufferArray(Vector<sp<MediaCodecBuffer>> *array) {
    std::shared_ptr<const std::vector<const BufferInfo>> inputBuffers(
    std::shared_ptr<const std::vector<BufferInfo>> inputBuffers(
            std::atomic_load(&mInputBuffers));
    array->clear();
    for (const BufferInfo &elem : *inputBuffers) {
@@ -526,7 +526,7 @@ void ACodecBufferChannel::getInputBufferArray(Vector<sp<MediaCodecBuffer>> *arra
}

void ACodecBufferChannel::getOutputBufferArray(Vector<sp<MediaCodecBuffer>> *array) {
    std::shared_ptr<const std::vector<const BufferInfo>> outputBuffers(
    std::shared_ptr<const std::vector<BufferInfo>> outputBuffers(
            std::atomic_load(&mOutputBuffers));
    array->clear();
    for (const BufferInfo &elem : *outputBuffers) {
@@ -583,7 +583,7 @@ void ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &ar
            mDecryptDestination = mDealer->allocate(destinationBufferSize);
        }
    }
    std::vector<const BufferInfo> inputBuffers;
    std::vector<BufferInfo> inputBuffers;
    for (const BufferAndId &elem : array) {
        sp<IMemory> sharedEncryptedBuffer;
        if (hasCryptoOrDescrambler()) {
@@ -593,22 +593,22 @@ void ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &ar
    }
    std::atomic_store(
            &mInputBuffers,
            std::make_shared<const std::vector<const BufferInfo>>(inputBuffers));
            std::make_shared<const std::vector<BufferInfo>>(inputBuffers));
}

void ACodecBufferChannel::setOutputBufferArray(const std::vector<BufferAndId> &array) {
    std::vector<const BufferInfo> outputBuffers;
    std::vector<BufferInfo> outputBuffers;
    for (const BufferAndId &elem : array) {
        outputBuffers.emplace_back(elem.mBuffer, elem.mBufferId, nullptr);
    }
    std::atomic_store(
            &mOutputBuffers,
            std::make_shared<const std::vector<const BufferInfo>>(outputBuffers));
            std::make_shared<const std::vector<BufferInfo>>(outputBuffers));
}

void ACodecBufferChannel::fillThisBuffer(IOMX::buffer_id bufferId) {
    ALOGV("fillThisBuffer #%d", bufferId);
    std::shared_ptr<const std::vector<const BufferInfo>> array(
    std::shared_ptr<const std::vector<BufferInfo>> array(
            std::atomic_load(&mInputBuffers));
    BufferInfoIterator it = findBufferId(array, bufferId);

@@ -629,7 +629,7 @@ void ACodecBufferChannel::drainThisBuffer(
        IOMX::buffer_id bufferId,
        OMX_U32 omxFlags) {
    ALOGV("drainThisBuffer #%d", bufferId);
    std::shared_ptr<const std::vector<const BufferInfo>> array(
    std::shared_ptr<const std::vector<BufferInfo>> array(
            std::atomic_load(&mOutputBuffers));
    BufferInfoIterator it = findBufferId(array, bufferId);

+2 −2
Original line number Diff line number Diff line
@@ -155,8 +155,8 @@ private:
    // obtained. Inside BufferInfo, mBufferId and mSharedEncryptedBuffer are
    // immutable objects. We write internal states of mClient/CodecBuffer when
    // the caller has given up the reference, so that access is also safe.
    std::shared_ptr<const std::vector<const BufferInfo>> mInputBuffers;
    std::shared_ptr<const std::vector<const BufferInfo>> mOutputBuffers;
    std::shared_ptr<const std::vector<BufferInfo>> mInputBuffers;
    std::shared_ptr<const std::vector<BufferInfo>> mOutputBuffers;

    sp<MemoryDealer> makeMemoryDealer(size_t heapSize);

+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ private:
    // Start of members protected by mBatchLock
    std::deque<uint32_t> mInflightBatchSizes;
    std::vector<native_handle_t*> mInflightReturnedHandles;
    std::vector<const sp<IMemory>> mInflightReturnedMemorys;
    std::vector<sp<IMemory>> mInflightReturnedMemorys;
    // End of members protected by mBatchLock

    void releaseQueuedFrames();
+1 −1
Original line number Diff line number Diff line
@@ -923,7 +923,7 @@ void Accessor::Impl::evictorThread(
        std::map<const std::weak_ptr<Accessor::Impl>, nsecs_t, std::owner_less<>> &accessors,
        std::mutex &mutex,
        std::condition_variable &cv) {
    std::list<const std::weak_ptr<Accessor::Impl>> evictList;
    std::list<std::weak_ptr<Accessor::Impl>> evictList;
    while (true) {
        int expired = 0;
        int evicted = 0;
+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ binder::Status CameraDeviceClient::submitRequestList(
    }

    List<const CameraDeviceBase::PhysicalCameraSettingsList> metadataRequestList;
    std::list<const SurfaceMap> surfaceMapList;
    std::list<SurfaceMap> surfaceMapList;
    submitInfo->mRequestId = mRequestIdCounter;
    uint32_t loopCounter = 0;

Loading