Loading camera/CameraBase.cpp +18 −20 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ namespace android { namespace hardware { status_t CameraInfo::writeToParcel(Parcel* parcel) const { status_t CameraInfo::writeToParcel(android::Parcel* parcel) const { status_t res; res = parcel->writeInt32(facing); if (res != OK) return res; Loading @@ -47,7 +47,7 @@ status_t CameraInfo::writeToParcel(Parcel* parcel) const { return res; } status_t CameraInfo::readFromParcel(const Parcel* parcel) { status_t CameraInfo::readFromParcel(const android::Parcel* parcel) { status_t res; res = parcel->readInt32(&facing); if (res != OK) return res; Loading @@ -55,8 +55,24 @@ status_t CameraInfo::readFromParcel(const Parcel* parcel) { return res; } status_t CameraStatus::writeToParcel(android::Parcel* parcel) const { status_t res; res = parcel->writeString8(cameraId); if (res != OK) return res; res = parcel->writeInt32(status); return res; } status_t CameraStatus::readFromParcel(const android::Parcel* parcel) { status_t res; res = parcel->readString8(&cameraId); if (res != OK) return res; res = parcel->readInt32(&status); return res; } } // namespace hardware namespace { sp<::android::hardware::ICameraService> gCameraService; const int kCameraServicePollDelay = 500000; // 0.5s Loading Loading @@ -239,24 +255,6 @@ status_t CameraBase<TCam, TCamTraits>::getCameraInfo(int cameraId, return res.isOk() ? OK : res.serviceSpecificErrorCode(); } template <typename TCam, typename TCamTraits> status_t CameraBase<TCam, TCamTraits>::addServiceListener( const sp<::android::hardware::ICameraServiceListener>& listener) { const sp<::android::hardware::ICameraService>& cs = getCameraService(); if (cs == 0) return UNKNOWN_ERROR; binder::Status res = cs->addListener(listener); return res.isOk() ? OK : res.serviceSpecificErrorCode(); } template <typename TCam, typename TCamTraits> status_t CameraBase<TCam, TCamTraits>::removeServiceListener( const sp<::android::hardware::ICameraServiceListener>& listener) { const sp<::android::hardware::ICameraService>& cs = getCameraService(); if (cs == 0) return UNKNOWN_ERROR; binder::Status res = cs->removeListener(listener); return res.isOk() ? OK : res.serviceSpecificErrorCode(); } template class CameraBase<Camera>; } // namespace android camera/CaptureResult.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ bool CaptureResultExtras::isValid() { return requestId >= 0; } status_t CaptureResultExtras::readFromParcel(const Parcel *parcel) { status_t CaptureResultExtras::readFromParcel(const android::Parcel *parcel) { if (parcel == NULL) { ALOGE("%s: Null parcel", __FUNCTION__); return BAD_VALUE; Loading @@ -43,7 +43,7 @@ status_t CaptureResultExtras::readFromParcel(const Parcel *parcel) { return OK; } status_t CaptureResultExtras::writeToParcel(Parcel *parcel) const { status_t CaptureResultExtras::writeToParcel(android::Parcel *parcel) const { if (parcel == NULL) { ALOGE("%s: Null parcel", __FUNCTION__); return BAD_VALUE; Loading @@ -69,7 +69,7 @@ CaptureResult::CaptureResult(const CaptureResult &otherResult) { mMetadata = otherResult.mMetadata; } status_t CaptureResult::readFromParcel(Parcel *parcel) { status_t CaptureResult::readFromParcel(android::Parcel *parcel) { ALOGV("%s: parcel = %p", __FUNCTION__, parcel); Loading Loading @@ -100,7 +100,7 @@ status_t CaptureResult::readFromParcel(Parcel *parcel) { return OK; } status_t CaptureResult::writeToParcel(Parcel *parcel) const { status_t CaptureResult::writeToParcel(android::Parcel *parcel) const { ALOGV("%s: parcel = %p", __FUNCTION__, parcel); Loading camera/VendorTagDescriptor.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ void VendorTagDescriptor::copyFrom(const VendorTagDescriptor& src) { mVendorOps = src.mVendorOps; } status_t VendorTagDescriptor::readFromParcel(const Parcel* parcel) { status_t VendorTagDescriptor::readFromParcel(const android::Parcel* parcel) { status_t res = OK; if (parcel == NULL) { ALOGE("%s: parcel argument was NULL.", __FUNCTION__); Loading Loading @@ -244,7 +244,7 @@ int VendorTagDescriptor::getTagType(uint32_t tag) const { return mTagToTypeMap.valueFor(tag); } status_t VendorTagDescriptor::writeToParcel(Parcel* parcel) const { status_t VendorTagDescriptor::writeToParcel(android::Parcel* parcel) const { status_t res = OK; if (parcel == NULL) { ALOGE("%s: parcel argument was NULL.", __FUNCTION__); Loading camera/aidl/android/hardware/CameraStatus.aidl 0 → 100644 +20 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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. */ package android.hardware; /** @hide */ parcelable CameraStatus cpp_header "camera/CameraBase.h"; camera/aidl/android/hardware/ICameraService.aidl +15 −6 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.hardware.camera2.params.VendorTagDescriptor; import android.hardware.camera2.impl.CameraMetadataNative; import android.hardware.ICameraServiceListener; import android.hardware.CameraInfo; import android.hardware.CameraStatus; /** * Binder interface for the native camera service running in mediaserver. Loading Loading @@ -83,7 +84,7 @@ interface ICameraService * Only supported for device HAL versions >= 3.2 */ ICameraDeviceUser connectDevice(ICameraDeviceCallbacks callbacks, int cameraId, String cameraId, String opPackageName, int clientUid); Loading @@ -102,16 +103,24 @@ interface ICameraService int clientUid); /** * Add/remove listeners for changes to camera device and flashlight state * Add listener for changes to camera device and flashlight state. * * Also returns the set of currently-known camera IDs and state of each device. * Adding a listener will trigger the torch status listener to fire for all * devices that have a flash unit */ CameraStatus[] addListener(ICameraServiceListener listener); /** * Remove listener for changes to camera device and flashlight state. */ void addListener(ICameraServiceListener listener); void removeListener(ICameraServiceListener listener); /** * Read the static camera metadata for a camera device. * Only supported for device HAL versions >= 3.2 */ CameraMetadataNative getCameraCharacteristics(int cameraId); CameraMetadataNative getCameraCharacteristics(String cameraId); /** * Read in the vendor tag descriptors from the camera module HAL. Loading @@ -132,9 +141,9 @@ interface ICameraService const int API_VERSION_2 = 2; // Determines if a particular API version is supported directly boolean supportsCameraApi(int cameraId, int apiVersion); boolean supportsCameraApi(String cameraId, int apiVersion); void setTorchMode(String CameraId, boolean enabled, IBinder clientBinder); void setTorchMode(String cameraId, boolean enabled, IBinder clientBinder); /** * Notify the camera service of a system event. Should only be called from system_server. Loading Loading
camera/CameraBase.cpp +18 −20 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ namespace android { namespace hardware { status_t CameraInfo::writeToParcel(Parcel* parcel) const { status_t CameraInfo::writeToParcel(android::Parcel* parcel) const { status_t res; res = parcel->writeInt32(facing); if (res != OK) return res; Loading @@ -47,7 +47,7 @@ status_t CameraInfo::writeToParcel(Parcel* parcel) const { return res; } status_t CameraInfo::readFromParcel(const Parcel* parcel) { status_t CameraInfo::readFromParcel(const android::Parcel* parcel) { status_t res; res = parcel->readInt32(&facing); if (res != OK) return res; Loading @@ -55,8 +55,24 @@ status_t CameraInfo::readFromParcel(const Parcel* parcel) { return res; } status_t CameraStatus::writeToParcel(android::Parcel* parcel) const { status_t res; res = parcel->writeString8(cameraId); if (res != OK) return res; res = parcel->writeInt32(status); return res; } status_t CameraStatus::readFromParcel(const android::Parcel* parcel) { status_t res; res = parcel->readString8(&cameraId); if (res != OK) return res; res = parcel->readInt32(&status); return res; } } // namespace hardware namespace { sp<::android::hardware::ICameraService> gCameraService; const int kCameraServicePollDelay = 500000; // 0.5s Loading Loading @@ -239,24 +255,6 @@ status_t CameraBase<TCam, TCamTraits>::getCameraInfo(int cameraId, return res.isOk() ? OK : res.serviceSpecificErrorCode(); } template <typename TCam, typename TCamTraits> status_t CameraBase<TCam, TCamTraits>::addServiceListener( const sp<::android::hardware::ICameraServiceListener>& listener) { const sp<::android::hardware::ICameraService>& cs = getCameraService(); if (cs == 0) return UNKNOWN_ERROR; binder::Status res = cs->addListener(listener); return res.isOk() ? OK : res.serviceSpecificErrorCode(); } template <typename TCam, typename TCamTraits> status_t CameraBase<TCam, TCamTraits>::removeServiceListener( const sp<::android::hardware::ICameraServiceListener>& listener) { const sp<::android::hardware::ICameraService>& cs = getCameraService(); if (cs == 0) return UNKNOWN_ERROR; binder::Status res = cs->removeListener(listener); return res.isOk() ? OK : res.serviceSpecificErrorCode(); } template class CameraBase<Camera>; } // namespace android
camera/CaptureResult.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ bool CaptureResultExtras::isValid() { return requestId >= 0; } status_t CaptureResultExtras::readFromParcel(const Parcel *parcel) { status_t CaptureResultExtras::readFromParcel(const android::Parcel *parcel) { if (parcel == NULL) { ALOGE("%s: Null parcel", __FUNCTION__); return BAD_VALUE; Loading @@ -43,7 +43,7 @@ status_t CaptureResultExtras::readFromParcel(const Parcel *parcel) { return OK; } status_t CaptureResultExtras::writeToParcel(Parcel *parcel) const { status_t CaptureResultExtras::writeToParcel(android::Parcel *parcel) const { if (parcel == NULL) { ALOGE("%s: Null parcel", __FUNCTION__); return BAD_VALUE; Loading @@ -69,7 +69,7 @@ CaptureResult::CaptureResult(const CaptureResult &otherResult) { mMetadata = otherResult.mMetadata; } status_t CaptureResult::readFromParcel(Parcel *parcel) { status_t CaptureResult::readFromParcel(android::Parcel *parcel) { ALOGV("%s: parcel = %p", __FUNCTION__, parcel); Loading Loading @@ -100,7 +100,7 @@ status_t CaptureResult::readFromParcel(Parcel *parcel) { return OK; } status_t CaptureResult::writeToParcel(Parcel *parcel) const { status_t CaptureResult::writeToParcel(android::Parcel *parcel) const { ALOGV("%s: parcel = %p", __FUNCTION__, parcel); Loading
camera/VendorTagDescriptor.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ void VendorTagDescriptor::copyFrom(const VendorTagDescriptor& src) { mVendorOps = src.mVendorOps; } status_t VendorTagDescriptor::readFromParcel(const Parcel* parcel) { status_t VendorTagDescriptor::readFromParcel(const android::Parcel* parcel) { status_t res = OK; if (parcel == NULL) { ALOGE("%s: parcel argument was NULL.", __FUNCTION__); Loading Loading @@ -244,7 +244,7 @@ int VendorTagDescriptor::getTagType(uint32_t tag) const { return mTagToTypeMap.valueFor(tag); } status_t VendorTagDescriptor::writeToParcel(Parcel* parcel) const { status_t VendorTagDescriptor::writeToParcel(android::Parcel* parcel) const { status_t res = OK; if (parcel == NULL) { ALOGE("%s: parcel argument was NULL.", __FUNCTION__); Loading
camera/aidl/android/hardware/CameraStatus.aidl 0 → 100644 +20 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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. */ package android.hardware; /** @hide */ parcelable CameraStatus cpp_header "camera/CameraBase.h";
camera/aidl/android/hardware/ICameraService.aidl +15 −6 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.hardware.camera2.params.VendorTagDescriptor; import android.hardware.camera2.impl.CameraMetadataNative; import android.hardware.ICameraServiceListener; import android.hardware.CameraInfo; import android.hardware.CameraStatus; /** * Binder interface for the native camera service running in mediaserver. Loading Loading @@ -83,7 +84,7 @@ interface ICameraService * Only supported for device HAL versions >= 3.2 */ ICameraDeviceUser connectDevice(ICameraDeviceCallbacks callbacks, int cameraId, String cameraId, String opPackageName, int clientUid); Loading @@ -102,16 +103,24 @@ interface ICameraService int clientUid); /** * Add/remove listeners for changes to camera device and flashlight state * Add listener for changes to camera device and flashlight state. * * Also returns the set of currently-known camera IDs and state of each device. * Adding a listener will trigger the torch status listener to fire for all * devices that have a flash unit */ CameraStatus[] addListener(ICameraServiceListener listener); /** * Remove listener for changes to camera device and flashlight state. */ void addListener(ICameraServiceListener listener); void removeListener(ICameraServiceListener listener); /** * Read the static camera metadata for a camera device. * Only supported for device HAL versions >= 3.2 */ CameraMetadataNative getCameraCharacteristics(int cameraId); CameraMetadataNative getCameraCharacteristics(String cameraId); /** * Read in the vendor tag descriptors from the camera module HAL. Loading @@ -132,9 +141,9 @@ interface ICameraService const int API_VERSION_2 = 2; // Determines if a particular API version is supported directly boolean supportsCameraApi(int cameraId, int apiVersion); boolean supportsCameraApi(String cameraId, int apiVersion); void setTorchMode(String CameraId, boolean enabled, IBinder clientBinder); void setTorchMode(String cameraId, boolean enabled, IBinder clientBinder); /** * Notify the camera service of a system event. Should only be called from system_server. Loading