Class MediaBlocksPipeline
Class MediaBlocksPipeline. Implements the IMediaBlocksPipeline. Implements the IDisposable.
Inherited Members
Namespace: VisioForge.Core.MediaBlocks
Assembly: VisioForge.Core.dll
Syntax
public class MediaBlocksPipeline : IMediaBlocksPipeline, IDisposable, IAsyncDisposable, INotifyPropertyChanged
Constructors
MediaBlocksPipeline(string, ContextX)
Initializes a new instance of the MediaBlocksPipeline class.
Declaration
public MediaBlocksPipeline(string name = null, ContextX context = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name. |
ContextX | context | The context. |
Properties
Debug_Dir
Gets or sets debug directory.
Declaration
public string Debug_Dir { get; set; }
Property Value
Type | Description |
---|---|
string | The debug dir. |
Debug_DisableMessageDialogs
Gets or sets a value indicating whether message dialog will be shown in case of error if OnError event is not implemented.
Declaration
public bool Debug_DisableMessageDialogs { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
Debug_Mode
Gets or sets a value indicating whether debug mode enabled.
Declaration
public bool Debug_Mode { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
Debug_Telemetry
Gets or sets a value indicating whether sending telemetry enabled (only during debugging in Visual Studio).
Declaration
public bool Debug_Telemetry { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
Remarks
Only anonymous data will be send.
Loop
Gets or sets a value indicating whether playback will restart from beginning when playback completed.
Declaration
public bool Loop { get; set; }
Property Value
Type | Description |
---|---|
bool |
Name
Gets or sets the optional name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string | The name. |
PauseOnStop
Gets or sets a value indicating whether playback will seek to beginning and paused when playback completed.
Declaration
public bool PauseOnStop { get; set; }
Property Value
Type | Description |
---|---|
bool |
SDK_BuildDate
Gets SDK build date.
Declaration
public static DateTime SDK_BuildDate { get; }
Property Value
Type | Description |
---|---|
DateTime | The SDK build date. |
SDK_Version
Gets SDK version.
Declaration
public static Version SDK_Version { get; }
Property Value
Type | Description |
---|---|
Version | The SDK version. |
StartPosition
Gets or sets start position.
Declaration
public TimeSpan? StartPosition { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan? |
State
Gets the state.
Declaration
public PlaybackState State { get; }
Property Value
Type | Description |
---|---|
PlaybackState | The state. |
StopPosition
Gets or sets stop position.
Declaration
public TimeSpan? StopPosition { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan? |
Methods
AddBlock(IMediaBlock)
Adds the block.
Declaration
public bool AddBlock(IMediaBlock block)
Parameters
Type | Name | Description |
---|---|---|
IMediaBlock | block | The block. |
Returns
Type | Description |
---|---|
bool |
|
Build()
Builds this instance.
Declaration
public bool Build()
Returns
Type | Description |
---|---|
bool |
|
ClearBlocks()
Clears the blocks.
Declaration
public void ClearBlocks()
Close()
Closes the source and frees resources.
Declaration
public void Close()
Connect(MediaBlock, MediaBlock)
Connects the specified block default output to another block default input.
Declaration
public bool Connect(MediaBlock output, MediaBlock input)
Parameters
Type | Name | Description |
---|---|---|
MediaBlock | output | The output. |
MediaBlock | input | The input. |
Returns
Type | Description |
---|---|
bool |
|
Connect(MediaBlockPad, MediaBlockPad)
Connects the specified output to input.
Declaration
public bool Connect(MediaBlockPad output, MediaBlockPad input)
Parameters
Type | Name | Description |
---|---|---|
MediaBlockPad | output | The output. |
MediaBlockPad | input | The input. |
Returns
Type | Description |
---|---|
bool |
|
Connect(MediaBlockPad[][])
Connects the specified output.
Declaration
public bool Connect(MediaBlockPad[][] pairs)
Parameters
Type | Name | Description |
---|---|---|
MediaBlockPad[][] | pairs | The pairs of pad inputs and outputs. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
Exception | Pads pair size should be 2. |
ConnectLive(MediaBlockPad, MediaBlockPad)
Connects the specified output when pipeline started.
Declaration
public bool ConnectLive(MediaBlockPad output, MediaBlockPad input)
Parameters
Type | Name | Description |
---|---|---|
MediaBlockPad | output | The output. |
MediaBlockPad | input | The input. |
Returns
Type | Description |
---|---|
bool |
|
CreateEditingPipeline(string, ContextX)
Creates the editing pipeline.
Declaration
public static MediaBlocksPipeline CreateEditingPipeline(string name = null, ContextX context = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name. |
ContextX | context | The context. |
Returns
Type | Description |
---|---|
MediaBlocksPipeline | MediaBlocksPipeline. |
Debug_GetPipeline()
Gets the pipeline as text (DOT format).
Declaration
public string Debug_GetPipeline()
Returns
Type | Description |
---|---|
string | string |
Debug_SavePipeline(string)
Saves the pipeline.
Declaration
public void Debug_SavePipeline(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
|
DisposeAsync()
Disposes the asynchronous.
Declaration
public ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
ValueTask | System.Threading.Tasks.ValueTask. |
Duration()
Gets duration.
Declaration
public TimeSpan Duration()
Returns
Type | Description |
---|---|
TimeSpan | TimeSpan. |
DurationAsync()
Gets duration (async).
Declaration
public Task<TimeSpan> DurationAsync()
Returns
Type | Description |
---|---|
Task<TimeSpan> | Task<TimeSpan>. |
~MediaBlocksPipeline()
Finalizes an instance of the MediaBlocksPipeline class.
Declaration
protected ~MediaBlocksPipeline()
ForceGPUDecodersUsage(bool)
Forces usage of GPU decoders.
Declaration
public static void ForceGPUDecodersUsage(bool value = true)
Parameters
Type | Name | Description |
---|---|---|
bool | value | True to force GPU decoders. |
GetBlock(string)
Gets the block.
Declaration
public IMediaBlock GetBlock(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name. |
Returns
Type | Description |
---|---|
IMediaBlock | IMediaBlock. |
GetBlock(MediaBlockType)
Gets the block.
Declaration
public IMediaBlock GetBlock(MediaBlockType type_)
Parameters
Type | Name | Description |
---|---|---|
MediaBlockType | type_ | The type. |
Returns
Type | Description |
---|---|
IMediaBlock | IMediaBlock. |
GetContext()
Gets the context.
Declaration
public ContextX GetContext()
Returns
Type | Description |
---|---|
ContextX | ContextX. |
GetHardwareDecoders(string[])
Gets hardware decoders with filtering. For example, use "H264" to get H264 decoders.
Declaration
public static Tuple<string, string>[] GetHardwareDecoders(string[] filters)
Parameters
Type | Name | Description |
---|---|---|
string[] | filters | Filters. |
Returns
Type | Description |
---|---|
Tuple<string, string>[] | Tuple. |
GetPipelineContext()
Gets the pipeline context.
Declaration
public BlockPipelineContext GetPipelineContext()
Returns
Type | Description |
---|---|
BlockPipelineContext | BlockPipelineContext. |
GetSoftwareH264Decoders()
Gets software H264 decoders.
Declaration
public static Tuple<string, string>[] GetSoftwareH264Decoders()
Returns
Type | Description |
---|---|
Tuple<string, string>[] | Tuple. |
GetSoftwareH265Decoders()
Gets software H265 decoders.
Declaration
public static Tuple<string, string>[] GetSoftwareH265Decoders()
Returns
Type | Description |
---|---|
Tuple<string, string>[] | Tuple. |
NextFrame()
Performs frames step.
Declaration
public bool NextFrame()
Returns
Type | Description |
---|---|
bool |
|
OnPropertyChanged(string)
OnPropertyChanged API.
Declaration
protected virtual void OnPropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | Property name. |
Pause()
Pauses playback.
Declaration
public bool Pause()
Returns
Type | Description |
---|---|
bool |
|
PauseAsync()
Pauses playback (async).
Declaration
public Task PauseAsync()
Returns
Type | Description |
---|---|
Task | The Task. |
Position_Get()
Gets position.
Declaration
public TimeSpan Position_Get()
Returns
Type | Description |
---|---|
TimeSpan | TimeSpan. |
Position_GetAsync()
Gets position (async).
Declaration
public Task<TimeSpan> Position_GetAsync()
Returns
Type | Description |
---|---|
Task<TimeSpan> | Task<TimeSpan>. |
Position_Set(TimeSpan, bool)
Sets position.
Declaration
public void Position_Set(TimeSpan position, bool seekToKeyframe = false)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | position | The position. |
bool | seekToKeyframe | True to seek to a keyframe. |
Position_SetAsync(TimeSpan, bool)
Sets position (async).
Declaration
public Task Position_SetAsync(TimeSpan position, bool seekToKeyframe = false)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | position | The position. |
bool | seekToKeyframe | True to seek to a keyframe. |
Returns
Type | Description |
---|---|
Task | Task. |
Position_SetRange(TimeSpan, TimeSpan, bool)
Sets start and stop position for playback.
Declaration
public void Position_SetRange(TimeSpan startPosition, TimeSpan stopPosition, bool seekToKeyframe = false)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | startPosition | The start position. |
TimeSpan | stopPosition | The stop position. |
bool | seekToKeyframe | if set to |
Position_SetRangeAsync(TimeSpan, TimeSpan, bool)
Sets start and stop position for playback (async.).
Declaration
public Task Position_SetRangeAsync(TimeSpan startPosition, TimeSpan stopPosition, bool seekToKeyframe = false)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | startPosition | The start position. |
TimeSpan | stopPosition | The stop position. |
bool | seekToKeyframe | if set to |
Returns
Type | Description |
---|---|
Task | Task. |
Rate_Get()
Gets the rate.
Declaration
public double Rate_Get()
Returns
Type | Description |
---|---|
double | System.Double. |
Rate_GetAsync()
Gets the rate (async).
Declaration
public Task<double> Rate_GetAsync()
Returns
Type | Description |
---|---|
Task<double> | Task<System.Double>. |
Rate_Set(double)
Sets the rate.
Declaration
public bool Rate_Set(double rate)
Parameters
Type | Name | Description |
---|---|---|
double | rate | The rate. |
Returns
Type | Description |
---|---|
bool |
|
Rate_SetAsync(double)
Sets the rate (async).
Declaration
public Task<bool> Rate_SetAsync(double rate)
Parameters
Type | Name | Description |
---|---|---|
double | rate | The rate. |
Returns
Type | Description |
---|---|
Task<bool> | Task<System.Boolean>. |
Resume()
Resumes playback.
Declaration
public bool Resume()
Returns
Type | Description |
---|---|
bool |
|
ResumeAsync()
Resumes playback (async).
Declaration
public Task ResumeAsync()
Returns
Type | Description |
---|---|
Task | The Task. |
SendEOS()
Sends the End-of-Stream event. You can use this method to stop the playback gracefully.
Declaration
public void SendEOS()
SetCustomErrorHandler(IMediaBlocksPipelineCustomErrorHandler)
Sets the custom error handler.
Declaration
public void SetCustomErrorHandler(IMediaBlocksPipelineCustomErrorHandler errorHandler)
Parameters
Type | Name | Description |
---|---|---|
IMediaBlocksPipelineCustomErrorHandler | errorHandler | The error handler. |
SetLicenseKey(string, string, string)
After buying a license of SDK, you will receive the serial number. To get rid of nag screen during the run time, you will need to activate control via this method.
Declaration
public void SetLicenseKey(string licenseKey, string username, string email)
Parameters
Type | Name | Description |
---|---|---|
string | licenseKey | License key. |
string | username | User name used during purchase. |
string | E-mail used during purchase. |
Examples
Pipeline1.SetLicenseKey(your_license_key, username, email).
Start(bool)
Starts this instance.
Declaration
public bool Start(bool onlyPreload = false)
Parameters
Type | Name | Description |
---|---|---|
bool | onlyPreload | if set to |
Returns
Type | Description |
---|---|
bool |
|
StartAsync(bool)
Start playback (async).
Declaration
public Task<bool> StartAsync(bool onlyPreload = false)
Parameters
Type | Name | Description |
---|---|---|
bool | onlyPreload | if set to |
Returns
Type | Description |
---|---|
Task<bool> | Task<System.Boolean>. |
Stop(bool)
Stops the playback.
Declaration
public bool Stop(bool force = false)
Parameters
Type | Name | Description |
---|---|---|
bool | force | if set to |
Returns
Type | Description |
---|---|
bool |
|
StopAsync(bool)
Stops the playback (async.).
Declaration
public Task<bool> StopAsync(bool force = false)
Parameters
Type | Name | Description |
---|---|---|
bool | force | If set to |
Returns
Type | Description |
---|---|
Task<bool> |
|
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
WaitForStop()
Waits for stop.
Declaration
public void WaitForStop()
WaitForStopAsync()
Wait for stop as an asynchronous operation.
Declaration
public Task WaitForStopAsync()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Events
OnBusStreamCollection
Occurs when on bus stream collection info is available.
Declaration
public event EventHandler<Tuple<VideoStreamInfo[], AudioStreamInfo[], SubtitleStreamInfo[]>> OnBusStreamCollection
Event Type
Type | Description |
---|---|
EventHandler<Tuple<VideoStreamInfo[], AudioStreamInfo[], SubtitleStreamInfo[]>> |
OnError
Occurs when error happened.
Declaration
public event EventHandler<ErrorsEventArgs> OnError
Event Type
Type | Description |
---|---|
EventHandler<ErrorsEventArgs> |
OnLoop
This event occurs whenever playback is completed and restarted because Loop property set to true.
Declaration
public event EventHandler<EventArgs> OnLoop
Event Type
Type | Description |
---|---|
EventHandler<EventArgs> |
OnPause
This event occurs whenever the playback pauses.
Declaration
public event EventHandler<EventArgs> OnPause
Event Type
Type | Description |
---|---|
EventHandler<EventArgs> |
OnReady
This event occurs whenever the pipeline is ready.
Declaration
public event EventHandler<EventArgs> OnReady
Event Type
Type | Description |
---|---|
EventHandler<EventArgs> |
OnResume
This event occurs whenever the playback resumes.
Declaration
public event EventHandler<EventArgs> OnResume
Event Type
Type | Description |
---|---|
EventHandler<EventArgs> |
OnStart
This event occurs whenever the playback starts.
Declaration
public event EventHandler<EventArgs> OnStart
Event Type
Type | Description |
---|---|
EventHandler<EventArgs> |
OnStop
This event occurs whenever playback is stopped.
Declaration
public event EventHandler<StopEventArgs> OnStop
Event Type
Type | Description |
---|---|
EventHandler<StopEventArgs> |
PropertyChanged
Property changed event.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
PropertyChangedEventHandler |