2d7fc1e640
10 predefined layouts (single, dual_horizontal, dual_vertical, quad, main_plus_preview, six_grid, nine_grid, sixteen_grid, panoramic, main_with_strip) — normalized [0..1] координаты, port из vf_cuda_grid.c старого FFmpeg patch'а. Применяются к фактическому output разрешению композитора через cfc_composer_set_layout(name). Source pool НЕ пересоздаётся: sources привязаны к индексам cells, layout меняет только геометрию (cell.x/y/w/h). Это даёт zero-disruption switch без потери накопленного state и без re-subscribe к cuframes publishers. ZMQ verbs: set_layout / list_layouts / get_layout. CLI: --layout=NAME перетирает --cell координаты на старте. Используется ONVIF wrapper'ом (gx/cctv-onvif:0.1) для PTZ presets: GotoPreset(token) → ZMQ set_layout(token). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
/* cuframes-composer — predefined layout templates.
|
|
*
|
|
* Phase 9 (task #194): runtime layout switching через ZMQ verb + ONVIF PTZ.
|
|
*
|
|
* Layouts описаны normalized (0..1) — масштабируются к фактическому output
|
|
* width/height композитора при apply_to_cells(). Список синхронизирован с
|
|
* historic'ой `vf_cuda_grid.c` layouts[] (старый FFmpeg patch), что
|
|
* обеспечивает совместимость с Python controller'ом и предыдущими ONVIF
|
|
* presets.
|
|
*
|
|
* Лицензия: LGPL-2.1+
|
|
*/
|
|
|
|
#ifndef CUFRAMES_COMPOSER_LAYOUTS_H
|
|
#define CUFRAMES_COMPOSER_LAYOUTS_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define CFC_LAYOUT_MAX_CELLS 16
|
|
#define CFC_LAYOUT_MAX_NAME 32
|
|
|
|
typedef struct cfc_layout_cell {
|
|
float x, y, w, h; /* normalized fraction of output dims */
|
|
} cfc_layout_cell_t;
|
|
|
|
typedef struct cfc_layout {
|
|
const char *name;
|
|
int nb_cells;
|
|
cfc_layout_cell_t cells[CFC_LAYOUT_MAX_CELLS];
|
|
} cfc_layout_t;
|
|
|
|
/* Найти layout по имени; NULL если нет. */
|
|
const cfc_layout_t *cfc_layout_find(const char *name);
|
|
|
|
/* Возвращает указатель на array всех layout'ов + их количество. */
|
|
const cfc_layout_t *cfc_layout_all(int *out_count);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CUFRAMES_COMPOSER_LAYOUTS_H */
|