Skip to content

Commit

Permalink
Update NextClientImpl.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
KSAH-42 committed Mar 16, 2024
1 parent 81d82ed commit 390abdc
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions Resources/NextArchitecture/NextClientImpl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,20 @@ namespace TestApp
using ( var client = RtspClientFactory.NewClient() )
{
if ( client == null )
{
return;

}

client.CommunicationStarted += ( sender , e ) =>
{
Console.WriteLine( "Communication Started" );
};

client.CommunicationStopped += ( sender , e ) =>
{
Console.WriteLine( "Communication Stopped" );
};

client.Connected += ( sender , e ) =>
{
Console.WriteLine( "Connected" );
Expand All @@ -37,9 +49,13 @@ namespace TestApp
client.Configuration.Uri = "rtsp://127.0.0.1/toy.mp4";
client.Configuration.UserName = "admin";
client.Configuration.Password = "camera123";
client.Configuration.DeliveryMode = "Tcp";
client.Configuration.MediaFormat = "Audio";
client.Configuration.MulticastAddress = "224.0.0.1";
client.Configuration.RtpPort = 12321;
client.Configuration.TimeToLive = 123;
client.Configuration.FilterEngine = FilterEngineType.Parallel;

client.AddFilter( new DataLoggerFilter() );
client.AddFilter( new RtpDataSinkFilter() );
client.AddFilter( new RtpDataDecoderFilter() );
client.AddFilter( new HttpVideoRenderFilter() );
Expand All @@ -49,6 +65,11 @@ namespace TestApp

client.StartCommunication();

if ( ! client.WaitForConnection( TimeSpan.FromSeconds( 3 ) ) )
{
client.Dispatch( new Action( () => { } ) );
}

Console.WriteLine("Press any keys...");
}
}
Expand Down Expand Up @@ -111,7 +132,15 @@ namespace TestApp.Rtsp.Clients
public abstract string DeliveryMode { get; set; }
public abstract string MediaFormat { get; set; }
public abstract FilterEngineType FilterEngine { get; set; }
public abstract IDictionary<string,string> DefaultHeaders { get; }
public abstract IReadOnlyDictionary<string,string> DefaultHeaders { get; }


public abstract void Validate();
public abstract bool TryValidate();
public abstract void AddHeader( string name , string value );
public abstract bool TryAddHeader( string name , string value );
public abstract bool RemoveHeader( string name , string value );
public abstract bool RemoveAllHeaders();
}

public abstract class RtspClient : IDisposable
Expand All @@ -136,11 +165,15 @@ namespace TestApp.Rtsp.Clients
public abstract bool IsStreamingActive { get; }
public abstract bool IsDisposed { get; }



public abstract void AddFilter( RtspFilter filter );
public abstract void AddFilterBefore( RtspFilter filter , RtspFilter previousFilter );
public abstract void AddFilterAfter( RtspFilter filter , RtspFilter previousFilter );

public abstract bool TryAddFilter( RtspFilter filter );
public abstract bool RemoveFilter( RtspFilter filter );

public abstract bool RemoveFilterById( string filter );
public abstract bool RemoveFilterById( string filter , string previous );
public abstract bool RemoveAllFilters( RtspFilter filter );
Expand Down Expand Up @@ -268,6 +301,9 @@ namespace TestApp.Rtsp.Clients
_client = client ?? throw new ArgumentNullException( nameof( client ) );
}

public string Uri { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public TimeSpan ReceiveTimeout { get; set; }
public TimeSpan SendTimeout { get; set; }

Expand All @@ -292,6 +328,9 @@ namespace TestApp.Rtsp.Clients
=> throw new NotImplementedException();
public RtspClientBuilder UseDefaultFilters()
=> throw new NotImplementedException();

public RtspClientBuilder ConfigureAsDefault()
=> throw new NotImplementedException();
public RtspClientBuilder ConfigureForMulticast( string address , int port )
=> throw new NotImplementedException();
public RtspClientBuilder ConfigureForUnicastUdp( int port )
Expand Down Expand Up @@ -819,4 +858,4 @@ namespace TestApp.Rtsp.Clients.Filters
base.OnStopped( e );
}
}
}
}

0 comments on commit 390abdc

Please sign in to comment.