summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2009-09-28 16:14:58 -0700
committerWu-cheng Li <wuchengli@google.com>2009-10-06 13:25:10 -0700
commit36f68b8f24df906c969581b0b8e1a47f95dc03cb (patch)
treeb1c8987ccd5b30c5527fc9abcfe275f163d8d8c5 /camera
parent5bba632d877c2878384ff21566c8eb6a1a22f37b (diff)
downloadframeworks_base-36f68b8f24df906c969581b0b8e1a47f95dc03cb.zip
frameworks_base-36f68b8f24df906c969581b0b8e1a47f95dc03cb.tar.gz
frameworks_base-36f68b8f24df906c969581b0b8e1a47f95dc03cb.tar.bz2
Add zoom functions and sendCommand.
b2060030
Diffstat (limited to 'camera')
-rw-r--r--camera/libcameraservice/CameraHardwareStub.cpp6
-rw-r--r--camera/libcameraservice/CameraHardwareStub.h2
-rw-r--r--camera/libcameraservice/CameraService.cpp21
-rw-r--r--camera/libcameraservice/CameraService.h3
4 files changed, 29 insertions, 3 deletions
diff --git a/camera/libcameraservice/CameraHardwareStub.cpp b/camera/libcameraservice/CameraHardwareStub.cpp
index 35f4846..8ad1f69 100644
--- a/camera/libcameraservice/CameraHardwareStub.cpp
+++ b/camera/libcameraservice/CameraHardwareStub.cpp
@@ -368,6 +368,12 @@ CameraParameters CameraHardwareStub::getParameters() const
return mParameters;
}
+status_t CameraHardwareStub::sendCommand(int32_t command, int32_t arg1,
+ int32_t arg2)
+{
+ return BAD_VALUE;
+}
+
void CameraHardwareStub::release()
{
}
diff --git a/camera/libcameraservice/CameraHardwareStub.h b/camera/libcameraservice/CameraHardwareStub.h
index f957fa8..8a67024 100644
--- a/camera/libcameraservice/CameraHardwareStub.h
+++ b/camera/libcameraservice/CameraHardwareStub.h
@@ -57,6 +57,8 @@ public:
virtual status_t dump(int fd, const Vector<String16>& args) const;
virtual status_t setParameters(const CameraParameters& params);
virtual CameraParameters getParameters() const;
+ virtual status_t sendCommand(int32_t command, int32_t arg1,
+ int32_t arg2);
virtual void release();
static sp<CameraHardwareInterface> createInstance();
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp
index bab7d08..8279914 100644
--- a/camera/libcameraservice/CameraService.cpp
+++ b/camera/libcameraservice/CameraService.cpp
@@ -195,7 +195,7 @@ void CameraService::decUsers() {
android_atomic_dec(&mUsers);
}
-static sp<MediaPlayer> newMediaPlayer(const char *file)
+static sp<MediaPlayer> newMediaPlayer(const char *file)
{
sp<MediaPlayer> mp = new MediaPlayer();
if (mp->setDataSource(file) == NO_ERROR) {
@@ -267,7 +267,7 @@ status_t CameraService::Client::lock()
status_t CameraService::Client::unlock()
{
int callingPid = getCallingPid();
- LOGD("unlock from pid %d (mClientPid %d)", callingPid, mClientPid);
+ LOGD("unlock from pid %d (mClientPid %d)", callingPid, mClientPid);
Mutex::Autolock _l(mLock);
// allow anyone to use camera
status_t result = checkPid();
@@ -648,7 +648,7 @@ status_t CameraService::Client::startPreviewMode()
status_t CameraService::Client::startPreview()
{
LOGD("startPreview (pid %d)", getCallingPid());
-
+
return startCameraMode(CAMERA_PREVIEW_MODE);
}
@@ -1134,6 +1134,21 @@ String8 CameraService::Client::getParameters() const
return params;
}
+status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
+{
+ LOGD("sendCommand (pid %d)", getCallingPid());
+ Mutex::Autolock lock(mLock);
+ status_t result = checkPid();
+ if (result != NO_ERROR) return result;
+
+ if (mHardware == 0) {
+ LOGE("mHardware is NULL, returning.");
+ return INVALID_OPERATION;
+ }
+
+ return mHardware->sendCommand(cmd, arg1, arg2);
+}
+
void CameraService::Client::copyFrameAndPostCopiedFrame(sp<IMemoryHeap> heap, size_t offset, size_t size)
{
LOGV("copyFrameAndPostCopiedFrame");
diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h
index 0a909cf..2e3597f 100644
--- a/camera/libcameraservice/CameraService.h
+++ b/camera/libcameraservice/CameraService.h
@@ -122,6 +122,9 @@ private:
// get preview/capture parameters - key/value pairs
virtual String8 getParameters() const;
+ // send command to camera driver
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);
+
// our client...
const sp<ICameraClient>& getCameraClient() const { return mCameraClient; }