summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.h
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-06-11 18:10:18 -0700
committerIgor Murashkin <iam@google.com>2013-06-20 20:31:30 -0700
commite7ee7637747371635a85fedd24d2190bb1f38651 (patch)
treefbae6cce035752d5386260deb4bf0222b6204ac3 /services/camera/libcameraservice/CameraService.h
parentb3570568b3f37b3f7018257ece53cbc009b91407 (diff)
downloadframeworks_av-e7ee7637747371635a85fedd24d2190bb1f38651.zip
frameworks_av-e7ee7637747371635a85fedd24d2190bb1f38651.tar.gz
frameworks_av-e7ee7637747371635a85fedd24d2190bb1f38651.tar.bz2
Initial implementation of android.hardware.photography.CameraDevice (service)
* Verified preview streaming requests * Other things *should* work but unverified / unimplemented in client side Missing: * CameraService needs to return static camera info metadata Bug: 9213377 Change-Id: I71568560fcf18d0e2b408ed1c4d0066647314868
Diffstat (limited to 'services/camera/libcameraservice/CameraService.h')
-rw-r--r--services/camera/libcameraservice/CameraService.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index eaa316a..cab804e 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -29,6 +29,8 @@
#include <camera/ICameraClient.h>
#include <camera/IProCameraUser.h>
#include <camera/IProCameraCallbacks.h>
+#include <camera/photography/ICameraDeviceUser.h>
+#include <camera/photography/ICameraDeviceCallbacks.h>
#include <camera/ICameraServiceListener.h>
@@ -74,6 +76,11 @@ public:
const String16& clientPackageName, int clientUid);
virtual sp<IProCameraUser> connect(const sp<IProCameraCallbacks>& cameraCb,
int cameraId, const String16& clientPackageName, int clientUid);
+ virtual sp<ICameraDeviceUser> connect(
+ const sp<ICameraDeviceCallbacks>& cameraCb,
+ int cameraId,
+ const String16& clientPackageName,
+ int clientUid);
virtual status_t addListener(const sp<ICameraServiceListener>& listener);
virtual status_t removeListener(
@@ -105,7 +112,7 @@ public:
// returns plain pointer of client. Note that mClientLock should be acquired to
// prevent the client from destruction. The result can be NULL.
- virtual Client* getClientByIdUnsafe(int cameraId);
+ virtual BasicClient* getClientByIdUnsafe(int cameraId);
virtual Mutex* getClientLockById(int cameraId);
class BasicClient : public virtual RefBase {
@@ -114,11 +121,17 @@ public:
virtual void disconnect() = 0;
+ // because we can't virtually inherit IInterface, which breaks
+ // virtual inheritance
+ virtual sp<IBinder> asBinderWrapper() = 0;
+
// Return the remote callback binder object (e.g. IProCameraCallbacks)
- wp<IBinder> getRemote() {
+ sp<IBinder> getRemote() {
return mRemoteBinder;
}
+ virtual status_t dump(int fd, const Vector<String16>& args) = 0;
+
protected:
BasicClient(const sp<CameraService>& cameraService,
const sp<IBinder>& remoteCallback,
@@ -147,7 +160,7 @@ public:
pid_t mServicePid; // immutable after constructor
// - The app-side Binder interface to receive callbacks from us
- wp<IBinder> mRemoteBinder; // immutable after constructor
+ sp<IBinder> mRemoteBinder; // immutable after constructor
// permissions management
status_t startCameraOps();
@@ -223,6 +236,10 @@ public:
return mRemoteCallback;
}
+ virtual sp<IBinder> asBinderWrapper() {
+ return asBinder();
+ }
+
protected:
static Mutex* getClientLockFromCookie(void* user);
// convert client from cookie. Client lock should be acquired before getting Client.
@@ -296,16 +313,17 @@ private:
const String16& clientPackageName,
const sp<IBinder>& remoteCallback,
/*out*/
- sp<Client> &client);
+ sp<BasicClient> &client);
// When connection is successful, initialize client and track its death
bool connectFinishUnsafe(const sp<BasicClient>& client,
- const sp<IBinder>& clientBinder);
+ const sp<IBinder>& remoteCallback);
virtual sp<BasicClient> getClientByRemote(const wp<IBinder>& cameraClient);
Mutex mServiceLock;
- wp<Client> mClient[MAX_CAMERAS]; // protected by mServiceLock
+ // either a Client or CameraDeviceClient
+ wp<BasicClient> mClient[MAX_CAMERAS]; // protected by mServiceLock
Mutex mClientLock[MAX_CAMERAS]; // prevent Client destruction inside callbacks
int mNumberOfCameras;
@@ -313,7 +331,7 @@ private:
Vector<weak_pro_client_ptr> mProClientList[MAX_CAMERAS];
// needs to be called with mServiceLock held
- sp<Client> findClientUnsafe(const wp<IBinder>& cameraClient, int& outIndex);
+ sp<BasicClient> findClientUnsafe(const wp<IBinder>& cameraClient, int& outIndex);
sp<ProClient> findProClientUnsafe(
const wp<IBinder>& cameraCallbacksRemote);