# wpesrc

The wpesrc element is used to produce a video texture representing a web page rendered off-screen by WPE.

Starting from WPEBackend-FDO 1.6.x, software rendering support is available. This features allows wpesrc to be used on machines without GPU, and/or for testing purpose. To enable it, set the `LIBGL_ALWAYS_SOFTWARE=true` environment variable and make sure `video/x-raw, format=BGRA` caps are negotiated by the wpesrc element.

## Example launch lines

### Show the GStreamer website homepage

    gst-launch-1.0 -v wpesrc location="https://gstreamer.freedesktop.org" ! queue ! glimagesink

### Save the first 50 video frames generated for the GStreamer website as PNG files in /tmp

    LIBGL_ALWAYS_SOFTWARE=true gst-launch-1.0 -v wpevideosrc num-buffers=50 location="https://gstreamer.freedesktop.org" ! videoconvert ! pngenc ! multifilesink location=/tmp/snapshot-%05d.png

### Show the GStreamer website homepage as played with GstPlayer in a GTK+ window

    export GST_PLUGIN_FEATURE_RANK="wpesrc:MAX"
    gst-play-1.0 --videosink gtkglsink web+https://gstreamer.freedesktop.org

Until 1.20 the `web://` URI protocol was supported, along with `wpe://`.

The supported URI protocols are `web+http://`, `web+https://` and `web+file://`.

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBin
                        ╰──wpesrc

## Implemented interfaces

    GstChildProxy
    GstURIHandler

## Factory details

Authors: – Philippe Normand <philn>, Žan Doberšek <zdobersek></zdobersek></philn>

Classification: – `Source/Video/Audio`

Rank – none

Plugin – wpe

Package – gst-plugins-bad

## Pad Templates

### `audio_%u`

Each audio stream in the renderer web page will expose the and `audio_%u` GstPad.

    audio/x-raw:
             format: F32LE
               rate: [ 1, 2147483647 ]
           channels: [ 1, 2147483647 ]
             layout: interleaved
    audio/x-raw:
             format: F64LE
               rate: [ 1, 2147483647 ]
           channels: [ 1, 2147483647 ]
             layout: interleaved
    audio/x-raw:
             format: S16LE
               rate: [ 1, 2147483647 ]
           channels: [ 1, 2147483647 ]
             layout: interleaved

Presence – sometimes

Direction – src

Object type – GstPad

Since : 1.20

### `src`

    video/x-raw(memory:GLMemory):
             format: RGBA
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]
    pixel-aspect-ratio: 1/1
     texture-target: 2D
    video/x-raw:
             format: BGRA

Presence – always

Direction – src

Object type – GstPad

### `video`

    video/x-raw(memory:GLMemory):
             format: RGBA
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]
    pixel-aspect-ratio: 1/1
     texture-target: 2D
    video/x-raw:
             format: BGRA
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]
    pixel-aspect-ratio: 1/1

Presence – always

Direction – src

Object type – GstPad

Since : 1.20

## Signals

### configure-web-view

    configure_web_view_callback (GstElement * param_0,
                                 GObject * arg0,
                                 gpointer udata)

    def configure_web_view_callback (param_0, arg0, udata):
        #python callback for the 'configure-web-view' signal

    function configure_web_view_callback(param_0: GstElement * param_0, arg0: GObject * arg0, udata: gpointer udata): {
        // javascript callback for the 'configure-web-view' signal
    }

Parameters:

`param_0` –
No description available
`arg0` –
No description available
`udata` –
No description available

Flags: Run Last

## Action Signals

### load-bytes

    g_signal_emit_by_name (src, "load-bytes", bytes);

    ret = src.emit ("load-bytes", bytes)

    let ret = src.emit ("load-bytes", bytes);

Load the specified bytes into the internal webView.

Parameters:

`src` (GstElement *) –

the object which received the signal

`bytes` (GBytes *) –

the GBytes data to load

Flags: Run Last / Action

### run-javascript

    g_signal_emit_by_name (src, "run-javascript", script);

    ret = src.emit ("run-javascript", script)

    let ret = src.emit ("run-javascript", script);

Asynchronously run script in the context of the current page on the internal webView.

Parameters:

`src` (GstElement *) –

the object which received the signal

`script` (gchararray) –

the script to run

Flags: Run Last / Action

Since : 1.22

## Properties

### draw-background

    “draw-background” gboolean

Whether to draw the WebView background

Flags : Read / Write

Default value : true

### location

    “location” gchararray

The URL to display

Flags : Read / Write

Default value : about:blank

The results of the search are