Loading PREUPLOAD.cfg +3 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,8 @@ clang_format = true [Builtin Hooks Options] # Only turn on clang-format check for the following subfolders. clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp media/libmediatranscoding/ services/mediatranscoding/ media/libaudioclient/tests/ media/libaudiohal/tests/ media/libmediatranscoding/ services/camera/virtualcamera/ services/mediatranscoding/ camera/Android.bp +18 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,23 @@ license { ], } aconfig_declarations { name: "camera_platform_flags", package: "com.android.internal.camera.flags", srcs: ["camera_platform.aconfig"], } cc_aconfig_library { name: "camera_platform_flags_c_lib", aconfig_declarations: "camera_platform_flags", host_supported: true, } java_aconfig_library { name: "camera_platform_flags_java_lib", aconfig_declarations: "camera_platform_flags", } cc_library_headers { name: "camera_headers", export_include_dirs: ["include"], Loading Loading @@ -85,6 +102,7 @@ cc_library { ], shared_libs: [ "camera_platform_flags_c_lib", "libbase", "libcutils", "libutils", Loading camera/CameraBase.cpp +4 −9 Original line number Diff line number Diff line Loading @@ -104,7 +104,6 @@ status_t CameraStatus::readFromParcel(const android::Parcel* parcel) { namespace { sp<::android::hardware::ICameraService> gCameraService; const int kCameraServicePollDelay = 500000; // 0.5s const char* kCameraServiceName = "media.camera"; Mutex gLock; Loading Loading @@ -142,14 +141,10 @@ const sp<::android::hardware::ICameraService> CameraBase<TCam, TCamTraits>::getC sp<IServiceManager> sm = defaultServiceManager(); sp<IBinder> binder; do { binder = sm->getService(toString16(kCameraServiceName)); if (binder != 0) { break; binder = sm->waitForService(toString16(kCameraServiceName)); if (binder == nullptr) { return nullptr; } ALOGW("CameraService not published, waiting..."); usleep(kCameraServicePollDelay); } while(true); if (gDeathNotifier == NULL) { gDeathNotifier = new DeathNotifier(); } Loading camera/CameraSessionStats.cpp +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ // #define LOG_NDEBUG 0 #define LOG_TAG "CameraSessionStats" #include <utils/Log.h> #include <utils/String16.h> Loading Loading @@ -414,6 +415,18 @@ status_t CameraSessionStats::readFromParcel(const android::Parcel* parcel) { return err; } bool usedUltraWide = false; if ((err = parcel->readBool(&usedUltraWide)) != OK) { ALOGE("%s: Failed to read ultrawide usage from parcel", __FUNCTION__); return err; } bool usedZoomOverride = false; if ((err = parcel->readBool(&usedZoomOverride)) != OK) { ALOGE("%s: Failed to read zoom override usage from parcel", __FUNCTION__); return err; } int32_t sessionIdx; if ((err = parcel->readInt32(&sessionIdx)) != OK) { ALOGE("%s: Failed to read session index from parcel", __FUNCTION__); Loading Loading @@ -443,6 +456,8 @@ status_t CameraSessionStats::readFromParcel(const android::Parcel* parcel) { mStreamStats = std::move(streamStats); mUserTag = toStdString(userTag); mVideoStabilizationMode = videoStabilizationMode; mUsedUltraWide = usedUltraWide; mUsedZoomOverride = usedZoomOverride; mSessionIndex = sessionIdx; mCameraExtensionSessionStats = extStats; Loading Loading @@ -542,6 +557,16 @@ status_t CameraSessionStats::writeToParcel(android::Parcel* parcel) const { return err; } if ((err = parcel->writeBool(mUsedUltraWide)) != OK) { ALOGE("%s: Failed to write ultrawide usage!", __FUNCTION__); return err; } if ((err = parcel->writeBool(mUsedZoomOverride)) != OK) { ALOGE("%s: Failed to write zoom override usage!", __FUNCTION__); return err; } if ((err = parcel->writeInt32(mSessionIndex)) != OK) { ALOGE("%s: Failed to write session index!", __FUNCTION__); return err; Loading camera/aidl/android/hardware/ICameraService.aidl +27 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.hardware.camera2.ICameraDeviceUser; import android.hardware.camera2.ICameraDeviceCallbacks; import android.hardware.camera2.ICameraInjectionCallback; import android.hardware.camera2.ICameraInjectionSession; import android.hardware.camera2.params.SessionConfiguration; import android.hardware.camera2.params.VendorTagDescriptor; import android.hardware.camera2.params.VendorTagDescriptorCache; import android.hardware.camera2.utils.ConcurrentCameraIdCombination; Loading Loading @@ -147,6 +148,18 @@ interface ICameraService */ void remapCameraIds(in CameraIdRemapping cameraIdRemapping); /** * Inject Session Params into an existing camera session. * * @param cameraId the camera id session to inject session params into. Note that * if there is no active session for the input cameraid, this operation * will be a no-op. In addition, future camera sessions for cameraid will * not be affected. * @param sessionParams the session params to override for the existing session. */ void injectSessionParams(@utf8InCpp String cameraId, in CameraMetadataNative sessionParams); /** * Remove listener for changes to camera device and flashlight state. */ Loading Loading @@ -261,4 +274,18 @@ interface ICameraService const int DEVICE_STATE_FOLDED = 4; const int DEVICE_STATE_LAST_FRAMEWORK_BIT = 0x80000000; // 1 << 31; // Create a CaptureRequest metadata based on template id CameraMetadataNative createDefaultRequest(@utf8InCpp String cameraId, int templateId); /** * Check whether a particular session configuration with optional session parameters * has camera device support. * * @param cameraId The camera id to query session configuration on * @param sessionConfiguration Specific session configuration to be verified. * @return true - in case the stream combination is supported. * false - in case there is no device support. */ boolean isSessionConfigurationWithParametersSupported(@utf8InCpp String cameraId, in SessionConfiguration sessionConfiguration); } Loading
PREUPLOAD.cfg +3 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,8 @@ clang_format = true [Builtin Hooks Options] # Only turn on clang-format check for the following subfolders. clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp media/libmediatranscoding/ services/mediatranscoding/ media/libaudioclient/tests/ media/libaudiohal/tests/ media/libmediatranscoding/ services/camera/virtualcamera/ services/mediatranscoding/
camera/Android.bp +18 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,23 @@ license { ], } aconfig_declarations { name: "camera_platform_flags", package: "com.android.internal.camera.flags", srcs: ["camera_platform.aconfig"], } cc_aconfig_library { name: "camera_platform_flags_c_lib", aconfig_declarations: "camera_platform_flags", host_supported: true, } java_aconfig_library { name: "camera_platform_flags_java_lib", aconfig_declarations: "camera_platform_flags", } cc_library_headers { name: "camera_headers", export_include_dirs: ["include"], Loading Loading @@ -85,6 +102,7 @@ cc_library { ], shared_libs: [ "camera_platform_flags_c_lib", "libbase", "libcutils", "libutils", Loading
camera/CameraBase.cpp +4 −9 Original line number Diff line number Diff line Loading @@ -104,7 +104,6 @@ status_t CameraStatus::readFromParcel(const android::Parcel* parcel) { namespace { sp<::android::hardware::ICameraService> gCameraService; const int kCameraServicePollDelay = 500000; // 0.5s const char* kCameraServiceName = "media.camera"; Mutex gLock; Loading Loading @@ -142,14 +141,10 @@ const sp<::android::hardware::ICameraService> CameraBase<TCam, TCamTraits>::getC sp<IServiceManager> sm = defaultServiceManager(); sp<IBinder> binder; do { binder = sm->getService(toString16(kCameraServiceName)); if (binder != 0) { break; binder = sm->waitForService(toString16(kCameraServiceName)); if (binder == nullptr) { return nullptr; } ALOGW("CameraService not published, waiting..."); usleep(kCameraServicePollDelay); } while(true); if (gDeathNotifier == NULL) { gDeathNotifier = new DeathNotifier(); } Loading
camera/CameraSessionStats.cpp +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ // #define LOG_NDEBUG 0 #define LOG_TAG "CameraSessionStats" #include <utils/Log.h> #include <utils/String16.h> Loading Loading @@ -414,6 +415,18 @@ status_t CameraSessionStats::readFromParcel(const android::Parcel* parcel) { return err; } bool usedUltraWide = false; if ((err = parcel->readBool(&usedUltraWide)) != OK) { ALOGE("%s: Failed to read ultrawide usage from parcel", __FUNCTION__); return err; } bool usedZoomOverride = false; if ((err = parcel->readBool(&usedZoomOverride)) != OK) { ALOGE("%s: Failed to read zoom override usage from parcel", __FUNCTION__); return err; } int32_t sessionIdx; if ((err = parcel->readInt32(&sessionIdx)) != OK) { ALOGE("%s: Failed to read session index from parcel", __FUNCTION__); Loading Loading @@ -443,6 +456,8 @@ status_t CameraSessionStats::readFromParcel(const android::Parcel* parcel) { mStreamStats = std::move(streamStats); mUserTag = toStdString(userTag); mVideoStabilizationMode = videoStabilizationMode; mUsedUltraWide = usedUltraWide; mUsedZoomOverride = usedZoomOverride; mSessionIndex = sessionIdx; mCameraExtensionSessionStats = extStats; Loading Loading @@ -542,6 +557,16 @@ status_t CameraSessionStats::writeToParcel(android::Parcel* parcel) const { return err; } if ((err = parcel->writeBool(mUsedUltraWide)) != OK) { ALOGE("%s: Failed to write ultrawide usage!", __FUNCTION__); return err; } if ((err = parcel->writeBool(mUsedZoomOverride)) != OK) { ALOGE("%s: Failed to write zoom override usage!", __FUNCTION__); return err; } if ((err = parcel->writeInt32(mSessionIndex)) != OK) { ALOGE("%s: Failed to write session index!", __FUNCTION__); return err; Loading
camera/aidl/android/hardware/ICameraService.aidl +27 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.hardware.camera2.ICameraDeviceUser; import android.hardware.camera2.ICameraDeviceCallbacks; import android.hardware.camera2.ICameraInjectionCallback; import android.hardware.camera2.ICameraInjectionSession; import android.hardware.camera2.params.SessionConfiguration; import android.hardware.camera2.params.VendorTagDescriptor; import android.hardware.camera2.params.VendorTagDescriptorCache; import android.hardware.camera2.utils.ConcurrentCameraIdCombination; Loading Loading @@ -147,6 +148,18 @@ interface ICameraService */ void remapCameraIds(in CameraIdRemapping cameraIdRemapping); /** * Inject Session Params into an existing camera session. * * @param cameraId the camera id session to inject session params into. Note that * if there is no active session for the input cameraid, this operation * will be a no-op. In addition, future camera sessions for cameraid will * not be affected. * @param sessionParams the session params to override for the existing session. */ void injectSessionParams(@utf8InCpp String cameraId, in CameraMetadataNative sessionParams); /** * Remove listener for changes to camera device and flashlight state. */ Loading Loading @@ -261,4 +274,18 @@ interface ICameraService const int DEVICE_STATE_FOLDED = 4; const int DEVICE_STATE_LAST_FRAMEWORK_BIT = 0x80000000; // 1 << 31; // Create a CaptureRequest metadata based on template id CameraMetadataNative createDefaultRequest(@utf8InCpp String cameraId, int templateId); /** * Check whether a particular session configuration with optional session parameters * has camera device support. * * @param cameraId The camera id to query session configuration on * @param sessionConfiguration Specific session configuration to be verified. * @return true - in case the stream combination is supported. * false - in case there is no device support. */ boolean isSessionConfigurationWithParametersSupported(@utf8InCpp String cameraId, in SessionConfiguration sessionConfiguration); }