summaryrefslogtreecommitdiffstats
path: root/camera/ProCamera.cpp
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-02-20 17:57:31 -0800
committerIgor Murashkin <iam@google.com>2013-02-22 10:50:14 -0800
commit68506fd58d26748617babe94d5648503cb3690bb (patch)
tree2e5e9336005bcbf29165acb14ba13a35749be4b5 /camera/ProCamera.cpp
parent39f79f77a435c2f769477caeb071e2f9f6e78742 (diff)
downloadframeworks_av-68506fd58d26748617babe94d5648503cb3690bb.zip
frameworks_av-68506fd58d26748617babe94d5648503cb3690bb.tar.gz
frameworks_av-68506fd58d26748617babe94d5648503cb3690bb.tar.bz2
Camera: ProCamera - add createStream stub and unit test for it
Change-Id: Ic05130e63f4f2c0c3278ba348b192992169f105f
Diffstat (limited to 'camera/ProCamera.cpp')
-rw-r--r--camera/ProCamera.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/camera/ProCamera.cpp b/camera/ProCamera.cpp
index 8164188..26e4de9 100644
--- a/camera/ProCamera.cpp
+++ b/camera/ProCamera.cpp
@@ -261,4 +261,72 @@ status_t ProCamera::cancelStream(int streamId)
return c->cancelStream(streamId);
}
+status_t ProCamera::createStream(int width, int height, int format,
+ const sp<ANativeWindow>& window,
+ /*out*/
+ int* streamId)
+{
+ *streamId = -1;
+
+ ALOGV("%s: createStreamW %dx%d (fmt=0x%x)", __FUNCTION__, width, height,
+ format);
+
+ if (window == 0) {
+ return BAD_VALUE;
+ }
+
+ // TODO: actually implement this in IProCamera
+ return INVALID_OPERATION;
+}
+
+status_t ProCamera::createStream(int width, int height, int format,
+ const sp<IGraphicBufferProducer>& bufferProducer,
+ /*out*/
+ int* streamId) {
+
+ ALOGV("%s: createStreamT %dx%d (fmt=0x%x)", __FUNCTION__, width, height,
+ format);
+
+ sp<IBinder> binder;
+ sp<ANativeWindow> window;
+
+ 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);
+ }
+ else {
+ *streamId = -1;
+ return BAD_VALUE;
+ }
+
+ return BAD_VALUE;
+}
+
+int ProCamera::getNumberOfCameras() {
+ ALOGE("%s: not implemented yet", __FUNCTION__);
+ return 1;
+}
+
+camera_metadata* ProCamera::getCameraInfo(int cameraId) {
+ ALOGE("%s: not implemented yet", __FUNCTION__);
+
+ ALOGV("%s: cameraId = %d", __FUNCTION__, cameraId);
+ return NULL;
+}
+
+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;
+}
+
}; // namespace android