summaryrefslogtreecommitdiffstats
path: root/camera/libcameraservice/CameraService.h
diff options
context:
space:
mode:
Diffstat (limited to 'camera/libcameraservice/CameraService.h')
-rw-r--r--camera/libcameraservice/CameraService.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h
index b225aa9f3..cd8c1e9a4 100644
--- a/camera/libcameraservice/CameraService.h
+++ b/camera/libcameraservice/CameraService.h
@@ -73,6 +73,12 @@ private:
// connect new client with existing camera remote
virtual status_t connect(const sp<ICameraClient>& client);
+ // prevent other processes from using this ICamera interface
+ virtual status_t lock();
+
+ // allow other processes to use this ICamera interface
+ virtual status_t unlock();
+
// pass the buffered ISurface to the camera service
virtual status_t setPreviewDisplay(const sp<ISurface>& surface);
@@ -86,6 +92,9 @@ private:
// stop preview mode
virtual void stopPreview();
+ // get preview state
+ virtual bool previewEnabled();
+
// auto focus
virtual status_t autoFocus();
@@ -103,11 +112,14 @@ private:
private:
friend class CameraService;
- Client( const sp<CameraService>& cameraService,
- const sp<ICameraClient>& cameraClient);
+ Client(const sp<CameraService>& cameraService,
+ const sp<ICameraClient>& cameraClient,
+ pid_t clientPid);
Client();
virtual ~Client();
+ status_t checkPid();
+
static void previewCallback(const sp<IMemory>& mem, void* user);
static void shutterCallback(void *user);
static void yuvPictureCallback(const sp<IMemory>& mem, void* user);
@@ -132,7 +144,7 @@ private:
// by the CameraHardwareInterface callback, and needs to
// access mSurface. It cannot hold mLock, however, because
// stopPreview() may be holding that lock while attempting
- // top stop preview, and stopPreview itself will block waiting
+ // to stop preview, and stopPreview itself will block waiting
// for a callback from CameraHardwareInterface. If this
// happens, it will cause a deadlock.
mutable Mutex mSurfaceLock;
@@ -146,6 +158,7 @@ private:
// they don't need to be protected by a lock
sp<ICameraClient> mCameraClient;
sp<CameraHardwareInterface> mHardware;
+ pid_t mClientPid;
};
// ----------------------------------------------------------------------------