FrameProcessor::FrameProcessor(wp<CameraDeviceBase> device,
                               sp<Camera2Client> client) :
    FrameProcessorBase(device),
    mClient(client),
    mLastFrameNumberOfFaces(0),
    mLast3AFrameNumber(-1) {

    sp<CameraDeviceBase> d = device.promote();
    mSynthesize3ANotify = !(d->willNotify3A());

    {
        SharedParameters::Lock l(client->getParameters());

        if (client->getCameraDeviceVersion() >= CAMERA_DEVICE_API_VERSION_3_2) {
            mUsePartialResult = (mNumPartialResults > 1);
        } else {
            mUsePartialResult = l.mParameters.quirks.partialResults;
        }

        // Initialize starting 3A state
        m3aState.afTriggerId = l.mParameters.afTriggerCounter;
        m3aState.aeTriggerId = l.mParameters.precaptureTriggerCounter;
        // Check if lens is fixed-focus
        if (l.mParameters.focusMode == Parameters::FOCUS_MODE_FIXED) {
            m3aState.afMode = ANDROID_CONTROL_AF_MODE_OFF;
        }
    }
}
Пример #2
0
 virtual sp<ISurfaceTexture> getSurfaceTexture() const {
     sp<ISurfaceTexture> res;
     sp<const Layer> that( mOwner.promote() );
     if (that != NULL) {
         res = that->mSurfaceTexture;
     }
     return res;
 }
Пример #3
0
void CameraSourceListener::postDataTimestamp(
        nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr) {

    sp<CameraSource> source = mSource.promote();
    if (source.get() != NULL) {
        source->dataCallbackTimestamp(timestamp/1000, msgType, dataPtr);
    }
}
void MediaResourceManagerService::binderDied(const wp<IBinder>& who)
{
  if (who != NULL) {
    sp<IBinder> binder = who.promote();
    if (binder != NULL) {
      cancelClientLocked(binder);
    }
  }
}
Пример #5
0
        virtual void binderDied(const wp<IBinder>& who) {
            uint32_t size = mItem.mConsumerList.size();
            GUIEXT_LOGI("consumer died, list size=%d, binder ptr=[%p]", size, who.unsafe_get());

            if (size == 0) {
                GUIEXT_LOGV("consumer died [%p], pool size is zero", who.unsafe_get());
            } else {
                for (uint32_t i = 0 ; i < size ; i++) {
                    GUIEXT_LOGV("   [c] compare index[%d], p=[%p], usage=%d, type=%d, id=%d", i,
                        mItem.mConsumerList[i]->token.get(),
                        mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);
                    if (mItem.mConsumerList[i]->token.get() == who.unsafe_get()) {
                        GUIEXT_LOGW("   [c] found index[%d], p=[%p], usage=%d, type=%d, id=%d", i,
                            mItem.mConsumerList[i]->token.get(),
                            mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);

                        mItem.release(mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);
                        mItem.mConsumerList[i]->token = NULL;
                        mItem.mConsumerList[i]->pid = -1;
                        mItem.mConsumerList[i]->observer = NULL;
                    }
                }

                for (uint32_t i = 0; i < GUI_EXT_USAGE_MAX; i++) {
                    mItem.mIsDisconnected[i] = true;
                }
                bool isDisconnect = true;
                for (uint32_t i = 0 ; i < size ; i++) {
                    if (mItem.mConsumerList[i]->token != NULL) {
                        mItem.mIsDisconnected[mItem.mConsumerList[i]->usage] = false;
                        isDisconnect = false;
                        GUIEXT_LOGV("   [c] still have consumer, idx=%d, token=%p, pid=%d, usage=%d, type=%d, id=%d", i,
                            mItem.mConsumerList[i]->token.get(), mItem.mConsumerList[i]->pid,
                            mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);
                    }
                }

                if (isDisconnect) {
                    mItem.mConsumerDeathListener->binderDied(mItem.mId);
                }

                GUIEXT_LOGV("consumer died done");
            }
        }
Пример #6
0
void CameraSourceListener::postData(int32_t msgType, const sp<IMemory> &dataPtr,
                                    camera_frame_metadata_t *metadata) {
    ALOGV("postData(%d, ptr:%p, size:%d)",
         msgType, dataPtr->pointer(), dataPtr->size());

    sp<CameraSource> source = mSource.promote();
    if (source.get() != NULL) {
        source->dataCallback(msgType, dataPtr);
    }
}
void MediaResourceManagerService::binderDied(const wp<IBinder>& who)
{
  if (who != NULL) {
    Mutex::Autolock autoLock(mLock);
    sp<IBinder> binder = who.promote();
    if (binder != NULL) {
      mResources.forgetClient(binder);
    }
  }
}
Пример #8
0
        virtual void binderDied(const wp<IBinder>& who) {
            uint32_t size = mPool.mPoolList.size();
            GUIEXT_LOGI("producer died, pool size=%d, binder ptr=[%p]", size, who.unsafe_get());

            if (size == 0) {
                GUIEXT_LOGV("producer died [%p], pool size is zero", who.unsafe_get());
            } else {
                for (uint32_t i = size-1 ;; i--) {
                    GUIEXT_LOGV("   [p] compare index[%d], p=[%p]", i, mPool.mPoolList[i]->mProducerToken.get());
                    if (mPool.mPoolList[i]->mProducerToken.get() == who.unsafe_get()) {
                        GUIEXT_LOGW("   [p] found index[%d], p=[%p], id=%d", i, mPool.mPoolList[i]->mProducerToken.get(), mPool.mPoolList[i]->mId);
                        mPool.mPoolList[i]->mProducerToken = NULL;
                        mPool.mPoolList[i]->mProducerPid = -1;
                        mPool.removePoolItem(mPool.mPoolList[i]->mId);
                    }

                    if (i == 0)
                        break;
                }

                GUIEXT_LOGV("producer died done");
            }
        }
Пример #9
0
void HeapCache::free_heap(const wp<IBinder>& binder)
{
    sp<IMemoryHeap> rel;
    {
        Mutex::Autolock _l(mHeapCacheLock);
        ssize_t i = mHeapCache.indexOfKey(binder);
        if (i>=0) {
            heap_info_t& info(mHeapCache.editValueAt(i));
            int32_t c = android_atomic_dec(&info.count);
            if (c == 1) {
                ALOGD_IF(VERBOSE,
                        "removing binder=%p, heap=%p, size=%d, fd=%d, count=%d",
                        binder.unsafe_get(), info.heap.get(),
                        static_cast<BpMemoryHeap*>(info.heap.get())->mSize,
                        static_cast<BpMemoryHeap*>(info.heap.get())->mHeapId,
                        info.count);
                rel = mHeapCache.valueAt(i).heap;
                mHeapCache.removeItemsAt(i);
            }
        } else {
            ALOGE("free_heap binder=%p not found!!!", binder.unsafe_get());
        }
    }
}
Пример #10
0
// IBinder::DeathRecipient
void        ChatSession::binderDied(const wp<IBinder>& who){
    LOGV("binderDied() %p, tid %d, calling tid %d", who.unsafe_get(), gettid(), IPCThreadState::self()->getCallingPid());
    Mutex::Autolock _l(m_csAdviseLock);
/*
    IBinder *binder = who.unsafe_get();

    if (binder != NULL) {
        int index = mNotificationClients.indexOf(binder);
        if (index >= 0) {
            LOGV("Removing notification client %p", binder);
            mNotificationClients.removeAt(index);
        }
    }
*/    
	pid_t callerPid = IPCThreadState::self()->getCallingPid();
     	LOGV("Removing notification client %d", callerPid);
	 m_Listeners.removeItem(callerPid);

}
Пример #11
0
 virtual void onFrameAvailable() {
     sp<Layer> that(mLayer.promote());
     if (that != 0) {
         that->onFrameQueued();
     }
 }
 virtual void binderDied(const wp<IBinder>& who) {
     ALOGW("ComposerService remote (surfaceflinger) died [%p]",
           who.unsafe_get());
     mComposerService.composerServiceDied();
 }
Пример #13
0
 virtual void binderDied(const wp<IBinder>& who) {
     ALOGW("sensorservice died [%p]", who.unsafe_get());
     mSensorManger.sensorManagerDied();
 }
void AudioPolicyService::binderDied(const wp<IBinder>& who) {
    LOGW("binderDied() %p, tid %d, calling tid %d", who.unsafe_get(), gettid(), IPCThreadState::self()->getCallingPid());
}