diff options
author | Chih-Chung Chang <chihchung@google.com> | 2010-05-06 16:36:58 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2010-05-10 11:21:14 +0800 |
commit | 35a055b8bfc6f3cbea409b2897caf936654519cb (patch) | |
tree | f2167d55486fd370d24e68aabe1ae37879cde8ec /camera/Camera.cpp | |
parent | d8a30349da270715156d3f658b165481ce10cf71 (diff) | |
download | frameworks_av-35a055b8bfc6f3cbea409b2897caf936654519cb.zip frameworks_av-35a055b8bfc6f3cbea409b2897caf936654519cb.tar.gz frameworks_av-35a055b8bfc6f3cbea409b2897caf936654519cb.tar.bz2 |
Support multiple cameras in framework.
Change-Id: I081f0fbdca4b633715ea7c3b3d42f8662d27598a
Diffstat (limited to 'camera/Camera.cpp')
-rw-r--r-- | camera/Camera.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/camera/Camera.cpp b/camera/Camera.cpp index f19c502..3346b1f 100644 --- a/camera/Camera.cpp +++ b/camera/Camera.cpp @@ -95,13 +95,20 @@ Camera::~Camera() disconnect(); } -sp<Camera> Camera::connect() +int32_t Camera::getNumberOfCameras() +{ + const sp<ICameraService>& cs = getCameraService(); + if (cs == 0) return 0; + return cs->getNumberOfCameras(); +} + +sp<Camera> Camera::connect(int cameraId) { LOGV("connect"); sp<Camera> c = new Camera(); const sp<ICameraService>& cs = getCameraService(); if (cs != 0) { - c->mCamera = cs->connect(c); + c->mCamera = cs->connect(c, cameraId); } if (c->mCamera != 0) { c->mCamera->asBinder()->linkToDeath(c); |