Home | History | Annotate | Download | only in libcameraservice

Lines Matching defs:Client

155     sp<Client> client;
172 client = mClient[cameraId].promote();
173 if (client != 0) {
174 if (cameraClient->asBinder() == client->getCameraClient()->asBinder()) {
175 LOG1("CameraService::connect X (pid %d) (the same client)",
177 return client;
179 LOGW("CameraService::connect X (pid %d) rejected (existing client).",
208 client = new Client(this, cameraClient, hardware, cameraId, info.facing, callingPid);
209 mClient[cameraId] = client;
211 return client;
221 sp<Client> client;
230 // Client::~Client() -> disconnect() -> removeClient().
231 client = mClient[i].promote();
233 if (client == 0) {
238 if (cameraClient->asBinder() == client->getCameraClient()->asBinder()) {
249 sp<CameraService::Client> CameraService::getClientById(int cameraId) {
278 // may come in while the previous Client's destructor has not been run or is
279 // still running. If the last strong reference of the previous Client is gone
280 // but the destructor has not been finished, we should not allow the new Client
281 // to be created because we need to wait for the previous Client to tear down
341 CameraService::Client::Client(const sp<CameraService>& cameraService,
346 LOG1("Client::Client E (pid %d)", callingPid);
372 LOG1("Client::Client X (pid %d)", callingPid);
375 // tear down the client
376 CameraService::Client::~Client() {
378 LOG1("Client::~Client E (pid %d, this %p)", callingPid, this);
384 LOG1("Client::~Client X (pid %d, this %p)", callingPid, this);
389 status_t CameraService::Client::checkPid() const {
398 status_t CameraService::Client::checkPidAndHardware() const {
408 status_t CameraService::Client::lock() {
413 // lock camera to this client if the the camera is unlocked
419 // returns NO_ERROR if the client already owns the camera, EBUSY otherwise
423 status_t CameraService::Client::unlock() {
444 // connect a new client to the camera
445 status_t CameraService::Client::connect(const sp<ICameraClient>& client) {
456 if (mCameraClient != 0 && (client->asBinder() == mCameraClient->asBinder())) {
457 LOG1("Connect to the same client");
463 mCameraClient = client;
480 void CameraService::Client::disconnect() {
486 LOGW("different client - don't disconnect");
525 status_t CameraService::Client::setPreviewWindow(const sp<IBinder>& binder,
571 status_t CameraService::Client::setPreviewDisplay(const sp<Surface>& surface) {
580 status_t CameraService::Client::setPreviewTexture(
596 void CameraService::Client::setPreviewCallbackFlag(int callback_flag) {
610 status_t CameraService::Client::startPreview() {
616 status_t CameraService::Client::startRecording() {
622 status_t CameraService::Client::startCameraMode(camera_mode mode) {
646 status_t CameraService::Client::startPreviewMode() {
667 status_t CameraService::Client::startRecordingMode() {
695 void CameraService::Client::stopPreview() {
708 void CameraService::Client::stopRecording() {
721 void CameraService::Client::releaseRecordingFrame(const sp<IMemory>& mem) {
727 status_t CameraService::Client::storeMetaDataInBuffers(bool enabled)
737 bool CameraService::Client::previewEnabled() {
745 bool CameraService::Client::recordingEnabled() {
753 status_t CameraService::Client::autoFocus() {
763 status_t CameraService::Client::cancelAutoFocus() {
774 status_t CameraService::Client::takePicture(int msgType) {
803 status_t CameraService::Client::setParameters(const String8& params) {
815 String8 CameraService::Client::getParameters() const {
825 status_t CameraService::Client::enableShutterSound(bool enable) {
853 status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
894 void CameraService::Client::enableMsgType(int32_t msgType) {
899 void CameraService::Client::disableMsgType(int32_t msgType) {
905 bool CameraService::Client::lockIfMessageWanted(int32_t msgType) {
926 // Converts from a raw pointer to the client to a strong pointer during a
927 // hardware callback. This requires the callbacks only happen when the client
929 sp<CameraService::Client> CameraService::Client::getClientFromCookie(void* user) {
930 sp<Client> client = gCameraService->getClientById((int) user);
932 // This could happen if the Client is in the process of shutting down (the
935 if (client == 0) return NULL;
938 if (client->mCameraService.get() != gCameraService) {
943 if (client->mHardware == 0) {
948 return client;
952 // client's callback functions, depending on the message type.
966 // NOTE: the *Callback functions grab mLock of the client before passing
969 // invoke methods in the Client class again (For example, the preview frame
974 void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1,
978 sp<Client> client = getClientFromCookie(user);
979 if (client == 0) return;
980 if (!client->lockIfMessageWanted(msgType)) return;
985 client->handleShutter();
988 client->handleGenericNotify(msgType, ext1, ext2);
993 void CameraService::Client::dataCallback(int32_t msgType,
997 sp<Client> client = getClientFromCookie(user);
998 if (client == 0) return;
999 if (!client->lockIfMessageWanted(msgType)) return;
1003 client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
1009 client->handlePreviewData(msgType, dataPtr, metadata);
1012 client->handlePostview(dataPtr);
1015 client->handleRawPicture(dataPtr);
1018 client->handleCompressedPicture(dataPtr);
1021 client->handleGenericData(msgType, dataPtr, metadata);
1026 void CameraService::Client::dataCallbackTimestamp(nsecs_t timestamp,
1030 sp<Client> client = getClientFromCookie(user);
1031 if (client == 0) return;
1032 if (!client->lockIfMessageWanted(msgType)) return;
1036 client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
1040 client->handleGenericDataTimestamp(timestamp, msgType, dataPtr);
1044 void CameraService::Client::handleShutter(void) {
1061 void CameraService::Client::handlePreviewData(int32_t msgType,
1079 // hold a strong pointer to the client
1082 // clear callback flags if no client or one-shot mode
1107 void CameraService::Client::handlePostview(const sp<IMemory>& mem) {
1118 void CameraService::Client::handleRawPicture(const sp<IMemory>& mem) {
1133 void CameraService::Client::handleCompressedPicture(const sp<IMemory>& mem) {
1144 void CameraService::Client::handleGenericNotify(int32_t msgType,
1153 void CameraService::Client::handleGenericData(int32_t msgType,
1162 void CameraService::Client::handleGenericDataTimestamp(nsecs_t timestamp,
1171 void CameraService::Client::copyFrameAndPostCopiedFrame(
1172 int32_t msgType, const sp<ICameraClient>& client,
1206 client->dataCallback(msgType, frame, metadata);
1209 int CameraService::Client::getOrientation(int degrees, bool mirror) {
1272 sp<Client> client = mClient[i].promote();
1273 if (client == 0) continue;
1275 sprintf(buffer, "Client[%d] (%p) PID: %d\n",
1277 client->getCameraClient()->asBinder().get(),
1278 client->mClientPid);
1281 client->mHardware->dump(fd, args);
1284 result.append("No camera client yet.\n");