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; } } }
virtual sp<ISurfaceTexture> getSurfaceTexture() const { sp<ISurfaceTexture> res; sp<const Layer> that( mOwner.promote() ); if (that != NULL) { res = that->mSurfaceTexture; } return res; }
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); } } }
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); } } }
virtual void onFrameAvailable() { sp<Layer> that(mLayer.promote()); if (that != 0) { that->onFrameQueued(); } }