diff options
author | Igor Murashkin <iam@google.com> | 2013-02-20 18:24:43 -0800 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2013-02-22 10:50:14 -0800 |
commit | 985fd30a10f6fec4293f071fd258c4726cff5a3d (patch) | |
tree | 493a26cd4544e2858822e8fbaf1ddc04fbd215d4 /camera/ProCamera.cpp | |
parent | 68506fd58d26748617babe94d5648503cb3690bb (diff) | |
download | frameworks_av-985fd30a10f6fec4293f071fd258c4726cff5a3d.zip frameworks_av-985fd30a10f6fec4293f071fd258c4726cff5a3d.tar.gz frameworks_av-985fd30a10f6fec4293f071fd258c4726cff5a3d.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.cpp | 25 |
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 |