summaryrefslogtreecommitdiffstats
path: root/include/camera
diff options
context:
space:
mode:
Diffstat (limited to 'include/camera')
-rw-r--r--include/camera/CameraMetadata.h4
-rw-r--r--include/camera/CameraParameters.h3
-rw-r--r--include/camera/ICameraService.h45
-rw-r--r--include/camera/ICameraServiceListener.h26
-rw-r--r--include/camera/IProCameraCallbacks.h71
-rw-r--r--include/camera/IProCameraUser.h100
-rw-r--r--include/camera/ProCamera.h319
-rw-r--r--include/camera/camera2/ICameraDeviceUser.h7
-rw-r--r--include/camera/camera2/OutputConfiguration.h51
9 files changed, 119 insertions, 507 deletions
diff --git a/include/camera/CameraMetadata.h b/include/camera/CameraMetadata.h
index 1254d3c..953d711 100644
--- a/include/camera/CameraMetadata.h
+++ b/include/camera/CameraMetadata.h
@@ -56,7 +56,7 @@ class CameraMetadata {
* thread-safety, it simply prevents the camera_metadata_t pointer returned
* here from being accidentally invalidated by CameraMetadata operations.
*/
- const camera_metadata_t* getAndLock();
+ const camera_metadata_t* getAndLock() const;
/**
* Unlock the CameraMetadata for use again. After this unlock, the pointer
@@ -208,7 +208,7 @@ class CameraMetadata {
private:
camera_metadata_t *mBuffer;
- bool mLocked;
+ mutable bool mLocked;
/**
* Check if tag has a given type
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index c6074fc..ba33ffe 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -108,6 +108,9 @@ public:
*/
void getSupportedPreviewFormats(Vector<int>& formats) const;
+ // Returns true if no keys are present
+ bool isEmpty() const;
+
// Parameter keys to communicate between camera application and driver.
// The access (read/write, read only, or write only) is viewed from the
// perspective of applications, not driver.
diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h
index f7f06bb..cad275e 100644
--- a/include/camera/ICameraService.h
+++ b/include/camera/ICameraService.h
@@ -25,8 +25,6 @@ namespace android {
class ICamera;
class ICameraClient;
-class IProCameraUser;
-class IProCameraCallbacks;
class ICameraServiceListener;
class ICameraDeviceUser;
class ICameraDeviceCallbacks;
@@ -44,7 +42,6 @@ public:
GET_NUMBER_OF_CAMERAS = IBinder::FIRST_CALL_TRANSACTION,
GET_CAMERA_INFO,
CONNECT,
- CONNECT_PRO,
CONNECT_DEVICE,
ADD_LISTENER,
REMOVE_LISTENER,
@@ -53,6 +50,8 @@ public:
GET_LEGACY_PARAMETERS,
SUPPORTS_CAMERA_API,
CONNECT_LEGACY,
+ SET_TORCH_MODE,
+ NOTIFY_SYSTEM_EVENT,
};
enum {
@@ -66,7 +65,18 @@ public:
enum {
CAMERA_HAL_API_VERSION_UNSPECIFIED = -1
- };
+ };
+
+ /**
+ * Keep up-to-date with declarations in
+ * frameworks/base/services/core/java/com/android/server/camera/CameraService.java
+ *
+ * These event codes are intended to be used with the notifySystemEvent call.
+ */
+ enum {
+ NO_EVENT = 0,
+ USER_SWITCHED,
+ };
public:
DECLARE_META_INTERFACE(CameraService);
@@ -104,13 +114,6 @@ public:
/*out*/
sp<ICamera>& device) = 0;
- virtual status_t connectPro(const sp<IProCameraCallbacks>& cameraCb,
- int cameraId,
- const String16& clientPackageName,
- int clientUid,
- /*out*/
- sp<IProCameraUser>& device) = 0;
-
virtual status_t connectDevice(
const sp<ICameraDeviceCallbacks>& cameraCb,
int cameraId,
@@ -142,6 +145,26 @@ public:
int clientUid,
/*out*/
sp<ICamera>& device) = 0;
+
+ /**
+ * Turn on or off a camera's torch mode. Torch mode will be turned off by
+ * camera service if the lastest client binder that turns it on dies.
+ *
+ * return values:
+ * 0: on a successful operation.
+ * -ENOSYS: the camera device doesn't support this operation. It it returned
+ * if and only if android.flash.into.available is false.
+ * -EBUSY: the camera device is opened.
+ * -EINVAL: camera_id is invalid or clientBinder is NULL when enabling a
+ * torch mode.
+ */
+ virtual status_t setTorchMode(const String16& cameraId, bool enabled,
+ const sp<IBinder>& clientBinder) = 0;
+
+ /**
+ * Notify the camera service of a system event. Should only be called from system_server.
+ */
+ virtual void notifySystemEvent(int eventId, int arg0) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/include/camera/ICameraServiceListener.h b/include/camera/ICameraServiceListener.h
index 0a0e43a..709ff31 100644
--- a/include/camera/ICameraServiceListener.h
+++ b/include/camera/ICameraServiceListener.h
@@ -66,9 +66,35 @@ public:
STATUS_UNKNOWN = 0xFFFFFFFF,
};
+ /**
+ * The torch mode status of a camera.
+ *
+ * Initial status will be transmitted with onTorchStatusChanged immediately
+ * after this listener is added to the service listener list.
+ *
+ * The enums should be set to values matching
+ * include/hardware/camera_common.h
+ */
+ enum TorchStatus {
+ // The camera's torch mode has become not available to use via
+ // setTorchMode().
+ TORCH_STATUS_NOT_AVAILABLE = TORCH_MODE_STATUS_NOT_AVAILABLE,
+ // The camera's torch mode is off and available to be turned on via
+ // setTorchMode().
+ TORCH_STATUS_AVAILABLE_OFF = TORCH_MODE_STATUS_AVAILABLE_OFF,
+ // The camera's torch mode is on and available to be turned off via
+ // setTorchMode().
+ TORCH_STATUS_AVAILABLE_ON = TORCH_MODE_STATUS_AVAILABLE_ON,
+
+ // Use to initialize variables only
+ TORCH_STATUS_UNKNOWN = 0xFFFFFFFF,
+ };
+
DECLARE_META_INTERFACE(CameraServiceListener);
virtual void onStatusChanged(Status status, int32_t cameraId) = 0;
+
+ virtual void onTorchStatusChanged(TorchStatus status, const String16& cameraId) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/include/camera/IProCameraCallbacks.h b/include/camera/IProCameraCallbacks.h
deleted file mode 100644
index e8abb89..0000000
--- a/include/camera/IProCameraCallbacks.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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_IPROCAMERA_CALLBACKS_H
-#define ANDROID_HARDWARE_IPROCAMERA_CALLBACKS_H
-
-#include <utils/RefBase.h>
-#include <binder/IInterface.h>
-#include <binder/Parcel.h>
-#include <binder/IMemory.h>
-#include <utils/Timers.h>
-#include <system/camera.h>
-
-struct camera_metadata;
-
-namespace android {
-
-class IProCameraCallbacks : public IInterface
-{
- /**
- * Keep up-to-date with IProCameraCallbacks.aidl in frameworks/base
- */
-public:
- DECLARE_META_INTERFACE(ProCameraCallbacks);
-
- virtual void notifyCallback(int32_t msgType,
- int32_t ext1,
- int32_t ext2) = 0;
-
- enum LockStatus {
- LOCK_ACQUIRED,
- LOCK_RELEASED,
- LOCK_STOLEN,
- };
-
- virtual void onLockStatusChanged(LockStatus newLockStatus) = 0;
-
- /** Missing by design: implementation is client-side in ProCamera.cpp **/
- // virtual void onBufferReceived(int streamId,
- // const CpuConsumer::LockedBufer& buf);
- virtual void onResultReceived(int32_t requestId,
- camera_metadata* result) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnProCameraCallbacks : public BnInterface<IProCameraCallbacks>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-}; // namespace android
-
-#endif
diff --git a/include/camera/IProCameraUser.h b/include/camera/IProCameraUser.h
deleted file mode 100644
index 2ccc4d2..0000000
--- a/include/camera/IProCameraUser.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 <utils/RefBase.h>
-#include <binder/IInterface.h>
-#include <binder/Parcel.h>
-#include <binder/IMemory.h>
-#include <utils/String8.h>
-#include <camera/IProCameraCallbacks.h>
-
-struct camera_metadata;
-
-namespace android {
-
-class IProCameraUserClient;
-class IGraphicBufferProducer;
-class Surface;
-
-class IProCameraUser: public IInterface
-{
- /**
- * Keep up-to-date with IProCameraUser.aidl in frameworks/base
- */
-public:
- DECLARE_META_INTERFACE(ProCameraUser);
-
- virtual void disconnect() = 0;
-
- // connect to the service, given a callbacks listener
- virtual status_t connect(const sp<IProCameraCallbacks>& 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 deleteStream(int streamId) = 0;
- virtual status_t createStream(
- int width, int height, int format,
- const sp<IGraphicBufferProducer>& bufferProducer,
- /*out*/
- int* streamId) = 0;
-
- // Create a request object from a template.
- virtual status_t createDefaultRequest(int templateId,
- /*out*/
- camera_metadata** request)
- = 0;
-
- // Get static camera metadata
- virtual status_t getCameraInfo(int cameraId,
- /*out*/
- camera_metadata** info) = 0;
-
-};
-
-// ----------------------------------------------------------------------------
-
-class BnProCameraUser: public BnInterface<IProCameraUser>
-{
-public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
-};
-
-}; // namespace android
-
-#endif
diff --git a/include/camera/ProCamera.h b/include/camera/ProCamera.h
deleted file mode 100644
index e9b687a..0000000
--- a/include/camera/ProCamera.h
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * 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_PRO_CAMERA_H
-#define ANDROID_HARDWARE_PRO_CAMERA_H
-
-#include <utils/Timers.h>
-#include <utils/KeyedVector.h>
-#include <gui/IGraphicBufferProducer.h>
-#include <system/camera.h>
-#include <camera/IProCameraCallbacks.h>
-#include <camera/IProCameraUser.h>
-#include <camera/Camera.h>
-#include <camera/CameraMetadata.h>
-#include <camera/ICameraService.h>
-#include <gui/CpuConsumer.h>
-
-#include <gui/Surface.h>
-
-#include <utils/Condition.h>
-#include <utils/Mutex.h>
-
-#include <camera/CameraBase.h>
-
-struct camera_metadata;
-
-namespace android {
-
-// All callbacks on this class are concurrent
-// (they come from separate threads)
-class ProCameraListener : virtual public RefBase
-{
-public:
- virtual void notify(int32_t msgType, int32_t ext1, int32_t ext2) = 0;
-
- // Lock has been acquired. Write operations now available.
- virtual void onLockAcquired() = 0;
- // Lock has been released with exclusiveUnlock.
- virtual void onLockReleased() = 0;
- // Lock has been stolen by another client.
- virtual void onLockStolen() = 0;
-
- // Lock free.
- virtual void onTriggerNotify(int32_t msgType, int32_t ext1, int32_t ext2)
- = 0;
- // onFrameAvailable and OnResultReceived can come in with any order,
- // use android.sensor.timestamp and LockedBuffer.timestamp to correlate them
-
- /**
- * A new metadata buffer has been received.
- * -- Ownership of request passes on to the callee, free with
- * free_camera_metadata.
- */
- virtual void onResultReceived(int32_t frameId, camera_metadata* result) = 0;
-
- // TODO: make onFrameAvailable pure virtual
-
- // A new frame buffer has been received for this stream.
- // -- This callback only fires for createStreamCpu streams
- // -- A buffer may be obtained by calling cpuConsumer->lockNextBuffer
- // -- Use buf.timestamp to correlate with result's android.sensor.timestamp
- // -- The buffer should be accessed with CpuConsumer::lockNextBuffer
- // and CpuConsumer::unlockBuffer
- virtual void onFrameAvailable(int /*streamId*/,
- const sp<CpuConsumer>& /*cpuConsumer*/) {
- }
-
-};
-
-class ProCamera;
-
-template <>
-struct CameraTraits<ProCamera>
-{
- typedef ProCameraListener TCamListener;
- typedef IProCameraUser TCamUser;
- typedef IProCameraCallbacks TCamCallbacks;
- typedef status_t (ICameraService::*TCamConnectService)(const sp<IProCameraCallbacks>&,
- int, const String16&, int,
- /*out*/
- sp<IProCameraUser>&);
- static TCamConnectService fnConnectService;
-};
-
-
-class ProCamera :
- public CameraBase<ProCamera>,
- public BnProCameraCallbacks
-{
-public:
- /**
- * Connect a shared camera. By default access is restricted to read only
- * (Lock free) operations. To be able to submit custom requests a lock needs
- * to be acquired with exclusive[Try]Lock.
- */
- static sp<ProCamera> connect(int cameraId);
- virtual ~ProCamera();
-
- /**
- * Exclusive Locks:
- * - We may request exclusive access to a camera if no other
- * clients are using the camera. This works as a traditional
- * client, writing/reading any camera state.
- * - An application opening the camera (a regular 'Camera') will
- * always steal away the exclusive lock from a ProCamera,
- * this will call onLockReleased.
- * - onLockAcquired will be called again once it is possible
- * to again exclusively lock the camera.
- *
- */
-
- /**
- * All exclusiveLock/unlock functions are asynchronous. The remote endpoint
- * shall not block while waiting to acquire the lock. Instead the lock
- * notifications will come in asynchronously on the listener.
- */
-
- /**
- * Attempt to acquire the lock instantly (non-blocking)
- * - If this succeeds, you do not need to wait for onLockAcquired
- * but the event will still be fired
- *
- * Returns -EBUSY if already locked. 0 on success.
- */
- status_t exclusiveTryLock();
- // always returns 0. wait for onLockAcquired before lock is acquired.
- status_t exclusiveLock();
- // release a lock if we have one, or cancel the lock request.
- status_t exclusiveUnlock();
-
- // exclusive lock = do whatever we want. no lock = read only.
- bool hasExclusiveLock();
-
- /**
- * < 0 error, >= 0 the request ID. streaming to have the request repeat
- * until cancelled.
- * The request queue is flushed when a lock is released or stolen
- * if not locked will return PERMISSION_DENIED
- */
- int submitRequest(const struct camera_metadata* metadata,
- bool streaming = false);
- // if not locked will return PERMISSION_DENIED, BAD_VALUE if requestId bad
- status_t cancelRequest(int requestId);
-
- /**
- * Ask for a stream to be enabled.
- * Lock free. Service maintains counter of streams.
- */
- status_t requestStream(int streamId);
-// TODO: remove requestStream, its useless.
-
- /**
- * Delete a stream.
- * Lock free.
- *
- * NOTE: As a side effect this cancels ALL streaming requests.
- *
- * Errors: BAD_VALUE if unknown stream ID.
- * PERMISSION_DENIED if the stream wasn't yours
- */
- status_t deleteStream(int streamId);
-
- /**
- * Create a new HW stream, whose sink will be the window.
- * Lock free. Service maintains counter of streams.
- * Errors: -EBUSY if too many streams created
- */
- status_t createStream(int width, int height, int format,
- const sp<Surface>& surface,
- /*out*/
- int* streamId);
-
- /**
- * Create a new HW stream, whose sink will be the SurfaceTexture.
- * Lock free. Service maintains counter of streams.
- * Errors: -EBUSY if too many streams created
- */
- status_t createStream(int width, int height, int format,
- const sp<IGraphicBufferProducer>& bufferProducer,
- /*out*/
- int* streamId);
- status_t createStreamCpu(int width, int height, int format,
- int heapCount,
- /*out*/
- sp<CpuConsumer>* cpuConsumer,
- int* streamId);
- status_t createStreamCpu(int width, int height, int format,
- int heapCount,
- bool synchronousMode,
- /*out*/
- sp<CpuConsumer>* cpuConsumer,
- int* streamId);
-
- // Create a request object from a template.
- status_t createDefaultRequest(int templateId,
- /*out*/
- camera_metadata** request) const;
-
- // Get static camera metadata
- camera_metadata* getCameraInfo(int cameraId);
-
- // Blocks until a frame is available (CPU streams only)
- // - Obtain the frame data by calling CpuConsumer::lockNextBuffer
- // - Release the frame data after use with CpuConsumer::unlockBuffer
- // Return value:
- // - >0 - number of frames available to be locked
- // - <0 - error (refer to error codes)
- // Error codes:
- // -ETIMEDOUT if it took too long to get a frame
- int waitForFrameBuffer(int streamId);
-
- // Blocks until a metadata result is available
- // - Obtain the metadata by calling consumeFrameMetadata()
- // Error codes:
- // -ETIMEDOUT if it took too long to get a frame
- status_t waitForFrameMetadata();
-
- // Get the latest metadata. This is destructive.
- // - Calling this repeatedly will produce empty metadata objects.
- // - Use waitForFrameMetadata to sync until new data is available.
- CameraMetadata consumeFrameMetadata();
-
- // Convenience method to drop frame buffers (CPU streams only)
- // Return values:
- // >=0 - number of frames dropped (up to count)
- // <0 - error code
- // Error codes:
- // BAD_VALUE - invalid streamId or count passed
- int dropFrameBuffer(int streamId, int count);
-
-protected:
- ////////////////////////////////////////////////////////
- // IProCameraCallbacks implementation
- ////////////////////////////////////////////////////////
- virtual void notifyCallback(int32_t msgType,
- int32_t ext,
- int32_t ext2);
-
- virtual void onLockStatusChanged(
- IProCameraCallbacks::LockStatus newLockStatus);
-
- virtual void onResultReceived(int32_t requestId,
- camera_metadata* result);
-private:
- ProCamera(int cameraId);
-
- class ProFrameListener : public CpuConsumer::FrameAvailableListener {
- public:
- ProFrameListener(wp<ProCamera> camera, int streamID) {
- mCamera = camera;
- mStreamId = streamID;
- }
-
- protected:
- virtual void onFrameAvailable(const BufferItem& /* item */) {
- sp<ProCamera> c = mCamera.promote();
- if (c.get() != NULL) {
- c->onFrameAvailable(mStreamId);
- }
- }
-
- private:
- wp<ProCamera> mCamera;
- int mStreamId;
- };
- friend class ProFrameListener;
-
- struct StreamInfo
- {
- StreamInfo(int streamId) {
- this->streamID = streamId;
- cpuStream = false;
- frameReady = 0;
- }
-
- StreamInfo() {
- streamID = -1;
- cpuStream = false;
- }
-
- int streamID;
- bool cpuStream;
- sp<CpuConsumer> cpuConsumer;
- bool synchronousMode;
- sp<ProFrameListener> frameAvailableListener;
- sp<Surface> stc;
- int frameReady;
- };
-
- Condition mWaitCondition;
- Mutex mWaitMutex;
- static const nsecs_t mWaitTimeout = 1000000000; // 1sec
- KeyedVector<int, StreamInfo> mStreams;
- bool mMetadataReady;
- CameraMetadata mLatestMetadata;
-
- void onFrameAvailable(int streamId);
-
- StreamInfo& getStreamInfo(int streamId);
-
- friend class CameraBase;
-};
-
-}; // namespace android
-
-#endif
diff --git a/include/camera/camera2/ICameraDeviceUser.h b/include/camera/camera2/ICameraDeviceUser.h
index 35488bb..e9f1f5a 100644
--- a/include/camera/camera2/ICameraDeviceUser.h
+++ b/include/camera/camera2/ICameraDeviceUser.h
@@ -27,9 +27,9 @@ namespace android {
class ICameraDeviceUserClient;
class IGraphicBufferProducer;
-class Surface;
class CaptureRequest;
class CameraMetadata;
+class OutputConfiguration;
enum {
NO_IN_FLIGHT_REPEATING_FRAMES = -1,
@@ -100,9 +100,8 @@ public:
virtual status_t endConfigure() = 0;
virtual status_t deleteStream(int streamId) = 0;
- virtual status_t createStream(
- int width, int height, int format,
- const sp<IGraphicBufferProducer>& bufferProducer) = 0;
+
+ virtual status_t createStream(const OutputConfiguration& outputConfiguration) = 0;
// Create a request object from a template.
virtual status_t createDefaultRequest(int templateId,
diff --git a/include/camera/camera2/OutputConfiguration.h b/include/camera/camera2/OutputConfiguration.h
new file mode 100644
index 0000000..e6b679f
--- /dev/null
+++ b/include/camera/camera2/OutputConfiguration.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2015 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_CAMERA2_OUTPUTCONFIGURATION_H
+#define ANDROID_HARDWARE_CAMERA2_OUTPUTCONFIGURATION_H
+
+#include <utils/RefBase.h>
+#include <gui/IGraphicBufferProducer.h>
+
+namespace android {
+
+class Surface;
+
+class OutputConfiguration : public virtual RefBase {
+public:
+
+ static const int INVALID_ROTATION;
+ sp<IGraphicBufferProducer> getGraphicBufferProducer() const;
+ int getRotation() const;
+
+ /**
+ * Keep impl up-to-date with OutputConfiguration.java in frameworks/base
+ */
+ status_t writeToParcel(Parcel& parcel) const;
+ // getGraphicBufferProducer will be NULL if error occurred
+ // getRotation will be INVALID_ROTATION if error occurred
+ OutputConfiguration(const Parcel& parcel);
+
+private:
+ sp<IGraphicBufferProducer> mGbp;
+ int mRotation;
+
+ // helper function
+ static String16 readMaybeEmptyString16(const Parcel& parcel);
+};
+}; // namespace android
+
+#endif