Screencast: libportal Reference Manual

## Screencast Screencast — create screencast sessions |

## Functions

void | xdp_portal_create_screencast_session ()
XdpSession * | xdp_portal_create_screencast_session_finish ()

## Types and Values

enum | XdpOutputType
#define | XDP_OUTPUT_NONE
#define | XDP_OUTPUT_ALL

## Description

A screencast session makes the content of a monitor or window available as a pipewire stream.

The underlying portal is org.freedesktop.portal.ScreenCast.

## Functions

### xdp_portal_create_screencast_session ()

    void
    xdp_portal_create_screencast_session (XdpPortal *portal,
                                          XdpOutputType outputs,
                                          gboolean multiple,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer data);

Creates a session for a screencast.

When the request is done, `callback` will be called. You can then call `xdp_portal_create_screencast_session_finish()` to get the results.

#### Parameters

portal | a XdpPortal |
outputs | which kinds of source to offer in the dialog |
multiple | whether to allow selecting multiple sources |
cancellable | optional GCancellable. | [nullable]
callback | a callback to call when the request is done. | [scope async]
data | data to pass to `callback` . | [closure]

### xdp_portal_create_screencast_session_finish ()

    XdpSession *
    xdp_portal_create_screencast_session_finish
                                   (XdpPortal *portal,
                                    GAsyncResult *result,
                                    GError **error);

Finishes the create-screencast request, and returns an XdpSession.

#### Parameters

portal | a XdpPortal |
result | a GAsyncResult |
error | return location for an error |

#### Returns

a XdpSession.

[transfer full]

## Types and Values

### enum XdpOutputType

Flags to specify what kind of sources to offer for a screencast session.

#### Members

XDP_OUTPUT_MONITOR | allow selecting monitors |
XDP_OUTPUT_WINDOW | allow selecting individual application windows |

### XDP_OUTPUT_NONE

    #define XDP_OUTPUT_NONE 0

The value to use as null value for XdpOutputType.

### XDP_OUTPUT_ALL

    #define XDP_OUTPUT_ALL  (XDP_OUTPUT_MONITOR | XDP_OUTPUT_WINDOW)

A convenient value to select all possible kinds of output.