Interface IReference<T>
Represents an interface for managing references to unmanaged objects that must be disposed, such as FFmpeg objects, without requiring the implementing struct to handle disposal directly.
Namespace: FFmpeg.Utils
Assembly: FFmpeg.dll
Syntax
public interface IReference<T> where T : class, IDisposable
Type Parameters
| Name | Description |
|---|---|
| T | The type of the referenced object, which must implement IDisposable. |
Methods
View SourceGetReferencedObject()
Gets the object currently being referenced. Or a copy if the type is nor reference counted.
Declaration
T? GetReferencedObject()
Returns
| Type | Description |
|---|---|
| T | The referenced object of type |
SetReferencedObject(T?)
Sets the reference to a new object of type T or creates a copy if the type is not reference counted or unlinks the current reference.
Declaration
void SetReferencedObject(T? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| T | obj | The new object to reference, or null to release the reference. |