Class RTSPRAWSourceSettings
- Namespace
- VisioForge.Core.Types.X.Sources
- Assembly
- VisioForge.Core.dll
RTSP RAW source settings.
public class RTSPRAWSourceSettings : IMediaPlayerBaseSourceSettings, IVideoSourceSettings, IMediaBlockSettingsInheritance
Implements
Inherited Members
Constructors
RTSPRAWSourceSettings()
Initializes a new instance of the VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings class with the default protocol set and no endpoint. This is the JSON persistence path: VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.Uri, VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.Login, VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.Password and VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.AudioEnabled are set from the document payload afterwards. Unlike VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.CreateAsync(System.Uri,System.String,System.String,System.Boolean,System.Boolean,VisioForge.Core.BaseContext,System.Threading.CancellationToken) it never contacts the camera, so VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.GetInfo returns null until VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.ReadInfoAsync runs. Use VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.CreateAsync(System.Uri,System.String,System.String,System.Boolean,System.Boolean,VisioForge.Core.BaseContext,System.Threading.CancellationToken) when the camera is reachable and its media information should be probed up front.
public RTSPRAWSourceSettings()Properties
AllowedProtocols
Gets or sets the allowed protocols.
public RTSPSourceProtocol AllowedProtocols { get; set; }Property Value
AudioEnabled
Gets or sets a value indicating whether audio stream is enabled.
public bool AudioEnabled { get; set; }Property Value
DecodeAudioStream
Gets or sets a value indicating whether to decode audio stream. May be required if you want to save an original video stream and PCM audio to a file.
public bool DecodeAudioStream { get; set; }Property Value
DoRTCP
Gets or sets a value indicating whether to send RTCP receiver reports. Default is true.
Cameras and servers commonly use these reports to tell that the client is still alive, and
drop the session without them. Disable only for an old server that cannot handle RTCP.
public bool DoRTCP { get; set; }Property Value
ForceCustomKeepAlive
Gets or sets a value indicating whether to replace the default RTSP keep-alive
with a GET_PARAMETER request every 30 seconds. Default is false.
Use only if the camera drops the session under the built-in keep-alive.
public bool ForceCustomKeepAlive { get; set; }Property Value
Latency
Gets or sets the latency.
public int Latency { get; set; }Property Value
Login
Gets or sets the login.
public string Login { get; set; }Property Value
Password
Gets or sets the password.
public string Password { get; set; }Property Value
RTPBlockSize
Gets or sets the size of the RTP block.
public int RTPBlockSize { get; set; }Property Value
SyncAudioWithKeyframe
Gets or sets whether to synchronize audio with the first video keyframe. When enabled, audio frames before the first keyframe are dropped to maintain A/V sync.
public bool SyncAudioWithKeyframe { get; set; }Property Value
UDPBufferSize
Gets or sets the size of the UDP buffer.
public int UDPBufferSize { get; set; }Property Value
Uri
Gets or sets the URI.
public Uri Uri { get; set; }Property Value
Remarks
Assigning a different endpoint drops the cached VisioForge.Core.Types.MediaInfo.MediaFileInfo: a probe describes one camera, and VisioForge.Core.MediaBlocks.Sources.RTSPRAWSourceBlock.Build picks its depayloader and parser from the probed RTP stream layout, so a stale one would build the graph for the previous camera - a failure that is silent rather than loud.
WaitForKeyframe
Gets or sets whether to wait for a keyframe before starting video playback. When enabled, ensures clean stream start from an I-frame with synchronized audio.
public bool WaitForKeyframe { get; set; }Property Value
Methods
CreateAsync(Uri, string, string, bool, bool, BaseContext, CancellationToken)
Create as an asynchronous operation.
public static Task<RTSPRAWSourceSettings> CreateAsync(Uri uri, string login, string password, bool audioEnabled = true, bool readInfo = true, BaseContext context = null, CancellationToken cancellationToken = default)Parameters
uriUri-
The URI.
loginstring-
The login.
passwordstring-
The password.
audioEnabledbool-
if set to
trueaudio enabled. readInfobool-
if set to
trueto read stream information. Disable only if you have some issues. contextBaseContext-
The base context for logging.
cancellationTokenCancellationToken-
A token to observe while waiting for the task to complete.
Returns
- Task<RTSPRAWSourceSettings>
-
A Task<RTSPRAWSourceSettings> representing the asynchronous operation.
CreateBlock()
Creates the block.
public MediaBlock CreateBlock()Returns
- MediaBlock
-
MediaBlock.
GetInfo()
Gets the file information.
public MediaFileInfo GetInfo()Returns
- MediaFileInfo
-
MediaFileInfo.
ReadInfoAsync()
Read information as an asynchronous operation.
public Task<MediaFileInfo> ReadInfoAsync()Returns
- Task<MediaFileInfo>
-
A Task<MediaFileInfo> representing the asynchronous operation.
ReadInfoAsync(BaseContext, CancellationToken)
Read information as an asynchronous operation, logging why a probe failed to the supplied context. Settings built by the JSON persistence constructor carry no context of their own, so without this the reason a camera could not be read is dropped.
public Task<MediaFileInfo> ReadInfoAsync(BaseContext context, CancellationToken cancellationToken)Parameters
contextBaseContext-
The context used for diagnostics by this call only; nothing is stored, and the settings' own context is used when this is null.
cancellationTokenCancellationToken-
The cancellation token. Required: an optional one would make
ReadInfoAsync(default)ambiguous against VisioForge.Core.Types.X.Sources.RTSPRAWSourceSettings.ReadInfoAsync(System.Threading.CancellationToken) and break existing callers.
Returns
- Task<MediaFileInfo>
-
A Task<MediaFileInfo> representing the asynchronous operation.
ReadInfoAsync(CancellationToken)
Read information as an asynchronous operation.
public Task<MediaFileInfo> ReadInfoAsync(CancellationToken cancellationToken)Parameters
cancellationTokenCancellationToken-
The cancellation token.
Returns
- Task<MediaFileInfo>
-
A Task<MediaFileInfo> representing the asynchronous operation.