# WebGlFrameProducer

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-media-browser/struct-webglframeproducer/

**struct** · [`ferroui-media-browser`](/docs/0.5.0/api/ferroui-media-browser/) · v0.5.0

```rust
struct WebGlFrameProducer
```

Allocation policy for the active compositor context. Old generations remain
charged to the same budget until their native storage actually retires.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L39)

## Members

- [`from_interop`](#function-from_interop)
- [`budget`](#function-budget)
- [`device`](#function-device)
- [`device_generation`](#function-device_generation)
- [`graphics`](#function-graphics)
- [`with_budget`](#function-with_budget)
- [`with_analysis`](#function-with_analysis)
- [`stream`](#function-stream)
- [`is_current`](#function-is_current)
- [`transfers_frames`](#function-transfers_frames)
- [`quadrants`](#function-quadrants)
- [`upload`](#function-upload)

<a id="function-from_interop"></a>

### from_interop

```rust
fn from_interop(interop: &dyn ICompositionGpuInterop, budget: FrameBudget) -> Result<Self, MediaError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L49)

<a id="function-budget"></a>

### budget

```rust
fn budget(self: &Self) -> FrameBudget
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L110)

<a id="function-device"></a>

### device

```rust
fn device(self: &Self) -> DeviceIdentity
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L113)

<a id="function-device_generation"></a>

### device_generation

```rust
fn device_generation(self: &Self) -> u64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L116)

<a id="function-graphics"></a>

### graphics

```rust
fn graphics(self: &Self) -> Acceleration
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L119)

<a id="function-with_budget"></a>

### with_budget

```rust
fn with_budget(self: &Self, budget: FrameBudget) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L122)

<a id="function-with_analysis"></a>

### with_analysis

```rust
fn with_analysis(self: &Self, enabled: bool) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L128)

<a id="function-stream"></a>

### stream

```rust
fn stream(self: &Self, source: u64, generation: u64) -> BrowserFrameStream
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L134)

<a id="function-is_current"></a>

### is_current

```rust
fn is_current(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L144)

<a id="function-transfers_frames"></a>

### transfers_frames

```rust
fn transfers_frames(self: &Self) -> bool
```

Whether frames are transferred to the render worker (#601) rather than written into a
texture of a context of this thread.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L150)

<a id="function-quadrants"></a>

### quadrants

```rust
fn quadrants(self: &Self, identity: FrameIdentity, width: u32, height: u32) -> Result<Option<PendingWebGlFrame>, MediaError>
```

Independent GPU producer. Its framebuffer is bottom-left oriented;
presentation must preserve that origin rather than flip CPU pixels.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L155)

<a id="function-upload"></a>

### upload

```rust
fn upload(self: &Self, identity: FrameIdentity, width: u32, height: u32, timestamp: Duration, source: &JsValue) -> Result<Option<PendingWebGlFrame>, MediaError>
```

Transfers a browser-owned HTMLVideoElement image directly to the active GL
context. CORS/security failures remain errors; there is no CPU fallback.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media.Browser/lib.rs#L172)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- `Clone`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
