Right now we just assume that every compositor and portal implementation exposes both window and monitor captures, but that's not true, and in fact the Desktop portal provides a simple mechanism to check which source types are available: a D-Bus property called "AvailableSourceTypes". Read this D-Bus property, and use it to conditionally register the desktop and the window captures. Related: https://github.com/obsproject/obs-studio/issues/4815
26 lines
881 B
C
26 lines
881 B
C
/* portal.c
|
|
*
|
|
* Copyright 2021 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
uint32_t portal_get_available_capture_types(void);
|