From 634a51509ee50475f3e9f8ccf897e90fc72ded31 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Wed, 20 Feb 2013 17:15:11 -0800 Subject: Camera: Add ProCamera private binder interface for an API2-light functionality Change-Id: I2af7a807c99df75ea659e6e6acc9c4fca6a56274 --- include/camera/IProCameraUser.h | 82 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 include/camera/IProCameraUser.h (limited to 'include/camera/IProCameraUser.h') diff --git a/include/camera/IProCameraUser.h b/include/camera/IProCameraUser.h new file mode 100644 index 0000000..6170410 --- /dev/null +++ b/include/camera/IProCameraUser.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_HARDWARE_IPROCAMERAUSER_H +#define ANDROID_HARDWARE_IPROCAMERAUSER_H + +#include +#include +#include +#include +#include +#include + +struct camera_metadata; + +namespace android { + +class IProCameraUserClient; +class IGraphicBufferProducer; +class Surface; + +class IProCameraUser: public IInterface +{ +public: + DECLARE_META_INTERFACE(ProCameraUser); + + virtual void disconnect() = 0; + + // connect to the service, given a callbacks listener + virtual status_t connect(const sp& callbacks) + = 0; + + /** + * Locking + **/ + virtual status_t exclusiveTryLock() = 0; + virtual status_t exclusiveLock() = 0; + virtual status_t exclusiveUnlock() = 0; + + virtual bool hasExclusiveLock() = 0; + + /** + * Request Handling + **/ + + // Note that the callee gets a copy of the metadata. + virtual int submitRequest(struct camera_metadata* metadata, + bool streaming = false) = 0; + virtual status_t cancelRequest(int requestId) = 0; + + virtual status_t requestStream(int streamId) = 0; + virtual status_t cancelStream(int streamId) = 0; + +}; + +// ---------------------------------------------------------------------------- + +class BnProCameraUser: public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +}; // namespace android + +#endif -- cgit v1.1 From 985fd30a10f6fec4293f071fd258c4726cff5a3d Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Wed, 20 Feb 2013 18:24:43 -0800 Subject: Camera: ProCamera2Client - add createStream (service is stubbed) and unit test Change-Id: I1ae7ba9b24f5883c214c19a7ed0eaf0c802d69c1 --- include/camera/IProCameraUser.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/camera/IProCameraUser.h') diff --git a/include/camera/IProCameraUser.h b/include/camera/IProCameraUser.h index 6170410..3ef4676 100644 --- a/include/camera/IProCameraUser.h +++ b/include/camera/IProCameraUser.h @@ -63,6 +63,16 @@ public: virtual status_t requestStream(int streamId) = 0; virtual status_t cancelStream(int streamId) = 0; + virtual status_t createStream(int width, int height, int format, + const sp& surface, + /*out*/ + int* streamId) = 0; + + // Create a request object from a template. + virtual status_t createDefaultRequest(int templateId, + /*out*/ + camera_metadata** request) + = 0; }; -- cgit v1.1 From 76f8b43909817179b317880202360863b8f976d0 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Wed, 20 Feb 2013 19:15:15 -0800 Subject: Camera: Change ProCamera to take IGraphicBufferProducer Change-Id: Iec62eead6d179aa5486f7719143340976bb76e7d --- include/camera/IProCameraUser.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/camera/IProCameraUser.h') diff --git a/include/camera/IProCameraUser.h b/include/camera/IProCameraUser.h index 3ef4676..a141769 100644 --- a/include/camera/IProCameraUser.h +++ b/include/camera/IProCameraUser.h @@ -63,10 +63,11 @@ public: virtual status_t requestStream(int streamId) = 0; virtual status_t cancelStream(int streamId) = 0; - virtual status_t createStream(int width, int height, int format, - const sp& surface, - /*out*/ - int* streamId) = 0; + virtual status_t createStream( + int width, int height, int format, + const sp& bufferProducer, + /*out*/ + int* streamId) = 0; // Create a request object from a template. virtual status_t createDefaultRequest(int templateId, -- cgit v1.1 From 7b33a74bbc514b99c16be7fff9a34e892bc19264 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Thu, 21 Feb 2013 13:49:26 -0800 Subject: ProCamera: Add getInfo for getting static metadata (and a test) Change-Id: I3b87dfbc621d98bf41f37a892a1012baf85b5166 --- include/camera/IProCameraUser.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/camera/IProCameraUser.h') diff --git a/include/camera/IProCameraUser.h b/include/camera/IProCameraUser.h index a141769..7bddb0c 100644 --- a/include/camera/IProCameraUser.h +++ b/include/camera/IProCameraUser.h @@ -75,6 +75,11 @@ public: camera_metadata** request) = 0; + // Get static camera metadata + virtual status_t getCameraInfo(int cameraId, + /*out*/ + camera_metadata** info) = 0; + }; // ---------------------------------------------------------------------------- -- cgit v1.1 From fa4cf9d310685b4c25877cba772ff7da84caf517 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Mon, 4 Mar 2013 16:14:23 -0800 Subject: (Camera)ProCamera: Remove unused functions from binder interface Change-Id: I0582268cef6e84b630bc87c8a03dcd69d54c440d --- include/camera/IProCameraUser.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/camera/IProCameraUser.h') diff --git a/include/camera/IProCameraUser.h b/include/camera/IProCameraUser.h index 7bddb0c..45b818c 100644 --- a/include/camera/IProCameraUser.h +++ b/include/camera/IProCameraUser.h @@ -61,8 +61,7 @@ public: bool streaming = false) = 0; virtual status_t cancelRequest(int requestId) = 0; - virtual status_t requestStream(int streamId) = 0; - virtual status_t cancelStream(int streamId) = 0; + virtual status_t deleteStream(int streamId) = 0; virtual status_t createStream( int width, int height, int format, const sp& bufferProducer, -- cgit v1.1 From bef3f23f16f2fc575b3f425febcfcc436a7db70f Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Thu, 30 May 2013 17:47:38 -0700 Subject: camera: Make some binder interfaces compatible with AIDL Done: * ICameraService * ICameraServiceListener Partial: * ICamera (disconnect only) * IProCameraUser (disconnect only) Bug: 9213377 Change-Id: I8e2e6e05cfd02ec36be1d5b2c551f10ffb43b5b4 --- include/camera/IProCameraUser.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/camera/IProCameraUser.h') diff --git a/include/camera/IProCameraUser.h b/include/camera/IProCameraUser.h index 45b818c..2ccc4d2 100644 --- a/include/camera/IProCameraUser.h +++ b/include/camera/IProCameraUser.h @@ -34,6 +34,9 @@ class Surface; class IProCameraUser: public IInterface { + /** + * Keep up-to-date with IProCameraUser.aidl in frameworks/base + */ public: DECLARE_META_INTERFACE(ProCameraUser); -- cgit v1.1