Class HWUpload
Uploads frames from system memory to hardware surfaces for hardware-accelerated processing.
Inherited Members
Namespace: FFmpeg.Filters.VideoFilters
Assembly: FFmpeg.dll
Syntax
public class HWUpload : FilterContext, IOptionQueryable, ILoggingContext, IAVPointer<_AVFilterContext>, IBufferSource, IBufferSink
Remarks
The hardware device used by the filter can be specified explicitly through a DeviceContext or derived from the device associated with the input frames by specifying a DeviceType.
When using an explicit hardware device, the device can be supplied through Create(string, DeviceContext, FilterGraph) or Create(string, DeviceContext_ref, FilterGraph). Alternatively, Create(string, DeviceType, FilterGraph) can be used to derive a new device of the specified type from the device on which the input frames reside.
The input and output devices must be compatible. Typically, this means that they refer to the same underlying hardware context, such as the same graphics card.
Properties
View SourceDeriveDevice
Gets or sets the type of hardware device to derive from the device associated with the input frames.
Declaration
public DeviceType DeriveDevice { get; set; }
Property Value
| Type | Description |
|---|---|
| DeviceType | The hardware device type to derive, or None when no derived device is configured. |
Remarks
When set, the filter derives a new hardware device of the specified type from the device on which the input frames reside, rather than using the device supplied through HwDeviceContext.
The derived device must be compatible with the input device. Typically, both devices must refer to the same underlying hardware context.
Methods
View SourceAllocate(string, FilterGraph)
Allocates an uninitialized HWUpload filter context.
Declaration
public static HWUpload Allocate(string name, FilterGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name assigned to the filter context. |
| FilterGraph | graph | The filter graph to which the filter belongs. |
Returns
| Type | Description |
|---|---|
| HWUpload | A newly allocated HWUpload filter context. |
Remarks
The returned filter is not initialized. A hardware device must be assigned through HwDeviceContext or DeriveDevice before calling Init().
Create(string, DeviceContext, FilterGraph)
Creates and initializes an HWUpload filter using the specified hardware device.
Declaration
public static HWUpload Create(string name, DeviceContext hwContext, FilterGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name assigned to the filter context. |
| DeviceContext | hwContext | The hardware device context to which frames are uploaded. |
| FilterGraph | graph | The filter graph to which the filter belongs. |
Returns
| Type | Description |
|---|---|
| HWUpload | An initialized HWUpload filter context. |
Create(string, DeviceContext_ref, FilterGraph)
Creates and initializes an HWUpload filter using the specified hardware device context reference.
Declaration
public static HWUpload Create(string name, DeviceContext_ref hwContext, FilterGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name assigned to the filter context. |
| DeviceContext_ref | hwContext | A reference to the hardware device context to which frames are uploaded. |
| FilterGraph | graph | The filter graph to which the filter belongs. |
Returns
| Type | Description |
|---|---|
| HWUpload | An initialized HWUpload filter context. |
Create(string, DeviceType, FilterGraph)
Creates and initializes an HWUpload filter by deriving a hardware device of the specified type from the device associated with the input frames.
Declaration
public static HWUpload Create(string name, DeviceType deviceType, FilterGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name assigned to the filter context. |
| DeviceType | deviceType | The type of hardware device to derive from the device associated with the input frames. |
| FilterGraph | graph | The filter graph to which the filter belongs. |
Returns
| Type | Description |
|---|---|
| HWUpload | An initialized HWUpload filter context. |
Remarks
This is equivalent to configuring the derive_device option before
initializing the filter.