diff options
Diffstat (limited to 'camera/common/1.0/default/include')
| -rw-r--r-- | camera/common/1.0/default/include/CameraModule.h | 12 | ||||
| -rw-r--r-- | camera/common/1.0/default/include/HandleImporter.h | 13 | ||||
| -rw-r--r-- | camera/common/1.0/default/include/VendorTagDescriptor.h | 75 |
3 files changed, 98 insertions, 2 deletions
diff --git a/camera/common/1.0/default/include/CameraModule.h b/camera/common/1.0/default/include/CameraModule.h index deebd09480..c89e934655 100644 --- a/camera/common/1.0/default/include/CameraModule.h +++ b/camera/common/1.0/default/include/CameraModule.h @@ -17,6 +17,9 @@ #ifndef CAMERA_COMMON_1_0_CAMERAMODULE_H #define CAMERA_COMMON_1_0_CAMERAMODULE_H +#include <string> +#include <unordered_set> + #include <hardware/camera.h> #include <utils/Mutex.h> #include <utils/KeyedVector.h> @@ -65,6 +68,13 @@ public: void *getDso(); // Only used by CameraProvider void removeCamera(int cameraId); + int getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t **physicalInfo); + int isStreamCombinationSupported(int cameraId, camera_stream_combination_t *streams); + void notifyDeviceStateChange(uint64_t deviceState); + + static bool isLogicalMultiCamera( + const common::V1_0::helper::CameraMetadata& metadata, + std::unordered_set<std::string>* physicalCameraIds); private: // Derive camera characteristics keys defined after HAL device version @@ -74,8 +84,10 @@ private: int32_t keyTag, const Vector<int32_t>& appendKeys); status_t filterOpenErrorCode(status_t err); camera_module_t *mModule; + int mNumberOfCameras; KeyedVector<int, camera_info> mCameraInfoMap; KeyedVector<int, int> mDeviceVersionMap; + KeyedVector<int, camera_metadata_t*> mPhysicalCameraInfoMap; Mutex mCameraInfoLock; }; diff --git a/camera/common/1.0/default/include/HandleImporter.h b/camera/common/1.0/default/include/HandleImporter.h index f9cd9fb604..a93d4554ad 100644 --- a/camera/common/1.0/default/include/HandleImporter.h +++ b/camera/common/1.0/default/include/HandleImporter.h @@ -19,6 +19,7 @@ #include <utils/Mutex.h> #include <android/hardware/graphics/mapper/2.0/IMapper.h> +#include <android/hardware/graphics/mapper/3.0/IMapper.h> #include <cutils/native_handle.h> using android::hardware::graphics::mapper::V2_0::IMapper; @@ -57,10 +58,18 @@ private: void initializeLocked(); void cleanup(); + template<class M, class E> + bool importBufferInternal(const sp<M> mapper, buffer_handle_t& handle); + template<class M, class E> + YCbCrLayout lockYCbCrInternal(const sp<M> mapper, buffer_handle_t& buf, uint64_t cpuUsage, + const IMapper::Rect& accessRegion); + template<class M, class E> + int unlockInternal(const sp<M> mapper, buffer_handle_t& buf); + Mutex mLock; bool mInitialized; - sp<IMapper> mMapper; - + sp<IMapper> mMapperV2; + sp<graphics::mapper::V3_0::IMapper> mMapperV3; }; } // namespace helper diff --git a/camera/common/1.0/default/include/VendorTagDescriptor.h b/camera/common/1.0/default/include/VendorTagDescriptor.h index a040540edb..0f54db52d1 100644 --- a/camera/common/1.0/default/include/VendorTagDescriptor.h +++ b/camera/common/1.0/default/include/VendorTagDescriptor.h @@ -157,6 +157,81 @@ class VendorTagDescriptor : }; +} /* namespace helper */ +} /* namespace V1_0 */ +} /* namespace common */ +} /* namespace camera */ + +namespace camera2 { +namespace params { + +class VendorTagDescriptorCache { + public: + typedef android::hardware::camera::common::V1_0::helper::VendorTagDescriptor + VendorTagDescriptor; + VendorTagDescriptorCache(){}; + int32_t addVendorDescriptor(metadata_vendor_id_t id, sp<VendorTagDescriptor> desc); + + int32_t getVendorTagDescriptor(metadata_vendor_id_t id, sp<VendorTagDescriptor>* desc /*out*/); + + // Returns the number of vendor tags defined. + int getTagCount(metadata_vendor_id_t id) const; + + // Returns an array containing the id's of vendor tags defined. + void getTagArray(uint32_t* tagArray, metadata_vendor_id_t id) const; + + // Returns the section name string for a given vendor tag id. + const char* getSectionName(uint32_t tag, metadata_vendor_id_t id) const; + + // Returns the tag name string for a given vendor tag id. + const char* getTagName(uint32_t tag, metadata_vendor_id_t id) const; + + // Returns the tag type for a given vendor tag id. + int getTagType(uint32_t tag, metadata_vendor_id_t id) const; + + /** + * Dump the currently configured vendor tags to a file descriptor. + */ + void dump(int fd, int verbosity, int indentation) const; + + protected: + std::unordered_map<metadata_vendor_id_t, sp<VendorTagDescriptor>> mVendorMap; + struct vendor_tag_cache_ops mVendorCacheOps; +}; + +} /* namespace params */ +} /* namespace camera2 */ + +namespace camera { +namespace common { +namespace V1_0 { +namespace helper { + +class VendorTagDescriptorCache + : public ::android::hardware::camera2::params::VendorTagDescriptorCache, + public LightRefBase<VendorTagDescriptorCache> { + public: + /** + * Sets the global vendor tag descriptor cache to use for this process. + * Camera metadata operations that access vendor tags will use the + * vendor tag definitions set this way. + * + * Returns OK on success, or a negative error code. + */ + static status_t setAsGlobalVendorTagCache(const sp<VendorTagDescriptorCache>& cache); + + /** + * Returns the global vendor tag cache used by this process. + * This will contain NULL if no vendor tags are defined. + */ + static sp<VendorTagDescriptorCache> getGlobalVendorTagCache(); + + /** + * Clears the global vendor tag cache used by this process. + */ + static void clearGlobalVendorTagCache(); +}; + } // namespace helper } // namespace V1_0 } // namespace common |
