diff options
Diffstat (limited to 'camera')
-rw-r--r-- | camera/camera2/ICameraDeviceCallbacks.cpp | 22 | ||||
-rw-r--r-- | camera/camera2/ICameraDeviceUser.cpp | 25 |
2 files changed, 45 insertions, 2 deletions
diff --git a/camera/camera2/ICameraDeviceCallbacks.cpp b/camera/camera2/ICameraDeviceCallbacks.cpp index 4cc7b5d..f599879 100644 --- a/camera/camera2/ICameraDeviceCallbacks.cpp +++ b/camera/camera2/ICameraDeviceCallbacks.cpp @@ -37,6 +37,7 @@ enum { CAMERA_IDLE, CAPTURE_STARTED, RESULT_RECEIVED, + PREPARED }; class BpCameraDeviceCallbacks: public BpInterface<ICameraDeviceCallbacks> @@ -80,7 +81,6 @@ public: data.writeNoException(); } - void onResultReceived(const CameraMetadata& metadata, const CaptureResultExtras& resultExtras) { ALOGV("onResultReceived"); @@ -93,6 +93,17 @@ public: remote()->transact(RESULT_RECEIVED, data, &reply, IBinder::FLAG_ONEWAY); data.writeNoException(); } + + void onPrepared(int streamId) + { + ALOGV("onPrepared"); + Parcel data, reply; + data.writeInterfaceToken(ICameraDeviceCallbacks::getInterfaceDescriptor()); + data.writeInt32(streamId); + remote()->transact(PREPARED, data, &reply, IBinder::FLAG_ONEWAY); + data.writeNoException(); + } + }; IMPLEMENT_META_INTERFACE(CameraDeviceCallbacks, @@ -160,6 +171,15 @@ status_t BnCameraDeviceCallbacks::onTransact( data.readExceptionCode(); return NO_ERROR; } break; + case PREPARED: { + ALOGV("onPrepared"); + CHECK_INTERFACE(ICameraDeviceCallbacks, data, reply); + CaptureResultExtras result; + int streamId = data.readInt32(); + onPrepared(streamId); + data.readExceptionCode(); + return NO_ERROR; + } break; default: return BBinder::onTransact(code, data, reply, flags); } diff --git a/camera/camera2/ICameraDeviceUser.cpp b/camera/camera2/ICameraDeviceUser.cpp index 2ec08a9..9700258 100644 --- a/camera/camera2/ICameraDeviceUser.cpp +++ b/camera/camera2/ICameraDeviceUser.cpp @@ -47,7 +47,8 @@ enum { CREATE_DEFAULT_REQUEST, GET_CAMERA_INFO, WAIT_UNTIL_IDLE, - FLUSH + FLUSH, + PREPARE }; namespace { @@ -348,6 +349,20 @@ public: return res; } + virtual status_t prepare(int streamId) + { + ALOGV("prepare"); + Parcel data, reply; + + data.writeInterfaceToken(ICameraDeviceUser::getInterfaceDescriptor()); + data.writeInt32(streamId); + + remote()->transact(PREPARE, data, &reply); + + reply.readExceptionCode(); + return reply.readInt32(); + } + private: @@ -545,6 +560,14 @@ status_t BnCameraDeviceUser::onTransact( reply->writeInt32(endConfigure()); return NO_ERROR; } break; + case PREPARE: { + CHECK_INTERFACE(ICameraDeviceUser, data, reply); + int streamId = data.readInt32(); + reply->writeNoException(); + reply->writeInt32(prepare(streamId)); + return NO_ERROR; + } break; + default: return BBinder::onTransact(code, data, reply, flags); } |