From 60a30fecb71d819a5952074010fd0de5f0ba7d51 Mon Sep 17 00:00:00 2001 From: Vincent BOUQUET Date: Sun, 3 Mar 2024 18:57:20 +0100 Subject: [PATCH] add VLC link --- StreamViewer.Designer.cs | 25 +++++++++++++++++++++++++ StreamViewer.cs | 5 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/StreamViewer.Designer.cs b/StreamViewer.Designer.cs index c1ae2dd..5e0d173 100644 --- a/StreamViewer.Designer.cs +++ b/StreamViewer.Designer.cs @@ -58,6 +58,8 @@ namespace robospot_camera_finder labelSerial = new Label(); tbSerial = new TextBox(); btnSidePanel = new Button(); + lblRtspLink = new Label(); + tbRtspLink = new TextBox(); ((System.ComponentModel.ISupportInitialize)videoView).BeginInit(); ((System.ComponentModel.ISupportInitialize)tbZoom).BeginInit(); grpSACN.SuspendLayout(); @@ -338,6 +340,8 @@ namespace robospot_camera_finder // // splitContainerMain.Panel1 // + splitContainerMain.Panel1.Controls.Add(tbRtspLink); + splitContainerMain.Panel1.Controls.Add(lblRtspLink); splitContainerMain.Panel1.Controls.Add(labelSerial); splitContainerMain.Panel1.Controls.Add(tbSerial); splitContainerMain.Panel1.Controls.Add(btnSidePanel); @@ -386,6 +390,25 @@ namespace robospot_camera_finder btnSidePanel.UseVisualStyleBackColor = true; btnSidePanel.Click += btnSidePanel_Click; // + // lblRtspLink + // + lblRtspLink.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + lblRtspLink.AutoSize = true; + lblRtspLink.Location = new Point(296, 483); + lblRtspLink.Name = "lblRtspLink"; + lblRtspLink.Size = new Size(57, 15); + lblRtspLink.TabIndex = 7; + lblRtspLink.Text = "RTSP Link"; + // + // tbRtspLink + // + tbRtspLink.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + tbRtspLink.Location = new Point(359, 480); + tbRtspLink.Name = "tbRtspLink"; + tbRtspLink.ReadOnly = true; + tbRtspLink.Size = new Size(383, 23); + tbRtspLink.TabIndex = 8; + // // StreamViewer // AutoScaleDimensions = new SizeF(7F, 15F); @@ -443,5 +466,7 @@ namespace robospot_camera_finder private Button btnPreset4; private Button btnPreset3; private Button btnPreset2; + private TextBox tbRtspLink; + private Label lblRtspLink; } } \ No newline at end of file diff --git a/StreamViewer.cs b/StreamViewer.cs index 936e317..79a7835 100644 --- a/StreamViewer.cs +++ b/StreamViewer.cs @@ -60,12 +60,15 @@ namespace robospot_camera_finder cam_ip = ip; this.Text = name; + string rtsp_link = "rtsp://" + ip + "/profile2/media.smp"; + updateZoomSlider(); tbSerial.Text = camera.camera_serial; + tbRtspLink.Text = rtsp_link; videoView.MediaPlayer = _mp; - var media = new Media(_libVLC, new Uri("rtsp://" + ip + "/profile2/media.smp")); + var media = new Media(_libVLC, new Uri(rtsp_link)); media.AddOption(":network-caching=25"); _mp.Play(media); media.Dispose();