/* CameraCell — рисует кадр из cuframes-источника в свой Rect (Phase 11b). * * Cell держит non-owning указатель на cfc_source_t (живёт в SourcePool * композитора). На каждом draw_content(): * 1. cfc_source_get_latest — snapshot последнего кадра в VRAM * 2. если ACTIVE/STALE — cfc_cugrid_resize_nv12 в свою geom_ * 3. если DEAD/CONNECTING — пропуск (cell остаётся blacked out) * * Decorations (label, border) рисуются в Cell::draw() поверх content'а. * * Лицензия: LGPL-2.1+ */ #ifndef CUFRAMES_COMPOSER_CPP_CAMERA_CELL_HPP #define CUFRAMES_COMPOSER_CPP_CAMERA_CELL_HPP #include "../source.h" #include "cell.hpp" #include namespace cfc { class CameraCell : public Cell { public: CameraCell(const Rect& geom, cfc_source_t* source, std::string source_key = {}) : Cell(geom), source_(source), source_key_(std::move(source_key)) {} void set_source(cfc_source_t* src) noexcept { source_ = src; } cfc_source_t* source() const noexcept { return source_; } const std::string& source_key() const noexcept { return source_key_; } protected: void draw_content(CUstream stream, NV12Ref& dst) override; private: cfc_source_t* source_; /* non-owning — pool владеет */ std::string source_key_; }; } // namespace cfc #endif /* CUFRAMES_COMPOSER_CPP_CAMERA_CELL_HPP */