Class VideoSource
A video source.
Inheritance
Implements
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class VideoSource : MediaSource<IVideoOutput, IVideoInput, IVideoInputCollection, VideoSource, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IVideoOutput, IMediaOutput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IOutput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IVideoElement, IMediaElement, IElement
Constructors
VideoSource(VideoFormat)
Initializes a new instance of the VideoSource class.
Declaration
public VideoSource(VideoFormat outputFormat)
Parameters
Type | Name | Description |
---|---|---|
VideoFormat | outputFormat | The output format. |
Properties
AverageFrameRate
Gets the average frame rate.
Declaration
public int AverageFrameRate { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Content
Gets the content descriptor.
Declaration
public override string Content { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
FrameCount
Gets the frame count.
Declaration
public long FrameCount { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
MaxOutputEncoding
Gets or sets the maximum allowed output encoding.
Declaration
public override EncodingInfo MaxOutputEncoding { get; protected set; }
Property Value
Type | Description |
---|---|
EncodingInfo |
Overrides
MaxOutputFrameRate
Gets or sets the maximum allowed output frame-rate, in fps. A value of -1 indicates unset (no maximum).
Declaration
public virtual double MaxOutputFrameRate { get; protected set; }
Property Value
Type | Description |
---|---|
System.Double |
MaxOutputHeight
Gets the maximum allowed output height. A value of -1 indicates unset (no minimum).
Declaration
public virtual int MaxOutputHeight { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxOutputScale
Gets or sets the maximum allowed output scale. A value of -1 indicates unset (no maximum).
Declaration
public virtual double MaxOutputScale { get; protected set; }
Property Value
Type | Description |
---|---|
System.Double |
MaxOutputSize
Gets or sets the maximum allowed output size. A value of null indicates unset (no maximum).
Declaration
public virtual Size MaxOutputSize { get; protected set; }
Property Value
Type | Description |
---|---|
Size |
MaxOutputWidth
Gets the maximum allowed output width. A value of -1 indicates unset (no minimum).
Declaration
public virtual int MaxOutputWidth { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MinOutputEncoding
Gets or sets the minimum allowed output encoding.
Declaration
public override EncodingInfo MinOutputEncoding { get; protected set; }
Property Value
Type | Description |
---|---|
EncodingInfo |
Overrides
MinOutputFrameRate
Gets or sets the minimum allowed output frame-rate, in fps. A value of -1 indicates unset (no minimum).
Declaration
public virtual double MinOutputFrameRate { get; protected set; }
Property Value
Type | Description |
---|---|
System.Double |
MinOutputHeight
Gets the minimum allowed output height. A value of -1 indicates unset (no minimum).
Declaration
public virtual int MinOutputHeight { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MinOutputScale
Gets or sets the minimum allowed output scale. A value of -1 indicates unset (no minimum).
Declaration
public virtual double MinOutputScale { get; protected set; }
Property Value
Type | Description |
---|---|
System.Double |
MinOutputSize
Gets or sets the minimum allowed output size. A value of null indicates unset (no minimum).
Declaration
public virtual Size MinOutputSize { get; protected set; }
Property Value
Type | Description |
---|---|
Size |
MinOutputWidth
Gets the minimum allowed output width. A value of -1 indicates unset (no minimum).
Declaration
public virtual int MinOutputWidth { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
OverConstrainedFrameRate
Gets whether the source frame-rate is over-constrained. A source frame-rate is over-constrained if the output frame-rate is over-constrained.
Declaration
public virtual bool OverConstrainedFrameRate { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedHeight
Gets whether the source height is over-constrained. A source height is over-constrained if the output height is over-constrained.
Declaration
public virtual bool OverConstrainedHeight { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedOutput
Gets whether the output is over-contrained. An output is over-constrained if it's output bitrate, output scale, output frame-rate, output size is over-contrained.
Declaration
public override bool OverConstrainedOutput { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
OverConstrainedOutputFrameRate
Gets whether the minimum allowed output frame-rate exceeds the maximum allowed output frame-rate.
Declaration
public bool OverConstrainedOutputFrameRate { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedOutputHeight
Gets whether the minimum allowed output height exceeds the maximum allowed output height.
Declaration
public bool OverConstrainedOutputHeight { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedOutputScale
Gets whether the minimum allowed output scale exceeds the maximum allowed output scale.
Declaration
public bool OverConstrainedOutputScale { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedOutputSize
Gets whether the minimum allowed output size exceeds the maximum allowed output size.
Declaration
public bool OverConstrainedOutputSize { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedOutputWidth
Gets whether the minimum allowed output width exceeds the maximum allowed output width.
Declaration
public bool OverConstrainedOutputWidth { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedScale
Gets whether the source scale is over-constrained. A source scale is over-constrained if the output scale is over-constrained.
Declaration
public virtual bool OverConstrainedScale { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedSize
Gets whether the source size is over-constrained. A source size is over-constrained if the output size is over-constrained.
Declaration
public virtual bool OverConstrainedSize { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OverConstrainedWidth
Gets whether the source width is over-constrained. A source width is over-constrained if the output width is over-constrained.
Declaration
public virtual bool OverConstrainedWidth { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
TargetOutputEncoding
Gets or sets the target output encoding.
Declaration
public override EncodingInfo TargetOutputEncoding { get; protected set; }
Property Value
Type | Description |
---|---|
EncodingInfo |
Overrides
TargetOutputFrameRate
Gets or sets the target output frame-rate, in fps. A value of -1 indicates unset (no target).
Declaration
public virtual double TargetOutputFrameRate { get; protected set; }
Property Value
Type | Description |
---|---|
System.Double |
TargetOutputHeight
Gets the target output height. A value of -1 indicates unset (no minimum).
Declaration
public virtual int TargetOutputHeight { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
TargetOutputScale
Gets or sets the target output scale. A value of -1 indicates unset (no target).
Declaration
public virtual double TargetOutputScale { get; protected set; }
Property Value
Type | Description |
---|---|
System.Double |
TargetOutputSize
Gets or sets the target output size. A value of null indicates unset (no target).
Declaration
public virtual Size TargetOutputSize { get; protected set; }
Property Value
Type | Description |
---|---|
Size |
TargetOutputWidth
Gets the target output width. A value of -1 indicates unset (no minimum).
Declaration
public virtual int TargetOutputWidth { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
VideoType
Gets or sets the video type.
Declaration
public virtual VideoType VideoType { get; protected set; }
Property Value
Type | Description |
---|---|
VideoType |
Methods
CreateInputCollection(IVideoOutput)
Creates an input collection.
Declaration
protected override IVideoInputCollection CreateInputCollection(IVideoOutput output)
Parameters
Type | Name | Description |
---|---|---|
IVideoOutput | output | The source. |
Returns
Type | Description |
---|---|
IVideoInputCollection |
Overrides
GetFrameRateDistance(Double, Double)
Gets the distance between two frame rates.
Declaration
public double GetFrameRateDistance(double frameRate1, double frameRate2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | frameRate1 | The first frame rate. |
System.Double | frameRate2 | The second frame rate. |
Returns
Type | Description |
---|---|
System.Double | The positive distance between the two frame rates. |
GetSizeDistance(Int32, Int32, Int32, Int32)
Gets the distance between two sizes.
Declaration
public int GetSizeDistance(int width1, int height1, int width2, int height2)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width1 | The first width. |
System.Int32 | height1 | The first height. |
System.Int32 | width2 | The second width. |
System.Int32 | height2 | The second height. |
Returns
Type | Description |
---|---|
System.Int32 | The positive linear distance between the two sizes. |
OutputCanProcessFrame(IVideoInput)
Determines whether an output can process a frame from this pipe.
Declaration
protected override bool OutputCanProcessFrame(IVideoInput output)
Parameters
Type | Name | Description |
---|---|---|
IVideoInput | output | The output. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
RaiseFrame(VideoFrame)
Raises a frame.
Declaration
protected override void RaiseFrame(VideoFrame frame)
Parameters
Type | Name | Description |
---|---|---|
VideoFrame | frame | The frame. |
Overrides
Events
OnRaiseSizeChange
Raised when a frame is about to be raised with a size that does not match the prior frame.
Declaration
public event Action1<Size> OnRaiseSizeChange
Event Type
Type | Description |
---|---|
Action1<Size> |