Table of Contents

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, IMediaBlockInternals

Inheritance

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

pipeline MediaBlocksPipeline

The pipeline.

settings ImageVideoSourceSettings

The image video source settings.

videoSize Size

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

MediaBlockPad

Inputs

Gets all input pads available on this block (none for source blocks).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Name

Gets or sets the name of the block.

public string Name { get; set; }

Property Value

string

Output

Gets the primary video output pad.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the settings.

public ImageVideoSourceSettings Settings { get; set; }

Property Value

ImageVideoSourceSettings

Type

Gets the media block type identifier.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the image source within the pipeline context.

public override bool Build()

Returns

bool

Dispose(bool)

Disposes of resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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

direction MediaBlockPadDirection
type MediaBlockPadMediaType

Returns

MediaBlockPad

GetPads()

Gets all media block pads available on this source.

public MediaBlockPad[] GetPads()

Returns

MediaBlockPad[]

SetDisplayMode(ImageDisplayMode)

Sets the display mode for the image.

public void SetDisplayMode(ImageDisplayMode mode)

Parameters

mode ImageDisplayMode

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

filename string

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

filename string

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

filename string

The new image filename.

timeout TimeSpan

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

pipeline MediaBlocksPipeline

See Also