- Replaced single TabPage CurrentTab with List<TabPage> CurrentTabs to support multiple tabs.
- Added new tab called Video - Removed unused tabs on load (Soak, Mobile, Video, Images). - Refactored InsertCamTab(): - Uses CurrentTabs to manage multiple tabs per camera type. Mobile → inserts Video + Mobile tabs. AiQ → inserts Images + Soak tabs. -Cleans up previous tabs before inserting new ones. -Updated BtnTest_Click(): Added 5-second delay before snapshot. Takes snapshot after video starts playing. - New file created VLC.cs Streams the given IP into the Video tab and takes a snapshot
This commit is contained in:
48
Mobile Tests/VLC.cs
Normal file
48
Mobile Tests/VLC.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using AiQ_GUI;
|
||||
using LibVLCSharp.Shared;
|
||||
using LibVLCSharp.WinForms;
|
||||
using System.IO;
|
||||
|
||||
internal class VLC
|
||||
{
|
||||
public static LibVLC libVLC;
|
||||
|
||||
static VLC()
|
||||
{
|
||||
// Ensure LibVLC is initialized before first use
|
||||
Core.Initialize();
|
||||
libVLC = new LibVLC();
|
||||
}
|
||||
|
||||
public static string RtspUrl = $"rtsp://ADMIN:1234@192.168.0.85:554/live/main";
|
||||
public static string SnapshotPath = Path.Combine(LDS.MAVPath, "Mobile_ov_snapshot.png");
|
||||
|
||||
public static void Play(VideoView VLCVV)
|
||||
{
|
||||
var media = new Media(libVLC, RtspUrl, FromType.FromLocation);
|
||||
VLCVV.MediaPlayer.Play(media);
|
||||
}
|
||||
|
||||
public static bool IsPLaying(VideoView VLCVV)
|
||||
{
|
||||
return VLCVV.MediaPlayer.IsPlaying;
|
||||
}
|
||||
|
||||
public static void TakeSnapshot(VideoView VLCVV)
|
||||
{
|
||||
VLCVV.MediaPlayer.TakeSnapshot(0, SnapshotPath, 1280, 720);
|
||||
|
||||
}
|
||||
|
||||
public static void Stop(VideoView VLCVV)
|
||||
{
|
||||
VLCVV.MediaPlayer.Stop();
|
||||
}
|
||||
|
||||
public static void Capture(VideoView VLCVV)
|
||||
{
|
||||
var media = new Media(libVLC, RtspUrl, FromType.FromLocation);
|
||||
media.AddOption(":rtsp-tcp");
|
||||
VLCVV.MediaPlayer.Play(media);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user