Merge change 529 into donut
* changes:
use gl.h to generate the *.in files. we are now supporting the full gl.h and glext.h apis.
diff --git a/include/ui/Camera.h b/include/ui/Camera.h
index e593fea..12fa20f 100644
--- a/include/ui/Camera.h
+++ b/include/ui/Camera.h
@@ -78,8 +78,8 @@
{
public:
// construct a camera client from an existing remote
- Camera(const sp<ICamera>& camera);
-
+ Camera(const sp<ICamera>& camera); // to be removed
+ static sp<Camera> create(const sp<ICamera>& camera);
static sp<Camera> connect();
~Camera();
void init();
diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp
index b3cbda1..0fba82c 100644
--- a/libs/ui/Camera.cpp
+++ b/libs/ui/Camera.cpp
@@ -75,6 +75,19 @@
}
}
+
+sp<Camera> Camera::create(const sp<ICamera>& camera)
+{
+ sp<Camera> c = new Camera();
+ // connect this client to existing camera remote
+ if (camera->connect(c) == NO_ERROR) {
+ c->mStatus = NO_ERROR;
+ c->mCamera = camera;
+ camera->asBinder()->linkToDeath(c);
+ }
+ return c;
+}
+
void Camera::init()
{
mStatus = UNKNOWN_ERROR;