summaryrefslogtreecommitdiffstats
path: root/camera/ProCamera.cpp
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-02-20 18:24:43 -0800
committerIgor Murashkin <iam@google.com>2013-02-22 10:50:14 -0800
commit69e22433b9d7df77907579f67e47a159aa57f876 (patch)
treeeb271a5175ff8bac5e86ccd72637481738efddf9 /camera/ProCamera.cpp
parent9476926bb91bf15f7aff2a289a4805148f5a8a4e (diff)
downloadframeworks_av-69e22433b9d7df77907579f67e47a159aa57f876.zip
frameworks_av-69e22433b9d7df77907579f67e47a159aa57f876.tar.gz
frameworks_av-69e22433b9d7df77907579f67e47a159aa57f876.tar.bz2
Camera: ProCamera2Client - add createStream (service is stubbed) and unit test
Change-Id: I1ae7ba9b24f5883c214c19a7ed0eaf0c802d69c1
Diffstat (limited to 'camera/ProCamera.cpp')
-rw-r--r--camera/ProCamera.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/camera/ProCamera.cpp b/camera/ProCamera.cpp
index 26e4de9..92ec9d6 100644
--- a/camera/ProCamera.cpp
+++ b/camera/ProCamera.cpp
@@ -262,7 +262,7 @@ status_t ProCamera::cancelStream(int streamId)
}
status_t ProCamera::createStream(int width, int height, int format,
- const sp<ANativeWindow>& window,
+ const sp<Surface>& surface,
/*out*/
int* streamId)
{
@@ -271,12 +271,14 @@ status_t ProCamera::createStream(int width, int height, int format,
ALOGV("%s: createStreamW %dx%d (fmt=0x%x)", __FUNCTION__, width, height,
format);
- if (window == 0) {
+ if (surface == 0) {
return BAD_VALUE;
}
- // TODO: actually implement this in IProCamera
- return INVALID_OPERATION;
+ sp <IProCameraUser> c = mCamera;
+ if (c == 0) return NO_INIT;
+
+ return c->createStream(width, height, format, surface, streamId);
}
status_t ProCamera::createStream(int width, int height, int format,
@@ -288,13 +290,10 @@ status_t ProCamera::createStream(int width, int height, int format,
format);
sp<IBinder> binder;
- sp<ANativeWindow> window;
+ status_t stat = INVALID_OPERATION;
if (bufferProducer != 0) {
binder = bufferProducer->asBinder();
- window = new Surface(bufferProducer);
-
- status_t stat = createStream(width, height, format, window, streamId);
ALOGV("%s: createStreamT END (%d), StreamID = %d", __FUNCTION__, stat,
*streamId);
@@ -304,7 +303,7 @@ status_t ProCamera::createStream(int width, int height, int format,
return BAD_VALUE;
}
- return BAD_VALUE;
+ return stat;
}
int ProCamera::getNumberOfCameras() {
@@ -321,12 +320,12 @@ camera_metadata* ProCamera::getCameraInfo(int cameraId) {
status_t ProCamera::createDefaultRequest(int templateId,
camera_metadata** request) const {
- ALOGE("%s: not implemented yet", __FUNCTION__);
-
ALOGV("%s: templateId = %d", __FUNCTION__, templateId);
- *request = NULL;
- return INVALID_OPERATION;
+ sp <IProCameraUser> c = mCamera;
+ if (c == 0) return NO_INIT;
+
+ return c->createDefaultRequest(templateId, request);
}
}; // namespace android