summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2022-06-01py: MappedFrameBuffer: Support non-contextmanager useTomi Valkeinen
2022-06-01py: Implement FrameBufferPlaneTomi Valkeinen
2022-06-01py: Add FrameMetadataPlaneTomi Valkeinen
2022-06-01py: Add Request.__str__()Tomi Valkeinen
2022-06-01py: cam: Drop PIL dependencyTomi Valkeinen
2022-06-01py: cam: Move conversion funcs to helpers.pyTomi Valkeinen
2022-06-01py: unittests: Fix test_select()Tomi Valkeinen
2022-06-01py: unittests: Fix test_sleep()Tomi Valkeinen
2022-06-01libcamera: base: log: Log to std::cerr if log file can't be openedLaurent Pinchart
2022-06-01libcamera: base: log: Replace stderr with std::cerr in documentationLaurent Pinchart
2022-06-01libcamera: base: log: Remove unnecessary local variableLaurent Pinchart
2022-06-01libcamera: Use "..." instead of <...> consistently for internal headersLaurent Pinchart
2022-06-01utils: checkstyle: Ensure "..." include style for internal headersLaurent Pinchart
2022-06-01utils: checkstyle: Run the CLangFormatter lastLaurent Pinchart
2022-06-01libcamera: Fix incorrect toString() to operator<<() conversionsLaurent Pinchart
2022-05-27py: Use ln --relative to create symlinksTomi Valkeinen
2022-05-27py: Generate bindings for propertiesTomi Valkeinen
2022-05-27py: Rename 'efd' to 'event_fd'Tomi Valkeinen
2022-05-27py: Re-structure the controls APITomi Valkeinen
2022-05-27py: Re-implement controls genenerationTomi Valkeinen
2022-05-27py: cam: Convert ctx and state to classesTomi Valkeinen
2022-05-27py: cam: Drop WA_ShowWithoutActivatingTomi Valkeinen
2022-05-27py: MappedFrameBuffer: Add type hints & docsTomi Valkeinen
2022-05-27py: Move MappedFrameBuffer to libcamera.utilsTomi Valkeinen
2022-05-27py: Add CameraManager.read_event()Tomi Valkeinen
2022-05-27py: Fix None value in ControlType enumTomi Valkeinen
2022-05-27py: Fix SceneFlicker enum valuesTomi Valkeinen
2022-05-27py: cam: CleanupsTomi Valkeinen
2022-05-27py: cam_qt: Use libcamera.formatsTomi Valkeinen
2022-05-27py: Generate pixel formats listTomi Valkeinen
2022-05-27libcamera: ipa: Move IPA control serialization structures to libcamera namespaceLaurent Pinchart
2022-05-27libcamera: pipeline: uvcvideo: Infer camera location from removable attributeLaurent Pinchart
2022-05-27libcamera: media_device: Return string references to avoid copiesLaurent Pinchart
2022-05-27libipa: camera_sensor_helper: Add Sony IMX477 helperNaushir Patuck
2022-05-27libcamera: camera_sensor: Add IMX477 sensor propertiesNaushir Patuck
2022-05-26ipa: camera_sensor_helper: Fix equation in exponential gain documentationLaurent Pinchart
2022-05-25libcamera: controls: Controls for driving AF (autofocus) algorithmsDavid Plowman
2022-05-23cam: sdl_sink: Add MJPG support to SDL sinkEric Curtin
2022-05-23cam: sdl_sink: Add SDL sink with initial YUYV supportEric Curtin
2022-05-23cam: event_loop: Add timer events to event loopEric Curtin
2022-05-23cam: event_loop: Rename addEvent to addFdEventEric Curtin
2022-05-23pipeline: raspberrypi: Fix possible null dereferenceNaushir Patuck
2022-05-22cam: Use script parser to set controlsJacopo Mondi
2022-05-22cam: Queue requests through CameraSession::queueRequest()Jacopo Mondi
2022-05-22cam: Add a parser for capture scriptsJacopo Mondi
2022-05-20android: Drop gcc 7 compatibilityLaurent Pinchart
2022-05-19libcamera: formats: Add missing RGBX8888 infoTomi Valkeinen
2022-05-19libcamera: formats: Fix warning printTomi Valkeinen
2022-05-18py: Clean up control enums generationTomi Valkeinen
2022-05-18py: Rename pyxyz to py_xyzTomi Valkeinen
an class="hl opt">, size_t> CameraMetadata::usage() const { size_t currentEntryCount = get_camera_metadata_entry_count(metadata_); size_t currentDataCount = get_camera_metadata_data_count(metadata_); return { currentEntryCount, currentDataCount }; } bool CameraMetadata::getEntry(uint32_t tag, camera_metadata_ro_entry_t *entry) const { if (find_camera_metadata_ro_entry(metadata_, tag, entry)) return false; return true; } /* * \brief Resize the metadata container, if necessary * \param[in] count Number of entries to add to the container * \param[in] size Total size of entries to add, in bytes * \return True if resize was successful or unnecessary, false otherwise */ bool CameraMetadata::resize(size_t count, size_t size) { if (!valid_) return false; if (!count && !size) return true; size_t currentEntryCount = get_camera_metadata_entry_count(metadata_); size_t currentEntryCapacity = get_camera_metadata_entry_capacity(metadata_); size_t newEntryCapacity = currentEntryCapacity < currentEntryCount + count ? currentEntryCapacity * 2 : currentEntryCapacity; size_t currentDataCount = get_camera_metadata_data_count(metadata_); size_t currentDataCapacity = get_camera_metadata_data_capacity(metadata_); size_t newDataCapacity = currentDataCapacity < currentDataCount + size ? currentDataCapacity * 2 : currentDataCapacity; if (newEntryCapacity > currentEntryCapacity || newDataCapacity > currentDataCapacity) { camera_metadata_t *oldMetadata = metadata_; metadata_ = allocate_camera_metadata(newEntryCapacity, newDataCapacity); if (!metadata_) { metadata_ = oldMetadata; return false; } LOG(CameraMetadata, Info) << "Resized: old entry capacity " << currentEntryCapacity << ", old data capacity " << currentDataCapacity << ", new entry capacity " << newEntryCapacity << ", new data capacity " << newDataCapacity; append_camera_metadata(metadata_, oldMetadata); free_camera_metadata(oldMetadata); resized_ = true; } return true; } template<> bool CameraMetadata::entryContains(uint32_t tag, uint8_t value) const { camera_metadata_ro_entry_t entry; if (!getEntry(tag, &entry)) return false; for (unsigned int i = 0; i < entry.count; i++) { if (entry.data.u8[i] == value) return true; } return false; } bool CameraMetadata::hasEntry(uint32_t tag) const { camera_metadata_ro_entry_t entry; return getEntry(tag, &entry); } bool CameraMetadata::addEntry(uint32_t tag, const void *data, size_t count, size_t elementSize) { if (!valid_) return false; if (!resize(1, count * elementSize)) { LOG(CameraMetadata, Error) << "Failed to resize"; valid_ = false; return false; } if (!add_camera_metadata_entry(metadata_, tag, data, count)) return true; const char *name = get_camera_metadata_tag_name(tag); if (name) LOG(CameraMetadata, Error) << "Failed to add tag " << name; else LOG(CameraMetadata, Error) << "Failed to add unknown tag " << tag; valid_ = false; return false; } bool CameraMetadata::updateEntry(uint32_t tag, const void *data, size_t count, size_t elementSize) { if (!valid_) return false; camera_metadata_entry_t entry; int ret = find_camera_metadata_entry(metadata_, tag, &entry); if (ret) { const char *name = get_camera_metadata_tag_name(tag); LOG(CameraMetadata, Error) << "Failed to update tag " << (name ? name : "<unknown>") << ": not present"; return false; } if (camera_metadata_type_size[entry.type] != elementSize) { const char *name = get_camera_metadata_tag_name(tag); LOG(CameraMetadata, Fatal) << "Invalid element size for tag " << (name ? name : "<unknown>"); return false; } size_t oldSize = calculate_camera_metadata_entry_data_size(entry.type, entry.count); size_t newSize = calculate_camera_metadata_entry_data_size(entry.type, count); size_t sizeIncrement = newSize - oldSize > 0 ? newSize - oldSize : 0; if (!resize(0, sizeIncrement)) { LOG(CameraMetadata, Error) << "Failed to resize"; valid_ = false; return false; } ret = update_camera_metadata_entry(metadata_, entry.index, data, count, nullptr); if (!ret) return true; const char *name = get_camera_metadata_tag_name(tag); LOG(CameraMetadata, Error) << "Failed to update tag " << (name ? name : "<unknown>"); valid_ = false; return false; } camera_metadata_t *CameraMetadata::get() { return valid_ ? metadata_ : nullptr; } const camera_metadata_t *CameraMetadata::get() const { return valid_ ? metadata_ : nullptr; }