Class ImageVideoSourceCairoBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
Image video source block with Cairo-based rendering for dynamic updates. Implements the VisioForge.Core.MediaBlocks.IMediaBlock
public class ImageVideoSourceCairoBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
ImageVideoSourceCairoBlock(MediaBlocksPipeline, ImageVideoSourceSettings, Size)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.ImageVideoSourceCairoBlock class.
public ImageVideoSourceCairoBlock(MediaBlocksPipeline pipeline, ImageVideoSourceSettings settings, Size videoSize)Parameters
pipelineMediaBlocksPipeline-
The pipeline.
settingsImageVideoSourceSettings-
The image video source settings.
videoSizeSize-
The output video frame size.
Properties
Context
Gets or sets the context.
public ContextX Context { get; set; }Property Value
- ContextX
Input
Gets the primary input pad (none for source blocks).
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block (none for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Name
Gets or sets the name of the block.
public string Name { get; set; }Property Value
Output
Gets the primary video output pad.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the settings.
public ImageVideoSourceSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the image source within the pipeline context.
public override bool Build()Returns
Dispose(bool)
Disposes of resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
True if disposing managed resources.
GetCore()
Gets the core GStreamer element wrapper.
public BaseElement GetCore()Returns
- BaseElement
GetElement()
Gets the native GStreamer element.
public Element GetElement()Returns
- Element
GetPad(MediaBlockPadDirection, MediaBlockPadMediaType)
Gets a specific media block pad by direction and media type.
public MediaBlockPad GetPad(MediaBlockPadDirection direction, MediaBlockPadMediaType type)Parameters
directionMediaBlockPadDirectiontypeMediaBlockPadMediaType
Returns
GetPads()
Gets all media block pads available on this source.
public MediaBlockPad[] GetPads()Returns
SetDisplayMode(ImageDisplayMode)
Sets the display mode for the image.
public void SetDisplayMode(ImageDisplayMode mode)Parameters
modeImageDisplayMode-
The display mode.
TryUpdateFilename(string)
Updates the image filename dynamically without stopping the pipeline, and reports whether the image named is the one that will be, or already is, shown.
public bool TryUpdateFilename(string filename)Parameters
filenamestring-
The new image filename.
Returns
- bool
-
True if the image was installed.
Remarks
See VisioForge.Core.MediaBlocks.Sources.ImageVideoSourceCairoBlock.UpdateFilename(System.String) for what happens before the block is built.
UpdateFilename(string)
Updates the image filename dynamically without stopping the pipeline.
public void UpdateFilename(string filename)Parameters
filenamestring-
The new image filename.
Remarks
Before the block is built this replaces VisioForge.Core.MediaBlocks.Sources.ImageVideoSourceCairoBlock.Settings with a new object built from
filename - the image's width, height and format are read once by the
settings constructor. A block created with no explicit video size takes its frame size from
them on its FIRST build only: the frame size is part of the pipeline's negotiated caps and
does not move afterwards, neither on a later image nor on a rebuild after a stop.
A caller holding the instance it passed to the constructor should re-read
VisioForge.Core.MediaBlocks.Sources.ImageVideoSourceCairoBlock.Settings after this call rather than keep mutating the old one.
UpdateFilenameAsync(string, TimeSpan)
Updates the image filename and waits until the new image has been painted into a frame.
public Task<ImageUpdateResult> UpdateFilenameAsync(string filename, TimeSpan timeout)Parameters
filenamestring-
The new image filename.
timeoutTimeSpan-
How long to wait for the draw. A pipeline that is not playing never draws.
Returns
- Task<ImageUpdateResult>
-
What happened to the image.
IMediaBlockInternals.CleanUp()
Cleans up resources.
void IMediaBlockInternals.CleanUp()IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline