Loading camera/camera2/ICameraDeviceUser.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -190,11 +190,13 @@ public: return reply.readInt32(); return reply.readInt32(); } } virtual status_t endConfigure() virtual status_t endConfigure(bool isConstrainedHighSpeed) { { ALOGV("endConfigure"); ALOGV("endConfigure"); Parcel data, reply; Parcel data, reply; data.writeInterfaceToken(ICameraDeviceUser::getInterfaceDescriptor()); data.writeInterfaceToken(ICameraDeviceUser::getInterfaceDescriptor()); data.writeInt32(isConstrainedHighSpeed); remote()->transact(END_CONFIGURE, data, &reply); remote()->transact(END_CONFIGURE, data, &reply); reply.readExceptionCode(); reply.readExceptionCode(); return reply.readInt32(); return reply.readInt32(); Loading Loading @@ -556,8 +558,9 @@ status_t BnCameraDeviceUser::onTransact( } break; } break; case END_CONFIGURE: { case END_CONFIGURE: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); CHECK_INTERFACE(ICameraDeviceUser, data, reply); bool isConstrainedHighSpeed = data.readInt32(); reply->writeNoException(); reply->writeNoException(); reply->writeInt32(endConfigure()); reply->writeInt32(endConfigure(isConstrainedHighSpeed)); return NO_ERROR; return NO_ERROR; } break; } break; case PREPARE: { case PREPARE: { Loading include/camera/camera2/ICameraDeviceUser.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -97,7 +97,7 @@ public: * must be called before any requests can be submitted. * must be called before any requests can be submitted. * <p> * <p> */ */ virtual status_t endConfigure() = 0; virtual status_t endConfigure(bool isConstrainedHighSpeed = false) = 0; virtual status_t deleteStream(int streamId) = 0; virtual status_t deleteStream(int streamId) = 0; Loading services/camera/libcameraservice/api2/CameraDeviceClient.cpp +23 −3 Original line number Original line Diff line number Diff line Loading @@ -269,14 +269,34 @@ status_t CameraDeviceClient::cancelRequest(int requestId, int64_t* lastFrameNumb status_t CameraDeviceClient::beginConfigure() { status_t CameraDeviceClient::beginConfigure() { // TODO: Implement this. // TODO: Implement this. ALOGE("%s: Not implemented yet.", __FUNCTION__); ALOGV("%s: Not implemented yet.", __FUNCTION__); return OK; return OK; } } status_t CameraDeviceClient::endConfigure() { status_t CameraDeviceClient::endConfigure(bool isConstrainedHighSpeed) { ALOGV("%s: ending configure (%d input stream, %zu output streams)", ALOGV("%s: ending configure (%d input stream, %zu output streams)", __FUNCTION__, mInputStream.configured ? 1 : 0, mStreamMap.size()); __FUNCTION__, mInputStream.configured ? 1 : 0, mStreamMap.size()); // Sanitize the high speed session against necessary capability bit. if (isConstrainedHighSpeed) { CameraMetadata staticInfo = mDevice->info(); camera_metadata_entry_t entry = staticInfo.find(ANDROID_REQUEST_AVAILABLE_CAPABILITIES); bool isConstrainedHighSpeedSupported = false; for(size_t i = 0; i < entry.count; ++i) { uint8_t capability = entry.data.u8[i]; if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO) { isConstrainedHighSpeedSupported = true; break; } } if (!isConstrainedHighSpeedSupported) { ALOGE("%s: Camera %d: Try to create a constrained high speed configuration on a device" " that doesn't support it.", __FUNCTION__, mCameraId); return INVALID_OPERATION; } } status_t res; status_t res; if ( (res = checkPid(__FUNCTION__) ) != OK) return res; if ( (res = checkPid(__FUNCTION__) ) != OK) return res; Loading @@ -284,7 +304,7 @@ status_t CameraDeviceClient::endConfigure() { if (!mDevice.get()) return DEAD_OBJECT; if (!mDevice.get()) return DEAD_OBJECT; return mDevice->configureStreams(); return mDevice->configureStreams(isConstrainedHighSpeed); } } status_t CameraDeviceClient::deleteStream(int streamId) { status_t CameraDeviceClient::deleteStream(int streamId) { Loading services/camera/libcameraservice/api2/CameraDeviceClient.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -79,7 +79,7 @@ public: virtual status_t beginConfigure(); virtual status_t beginConfigure(); virtual status_t endConfigure(); virtual status_t endConfigure(bool isConstrainedHighSpeed = false); // Returns -EBUSY if device is not idle // Returns -EBUSY if device is not idle virtual status_t deleteStream(int streamId); virtual status_t deleteStream(int streamId); Loading services/camera/libcameraservice/common/CameraDeviceBase.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -157,7 +157,7 @@ class CameraDeviceBase : public virtual RefBase { * - BAD_VALUE if the set of streams was invalid (e.g. fmts or sizes) * - BAD_VALUE if the set of streams was invalid (e.g. fmts or sizes) * - INVALID_OPERATION if the device was in the wrong state * - INVALID_OPERATION if the device was in the wrong state */ */ virtual status_t configureStreams() = 0; virtual status_t configureStreams(bool isConstrainedHighSpeed = false) = 0; // get the buffer producer of the input stream // get the buffer producer of the input stream virtual status_t getInputBufferProducer( virtual status_t getInputBufferProducer( Loading Loading
camera/camera2/ICameraDeviceUser.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -190,11 +190,13 @@ public: return reply.readInt32(); return reply.readInt32(); } } virtual status_t endConfigure() virtual status_t endConfigure(bool isConstrainedHighSpeed) { { ALOGV("endConfigure"); ALOGV("endConfigure"); Parcel data, reply; Parcel data, reply; data.writeInterfaceToken(ICameraDeviceUser::getInterfaceDescriptor()); data.writeInterfaceToken(ICameraDeviceUser::getInterfaceDescriptor()); data.writeInt32(isConstrainedHighSpeed); remote()->transact(END_CONFIGURE, data, &reply); remote()->transact(END_CONFIGURE, data, &reply); reply.readExceptionCode(); reply.readExceptionCode(); return reply.readInt32(); return reply.readInt32(); Loading Loading @@ -556,8 +558,9 @@ status_t BnCameraDeviceUser::onTransact( } break; } break; case END_CONFIGURE: { case END_CONFIGURE: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); CHECK_INTERFACE(ICameraDeviceUser, data, reply); bool isConstrainedHighSpeed = data.readInt32(); reply->writeNoException(); reply->writeNoException(); reply->writeInt32(endConfigure()); reply->writeInt32(endConfigure(isConstrainedHighSpeed)); return NO_ERROR; return NO_ERROR; } break; } break; case PREPARE: { case PREPARE: { Loading
include/camera/camera2/ICameraDeviceUser.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -97,7 +97,7 @@ public: * must be called before any requests can be submitted. * must be called before any requests can be submitted. * <p> * <p> */ */ virtual status_t endConfigure() = 0; virtual status_t endConfigure(bool isConstrainedHighSpeed = false) = 0; virtual status_t deleteStream(int streamId) = 0; virtual status_t deleteStream(int streamId) = 0; Loading
services/camera/libcameraservice/api2/CameraDeviceClient.cpp +23 −3 Original line number Original line Diff line number Diff line Loading @@ -269,14 +269,34 @@ status_t CameraDeviceClient::cancelRequest(int requestId, int64_t* lastFrameNumb status_t CameraDeviceClient::beginConfigure() { status_t CameraDeviceClient::beginConfigure() { // TODO: Implement this. // TODO: Implement this. ALOGE("%s: Not implemented yet.", __FUNCTION__); ALOGV("%s: Not implemented yet.", __FUNCTION__); return OK; return OK; } } status_t CameraDeviceClient::endConfigure() { status_t CameraDeviceClient::endConfigure(bool isConstrainedHighSpeed) { ALOGV("%s: ending configure (%d input stream, %zu output streams)", ALOGV("%s: ending configure (%d input stream, %zu output streams)", __FUNCTION__, mInputStream.configured ? 1 : 0, mStreamMap.size()); __FUNCTION__, mInputStream.configured ? 1 : 0, mStreamMap.size()); // Sanitize the high speed session against necessary capability bit. if (isConstrainedHighSpeed) { CameraMetadata staticInfo = mDevice->info(); camera_metadata_entry_t entry = staticInfo.find(ANDROID_REQUEST_AVAILABLE_CAPABILITIES); bool isConstrainedHighSpeedSupported = false; for(size_t i = 0; i < entry.count; ++i) { uint8_t capability = entry.data.u8[i]; if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO) { isConstrainedHighSpeedSupported = true; break; } } if (!isConstrainedHighSpeedSupported) { ALOGE("%s: Camera %d: Try to create a constrained high speed configuration on a device" " that doesn't support it.", __FUNCTION__, mCameraId); return INVALID_OPERATION; } } status_t res; status_t res; if ( (res = checkPid(__FUNCTION__) ) != OK) return res; if ( (res = checkPid(__FUNCTION__) ) != OK) return res; Loading @@ -284,7 +304,7 @@ status_t CameraDeviceClient::endConfigure() { if (!mDevice.get()) return DEAD_OBJECT; if (!mDevice.get()) return DEAD_OBJECT; return mDevice->configureStreams(); return mDevice->configureStreams(isConstrainedHighSpeed); } } status_t CameraDeviceClient::deleteStream(int streamId) { status_t CameraDeviceClient::deleteStream(int streamId) { Loading
services/camera/libcameraservice/api2/CameraDeviceClient.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -79,7 +79,7 @@ public: virtual status_t beginConfigure(); virtual status_t beginConfigure(); virtual status_t endConfigure(); virtual status_t endConfigure(bool isConstrainedHighSpeed = false); // Returns -EBUSY if device is not idle // Returns -EBUSY if device is not idle virtual status_t deleteStream(int streamId); virtual status_t deleteStream(int streamId); Loading
services/camera/libcameraservice/common/CameraDeviceBase.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -157,7 +157,7 @@ class CameraDeviceBase : public virtual RefBase { * - BAD_VALUE if the set of streams was invalid (e.g. fmts or sizes) * - BAD_VALUE if the set of streams was invalid (e.g. fmts or sizes) * - INVALID_OPERATION if the device was in the wrong state * - INVALID_OPERATION if the device was in the wrong state */ */ virtual status_t configureStreams() = 0; virtual status_t configureStreams(bool isConstrainedHighSpeed = false) = 0; // get the buffer producer of the input stream // get the buffer producer of the input stream virtual status_t getInputBufferProducer( virtual status_t getInputBufferProducer( Loading