![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include "config.h"#include <stdlib.h>#include <string.h>#include <iostream>#include <chrono>#include <cassert>#include <algorithm>#include <vector>#include <mutex>#include <unistd.h>#include <pipewire/pipewire.h>#include <pipewire/version.h>#include <spa/utils/result.h>#include <spa/param/video/format-utils.h>#include <spa/param/props.h>#include <spa/debug/types.h>#include "debug.h"#include "lib_common.h"#include "utils/color_out.h"#include "utils/dbus_portal.hpp"#include "utils/synchronized_queue.h"#include "utils/profile_timer.hpp"#include "video_frame.h"#include "video_codec.h"#include "video_capture.h"#include "pipewire_common.hpp"#include "pixfmt_conv.h"
Go to the source code of this file.
Classes | |
| struct | frame_deleter |
| struct | vcap_pw_state |
Macros | |
| #define | MOD_NAME "[PW vcap] " |
Typedefs | |
| using | unique_frame = std::unique_ptr<video_frame, frame_deleter> |
Functions | |
| static void | on_add_buffer (void *, struct pw_buffer *) |
| static void | on_drained (void *) |
| static void | on_process (void *state) |
| static void | on_remove_buffer (void *, struct pw_buffer *) |
| static void | on_stream_param_changed (void *state, uint32_t id, const struct spa_pod *param) |
| static void | on_stream_state_changed (void *, enum pw_stream_state old, enum pw_stream_state state, const char *error) |
| static int | parse_params (struct vidcap_params *params, vcap_pw_state *s) |
| static void | pw_frame_to_uv_frame_memcpy (video_frame *dst, spa_buffer *src, spa_video_format fmt, spa_rectangle size, const spa_region *crop) |
| REGISTER_MODULE (pipewire, &vidcap_pw_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION) | |
| static void | show_generic_help () |
| static void | show_screen_help () |
| static int | start_pipewire (vcap_pw_state *s) |
| static int | vidcap_pw_init (struct vidcap_params *params, void **state) |
| static void | vidcap_pw_probe (struct device_info **available_devices, int *count, void(**deleter)(void *)) |
| static void | vidcap_screen_pw_done (void *state) |
| static struct video_frame * | vidcap_screen_pw_grab (void *state, struct audio_frame **audio) |
| static void | vidcap_screen_pw_probe (struct device_info **available_devices, int *count, void(**deleter)(void *)) |
Variables | |
| static constexpr int | DEFAULT_BUFFERS_PW = 2 |
| static constexpr int | DEFAULT_EXPECTING_FPS = 30 |
| static constexpr int | MAX_BUFFERS_PW = 10 |
| static constexpr int | MIN_BUFFERS_PW = 2 |
| static constexpr int | QUEUE_SIZE = 3 |
| static const struct pw_stream_events | stream_events |
| static const struct video_capture_info | vidcap_pw_info |
Definition in file pipewire.cpp.
| #define MOD_NAME "[PW vcap] " |
Definition at line 69 of file pipewire.cpp.
| using unique_frame = std::unique_ptr<video_frame, frame_deleter> |
Definition at line 78 of file pipewire.cpp.
|
static |
Definition at line 317 of file pipewire.cpp.
References LOG, LOG_LEVEL_VERBOSE, and MOD_NAME.
|
static |
Definition at line 312 of file pipewire.cpp.
References LOG, LOG_LEVEL_VERBOSE, and MOD_NAME.
|
static |
Definition at line 243 of file pipewire.cpp.
References LOG, LOG_LEVEL_DEBUG, LOG_LEVEL_VERBOSE, log_msg(), MOD_NAME, PROFILE_FUNC, pw_frame_to_uv_frame_memcpy(), state, vf_alloc_desc_data(), video_desc_eq(), and video_desc_from_frame().

|
static |
Definition at line 322 of file pipewire.cpp.
References LOG, LOG_LEVEL_VERBOSE, and MOD_NAME.
|
static |
Definition at line 127 of file pipewire.cpp.
References DEFAULT_BUFFERS_PW, LOG, LOG_LEVEL_ERROR, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE, LOG_LEVEL_WARNING, log_msg(), MAX_BUFFERS_PW, MIN_BUFFERS_PW, MOD_NAME, param, PROGRESSIVE, state, uv_codec_from_pw_fmt(), and vc_get_linesize().

|
static |
Definition at line 117 of file pipewire.cpp.
References LOG, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, MOD_NAME, and state.
|
static |
Definition at line 487 of file pipewire.cpp.
References vcap_pw_state::crop, fmt, vcap_pw_state::fps, LOG, LOG_LEVEL_ERROR, MOD_NAME, vcap_pw_state::mode, name, param, vcap_pw_state::restore_file, vcap_pw_state::Screen_capture, vcap_pw_state::show_cursor, show_generic_help(), show_screen_help(), vcap_pw_state::target, vcap_pw_state::user_options, VIDCAP_INIT_FAIL, VIDCAP_INIT_NOERR, VIDCAP_INIT_OK, and vidcap_params_get_fmt().
Referenced by vidcap_pw_init().

|
static |
Definition at line 202 of file pipewire.cpp.
References video_frame::color_spec, tile::data, tile::data_len, fmt, tile::height, offset, video_frame::tiles, vc_copylineRGBA, vc_get_linesize(), and tile::width.
Referenced by on_process().

| REGISTER_MODULE | ( | pipewire | , |
| & | vidcap_pw_info, | ||
| LIBRARY_CLASS_VIDEO_CAPTURE | , | ||
| VIDEO_CAPTURE_ABI_VERSION | ) |
|
static |
Definition at line 476 of file pipewire.cpp.
References color_printf(), print_devices(), TERM_BOLD, TERM_FG_RED, TERM_FG_RESET, and TERM_RESET.
Referenced by parse_params().

|
static |
Definition at line 462 of file pipewire.cpp.
References name, param, and SBOLD.
Referenced by parse_params().
|
static |
Definition at line 344 of file pipewire.cpp.
References DEFAULT_EXPECTING_FPS, vcap_pw_state::fd, flags, vcap_pw_state::fps, spa_hook_uniq::get(), initialize_pw_common(), MOD_NAME, vcap_pw_state::mode, vcap_pw_state::node, pipewire_state_common::pipewire_core, pipewire_state_common::pipewire_loop, vcap_pw_state::pw, vcap_pw_state::Screen_capture, vcap_pw_state::stream, stream_events, vcap_pw_state::stream_listener, STREAM_TARGET_PROPERTY_KEY, vcap_pw_state::target, and vcap_pw_state::user_options.
Referenced by vidcap_pw_init().

|
static |
Definition at line 573 of file pipewire.cpp.
References LOG, LOG_LEVEL_DEBUG, MOD_NAME, parse_params(), QUEUE_SIZE, start_pipewire(), state, vf_alloc(), VIDCAP_FLAG_AUDIO_ANY, VIDCAP_INIT_AUDIO_NOT_SUPPORTED, VIDCAP_INIT_OK, and vidcap_params_get_flags().

|
static |
Definition at line 453 of file pipewire.cpp.
|
static |
Definition at line 600 of file pipewire.cpp.
References LOG, LOG_LEVEL_DEBUG, MOD_NAME, and state.
|
static |
Definition at line 614 of file pipewire.cpp.
References audio, PROFILE_FUNC, and state.
|
static |
|
staticconstexpr |
Definition at line 71 of file pipewire.cpp.
Referenced by on_stream_param_changed().
|
staticconstexpr |
Definition at line 75 of file pipewire.cpp.
Referenced by start_pipewire().
|
staticconstexpr |
Definition at line 73 of file pipewire.cpp.
Referenced by on_stream_param_changed().
|
staticconstexpr |
Definition at line 72 of file pipewire.cpp.
Referenced by on_stream_param_changed().
|
staticconstexpr |
Definition at line 74 of file pipewire.cpp.
Referenced by vidcap_pw_init().
|
static |
Definition at line 327 of file pipewire.cpp.
|
static |
Definition at line 645 of file pipewire.cpp.