├── .gitignore ├── Dependencies └── SystemMetrics.dll ├── EmulatorChannel ├── Emulator.csproj ├── EmulatorChannel.cs ├── EmulatorEngine.cs ├── Properties │ └── AssemblyInfo.cs └── RtspStreamLib.cs ├── Images ├── Icons │ ├── cctv_camera.ico │ └── wall-mount-camera-32.png ├── add-24.png ├── camera-24.png ├── close-24.png ├── delete-24.png ├── help-24.png ├── info-24.png ├── modify-24.png ├── open-24.png ├── pause-24.png ├── settings-24.png ├── start-24.png ├── stop-24.png ├── support-24.png └── wall-mount-camera-24.png ├── IpCameraEmulator.sln ├── IpCameraEmulatorStd ├── AboutBox.Designer.cs ├── AboutBox.cs ├── AboutBox.resx ├── App.config ├── FormChannel.Designer.cs ├── FormChannel.cs ├── FormChannel.resx ├── FormMain.Designer.cs ├── FormMain.cs ├── FormMain.resx ├── FormSettings.Designer.cs ├── FormSettings.cs ├── FormSettings.resx ├── IpCameraEmulatorStd.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── start.png │ └── stop.png ├── SystemConfiguration.cs ├── Utilities.cs └── cctv_camera.ico ├── LICENSE ├── README.md ├── RtspStreamLibTest ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── RtspStreamLibTest.csproj └── RtspStreamerLib.cs └── RtspStreamerLib ├── ReadMe.txt ├── RtspStreamerLib.cpp ├── RtspStreamerLib.def ├── RtspStreamerLib.h ├── RtspStreamerLib.vcxproj ├── RtspStreamerLib.vcxproj.filters ├── RtspStreamerLib.vcxproj.user ├── dllmain.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | 11 | [Dd]ebug/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | 18 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 19 | !packages/*/build/ 20 | 21 | # MSTest test Results 22 | [Tt]est[Rr]esult*/ 23 | [Bb]uild[Ll]og.* 24 | 25 | *_i.c 26 | *_p.c 27 | *.ilk 28 | *.meta 29 | *.obj 30 | *.pch 31 | *.pdb 32 | *.pgc 33 | *.pgd 34 | *.rsp 35 | *.sbr 36 | *.tlb 37 | *.tli 38 | *.tlh 39 | *.tmp 40 | *.tmp_proj 41 | *.log 42 | *.vspscc 43 | *.vssscc 44 | .builds 45 | *.pidb 46 | *.log 47 | *.scc 48 | 49 | # Visual C++ cache files 50 | ipch/ 51 | *.aps 52 | *.ncb 53 | *.opensdf 54 | *.sdf 55 | *.cachefile 56 | 57 | # Visual Studio profiler 58 | *.psess 59 | *.vsp 60 | *.vspx 61 | 62 | # Guidance Automation Toolkit 63 | *.gpState 64 | 65 | # ReSharper is a .NET coding add-in 66 | _ReSharper*/ 67 | *.[Rr]e[Ss]harper 68 | 69 | # TeamCity is a build add-in 70 | _TeamCity* 71 | 72 | # DotCover is a Code Coverage Tool 73 | *.dotCover 74 | 75 | # NCrunch 76 | *.ncrunch* 77 | .*crunch*.local.xml 78 | 79 | # Installshield output folder 80 | [Ee]xpress/ 81 | 82 | # DocProject is a documentation generator add-in 83 | DocProject/buildhelp/ 84 | DocProject/Help/*.HxT 85 | DocProject/Help/*.HxC 86 | DocProject/Help/*.hhc 87 | DocProject/Help/*.hhk 88 | DocProject/Help/*.hhp 89 | DocProject/Help/Html2 90 | DocProject/Help/html 91 | 92 | # Click-Once directory 93 | publish/ 94 | 95 | # Publish Web Output 96 | *.Publish.xml 97 | 98 | # NuGet Packages Directory 99 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 100 | #packages/ 101 | 102 | # Windows Azure Build Output 103 | csx 104 | *.build.csdef 105 | 106 | # Windows Store app package directory 107 | AppPackages/ 108 | 109 | # Others 110 | sql/ 111 | *.Cache 112 | ClientBin/ 113 | [Ss]tyle[Cc]op.* 114 | ~$* 115 | *~ 116 | *.dbmdl 117 | *.[Pp]ublish.xml 118 | *.pfx 119 | *.publishsettings 120 | 121 | # RIA/Silverlight projects 122 | Generated_Code/ 123 | 124 | # Backup & report files from converting an old project file to a newer 125 | # Visual Studio version. Backup files are not needed, because we have git ;-) 126 | _UpgradeReport_Files/ 127 | Backup*/ 128 | UpgradeLog*.XML 129 | UpgradeLog*.htm 130 | 131 | # SQL Server files 132 | App_Data/*.mdf 133 | App_Data/*.ldf 134 | 135 | 136 | #LightSwitch generated files 137 | GeneratedArtifacts/ 138 | _Pvt_Extensions/ 139 | ModelManifest.xml 140 | 141 | # ========================= 142 | # Windows detritus 143 | # ========================= 144 | 145 | # Windows image file caches 146 | Thumbs.db 147 | ehthumbs.db 148 | 149 | # Folder config file 150 | Desktop.ini 151 | 152 | # Recycle Bin used on file shares 153 | $RECYCLE.BIN/ 154 | 155 | # Mac desktop service store files 156 | .DS_Store 157 | *.db 158 | -------------------------------------------------------------------------------- /Dependencies/SystemMetrics.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Dependencies/SystemMetrics.dll -------------------------------------------------------------------------------- /EmulatorChannel/Emulator.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {27CB49FB-0FBE-4C56-8DC0-18154840852D} 8 | Library 9 | Properties 10 | Emulator 11 | Emulator 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 55 | -------------------------------------------------------------------------------- /EmulatorChannel/EmulatorChannel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Xml.Serialization; 7 | 8 | namespace Emulator 9 | { 10 | public enum ChannelStatus 11 | { 12 | Unknown = -1, 13 | Normal = 0, 14 | Error 15 | } 16 | 17 | public class EmulatorChannel 18 | { 19 | public int Id { get; set; } 20 | public string Name { get; set; } 21 | public string MediaPath { get; set; } 22 | public int RtspPort { get; set; } 23 | public bool Enabled { get; set; } 24 | public ChannelStatus Status { get; set; } 25 | 26 | [XmlIgnore] 27 | public EmulatorEngine Engine { get; set; } 28 | 29 | public EmulatorChannel() 30 | { 31 | } 32 | 33 | public EmulatorChannel(int id, string name, string mediaPath, int rtspPort, bool enabled) 34 | { 35 | Id = id; 36 | Name = name; 37 | MediaPath = mediaPath; 38 | RtspPort = rtspPort; 39 | Enabled = enabled; 40 | Status = ChannelStatus.Unknown; 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /EmulatorChannel/EmulatorEngine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using System.Threading; 6 | 7 | namespace Emulator 8 | { 9 | public class EmulatorEngine : IDisposable 10 | { 11 | private IntPtr _RstpStreamLibPointer = IntPtr.Zero; 12 | private EmulatorChannel _ChannelInfo = null; 13 | 14 | // --------------------------------------------------------------------------- 15 | 16 | #region Public Methods 17 | 18 | public void Start() 19 | { 20 | try 21 | { 22 | if (!File.Exists(_ChannelInfo.MediaPath)) 23 | throw new InvalidOperationException("Invalid media file"); 24 | 25 | Console.WriteLine("Loading media (" + _ChannelInfo.MediaPath + ")..."); 26 | StartStream(); 27 | Console.WriteLine("Started stream on Port " + _ChannelInfo.RtspPort.ToString()); 28 | } 29 | catch 30 | { 31 | throw; 32 | } 33 | } 34 | 35 | public void Stop() 36 | { 37 | try 38 | { 39 | StopStream(); 40 | } 41 | catch 42 | { 43 | throw; 44 | } 45 | } 46 | 47 | public ChannelStatus GetChannelStatus() 48 | { 49 | try 50 | { 51 | return (RtspStreamerLib.GetStreamRateLib(_RstpStreamLibPointer) <= 0) ? 52 | ChannelStatus.Error : ChannelStatus.Normal; 53 | } 54 | catch 55 | { 56 | throw; 57 | } 58 | } 59 | 60 | public string GetVlcLibraryVersion() 61 | { 62 | try 63 | { 64 | return RtspStreamerLib.GetVlcVersion(_RstpStreamLibPointer); 65 | } 66 | catch 67 | { 68 | return ""; 69 | } 70 | } 71 | 72 | #endregion 73 | 74 | // --------------------------------------------------------------------------- 75 | 76 | public EmulatorEngine(string channelName, string mediaPath, int rtspPort, bool enabled) 77 | { 78 | _ChannelInfo = new EmulatorChannel(); 79 | _ChannelInfo.Name = channelName; 80 | _ChannelInfo.MediaPath = mediaPath; 81 | _ChannelInfo.RtspPort = rtspPort; 82 | _ChannelInfo.Enabled = enabled; 83 | 84 | try 85 | { 86 | _RstpStreamLibPointer = RtspStreamerLib.CreateRtspStreamerLib(); 87 | } 88 | catch 89 | { 90 | throw; 91 | } 92 | } 93 | 94 | ~EmulatorEngine() 95 | { 96 | Dispose(false); 97 | } 98 | 99 | public void Dispose() 100 | { 101 | Dispose(true); 102 | GC.SuppressFinalize(this); 103 | } 104 | 105 | protected virtual void Dispose(bool disposing) 106 | { 107 | if (disposing) 108 | { 109 | // free managed resources 110 | } 111 | // free native resources if there are any. 112 | RtspStreamerLib.DestroyRtspStreamerLib(_RstpStreamLibPointer); 113 | _RstpStreamLibPointer = IntPtr.Zero; 114 | } 115 | 116 | private void StartStream() 117 | { 118 | try 119 | { 120 | byte[] streamName = Encoding.UTF8.GetBytes(_ChannelInfo.Name); 121 | byte[] mediaPath = Encoding.UTF8.GetBytes(_ChannelInfo.MediaPath); 122 | 123 | RtspStreamerLib.StartStreamLib(_RstpStreamLibPointer, streamName, mediaPath, _ChannelInfo.RtspPort); 124 | } 125 | catch 126 | { 127 | throw; 128 | } 129 | } 130 | 131 | private void StopStream() 132 | { 133 | try 134 | { 135 | RtspStreamerLib.StopStreamLib(_RstpStreamLibPointer); 136 | } 137 | catch 138 | { 139 | throw; 140 | } 141 | } 142 | 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /EmulatorChannel/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Emulator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Emulator")] 13 | [assembly: AssemblyCopyright("Copyright © Inspired Technologies 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4bdc45db-f7fb-442e-8135-0d9b54ba3c5d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EmulatorChannel/RtspStreamLib.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Emulator 8 | { 9 | static class RtspStreamerLib 10 | { 11 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 12 | public static extern IntPtr CreateRtspStreamerLib(); 13 | 14 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 15 | public static extern void DestroyRtspStreamerLib(IntPtr lib); 16 | 17 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 18 | public static extern Int32 StartStreamLib(IntPtr lib, byte[] streamName, byte[] mediaPath, Int32 portNumber); 19 | 20 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 21 | public static extern void StopStreamLib(IntPtr lib); 22 | 23 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 24 | public static extern bool GetStreamStatusLib(IntPtr lib); 25 | 26 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 27 | public static extern Int32 GetStreamRateLib(IntPtr lib); 28 | 29 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 30 | public static extern IntPtr GetVlcVersionLib(IntPtr lib); 31 | 32 | public static string GetVlcVersion(IntPtr lib) 33 | { 34 | byte[] retPtr = new byte[64]; 35 | System.Runtime.InteropServices.Marshal.Copy(RtspStreamerLib.GetVlcVersionLib(lib), retPtr, 0, 64); 36 | return Encoding.UTF8.GetString(retPtr); 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Images/Icons/cctv_camera.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/Icons/cctv_camera.ico -------------------------------------------------------------------------------- /Images/Icons/wall-mount-camera-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/Icons/wall-mount-camera-32.png -------------------------------------------------------------------------------- /Images/add-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/add-24.png -------------------------------------------------------------------------------- /Images/camera-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/camera-24.png -------------------------------------------------------------------------------- /Images/close-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/close-24.png -------------------------------------------------------------------------------- /Images/delete-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/delete-24.png -------------------------------------------------------------------------------- /Images/help-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/help-24.png -------------------------------------------------------------------------------- /Images/info-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/info-24.png -------------------------------------------------------------------------------- /Images/modify-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/modify-24.png -------------------------------------------------------------------------------- /Images/open-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/open-24.png -------------------------------------------------------------------------------- /Images/pause-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/pause-24.png -------------------------------------------------------------------------------- /Images/settings-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/settings-24.png -------------------------------------------------------------------------------- /Images/start-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/start-24.png -------------------------------------------------------------------------------- /Images/stop-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/stop-24.png -------------------------------------------------------------------------------- /Images/support-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/support-24.png -------------------------------------------------------------------------------- /Images/wall-mount-camera-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/Images/wall-mount-camera-24.png -------------------------------------------------------------------------------- /IpCameraEmulator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IpCameraEmulatorStd", "IpCameraEmulatorStd\IpCameraEmulatorStd.csproj", "{783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RtspStreamerLib", "RtspStreamerLib\RtspStreamerLib.vcxproj", "{E96BBB68-A0D6-484D-87A3-E0844E9CD72C}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RtspStreamLibTest", "RtspStreamLibTest\RtspStreamLibTest.csproj", "{E9FFA4EB-8BB0-40E6-B177-16507C834467}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emulator", "EmulatorChannel\Emulator.csproj", "{27CB49FB-0FBE-4C56-8DC0-18154840852D}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|Mixed Platforms = Debug|Mixed Platforms 18 | Debug|Win32 = Debug|Win32 19 | Debug|x86 = Debug|x86 20 | Release|Any CPU = Release|Any CPU 21 | Release|Mixed Platforms = Release|Mixed Platforms 22 | Release|Win32 = Release|Win32 23 | Release|x86 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 29 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|Mixed Platforms.Build.0 = Debug|x86 30 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|Win32.ActiveCfg = Debug|x86 31 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|Win32.Build.0 = Debug|x86 32 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|x86.ActiveCfg = Debug|x86 33 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Debug|x86.Build.0 = Debug|x86 34 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 37 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|Mixed Platforms.Build.0 = Release|Any CPU 38 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|Win32.ActiveCfg = Release|x86 39 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|Win32.Build.0 = Release|x86 40 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|x86.ActiveCfg = Release|x86 41 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467}.Release|x86.Build.0 = Release|x86 42 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Debug|Any CPU.ActiveCfg = Debug|Win32 43 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 44 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 45 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Debug|Win32.ActiveCfg = Debug|Win32 46 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Debug|Win32.Build.0 = Debug|Win32 47 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Debug|x86.ActiveCfg = Debug|Win32 48 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Debug|x86.Build.0 = Debug|Win32 49 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Release|Any CPU.ActiveCfg = Release|Win32 50 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 51 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Release|Mixed Platforms.Build.0 = Release|Win32 52 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Release|Win32.ActiveCfg = Release|Win32 53 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Release|Win32.Build.0 = Release|Win32 54 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Release|x86.ActiveCfg = Release|Win32 55 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C}.Release|x86.Build.0 = Release|Win32 56 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 59 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|Mixed Platforms.Build.0 = Debug|x86 60 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|Win32.ActiveCfg = Debug|x86 61 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|Win32.Build.0 = Debug|x86 62 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|x86.ActiveCfg = Debug|x86 63 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Debug|x86.Build.0 = Debug|x86 64 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|Any CPU.Build.0 = Release|Any CPU 66 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|Mixed Platforms.ActiveCfg = Release|x86 67 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|Mixed Platforms.Build.0 = Release|x86 68 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|Win32.ActiveCfg = Release|x86 69 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|Win32.Build.0 = Release|x86 70 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|x86.ActiveCfg = Release|x86 71 | {E9FFA4EB-8BB0-40E6-B177-16507C834467}.Release|x86.Build.0 = Release|x86 72 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 73 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Debug|Any CPU.Build.0 = Debug|Any CPU 74 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 75 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 76 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Debug|Win32.ActiveCfg = Debug|Any CPU 77 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Debug|Win32.Build.0 = Debug|Any CPU 78 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Debug|x86.ActiveCfg = Debug|Any CPU 79 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|Any CPU.ActiveCfg = Release|Any CPU 80 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|Any CPU.Build.0 = Release|Any CPU 81 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 82 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|Mixed Platforms.Build.0 = Release|Any CPU 83 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|Win32.ActiveCfg = Release|Any CPU 84 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|Win32.Build.0 = Release|Any CPU 85 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|x86.ActiveCfg = Release|Any CPU 86 | {27CB49FB-0FBE-4C56-8DC0-18154840852D}.Release|x86.Build.0 = Release|Any CPU 87 | EndGlobalSection 88 | GlobalSection(SolutionProperties) = preSolution 89 | HideSolutionNode = FALSE 90 | EndGlobalSection 91 | EndGlobal 92 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/AboutBox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IpCameraEmulatorStd 2 | { 3 | partial class AboutBox 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | protected override void Dispose(bool disposing) 14 | { 15 | if (disposing && (components != null)) 16 | { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Windows Form Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | this.components = new System.ComponentModel.Container(); 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox)); 32 | this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 33 | this.labelProductName = new System.Windows.Forms.Label(); 34 | this.labelVersion = new System.Windows.Forms.Label(); 35 | this.labelCopyright = new System.Windows.Forms.Label(); 36 | this.labelCompanyName = new System.Windows.Forms.Label(); 37 | this.okButton = new System.Windows.Forms.Button(); 38 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 39 | this.labelLibVersion = new System.Windows.Forms.Label(); 40 | this.btnCopyToClipboard = new System.Windows.Forms.Button(); 41 | this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); 42 | this.tableLayoutPanel.SuspendLayout(); 43 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 44 | this.SuspendLayout(); 45 | // 46 | // tableLayoutPanel 47 | // 48 | this.tableLayoutPanel.ColumnCount = 2; 49 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.75179F)); 50 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 84.24821F)); 51 | this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); 52 | this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); 53 | this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); 54 | this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); 55 | this.tableLayoutPanel.Controls.Add(this.pictureBox1, 0, 0); 56 | this.tableLayoutPanel.Controls.Add(this.labelLibVersion, 1, 4); 57 | this.tableLayoutPanel.Controls.Add(this.btnCopyToClipboard, 1, 5); 58 | this.tableLayoutPanel.Controls.Add(this.okButton, 1, 6); 59 | this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; 60 | this.tableLayoutPanel.Location = new System.Drawing.Point(10, 10); 61 | this.tableLayoutPanel.Name = "tableLayoutPanel"; 62 | this.tableLayoutPanel.RowCount = 7; 63 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.49414F)); 64 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.49415F)); 65 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.49415F)); 66 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15.74261F)); 67 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 17.24138F)); 68 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 18.74047F)); 69 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.7931F)); 70 | this.tableLayoutPanel.Size = new System.Drawing.Size(396, 188); 71 | this.tableLayoutPanel.TabIndex = 0; 72 | // 73 | // labelProductName 74 | // 75 | this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; 76 | this.labelProductName.Location = new System.Drawing.Point(69, 0); 77 | this.labelProductName.Margin = new System.Windows.Forms.Padding(7, 0, 3, 0); 78 | this.labelProductName.MaximumSize = new System.Drawing.Size(0, 20); 79 | this.labelProductName.Name = "labelProductName"; 80 | this.labelProductName.Size = new System.Drawing.Size(324, 20); 81 | this.labelProductName.TabIndex = 19; 82 | this.labelProductName.Text = "Product Name"; 83 | this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 84 | // 85 | // labelVersion 86 | // 87 | this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; 88 | this.labelVersion.Location = new System.Drawing.Point(69, 21); 89 | this.labelVersion.Margin = new System.Windows.Forms.Padding(7, 0, 3, 0); 90 | this.labelVersion.MaximumSize = new System.Drawing.Size(0, 20); 91 | this.labelVersion.Name = "labelVersion"; 92 | this.labelVersion.Size = new System.Drawing.Size(324, 20); 93 | this.labelVersion.TabIndex = 0; 94 | this.labelVersion.Text = "Version"; 95 | this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 96 | // 97 | // labelCopyright 98 | // 99 | this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; 100 | this.labelCopyright.Location = new System.Drawing.Point(69, 42); 101 | this.labelCopyright.Margin = new System.Windows.Forms.Padding(7, 0, 3, 0); 102 | this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 20); 103 | this.labelCopyright.Name = "labelCopyright"; 104 | this.labelCopyright.Size = new System.Drawing.Size(324, 20); 105 | this.labelCopyright.TabIndex = 21; 106 | this.labelCopyright.Text = "Copyright"; 107 | this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 108 | // 109 | // labelCompanyName 110 | // 111 | this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; 112 | this.labelCompanyName.Location = new System.Drawing.Point(69, 63); 113 | this.labelCompanyName.Margin = new System.Windows.Forms.Padding(7, 0, 3, 0); 114 | this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 20); 115 | this.labelCompanyName.Name = "labelCompanyName"; 116 | this.labelCompanyName.Size = new System.Drawing.Size(324, 20); 117 | this.labelCompanyName.TabIndex = 22; 118 | this.labelCompanyName.Text = "Company Name"; 119 | this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 120 | // 121 | // okButton 122 | // 123 | this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 124 | this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 125 | this.okButton.Location = new System.Drawing.Point(306, 162); 126 | this.okButton.Name = "okButton"; 127 | this.okButton.Size = new System.Drawing.Size(87, 23); 128 | this.okButton.TabIndex = 24; 129 | this.okButton.Text = "&OK"; 130 | // 131 | // pictureBox1 132 | // 133 | this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); 134 | this.pictureBox1.Location = new System.Drawing.Point(12, 3); 135 | this.pictureBox1.Margin = new System.Windows.Forms.Padding(12, 3, 3, 3); 136 | this.pictureBox1.Name = "pictureBox1"; 137 | this.tableLayoutPanel.SetRowSpan(this.pictureBox1, 2); 138 | this.pictureBox1.Size = new System.Drawing.Size(47, 36); 139 | this.pictureBox1.TabIndex = 25; 140 | this.pictureBox1.TabStop = false; 141 | // 142 | // labelLibVersion 143 | // 144 | this.labelLibVersion.AutoSize = true; 145 | this.labelLibVersion.Location = new System.Drawing.Point(69, 92); 146 | this.labelLibVersion.Margin = new System.Windows.Forms.Padding(7, 0, 3, 0); 147 | this.labelLibVersion.Name = "labelLibVersion"; 148 | this.labelLibVersion.Size = new System.Drawing.Size(85, 15); 149 | this.labelLibVersion.TabIndex = 26; 150 | this.labelLibVersion.Text = "Library Version"; 151 | // 152 | // btnCopyToClipboard 153 | // 154 | this.btnCopyToClipboard.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 155 | this.btnCopyToClipboard.Location = new System.Drawing.Point(306, 133); 156 | this.btnCopyToClipboard.Name = "btnCopyToClipboard"; 157 | this.btnCopyToClipboard.Size = new System.Drawing.Size(87, 23); 158 | this.btnCopyToClipboard.TabIndex = 27; 159 | this.btnCopyToClipboard.Text = "Copy"; 160 | this.toolTip1.SetToolTip(this.btnCopyToClipboard, "Copy About Info to Clipboard"); 161 | this.btnCopyToClipboard.UseVisualStyleBackColor = true; 162 | this.btnCopyToClipboard.Click += new System.EventHandler(this.btnCopyToClipboard_Click); 163 | // 164 | // AboutBox 165 | // 166 | this.AcceptButton = this.okButton; 167 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 168 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 169 | this.ClientSize = new System.Drawing.Size(416, 208); 170 | this.Controls.Add(this.tableLayoutPanel); 171 | this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 172 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 173 | this.MaximizeBox = false; 174 | this.MinimizeBox = false; 175 | this.Name = "AboutBox"; 176 | this.Padding = new System.Windows.Forms.Padding(10); 177 | this.ShowIcon = false; 178 | this.ShowInTaskbar = false; 179 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 180 | this.Text = "AboutBox"; 181 | this.Load += new System.EventHandler(this.AboutBox_Load); 182 | this.tableLayoutPanel.ResumeLayout(false); 183 | this.tableLayoutPanel.PerformLayout(); 184 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 185 | this.ResumeLayout(false); 186 | 187 | } 188 | 189 | #endregion 190 | 191 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 192 | private System.Windows.Forms.Label labelProductName; 193 | private System.Windows.Forms.Label labelVersion; 194 | private System.Windows.Forms.Label labelCopyright; 195 | private System.Windows.Forms.Label labelCompanyName; 196 | private System.Windows.Forms.Button okButton; 197 | private System.Windows.Forms.PictureBox pictureBox1; 198 | private System.Windows.Forms.Label labelLibVersion; 199 | private System.Windows.Forms.Button btnCopyToClipboard; 200 | private System.Windows.Forms.ToolTip toolTip1; 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/AboutBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using Emulator; 11 | using SystemMetrics; 12 | 13 | namespace IpCameraEmulatorStd 14 | { 15 | partial class AboutBox : Form 16 | { 17 | public AboutBox() 18 | { 19 | try 20 | { 21 | InitializeComponent(); 22 | this.Text = String.Format("About {0}", AssemblyTitle); 23 | this.labelProductName.Text = AssemblyProduct; 24 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); 25 | this.labelCopyright.Text = AssemblyCopyright; 26 | this.labelCompanyName.Text = AssemblyCompany; 27 | 28 | EmulatorEngine testEngine = new EmulatorEngine("test", string.Empty, 554, true); 29 | this.labelLibVersion.Text = "VLC Library Version: " + testEngine.GetVlcLibraryVersion(); 30 | testEngine.Dispose(); 31 | } 32 | catch (Exception ex) 33 | { 34 | MessageBox.Show(ex.ToString()); 35 | } 36 | } 37 | 38 | #region Assembly Attribute Accessors 39 | 40 | public string AssemblyTitle 41 | { 42 | get 43 | { 44 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 45 | if (attributes.Length > 0) 46 | { 47 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 48 | if (titleAttribute.Title != "") 49 | { 50 | return titleAttribute.Title; 51 | } 52 | } 53 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 54 | } 55 | } 56 | 57 | public string AssemblyVersion 58 | { 59 | get 60 | { 61 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 62 | } 63 | } 64 | 65 | public string AssemblyDescription 66 | { 67 | get 68 | { 69 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 70 | if (attributes.Length == 0) 71 | { 72 | return ""; 73 | } 74 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 75 | } 76 | } 77 | 78 | public string AssemblyProduct 79 | { 80 | get 81 | { 82 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 83 | if (attributes.Length == 0) 84 | { 85 | return ""; 86 | } 87 | return ((AssemblyProductAttribute)attributes[0]).Product; 88 | } 89 | } 90 | 91 | public string AssemblyCopyright 92 | { 93 | get 94 | { 95 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 96 | if (attributes.Length == 0) 97 | { 98 | return ""; 99 | } 100 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 101 | } 102 | } 103 | 104 | public string AssemblyCompany 105 | { 106 | get 107 | { 108 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 109 | if (attributes.Length == 0) 110 | { 111 | return ""; 112 | } 113 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 114 | } 115 | } 116 | #endregion 117 | 118 | private void AboutBox_Load(object sender, EventArgs e) 119 | { 120 | this.Text = "About IP Camera Emulator"; 121 | } 122 | 123 | private void btnCopyToClipboard_Click(object sender, EventArgs e) 124 | { 125 | try 126 | { 127 | StringBuilder sb = new StringBuilder(); 128 | sb.Append(this.labelProductName.Text + Environment.NewLine); 129 | sb.Append(this.labelVersion.Text + Environment.NewLine); 130 | sb.Append(this.labelCompanyName.Text + Environment.NewLine); 131 | sb.Append(this.labelLibVersion.Text + Environment.NewLine); 132 | sb.Append("Emulator library version: " + typeof(EmulatorChannel).Assembly.GetName().Version.ToString() + Environment.NewLine); 133 | sb.Append("SystemMetrics library version: " + typeof(OsMetrics).Assembly.GetName().Version.ToString() + Environment.NewLine); 134 | sb.Append("OS: " + OsMetrics.GetOSVersion() + " (" + 135 | (Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit") + ")" + Environment.NewLine); 136 | sb.Append("DotNet Framework: " + Environment.Version + Environment.NewLine); 137 | sb.Append("System Resources: CPU - " + Environment.ProcessorCount.ToString() + 138 | "-core, Memory: " + (OsMetrics.GetInstalledPhysicalMemory() / 1024).ToString("0") + " MB" + Environment.NewLine); 139 | Clipboard.Clear(); 140 | Clipboard.SetText(sb.ToString()); 141 | } 142 | catch (Exception ex) 143 | { 144 | MessageBox.Show(ex.ToString()); 145 | } 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/AboutBox.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 | YQUAAAAJcEhZcwAADr4AAA6+AepCscAAAAHVSURBVFhH7dQ7SxxRGMbx1RiNmkQR/Qg2fgBBEESRQKJ4 125 | aywECwsbL4hKCguLFKms/QIJ+QQxaiGigqi5FIoSgiCCiRcURGwsxPyf3XnhMOy4M7PGIswDP/bMmTnz 126 | zuw5c1JJkvzveYK6TPNxU4R+/MQpyvAoeYoB7OPOMYF/mmIM4gBW9BdmvPYxSvHgKcEQDmGF99AHzb+y 127 | CfWPpY8eKHqbURzBCm+jF4Vw0wad/4O8/4VyjEN/qRX+gR4UIFvU/xW6Vg8dK8/xFlrRVngLHQgq7EbX 128 | acxvPFNH2LzEFM5hhdfxGlGiv15ToPHD6ggTvdkurPAqWhEl+v61+Ny1MofQGYEG7aSPwkdTNokTWOHv 129 | 6ETglGnLnIcN8HuFXHkBTdkZbJzWSjtyrpVluAX91hCUCkzjAnb9Bt4gdJqhgXp6fW6WSlxC51rU4aQK 130 | 72DnXbGit9Rgd+/WCta2qv4VdZAavMcVrOASmpzjWNE8a7C7d8/Cbiofce0cL6IRFuuPHc2dbqBdq8tr 131 | 3+CT1zZf0AB/7HzsuHu3LSpNiTYlHX9GPYKS9wPoc/kGu9GC16dUe7/3Je8HULpxiw/QgosSe4D75Ize 132 | uDbTjJxsBf2SJEniJZX6CyZ/paWJ/UQSAAAAAElFTkSuQmCC 133 | 134 | 135 | 136 | 17, 17 137 | 138 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormChannel.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IpCameraEmulatorStd 2 | { 3 | partial class FormChannel 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.label3 = new System.Windows.Forms.Label(); 33 | this.label4 = new System.Windows.Forms.Label(); 34 | this.chkChannelEnabled = new System.Windows.Forms.CheckBox(); 35 | this.lblBatchAddition = new System.Windows.Forms.Label(); 36 | this.updChannelQty = new System.Windows.Forms.NumericUpDown(); 37 | this.txtVideoFilePath = new System.Windows.Forms.TextBox(); 38 | this.updRtspPort = new System.Windows.Forms.NumericUpDown(); 39 | this.btnBrowse = new System.Windows.Forms.Button(); 40 | this.txtChannelName = new System.Windows.Forms.TextBox(); 41 | this.label1 = new System.Windows.Forms.Label(); 42 | this.txtChannelIndex = new System.Windows.Forms.TextBox(); 43 | this.lblChannelIndex = new System.Windows.Forms.Label(); 44 | this.btnAdd = new System.Windows.Forms.Button(); 45 | this.btnCancel = new System.Windows.Forms.Button(); 46 | this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 47 | this.toolTips = new System.Windows.Forms.ToolTip(this.components); 48 | ((System.ComponentModel.ISupportInitialize)(this.updChannelQty)).BeginInit(); 49 | ((System.ComponentModel.ISupportInitialize)(this.updRtspPort)).BeginInit(); 50 | this.SuspendLayout(); 51 | // 52 | // label3 53 | // 54 | this.label3.AutoSize = true; 55 | this.label3.Location = new System.Drawing.Point(42, 110); 56 | this.label3.Name = "label3"; 57 | this.label3.Size = new System.Drawing.Size(61, 15); 58 | this.label3.TabIndex = 2; 59 | this.label3.Text = "Video File:"; 60 | // 61 | // label4 62 | // 63 | this.label4.AutoSize = true; 64 | this.label4.Location = new System.Drawing.Point(36, 149); 65 | this.label4.Name = "label4"; 66 | this.label4.Size = new System.Drawing.Size(62, 15); 67 | this.label4.TabIndex = 3; 68 | this.label4.Text = "RTSP Port:"; 69 | // 70 | // chkChannelEnabled 71 | // 72 | this.chkChannelEnabled.AutoSize = true; 73 | this.chkChannelEnabled.Checked = true; 74 | this.chkChannelEnabled.CheckState = System.Windows.Forms.CheckState.Checked; 75 | this.chkChannelEnabled.Location = new System.Drawing.Point(114, 193); 76 | this.chkChannelEnabled.Name = "chkChannelEnabled"; 77 | this.chkChannelEnabled.Size = new System.Drawing.Size(68, 19); 78 | this.chkChannelEnabled.TabIndex = 6; 79 | this.chkChannelEnabled.Text = "Enabled"; 80 | this.chkChannelEnabled.UseVisualStyleBackColor = true; 81 | // 82 | // lblBatchAddition 83 | // 84 | this.lblBatchAddition.AutoSize = true; 85 | this.lblBatchAddition.Location = new System.Drawing.Point(241, 28); 86 | this.lblBatchAddition.Name = "lblBatchAddition"; 87 | this.lblBatchAddition.Size = new System.Drawing.Size(89, 15); 88 | this.lblBatchAddition.TabIndex = 5; 89 | this.lblBatchAddition.Text = "Batch Addition:"; 90 | // 91 | // updChannelQty 92 | // 93 | this.updChannelQty.Location = new System.Drawing.Point(336, 24); 94 | this.updChannelQty.Maximum = new decimal(new int[] { 95 | 10, 96 | 0, 97 | 0, 98 | 0}); 99 | this.updChannelQty.Minimum = new decimal(new int[] { 100 | 1, 101 | 0, 102 | 0, 103 | 0}); 104 | this.updChannelQty.Name = "updChannelQty"; 105 | this.updChannelQty.Size = new System.Drawing.Size(65, 23); 106 | this.updChannelQty.TabIndex = 1; 107 | this.updChannelQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 108 | this.toolTips.SetToolTip(this.updChannelQty, "Add more than one channel at a time"); 109 | this.updChannelQty.Value = new decimal(new int[] { 110 | 1, 111 | 0, 112 | 0, 113 | 0}); 114 | // 115 | // txtVideoFilePath 116 | // 117 | this.txtVideoFilePath.Location = new System.Drawing.Point(114, 106); 118 | this.txtVideoFilePath.MaxLength = 255; 119 | this.txtVideoFilePath.Name = "txtVideoFilePath"; 120 | this.txtVideoFilePath.Size = new System.Drawing.Size(251, 23); 121 | this.txtVideoFilePath.TabIndex = 3; 122 | // 123 | // updRtspPort 124 | // 125 | this.updRtspPort.Location = new System.Drawing.Point(114, 147); 126 | this.updRtspPort.Maximum = new decimal(new int[] { 127 | 65535, 128 | 0, 129 | 0, 130 | 0}); 131 | this.updRtspPort.Minimum = new decimal(new int[] { 132 | 100, 133 | 0, 134 | 0, 135 | 0}); 136 | this.updRtspPort.Name = "updRtspPort"; 137 | this.updRtspPort.Size = new System.Drawing.Size(87, 23); 138 | this.updRtspPort.TabIndex = 5; 139 | this.updRtspPort.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 140 | this.toolTips.SetToolTip(this.updRtspPort, "Each channel requires a unique RTSP server port"); 141 | this.updRtspPort.Value = new decimal(new int[] { 142 | 8554, 143 | 0, 144 | 0, 145 | 0}); 146 | this.updRtspPort.ValueChanged += new System.EventHandler(this.updRtspPort_ValueChanged); 147 | // 148 | // btnBrowse 149 | // 150 | this.btnBrowse.Location = new System.Drawing.Point(373, 104); 151 | this.btnBrowse.Name = "btnBrowse"; 152 | this.btnBrowse.Size = new System.Drawing.Size(36, 27); 153 | this.btnBrowse.TabIndex = 4; 154 | this.btnBrowse.Text = "..."; 155 | this.btnBrowse.UseVisualStyleBackColor = true; 156 | this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); 157 | // 158 | // txtChannelName 159 | // 160 | this.txtChannelName.Location = new System.Drawing.Point(114, 63); 161 | this.txtChannelName.MaxLength = 32; 162 | this.txtChannelName.Name = "txtChannelName"; 163 | this.txtChannelName.Size = new System.Drawing.Size(251, 23); 164 | this.txtChannelName.TabIndex = 2; 165 | // 166 | // label1 167 | // 168 | this.label1.AutoSize = true; 169 | this.label1.Location = new System.Drawing.Point(14, 67); 170 | this.label1.Name = "label1"; 171 | this.label1.Size = new System.Drawing.Size(89, 15); 172 | this.label1.TabIndex = 11; 173 | this.label1.Text = "Channel Name:"; 174 | // 175 | // txtChannelIndex 176 | // 177 | this.txtChannelIndex.Location = new System.Drawing.Point(114, 24); 178 | this.txtChannelIndex.MaxLength = 4; 179 | this.txtChannelIndex.Name = "txtChannelIndex"; 180 | this.txtChannelIndex.Size = new System.Drawing.Size(88, 23); 181 | this.txtChannelIndex.TabIndex = 0; 182 | // 183 | // lblChannelIndex 184 | // 185 | this.lblChannelIndex.AutoSize = true; 186 | this.lblChannelIndex.Location = new System.Drawing.Point(16, 28); 187 | this.lblChannelIndex.Name = "lblChannelIndex"; 188 | this.lblChannelIndex.Size = new System.Drawing.Size(85, 15); 189 | this.lblChannelIndex.TabIndex = 13; 190 | this.lblChannelIndex.Text = "Channel Index:"; 191 | // 192 | // btnAdd 193 | // 194 | this.btnAdd.Location = new System.Drawing.Point(114, 252); 195 | this.btnAdd.Name = "btnAdd"; 196 | this.btnAdd.Size = new System.Drawing.Size(87, 27); 197 | this.btnAdd.TabIndex = 7; 198 | this.btnAdd.Text = "Add"; 199 | this.btnAdd.UseVisualStyleBackColor = true; 200 | this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); 201 | // 202 | // btnCancel 203 | // 204 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 205 | this.btnCancel.Location = new System.Drawing.Point(233, 252); 206 | this.btnCancel.Name = "btnCancel"; 207 | this.btnCancel.Size = new System.Drawing.Size(87, 27); 208 | this.btnCancel.TabIndex = 8; 209 | this.btnCancel.Text = "Cancel"; 210 | this.btnCancel.UseVisualStyleBackColor = true; 211 | // 212 | // FormChannel 213 | // 214 | this.AcceptButton = this.btnAdd; 215 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 216 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 217 | this.CancelButton = this.btnCancel; 218 | this.ClientSize = new System.Drawing.Size(429, 302); 219 | this.Controls.Add(this.btnCancel); 220 | this.Controls.Add(this.btnAdd); 221 | this.Controls.Add(this.txtChannelIndex); 222 | this.Controls.Add(this.lblChannelIndex); 223 | this.Controls.Add(this.txtChannelName); 224 | this.Controls.Add(this.label1); 225 | this.Controls.Add(this.btnBrowse); 226 | this.Controls.Add(this.updRtspPort); 227 | this.Controls.Add(this.txtVideoFilePath); 228 | this.Controls.Add(this.updChannelQty); 229 | this.Controls.Add(this.lblBatchAddition); 230 | this.Controls.Add(this.chkChannelEnabled); 231 | this.Controls.Add(this.label4); 232 | this.Controls.Add(this.label3); 233 | this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 234 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 235 | this.MaximizeBox = false; 236 | this.MinimizeBox = false; 237 | this.Name = "FormChannel"; 238 | this.ShowIcon = false; 239 | this.ShowInTaskbar = false; 240 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 241 | this.Text = "Add Channel"; 242 | this.Load += new System.EventHandler(this.FormChannel_Load); 243 | this.Shown += new System.EventHandler(this.FormChannel_Shown); 244 | ((System.ComponentModel.ISupportInitialize)(this.updChannelQty)).EndInit(); 245 | ((System.ComponentModel.ISupportInitialize)(this.updRtspPort)).EndInit(); 246 | this.ResumeLayout(false); 247 | this.PerformLayout(); 248 | 249 | } 250 | 251 | #endregion 252 | 253 | private System.Windows.Forms.Label label3; 254 | private System.Windows.Forms.Label label4; 255 | private System.Windows.Forms.CheckBox chkChannelEnabled; 256 | private System.Windows.Forms.Label lblBatchAddition; 257 | private System.Windows.Forms.NumericUpDown updChannelQty; 258 | private System.Windows.Forms.TextBox txtVideoFilePath; 259 | private System.Windows.Forms.NumericUpDown updRtspPort; 260 | private System.Windows.Forms.Button btnBrowse; 261 | private System.Windows.Forms.TextBox txtChannelName; 262 | private System.Windows.Forms.Label label1; 263 | private System.Windows.Forms.TextBox txtChannelIndex; 264 | private System.Windows.Forms.Label lblChannelIndex; 265 | private System.Windows.Forms.Button btnAdd; 266 | private System.Windows.Forms.Button btnCancel; 267 | private System.Windows.Forms.OpenFileDialog openFileDialog; 268 | private System.Windows.Forms.ToolTip toolTips; 269 | } 270 | } -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormChannel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.IO; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using Emulator; 12 | 13 | namespace IpCameraEmulatorStd 14 | { 15 | public partial class FormChannel : Form 16 | { 17 | private const string urlPrefix = "rtsp://:"; 18 | 19 | public bool _EditMode; 20 | public Collection CurrentChannels { get; set; } 21 | public Collection AllChannels { get; set; } 22 | 23 | public void SetEditMode(bool editMode, EmulatorChannel currentChannel) 24 | { 25 | _EditMode = editMode; 26 | this.Text = _EditMode ? "Edit Channel" : "Add Channel"; 27 | btnAdd.Text = _EditMode ? "Update" : "Add"; 28 | lblBatchAddition.Visible = updChannelQty.Visible = !_EditMode; 29 | lblChannelIndex.Visible = txtChannelIndex.Visible = _EditMode; 30 | 31 | if (_EditMode) 32 | { 33 | if (CurrentChannels == null) 34 | CurrentChannels = new Collection(); 35 | else 36 | CurrentChannels.Clear(); 37 | CurrentChannels.Add(currentChannel); 38 | 39 | updChannelQty.Value = 1; 40 | updChannelQty.Enabled = false; 41 | txtChannelIndex.Text = currentChannel.Id.ToString(); 42 | txtChannelIndex.Enabled = false; 43 | txtChannelName.Text = currentChannel.Name; 44 | txtVideoFilePath.Text = currentChannel.MediaPath; 45 | updRtspPort.Value = currentChannel.RtspPort; 46 | chkChannelEnabled.Checked = currentChannel.Enabled; 47 | } 48 | } 49 | 50 | public FormChannel() 51 | { 52 | InitializeComponent(); 53 | _EditMode = false; 54 | } 55 | 56 | private void FormChannel_Load(object sender, EventArgs e) 57 | { 58 | UpdatePortTooltip(); 59 | } 60 | 61 | private void FormChannel_Shown(object sender, EventArgs e) 62 | { 63 | if (!_EditMode) 64 | { 65 | txtChannelName.Focus(); 66 | } 67 | } 68 | 69 | private void btnAdd_Click(object sender, EventArgs e) 70 | { 71 | string messageTitle = _EditMode ? "Modify Channel" : "Add Channel"; 72 | 73 | if (!File.Exists(txtVideoFilePath.Text)) 74 | { 75 | txtVideoFilePath.Focus(); 76 | MessageBox.Show("Invalid Video File", messageTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 77 | return; 78 | } 79 | if (CheckForDuplicatedRtspPort()) 80 | { 81 | updRtspPort.Focus(); 82 | MessageBox.Show("RTSP Port " + updRtspPort.Value.ToString() + " has been assigned." + Environment.NewLine, 83 | messageTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 84 | return; 85 | } 86 | 87 | if (!_EditMode) 88 | { 89 | if (CurrentChannels == null) 90 | { 91 | CurrentChannels = new Collection(); 92 | } 93 | int rtspPort = (int)updRtspPort.Value; 94 | for (int i = 0; i < updChannelQty.Value; i++) 95 | { 96 | CurrentChannels.Add(new EmulatorChannel(0, txtChannelName.Text, txtVideoFilePath.Text, 97 | rtspPort++, chkChannelEnabled.Checked)); 98 | } 99 | } 100 | else 101 | { 102 | if (CurrentChannels != null && CurrentChannels.Count > 0) 103 | { 104 | CurrentChannels[0].Name = txtChannelName.Text; 105 | CurrentChannels[0].MediaPath = txtVideoFilePath.Text; 106 | CurrentChannels[0].RtspPort = (int)updRtspPort.Value; 107 | CurrentChannels[0].Enabled = chkChannelEnabled.Checked; 108 | } 109 | } 110 | this.DialogResult = System.Windows.Forms.DialogResult.OK; 111 | this.Close(); 112 | } 113 | 114 | private bool CheckForDuplicatedRtspPort() 115 | { 116 | if (AllChannels != null) 117 | { 118 | foreach (EmulatorChannel channel in AllChannels) 119 | { 120 | if (_EditMode) 121 | { 122 | if (CurrentChannels != null && CurrentChannels.Count > 0) 123 | { 124 | if (channel.Id != CurrentChannels[0].Id) 125 | { 126 | if (channel.RtspPort == (int)updRtspPort.Value) 127 | return true; 128 | } 129 | } 130 | } 131 | else 132 | { 133 | if (channel.RtspPort == (int)updRtspPort.Value) 134 | { 135 | return true; 136 | } 137 | } 138 | } 139 | } 140 | return false; 141 | } 142 | 143 | private void btnBrowse_Click(object sender, EventArgs e) 144 | { 145 | openFileDialog.Title = "Select Video File"; 146 | openFileDialog.Filter = "AVI File (*.avi)|*.avi|MP4 File (*.mp4)|*.mp4|M4V File (*.m4v)|*.m4v"; 147 | openFileDialog.FilterIndex = 2; 148 | openFileDialog.Multiselect = false; 149 | 150 | if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) 151 | { 152 | txtVideoFilePath.Text = openFileDialog.FileName; 153 | } 154 | } 155 | 156 | private void updRtspPort_ValueChanged(object sender, EventArgs e) 157 | { 158 | UpdatePortTooltip(); 159 | } 160 | 161 | private void UpdatePortTooltip() 162 | { 163 | toolTips.SetToolTip(updRtspPort, "Connect to this channel using the following URL:" + 164 | Environment.NewLine + 165 | "rtsp://:" + ((int)updRtspPort.Value).ToString() + "/" + 166 | Environment.NewLine + Environment.NewLine + 167 | "Each channel requires a unique RTSP server port."); 168 | } 169 | 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormChannel.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 150, 17 122 | 123 | 124 | 17, 17 125 | 126 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormMain.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IpCameraEmulatorStd 2 | { 3 | partial class FormMain 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); 33 | this.tsMain = new System.Windows.Forms.ToolStrip(); 34 | this.tbAdd = new System.Windows.Forms.ToolStripButton(); 35 | this.tbEdit = new System.Windows.Forms.ToolStripButton(); 36 | this.tbDelete = new System.Windows.Forms.ToolStripButton(); 37 | this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); 38 | this.tbSettings = new System.Windows.Forms.ToolStripButton(); 39 | this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); 40 | this.tbStart = new System.Windows.Forms.ToolStripButton(); 41 | this.tssbInfo = new System.Windows.Forms.ToolStripSplitButton(); 42 | this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 43 | this.tmrGetStatus = new System.Windows.Forms.Timer(this.components); 44 | this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components); 45 | this.channelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 46 | this.tsmiEnableChannel = new System.Windows.Forms.ToolStripMenuItem(); 47 | this.tsmiDisableChannel = new System.Windows.Forms.ToolStripMenuItem(); 48 | this.statusStripMain = new System.Windows.Forms.StatusStrip(); 49 | this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel(); 50 | this.tsslCpuLabel = new System.Windows.Forms.ToolStripStatusLabel(); 51 | this.tsslCpuUsage = new System.Windows.Forms.ToolStripStatusLabel(); 52 | this.tsslMemLabel = new System.Windows.Forms.ToolStripStatusLabel(); 53 | this.tsslMemoryUsage = new System.Windows.Forms.ToolStripStatusLabel(); 54 | this.tsslNetLabel = new System.Windows.Forms.ToolStripStatusLabel(); 55 | this.tsslNwUsage = new System.Windows.Forms.ToolStripStatusLabel(); 56 | this.lvMain = new System.Windows.Forms.ListView(); 57 | this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 58 | this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 59 | this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 60 | this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 61 | this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 62 | this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 63 | this.tsMain.SuspendLayout(); 64 | this.cmsMain.SuspendLayout(); 65 | this.statusStripMain.SuspendLayout(); 66 | this.SuspendLayout(); 67 | // 68 | // tsMain 69 | // 70 | this.tsMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; 71 | this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 72 | this.tbAdd, 73 | this.tbEdit, 74 | this.tbDelete, 75 | this.toolStripSeparator1, 76 | this.tbSettings, 77 | this.toolStripSeparator2, 78 | this.tbStart, 79 | this.tssbInfo}); 80 | this.tsMain.Location = new System.Drawing.Point(0, 0); 81 | this.tsMain.Name = "tsMain"; 82 | this.tsMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; 83 | this.tsMain.Size = new System.Drawing.Size(982, 46); 84 | this.tsMain.TabIndex = 0; 85 | this.tsMain.Text = "toolStrip1"; 86 | // 87 | // tbAdd 88 | // 89 | this.tbAdd.Image = ((System.Drawing.Image)(resources.GetObject("tbAdd.Image"))); 90 | this.tbAdd.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; 91 | this.tbAdd.ImageTransparentColor = System.Drawing.Color.Magenta; 92 | this.tbAdd.Name = "tbAdd"; 93 | this.tbAdd.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); 94 | this.tbAdd.Size = new System.Drawing.Size(45, 43); 95 | this.tbAdd.Text = " Add "; 96 | this.tbAdd.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; 97 | this.tbAdd.ToolTipText = "Add Channel"; 98 | this.tbAdd.Click += new System.EventHandler(this.tbAdd_Click); 99 | // 100 | // tbEdit 101 | // 102 | this.tbEdit.Enabled = false; 103 | this.tbEdit.Image = ((System.Drawing.Image)(resources.GetObject("tbEdit.Image"))); 104 | this.tbEdit.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; 105 | this.tbEdit.ImageTransparentColor = System.Drawing.Color.Magenta; 106 | this.tbEdit.Name = "tbEdit"; 107 | this.tbEdit.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); 108 | this.tbEdit.Size = new System.Drawing.Size(43, 43); 109 | this.tbEdit.Text = " Edit "; 110 | this.tbEdit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; 111 | this.tbEdit.ToolTipText = "Edit Channel Properties"; 112 | this.tbEdit.Click += new System.EventHandler(this.tbEdit_Click); 113 | // 114 | // tbDelete 115 | // 116 | this.tbDelete.Enabled = false; 117 | this.tbDelete.Image = ((System.Drawing.Image)(resources.GetObject("tbDelete.Image"))); 118 | this.tbDelete.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; 119 | this.tbDelete.ImageTransparentColor = System.Drawing.Color.Magenta; 120 | this.tbDelete.Name = "tbDelete"; 121 | this.tbDelete.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); 122 | this.tbDelete.Size = new System.Drawing.Size(50, 43); 123 | this.tbDelete.Text = "Delete"; 124 | this.tbDelete.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; 125 | this.tbDelete.ToolTipText = "Delete Channel"; 126 | this.tbDelete.Click += new System.EventHandler(this.tbDelete_Click); 127 | // 128 | // toolStripSeparator1 129 | // 130 | this.toolStripSeparator1.Name = "toolStripSeparator1"; 131 | this.toolStripSeparator1.Size = new System.Drawing.Size(6, 46); 132 | // 133 | // tbSettings 134 | // 135 | this.tbSettings.Image = ((System.Drawing.Image)(resources.GetObject("tbSettings.Image"))); 136 | this.tbSettings.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; 137 | this.tbSettings.ImageTransparentColor = System.Drawing.Color.Magenta; 138 | this.tbSettings.Name = "tbSettings"; 139 | this.tbSettings.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); 140 | this.tbSettings.Size = new System.Drawing.Size(59, 43); 141 | this.tbSettings.Text = "Settings"; 142 | this.tbSettings.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; 143 | this.tbSettings.ToolTipText = "Settings"; 144 | this.tbSettings.Click += new System.EventHandler(this.tbSettings_Click); 145 | // 146 | // toolStripSeparator2 147 | // 148 | this.toolStripSeparator2.Name = "toolStripSeparator2"; 149 | this.toolStripSeparator2.Size = new System.Drawing.Size(6, 46); 150 | // 151 | // tbStart 152 | // 153 | this.tbStart.Image = ((System.Drawing.Image)(resources.GetObject("tbStart.Image"))); 154 | this.tbStart.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; 155 | this.tbStart.ImageTransparentColor = System.Drawing.Color.Magenta; 156 | this.tbStart.Name = "tbStart"; 157 | this.tbStart.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0); 158 | this.tbStart.Size = new System.Drawing.Size(41, 43); 159 | this.tbStart.Tag = "false"; 160 | this.tbStart.Text = "Start"; 161 | this.tbStart.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; 162 | this.tbStart.ToolTipText = "Start Emulator Service"; 163 | this.tbStart.Click += new System.EventHandler(this.tbStart_Click); 164 | // 165 | // tssbInfo 166 | // 167 | this.tssbInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; 168 | this.tssbInfo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 169 | this.aboutToolStripMenuItem}); 170 | this.tssbInfo.Image = ((System.Drawing.Image)(resources.GetObject("tssbInfo.Image"))); 171 | this.tssbInfo.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; 172 | this.tssbInfo.ImageTransparentColor = System.Drawing.Color.Magenta; 173 | this.tssbInfo.Name = "tssbInfo"; 174 | this.tssbInfo.Size = new System.Drawing.Size(44, 43); 175 | this.tssbInfo.Text = "Info"; 176 | this.tssbInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; 177 | this.tssbInfo.ButtonClick += new System.EventHandler(this.tssbInfo_ButtonClick); 178 | // 179 | // aboutToolStripMenuItem 180 | // 181 | this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; 182 | this.aboutToolStripMenuItem.Size = new System.Drawing.Size(116, 22); 183 | this.aboutToolStripMenuItem.Text = "About..."; 184 | this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); 185 | // 186 | // tmrGetStatus 187 | // 188 | this.tmrGetStatus.Interval = 1000; 189 | this.tmrGetStatus.Tick += new System.EventHandler(this.tmrGetStatus_Tick); 190 | // 191 | // cmsMain 192 | // 193 | this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 194 | this.channelToolStripMenuItem}); 195 | this.cmsMain.Name = "cmsMain"; 196 | this.cmsMain.Size = new System.Drawing.Size(119, 26); 197 | // 198 | // channelToolStripMenuItem 199 | // 200 | this.channelToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 201 | this.tsmiEnableChannel, 202 | this.tsmiDisableChannel}); 203 | this.channelToolStripMenuItem.Name = "channelToolStripMenuItem"; 204 | this.channelToolStripMenuItem.Size = new System.Drawing.Size(118, 22); 205 | this.channelToolStripMenuItem.Text = "Channel"; 206 | // 207 | // tsmiEnableChannel 208 | // 209 | this.tsmiEnableChannel.Name = "tsmiEnableChannel"; 210 | this.tsmiEnableChannel.Size = new System.Drawing.Size(112, 22); 211 | this.tsmiEnableChannel.Text = "Enable"; 212 | this.tsmiEnableChannel.Click += new System.EventHandler(this.tsmiEnableChannel_Click); 213 | // 214 | // tsmiDisableChannel 215 | // 216 | this.tsmiDisableChannel.Name = "tsmiDisableChannel"; 217 | this.tsmiDisableChannel.Size = new System.Drawing.Size(112, 22); 218 | this.tsmiDisableChannel.Text = "Disable"; 219 | this.tsmiDisableChannel.Click += new System.EventHandler(this.tsmiDisableChannel_Click); 220 | // 221 | // statusStripMain 222 | // 223 | this.statusStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 224 | this.tsslStatus, 225 | this.tsslCpuLabel, 226 | this.tsslCpuUsage, 227 | this.tsslMemLabel, 228 | this.tsslMemoryUsage, 229 | this.tsslNetLabel, 230 | this.tsslNwUsage}); 231 | this.statusStripMain.Location = new System.Drawing.Point(0, 334); 232 | this.statusStripMain.Name = "statusStripMain"; 233 | this.statusStripMain.Size = new System.Drawing.Size(982, 23); 234 | this.statusStripMain.TabIndex = 3; 235 | this.statusStripMain.Text = "statusStripMain"; 236 | // 237 | // tsslStatus 238 | // 239 | this.tsslStatus.Name = "tsslStatus"; 240 | this.tsslStatus.Size = new System.Drawing.Size(715, 18); 241 | this.tsslStatus.Spring = true; 242 | // 243 | // tsslCpuLabel 244 | // 245 | this.tsslCpuLabel.Name = "tsslCpuLabel"; 246 | this.tsslCpuLabel.Size = new System.Drawing.Size(33, 18); 247 | this.tsslCpuLabel.Text = "CPU:"; 248 | // 249 | // tsslCpuUsage 250 | // 251 | this.tsslCpuUsage.AutoSize = false; 252 | this.tsslCpuUsage.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) 253 | | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) 254 | | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); 255 | this.tsslCpuUsage.BorderStyle = System.Windows.Forms.Border3DStyle.Etched; 256 | this.tsslCpuUsage.Name = "tsslCpuUsage"; 257 | this.tsslCpuUsage.Size = new System.Drawing.Size(50, 18); 258 | this.tsslCpuUsage.Text = " "; 259 | this.tsslCpuUsage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 260 | // 261 | // tsslMemLabel 262 | // 263 | this.tsslMemLabel.Name = "tsslMemLabel"; 264 | this.tsslMemLabel.Size = new System.Drawing.Size(38, 18); 265 | this.tsslMemLabel.Text = "MEM:"; 266 | // 267 | // tsslMemoryUsage 268 | // 269 | this.tsslMemoryUsage.AutoSize = false; 270 | this.tsslMemoryUsage.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) 271 | | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) 272 | | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); 273 | this.tsslMemoryUsage.BorderStyle = System.Windows.Forms.Border3DStyle.Etched; 274 | this.tsslMemoryUsage.Name = "tsslMemoryUsage"; 275 | this.tsslMemoryUsage.Size = new System.Drawing.Size(50, 18); 276 | this.tsslMemoryUsage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 277 | // 278 | // tsslNetLabel 279 | // 280 | this.tsslNetLabel.Name = "tsslNetLabel"; 281 | this.tsslNetLabel.Size = new System.Drawing.Size(31, 18); 282 | this.tsslNetLabel.Text = "NET:"; 283 | // 284 | // tsslNwUsage 285 | // 286 | this.tsslNwUsage.AutoSize = false; 287 | this.tsslNwUsage.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) 288 | | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) 289 | | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); 290 | this.tsslNwUsage.BorderStyle = System.Windows.Forms.Border3DStyle.Etched; 291 | this.tsslNwUsage.Name = "tsslNwUsage"; 292 | this.tsslNwUsage.Size = new System.Drawing.Size(50, 18); 293 | this.tsslNwUsage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 294 | // 295 | // lvMain 296 | // 297 | this.lvMain.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 298 | this.columnHeader1, 299 | this.columnHeader6, 300 | this.columnHeader2, 301 | this.columnHeader3, 302 | this.columnHeader4, 303 | this.columnHeader5}); 304 | this.lvMain.Dock = System.Windows.Forms.DockStyle.Fill; 305 | this.lvMain.FullRowSelect = true; 306 | this.lvMain.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; 307 | this.lvMain.HideSelection = false; 308 | this.lvMain.Location = new System.Drawing.Point(0, 46); 309 | this.lvMain.Name = "lvMain"; 310 | this.lvMain.Size = new System.Drawing.Size(982, 288); 311 | this.lvMain.TabIndex = 4; 312 | this.lvMain.UseCompatibleStateImageBehavior = false; 313 | this.lvMain.View = System.Windows.Forms.View.Details; 314 | this.lvMain.SelectedIndexChanged += new System.EventHandler(this.lvMain_SelectedIndexChanged); 315 | this.lvMain.DoubleClick += new System.EventHandler(this.lvMain_DoubleClick); 316 | this.lvMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvMain_MouseClick); 317 | // 318 | // columnHeader1 319 | // 320 | this.columnHeader1.Text = "Channel"; 321 | this.columnHeader1.Width = 65; 322 | // 323 | // columnHeader6 324 | // 325 | this.columnHeader6.Text = "Name"; 326 | this.columnHeader6.Width = 123; 327 | // 328 | // columnHeader2 329 | // 330 | this.columnHeader2.Text = "Video File"; 331 | this.columnHeader2.Width = 321; 332 | // 333 | // columnHeader3 334 | // 335 | this.columnHeader3.Text = "Port"; 336 | this.columnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 337 | this.columnHeader3.Width = 83; 338 | // 339 | // columnHeader4 340 | // 341 | this.columnHeader4.Text = "Enabled"; 342 | this.columnHeader4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 343 | this.columnHeader4.Width = 78; 344 | // 345 | // columnHeader5 346 | // 347 | this.columnHeader5.Text = "Status"; 348 | this.columnHeader5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 349 | this.columnHeader5.Width = 134; 350 | // 351 | // FormMain 352 | // 353 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 354 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 355 | this.ClientSize = new System.Drawing.Size(982, 357); 356 | this.Controls.Add(this.lvMain); 357 | this.Controls.Add(this.statusStripMain); 358 | this.Controls.Add(this.tsMain); 359 | this.DoubleBuffered = true; 360 | this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 361 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 362 | this.Name = "FormMain"; 363 | this.Text = "IP Camera Emulator"; 364 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing); 365 | this.Load += new System.EventHandler(this.FormMain_Load); 366 | this.Shown += new System.EventHandler(this.FormMain_Shown); 367 | this.tsMain.ResumeLayout(false); 368 | this.tsMain.PerformLayout(); 369 | this.cmsMain.ResumeLayout(false); 370 | this.statusStripMain.ResumeLayout(false); 371 | this.statusStripMain.PerformLayout(); 372 | this.ResumeLayout(false); 373 | this.PerformLayout(); 374 | 375 | } 376 | 377 | #endregion 378 | 379 | private System.Windows.Forms.ToolStrip tsMain; 380 | private System.Windows.Forms.ToolStripButton tbAdd; 381 | private System.Windows.Forms.ToolStripButton tbEdit; 382 | private System.Windows.Forms.ToolStripButton tbDelete; 383 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; 384 | private System.Windows.Forms.ToolStripButton tbSettings; 385 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; 386 | private System.Windows.Forms.ToolStripButton tbStart; 387 | private System.Windows.Forms.Timer tmrGetStatus; 388 | private System.Windows.Forms.ContextMenuStrip cmsMain; 389 | private System.Windows.Forms.ToolStripMenuItem channelToolStripMenuItem; 390 | private System.Windows.Forms.ToolStripMenuItem tsmiEnableChannel; 391 | private System.Windows.Forms.ToolStripMenuItem tsmiDisableChannel; 392 | private System.Windows.Forms.StatusStrip statusStripMain; 393 | private System.Windows.Forms.ToolStripStatusLabel tsslStatus; 394 | private System.Windows.Forms.ToolStripStatusLabel tsslCpuLabel; 395 | private System.Windows.Forms.ToolStripStatusLabel tsslCpuUsage; 396 | private System.Windows.Forms.ToolStripStatusLabel tsslMemLabel; 397 | private System.Windows.Forms.ToolStripStatusLabel tsslMemoryUsage; 398 | private System.Windows.Forms.ToolStripStatusLabel tsslNetLabel; 399 | private System.Windows.Forms.ToolStripStatusLabel tsslNwUsage; 400 | private System.Windows.Forms.ListView lvMain; 401 | private System.Windows.Forms.ColumnHeader columnHeader1; 402 | private System.Windows.Forms.ColumnHeader columnHeader6; 403 | private System.Windows.Forms.ColumnHeader columnHeader2; 404 | private System.Windows.Forms.ColumnHeader columnHeader3; 405 | private System.Windows.Forms.ColumnHeader columnHeader4; 406 | private System.Windows.Forms.ColumnHeader columnHeader5; 407 | private System.Windows.Forms.ToolStripSplitButton tssbInfo; 408 | private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; 409 | } 410 | } 411 | 412 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormMain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using Emulator; 12 | using SystemMetrics; 13 | 14 | namespace IpCameraEmulatorStd 15 | { 16 | public partial class FormMain : Form 17 | { 18 | private SystemConfiguration _AppSettings = new SystemConfiguration(@"IpCameraEmulatorStd"); 19 | private Collection _Channels = null; 20 | private bool _EmulatorStarted = false; 21 | private bool _AutoStart = false; 22 | 23 | public FormMain() 24 | { 25 | InitializeComponent(); 26 | Utilities.DoubleBuffered(lvMain, true); // to eliminate flickering when the listview is updated 27 | } 28 | 29 | private void FormMain_Load(object sender, EventArgs e) 30 | { 31 | try 32 | { 33 | LoadApplicationSettings(); 34 | DisplaySystemResourceUsage(_AppSettings.ShowSystemResourceUsage); 35 | _Channels = _AppSettings.Channels; 36 | RefreshChannelsList(); 37 | 38 | string[] args = Environment.GetCommandLineArgs(); 39 | if (args != null && args.Length > 1) 40 | { 41 | if (args[1].Equals(@"-autostart", StringComparison.InvariantCultureIgnoreCase)) 42 | { 43 | _AutoStart = true; 44 | } 45 | } 46 | } 47 | catch (Exception ex) 48 | { 49 | MessageBox.Show(ex.ToString()); 50 | } 51 | } 52 | 53 | private void FormMain_Shown(object sender, EventArgs e) 54 | { 55 | if (_AutoStart) 56 | { 57 | tbStart.PerformClick(); 58 | } 59 | } 60 | 61 | private void FormMain_FormClosing(object sender, FormClosingEventArgs e) 62 | { 63 | SaveApplicationSettings(); 64 | } 65 | 66 | private bool LoadApplicationSettings() 67 | { 68 | try 69 | { 70 | if (_AppSettings == null) 71 | throw new InvalidOperationException(); 72 | 73 | if (!_AppSettings.Load()) 74 | return false; 75 | else 76 | { 77 | if (_AppSettings.WindowLocation.X >= 0 && 78 | _AppSettings.WindowLocation.X < Screen.FromControl(this).Bounds.Width && 79 | _AppSettings.WindowLocation.Y >= 0 && 80 | _AppSettings.WindowLocation.Y < Screen.FromControl(this).Bounds.Height) 81 | { 82 | this.Location = _AppSettings.WindowLocation; 83 | } 84 | 85 | if (_AppSettings.WindowSize.Width > 0 && _AppSettings.WindowSize.Height > 0) 86 | { 87 | this.Size = _AppSettings.WindowSize; 88 | } 89 | 90 | if (_AppSettings.AppWIndowState != FormWindowState.Minimized) 91 | { 92 | this.WindowState = _AppSettings.AppWIndowState; 93 | } 94 | 95 | return true; 96 | } 97 | } 98 | catch 99 | { 100 | throw; 101 | } 102 | } 103 | 104 | private bool SaveApplicationSettings() 105 | { 106 | try 107 | { 108 | if (_AppSettings == null) 109 | throw new InvalidOperationException(); 110 | 111 | _AppSettings.AppWIndowState = this.WindowState; 112 | _AppSettings.WindowLocation = this.Location; 113 | 114 | if (this.WindowState != FormWindowState.Normal) 115 | _AppSettings.WindowSize = new Size(this.RestoreBounds.Width, this.RestoreBounds.Height); 116 | else 117 | _AppSettings.WindowSize = new Size(this.Width, this.Height); 118 | 119 | return _AppSettings.Save(); 120 | } 121 | catch 122 | { 123 | throw; 124 | } 125 | } 126 | 127 | private void tbAdd_Click(object sender, EventArgs e) 128 | { 129 | try 130 | { 131 | using (FormChannel channelForm = new FormChannel()) 132 | { 133 | channelForm.SetEditMode(false, null); 134 | channelForm.AllChannels = _Channels; 135 | if (channelForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) 136 | { 137 | Collection newChannels = channelForm.CurrentChannels; 138 | if (newChannels != null && newChannels.Count > 0) 139 | { 140 | int nextChannelIndex = GetNextChannelIndex(); 141 | foreach (EmulatorChannel newChannel in newChannels) 142 | { 143 | newChannel.Id = nextChannelIndex++; 144 | if (string.IsNullOrWhiteSpace(newChannel.Name)) 145 | { 146 | newChannel.Name = "Channel " + newChannel.Id.ToString(); 147 | } 148 | _Channels.Add(newChannel); 149 | } 150 | } 151 | RefreshChannelsList(); 152 | SaveApplicationSettings(); 153 | } 154 | } 155 | } 156 | catch (Exception ex) 157 | { 158 | MessageBox.Show(ex.ToString()); 159 | } 160 | } 161 | 162 | private void RefreshChannelsList() 163 | { 164 | try 165 | { 166 | lvMain.Items.Clear(); 167 | if (_Channels != null) 168 | { 169 | foreach (EmulatorChannel channel in _Channels) 170 | { 171 | ListViewItem item = lvMain.Items.Add(channel.Id.ToString()); 172 | item.UseItemStyleForSubItems = false; 173 | item.ForeColor = channel.Enabled ? Color.Black : Color.Silver; 174 | ListViewItem.ListViewSubItem subItem = item.SubItems.Add(channel.Name); 175 | subItem.ForeColor = channel.Enabled ? Color.Black : Color.Silver; 176 | subItem = item.SubItems.Add(channel.MediaPath); 177 | subItem.ForeColor = channel.Enabled ? Color.Black : Color.Silver; 178 | subItem = item.SubItems.Add(channel.RtspPort.ToString()); 179 | subItem.ForeColor = channel.Enabled ? Color.Black : Color.Silver; 180 | subItem = item.SubItems.Add(channel.Enabled ? "Enabled" : "Disabled"); 181 | subItem.ForeColor = channel.Enabled ? Color.Black : Color.Silver; 182 | subItem = item.SubItems.Add(string.Empty); 183 | subItem.ForeColor = channel.Enabled ? Color.Black : Color.Silver; 184 | item.Tag = channel; 185 | } 186 | } 187 | } 188 | catch 189 | { 190 | throw; 191 | } 192 | } 193 | 194 | private int GetNextChannelIndex() 195 | { 196 | try 197 | { 198 | if (_Channels != null && _Channels.Count > 0) 199 | { 200 | int lastIndex = 0; 201 | List indices = new List(); 202 | foreach (EmulatorChannel channel in _Channels) 203 | { 204 | indices.Add(channel.Id); 205 | } 206 | lastIndex = indices.Max() + 1; 207 | return lastIndex; 208 | } 209 | else 210 | return 1; 211 | } 212 | catch 213 | { 214 | throw; 215 | } 216 | } 217 | 218 | private void lvMain_SelectedIndexChanged(object sender, EventArgs e) 219 | { 220 | tbEdit.Enabled = tbDelete.Enabled = (lvMain.SelectedItems.Count == 1 && !_EmulatorStarted); 221 | } 222 | 223 | private void lvMain_DoubleClick(object sender, EventArgs e) 224 | { 225 | EditChannel(); 226 | } 227 | 228 | private void tbEdit_Click(object sender, EventArgs e) 229 | { 230 | EditChannel(); 231 | } 232 | 233 | private void EditChannel() 234 | { 235 | try 236 | { 237 | if (lvMain.SelectedItems.Count > 0 && !_EmulatorStarted) 238 | { 239 | EmulatorChannel selectedChannel = (EmulatorChannel)lvMain.SelectedItems[0].Tag; 240 | if (selectedChannel == null) 241 | return; 242 | 243 | using (FormChannel editChannelForm = new FormChannel()) 244 | { 245 | editChannelForm.SetEditMode(true, selectedChannel); 246 | editChannelForm.AllChannels = _Channels; 247 | if (editChannelForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) 248 | { 249 | if (editChannelForm.CurrentChannels != null && editChannelForm.CurrentChannels.Count > 0) 250 | { 251 | EmulatorChannel updatedChannel = editChannelForm.CurrentChannels[0]; 252 | foreach (EmulatorChannel channel in _Channels) 253 | { 254 | if (channel.Id == updatedChannel.Id) 255 | { 256 | channel.Name = updatedChannel.Name; 257 | channel.MediaPath = updatedChannel.MediaPath; 258 | channel.RtspPort = updatedChannel.RtspPort; 259 | channel.Enabled = updatedChannel.Enabled; 260 | } 261 | } 262 | } 263 | RefreshChannelsList(); 264 | SaveApplicationSettings(); 265 | } 266 | } 267 | } 268 | } 269 | catch (Exception ex) 270 | { 271 | MessageBox.Show(ex.ToString()); 272 | } 273 | } 274 | 275 | private void tbDelete_Click(object sender, EventArgs e) 276 | { 277 | try 278 | { 279 | if (lvMain.SelectedItems.Count > 0) 280 | { 281 | if (lvMain.SelectedItems == null || lvMain.SelectedItems.Count == 0) 282 | return; 283 | else 284 | { 285 | string channelName = (lvMain.SelectedItems[0].Tag is EmulatorChannel) ? 286 | ((EmulatorChannel)lvMain.SelectedItems[0].Tag).Name + " ?" : string.Empty; 287 | if (MessageBox.Show("Are you sure you want to delete" + Environment.NewLine + channelName, 288 | "Delete Channel", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == 289 | System.Windows.Forms.DialogResult.Yes) 290 | { 291 | foreach (ListViewItem selectedItem in lvMain.SelectedItems) 292 | { 293 | if (selectedItem.Tag is EmulatorChannel) 294 | { 295 | _Channels.Remove((EmulatorChannel)selectedItem.Tag); 296 | } 297 | } 298 | RefreshChannelsList(); 299 | SaveApplicationSettings(); 300 | } 301 | } 302 | } 303 | } 304 | catch (Exception ex) 305 | { 306 | MessageBox.Show(ex.ToString()); 307 | } 308 | } 309 | 310 | private void tbStart_Click(object sender, EventArgs e) 311 | { 312 | tbStart.Enabled = false; 313 | try 314 | { 315 | if (tbStart.Text.StartsWith("Start")) 316 | { 317 | DisplayPendingChannelStatuses(); 318 | StartEmulator(); 319 | _EmulatorStarted = true; 320 | LockUI(true); 321 | tbStart.Text = "Stop"; 322 | tbStart.Image = Properties.Resources.stop; 323 | tbStart.ToolTipText = "Stop Emulator Service"; 324 | tmrGetStatus.Enabled = true; 325 | } 326 | else 327 | { 328 | tmrGetStatus.Enabled = false; 329 | StopEmulator(); 330 | tbStart.Text = "Start"; 331 | tbStart.Image = Properties.Resources.start; 332 | tbStart.ToolTipText = "Start Emulator Service"; 333 | tsslCpuUsage.Text = tsslMemoryUsage.Text = string.Empty; 334 | ClearChannelStatuses(); 335 | _EmulatorStarted = false; 336 | LockUI(false); 337 | } 338 | } 339 | catch (Exception ex) 340 | { 341 | MessageBox.Show(ex.ToString()); 342 | } 343 | finally 344 | { 345 | tbStart.Enabled = true; 346 | } 347 | } 348 | 349 | private void LockUI(bool disableConfiguration) 350 | { 351 | if (disableConfiguration) 352 | { 353 | tbAdd.Enabled = tbEdit.Enabled = tbDelete.Enabled = tbSettings.Enabled = false; 354 | } 355 | else 356 | { 357 | tbAdd.Enabled = tbSettings.Enabled = true; 358 | tbEdit.Enabled = tbDelete.Enabled = (lvMain.SelectedItems.Count == 1); 359 | } 360 | } 361 | 362 | private void StartEmulator() 363 | { 364 | try 365 | { 366 | if (_Channels != null) 367 | { 368 | foreach (EmulatorChannel channel in _Channels) 369 | { 370 | if (channel.Enabled) 371 | { 372 | channel.Engine = new EmulatorEngine(channel.Name, channel.MediaPath, channel.RtspPort, channel.Enabled); 373 | Task.Run(delegate 374 | { 375 | channel.Engine.Start(); 376 | }); 377 | } 378 | } 379 | } 380 | } 381 | catch 382 | { 383 | throw; 384 | } 385 | } 386 | 387 | private void StopEmulator() 388 | { 389 | try 390 | { 391 | if (_Channels != null) 392 | { 393 | foreach (EmulatorChannel channel in _Channels) 394 | { 395 | if (channel.Engine != null) 396 | { 397 | Task.Run(delegate 398 | { 399 | channel.Engine.Stop(); 400 | }); 401 | } 402 | } 403 | } 404 | } 405 | catch 406 | { 407 | throw; 408 | } 409 | } 410 | 411 | private void tmrGetStatus_Tick(object sender, EventArgs e) 412 | { 413 | lvMain.BeginUpdate(); 414 | 415 | try 416 | { 417 | foreach (ListViewItem item in lvMain.Items) 418 | { 419 | if (item.Tag is EmulatorChannel) 420 | { 421 | EmulatorChannel channel = (EmulatorChannel)item.Tag; 422 | if (channel.Engine != null && channel.Enabled) 423 | { 424 | channel.Status = channel.Engine.GetChannelStatus(); 425 | switch (channel.Status) 426 | { 427 | case ChannelStatus.Unknown: 428 | item.SubItems[5].Text = string.Empty; 429 | break; 430 | 431 | case ChannelStatus.Normal: 432 | item.SubItems[5].Text = "Streaming"; 433 | break; 434 | 435 | default: 436 | item.SubItems[5].Text = channel.Status.ToString(); 437 | break; 438 | } 439 | item.SubItems[5].ForeColor = (channel.Status == ChannelStatus.Normal) ? Color.Green : Color.Red; 440 | } 441 | else 442 | { 443 | item.SubItems[5].Text = string.Empty; 444 | } 445 | } 446 | } 447 | 448 | if (_AppSettings.ShowSystemResourceUsage) 449 | { 450 | tsslCpuUsage.Text = OsMetrics.GetCpuUsage().ToString() + " %"; 451 | tsslMemoryUsage.Text = OsMetrics.GetMemoryUsage().ToString() + " %"; 452 | } 453 | } 454 | catch (Exception ex) 455 | { 456 | Console.WriteLine(ex.ToString()); 457 | } 458 | finally 459 | { 460 | lvMain.EndUpdate(); 461 | } 462 | } 463 | 464 | private void ClearChannelStatuses() 465 | { 466 | foreach (ListViewItem item in lvMain.Items) 467 | { 468 | item.SubItems[5].Text = string.Empty; 469 | } 470 | } 471 | 472 | private void DisplayPendingChannelStatuses() 473 | { 474 | foreach (ListViewItem item in lvMain.Items) 475 | { 476 | if (item.Tag is EmulatorChannel && ((EmulatorChannel)item.Tag).Enabled) 477 | { 478 | item.SubItems[5].ForeColor = Color.Silver; 479 | item.SubItems[5].Text = "Initalizing..."; 480 | } 481 | else 482 | { 483 | item.SubItems[5].Text = string.Empty; 484 | } 485 | } 486 | } 487 | 488 | private void lvMain_MouseClick(object sender, MouseEventArgs e) 489 | { 490 | if (e.Button == MouseButtons.Right && !_EmulatorStarted) 491 | { 492 | if (lvMain.FocusedItem.Bounds.Contains(e.Location) == true) 493 | { 494 | cmsMain.Show(Cursor.Position); 495 | } 496 | } 497 | } 498 | 499 | private void tsmiEnableChannel_Click(object sender, EventArgs e) 500 | { 501 | if (lvMain.SelectedItems.Count > 0) 502 | { 503 | foreach (ListViewItem selectedItem in lvMain.SelectedItems) 504 | { 505 | if (selectedItem.Tag is EmulatorChannel) 506 | { 507 | EmulatorChannel selectedChannel = (EmulatorChannel)selectedItem.Tag; 508 | selectedChannel.Enabled = true; 509 | } 510 | } 511 | RefreshChannelsList(); 512 | SaveApplicationSettings(); 513 | } 514 | } 515 | 516 | private void tsmiDisableChannel_Click(object sender, EventArgs e) 517 | { 518 | if (lvMain.SelectedItems.Count > 0) 519 | { 520 | foreach (ListViewItem selectedItem in lvMain.SelectedItems) 521 | { 522 | if (selectedItem.Tag is EmulatorChannel) 523 | { 524 | EmulatorChannel selectedChannel = (EmulatorChannel)selectedItem.Tag; 525 | selectedChannel.Enabled = false; 526 | } 527 | } 528 | RefreshChannelsList(); 529 | SaveApplicationSettings(); 530 | } 531 | } 532 | 533 | private void tbSettings_Click(object sender, EventArgs e) 534 | { 535 | using (FormSettings settingsForm = new FormSettings(_AppSettings)) 536 | { 537 | if (settingsForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) 538 | { 539 | SaveApplicationSettings(); 540 | DisplaySystemResourceUsage(_AppSettings.ShowSystemResourceUsage); 541 | } 542 | } 543 | } 544 | 545 | private void DisplaySystemResourceUsage(bool enable) 546 | { 547 | tsslCpuLabel.Visible = tsslCpuUsage.Visible = tsslMemLabel.Visible = tsslMemoryUsage.Visible = 548 | tsslNetLabel.Visible = tsslNwUsage.Visible = enable; 549 | } 550 | 551 | private void aboutToolStripMenuItem_Click(object sender, EventArgs e) 552 | { 553 | using (AboutBox aboutBox = new AboutBox()) 554 | { 555 | aboutBox.ShowDialog(); 556 | } 557 | } 558 | 559 | private void tssbInfo_ButtonClick(object sender, EventArgs e) 560 | { 561 | tssbInfo.ShowDropDown(); 562 | } 563 | 564 | } 565 | } 566 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormSettings.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IpCameraEmulatorStd 2 | { 3 | partial class FormSettings 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.btnCancel = new System.Windows.Forms.Button(); 32 | this.btnApply = new System.Windows.Forms.Button(); 33 | this.chkShowSystemResourceUsage = new System.Windows.Forms.CheckBox(); 34 | this.SuspendLayout(); 35 | // 36 | // btnCancel 37 | // 38 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 39 | this.btnCancel.Location = new System.Drawing.Point(216, 106); 40 | this.btnCancel.Name = "btnCancel"; 41 | this.btnCancel.Size = new System.Drawing.Size(87, 25); 42 | this.btnCancel.TabIndex = 10; 43 | this.btnCancel.Text = "Cancel"; 44 | this.btnCancel.UseVisualStyleBackColor = true; 45 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 46 | // 47 | // btnApply 48 | // 49 | this.btnApply.Location = new System.Drawing.Point(97, 106); 50 | this.btnApply.Name = "btnApply"; 51 | this.btnApply.Size = new System.Drawing.Size(87, 25); 52 | this.btnApply.TabIndex = 9; 53 | this.btnApply.Text = "Apply"; 54 | this.btnApply.UseVisualStyleBackColor = true; 55 | this.btnApply.Click += new System.EventHandler(this.btnApply_Click); 56 | // 57 | // chkShowSystemResourceUsage 58 | // 59 | this.chkShowSystemResourceUsage.AutoSize = true; 60 | this.chkShowSystemResourceUsage.Location = new System.Drawing.Point(35, 26); 61 | this.chkShowSystemResourceUsage.Name = "chkShowSystemResourceUsage"; 62 | this.chkShowSystemResourceUsage.Size = new System.Drawing.Size(164, 17); 63 | this.chkShowSystemResourceUsage.TabIndex = 11; 64 | this.chkShowSystemResourceUsage.Text = "Show system resource usage"; 65 | this.chkShowSystemResourceUsage.UseVisualStyleBackColor = true; 66 | // 67 | // FormSettings 68 | // 69 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 70 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 71 | this.ClientSize = new System.Drawing.Size(398, 152); 72 | this.Controls.Add(this.chkShowSystemResourceUsage); 73 | this.Controls.Add(this.btnCancel); 74 | this.Controls.Add(this.btnApply); 75 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 76 | this.MaximizeBox = false; 77 | this.MinimizeBox = false; 78 | this.Name = "FormSettings"; 79 | this.ShowInTaskbar = false; 80 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 81 | this.Text = "Settings"; 82 | this.Load += new System.EventHandler(this.FormSettings_Load); 83 | this.ResumeLayout(false); 84 | this.PerformLayout(); 85 | 86 | } 87 | 88 | #endregion 89 | 90 | private System.Windows.Forms.Button btnCancel; 91 | private System.Windows.Forms.Button btnApply; 92 | private System.Windows.Forms.CheckBox chkShowSystemResourceUsage; 93 | } 94 | } -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace IpCameraEmulatorStd 12 | { 13 | public partial class FormSettings : Form 14 | { 15 | SystemConfiguration _Config = null; 16 | 17 | public FormSettings(SystemConfiguration config) 18 | { 19 | InitializeComponent(); 20 | _Config = config; 21 | } 22 | 23 | private void FormSettings_Load(object sender, EventArgs e) 24 | { 25 | chkShowSystemResourceUsage.Checked = (_Config != null) ? _Config.ShowSystemResourceUsage : false; 26 | } 27 | 28 | private void btnCancel_Click(object sender, EventArgs e) 29 | { 30 | this.DialogResult = System.Windows.Forms.DialogResult.Cancel; 31 | this.Close(); 32 | } 33 | 34 | private void btnApply_Click(object sender, EventArgs e) 35 | { 36 | _Config.ShowSystemResourceUsage = chkShowSystemResourceUsage.Checked; 37 | this.DialogResult = System.Windows.Forms.DialogResult.OK; 38 | this.Close(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/FormSettings.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/IpCameraEmulatorStd.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {783C4C47-2CD0-404C-A2EA-B1CD3EA3A467} 8 | WinExe 9 | Properties 10 | IpCameraEmulatorStd 11 | IpCameraEmulatorStd 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | true 36 | bin\x86\Debug\ 37 | DEBUG;TRACE 38 | full 39 | x86 40 | prompt 41 | MinimumRecommendedRules.ruleset 42 | true 43 | 44 | 45 | bin\x86\Release\ 46 | TRACE 47 | true 48 | pdbonly 49 | x86 50 | prompt 51 | MinimumRecommendedRules.ruleset 52 | true 53 | 54 | 55 | cctv_camera.ico 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | False 70 | ..\Dependencies\SystemMetrics.dll 71 | 72 | 73 | 74 | 75 | Form 76 | 77 | 78 | AboutBox.cs 79 | 80 | 81 | Form 82 | 83 | 84 | FormChannel.cs 85 | 86 | 87 | Form 88 | 89 | 90 | FormMain.cs 91 | 92 | 93 | Form 94 | 95 | 96 | FormSettings.cs 97 | 98 | 99 | 100 | 101 | 102 | 103 | AboutBox.cs 104 | 105 | 106 | FormChannel.cs 107 | 108 | 109 | FormMain.cs 110 | 111 | 112 | FormSettings.cs 113 | 114 | 115 | ResXFileCodeGenerator 116 | Resources.Designer.cs 117 | Designer 118 | 119 | 120 | True 121 | Resources.resx 122 | True 123 | 124 | 125 | SettingsSingleFileGenerator 126 | Settings.Designer.cs 127 | 128 | 129 | True 130 | Settings.settings 131 | True 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | {27cb49fb-0fbe-4c56-8dc0-18154840852d} 140 | Emulator 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 156 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading; 4 | using System.Windows.Forms; 5 | 6 | namespace IpCameraEmulatorStd 7 | { 8 | static class Program 9 | { 10 | private static string appGuid = "01CD8ADA-E692-4971-98F9-B8E709037768"; 11 | 12 | /// 13 | /// The main entry point for the application. 14 | /// 15 | [STAThread] 16 | static void Main() 17 | { 18 | using (Mutex mutex = new Mutex(false, "Global\\" + appGuid)) 19 | { 20 | // Allow running one and only one instance 21 | if (!mutex.WaitOne(0, false)) 22 | { 23 | MessageBox.Show("Application already running", "IP Camera Emulator", 24 | MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 25 | return; 26 | } 27 | Application.EnableVisualStyles(); 28 | Application.SetCompatibleTextRenderingDefault(false); 29 | Application.Run(new FormMain()); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("IpCameraEmulatorStd")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("IpCameraEmulatorStd")] 13 | [assembly: AssemblyCopyright("Copyright © Inspired Technologies 2018-2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cd71d375-b3b3-4e03-b697-e6cab12e1210")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace IpCameraEmulatorStd.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IpCameraEmulatorStd.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap start { 67 | get { 68 | object obj = ResourceManager.GetObject("start", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap stop { 77 | get { 78 | object obj = ResourceManager.GetObject("stop", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\start.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\resources\stop.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace IpCameraEmulatorStd.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Resources/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/IpCameraEmulatorStd/Resources/start.png -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Resources/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/IpCameraEmulatorStd/Resources/stop.png -------------------------------------------------------------------------------- /IpCameraEmulatorStd/SystemConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Text; 7 | using System.Threading; 8 | using System.Windows.Forms; 9 | using System.Xml.Serialization; 10 | using Emulator; 11 | 12 | namespace IpCameraEmulatorStd 13 | { 14 | public class SystemConfiguration 15 | { 16 | private const string ConfigurationFileExtension = @".cfg"; 17 | 18 | private string _AppConfigFolder = Environment.GetFolderPath( 19 | Environment.SpecialFolder.CommonApplicationData) + @"\IpCameraEmulator\"; 20 | 21 | private Point _WindowLocation; 22 | private Size _WindowSize; 23 | private FormWindowState _AppWIndowState; 24 | private bool _ShowSystemResourceUsage; 25 | private Collection _Channels; 26 | 27 | private bool _AppSettingsChanged = false; 28 | public string ConfigurationFileName { get; set; } 29 | 30 | // -------------------------------------------------------- 31 | 32 | #region Public Properties 33 | 34 | public Point WindowLocation 35 | { 36 | get { return _WindowLocation; } 37 | set 38 | { 39 | _WindowLocation = value; 40 | _AppSettingsChanged = true; 41 | } 42 | } 43 | 44 | public Size WindowSize 45 | { 46 | get { return _WindowSize; } 47 | set 48 | { 49 | _WindowSize = value; 50 | _AppSettingsChanged = true; 51 | } 52 | } 53 | 54 | public FormWindowState AppWIndowState 55 | { 56 | get { return _AppWIndowState; } 57 | set 58 | { 59 | _AppWIndowState = value; 60 | _AppSettingsChanged = true; 61 | } 62 | } 63 | 64 | public bool ShowSystemResourceUsage 65 | { 66 | get { return _ShowSystemResourceUsage; } 67 | set 68 | { 69 | _ShowSystemResourceUsage = value; 70 | _AppSettingsChanged = true; 71 | } 72 | } 73 | 74 | public Collection Channels 75 | { 76 | get { return _Channels; } 77 | set 78 | { 79 | _Channels = value; 80 | _AppSettingsChanged = true; 81 | } 82 | } 83 | 84 | #endregion 85 | 86 | // ------------------------------------------------------------------ 87 | 88 | #region Public Methods 89 | 90 | public bool Load() 91 | { 92 | XmlSerializer serializer = null; 93 | FileStream fileStream = null; 94 | bool fileExists = false; 95 | 96 | try 97 | { 98 | // Create an XmlSerializer for the SystemConfiguration type. 99 | serializer = new XmlSerializer(typeof(SystemConfiguration)); 100 | FileInfo fi = new FileInfo(_AppConfigFolder + ConfigurationFileName + ConfigurationFileExtension); 101 | // If the config file exists, open it. 102 | if (fi.Exists) 103 | { 104 | fileStream = fi.OpenRead(); 105 | // Create a new instance of the SystemConfiguration by deserializing the config file. 106 | SystemConfiguration appSettings = (SystemConfiguration)serializer.Deserialize(fileStream); 107 | // Assign property values to this instance of the SystemConfiguration class. 108 | _WindowLocation = appSettings.WindowLocation; 109 | _WindowSize = appSettings.WindowSize; 110 | _AppWIndowState = appSettings.AppWIndowState; 111 | _ShowSystemResourceUsage = appSettings.ShowSystemResourceUsage; 112 | _Channels = appSettings.Channels; 113 | fileExists = true; 114 | } 115 | else 116 | { 117 | // Create default config. 118 | _WindowLocation = new Point(0, 0); 119 | _WindowSize = new Size(800, 600); 120 | _AppSettingsChanged = true; 121 | _ShowSystemResourceUsage = false; 122 | _Channels = new Collection(); 123 | fileExists = Save(); 124 | } 125 | } 126 | catch 127 | { 128 | throw; 129 | } 130 | finally 131 | { 132 | if (fileStream != null) 133 | { 134 | fileStream.Close(); 135 | } 136 | } 137 | return fileExists; 138 | } 139 | 140 | public bool Save() 141 | { 142 | if (_AppSettingsChanged) 143 | { 144 | StreamWriter writer = null; 145 | XmlSerializer serializer = null; 146 | 147 | try 148 | { 149 | if (!Directory.Exists(_AppConfigFolder)) 150 | { 151 | Directory.CreateDirectory(_AppConfigFolder); 152 | } 153 | 154 | // Create an XmlSerializer for the SystemConfiguration type. 155 | serializer = new XmlSerializer(typeof(SystemConfiguration)); 156 | writer = new StreamWriter(_AppConfigFolder + ConfigurationFileName + ConfigurationFileExtension, false); 157 | // Serialize this instance of the SystemConfiguration class to the config file. 158 | serializer.Serialize(writer, this); 159 | } 160 | catch 161 | { 162 | throw; 163 | } 164 | finally 165 | { 166 | if (writer != null) 167 | { 168 | writer.Close(); 169 | } 170 | } 171 | } 172 | return _AppSettingsChanged; 173 | } 174 | 175 | #endregion 176 | 177 | // ------------------------------------------------------------------ 178 | 179 | public SystemConfiguration() 180 | { 181 | } 182 | 183 | public SystemConfiguration(string configurationFileName) 184 | { 185 | ConfigurationFileName = configurationFileName; 186 | } 187 | 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/Utilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace IpCameraEmulatorStd 10 | { 11 | static class Utilities 12 | { 13 | public static void DoubleBuffered(this Control control, bool enable) 14 | { 15 | var doubleBufferPropertyInfo = control.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); 16 | doubleBufferPropertyInfo.SetValue(control, enable, null); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /IpCameraEmulatorStd/cctv_camera.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inspiredtechnologies/IP-Camera-Emulator/25cca10e4ea2fdc6b2e5aabae5a0b70c5821e65f/IpCameraEmulatorStd/cctv_camera.ico -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IP Camera Emulator 2 | IP Camera Emulator - A Windows .NET app that emulates one or more RTSP video cameras 3 | 4 | This software tool was created to perform load testing of video management software and CCTV network video recorders. It makes use of the VLC libraries to generate RTSP video streams from video files. The software requires these library components in the application folder: 5 | 6 | * RtspStreamerLib.dll (C++ DLL from the RtspStreamerLib project) 7 | * libvlc.dll, libvlccore.dll and the plugins folder from VLC (32-bit editions. Ver 2.2.6, 1.1.9 seem to work well) 8 | * SystemMetrics .NET library (https://github.com/inspiredtechnologies/SystemMetrics/) 9 | 10 | To build the RtspStreamerLib DLL, you will need the VLC SDK C++ headers and 32-bit MSVC libraries (try https://github.com/RSATom/libvlc-sdk). I was also able to generate the required LIB files from the official VLC DLLs (http://www.asawicki.info/news_1420_generating_lib_file_for_dll_library.html). 11 | 12 | 13 | -------------------------------------------------------------------------------- /RtspStreamLibTest/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RtspStreamLibTest/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Threading; 5 | 6 | namespace RtspStreamLibTest 7 | { 8 | class Program 9 | { 10 | static IntPtr _RtspStreamLibPointer = IntPtr.Zero; 11 | static bool _Terminate = false; 12 | static string _MediaFile = "D:/Tenders/IHIS C3/Video Clips/CH A-h.m4v"; 13 | static int _RtspPort = 8554; 14 | 15 | static void Main(string[] args) 16 | { 17 | try 18 | { 19 | _RtspStreamLibPointer = RtspStreamerLib.CreateRtspStreamerLib(); 20 | _Terminate = false; 21 | 22 | Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) 23 | { 24 | e.Cancel = true; 25 | _Terminate = true; 26 | }; 27 | 28 | Console.WriteLine("Using VLC Library Version " + 29 | RtspStreamerLib.GetVlcVersion(_RtspStreamLibPointer) + Environment.NewLine); 30 | 31 | Console.WriteLine("Loading media (" + _MediaFile + ")..."); 32 | Thread streamThread = new Thread(new ThreadStart(StartStream)); 33 | streamThread.IsBackground = true; 34 | streamThread.Start(); 35 | //StartStream(); 36 | Console.WriteLine("Started stream on Port " + _RtspPort.ToString()); 37 | Console.WriteLine("Hit Ctrl-C to terminate streaming...."); 38 | 39 | int loop = 50; 40 | while (!_Terminate) 41 | { 42 | Thread.Sleep(100); 43 | if (--loop <= 0) 44 | { 45 | loop = 50; 46 | if (RtspStreamerLib.GetStreamRateLib(_RtspStreamLibPointer) <= 0) 47 | { 48 | Console.WriteLine(DateTime.Now + " : Stream error detected...."); 49 | } 50 | } 51 | } 52 | 53 | StopStream(); 54 | Thread.Sleep(300); 55 | RtspStreamerLib.DestroyRtspStreamerLib(_RtspStreamLibPointer); 56 | _RtspStreamLibPointer = IntPtr.Zero; 57 | } 58 | catch (Exception ex) 59 | { 60 | Console.WriteLine(ex.ToString()); 61 | } 62 | } 63 | 64 | static void StartStream() 65 | { 66 | byte[] streamName = Encoding.UTF8.GetBytes("test"); 67 | byte[] mediaPath = Encoding.UTF8.GetBytes(_MediaFile); 68 | 69 | RtspStreamerLib.StartStreamLib(_RtspStreamLibPointer, streamName, mediaPath, _RtspPort); 70 | } 71 | 72 | static void StopStream() 73 | { 74 | RtspStreamerLib.StopStreamLib(_RtspStreamLibPointer); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /RtspStreamLibTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RtspStreamLibTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Hewlett-Packard Company")] 12 | [assembly: AssemblyProduct("RtspStreamLibTest")] 13 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("32e83262-d704-4390-9290-e86b2f4894f7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /RtspStreamLibTest/RtspStreamLibTest.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E9FFA4EB-8BB0-40E6-B177-16507C834467} 8 | Exe 9 | Properties 10 | RtspStreamLibTest 11 | RtspStreamLibTest 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | true 36 | bin\x86\Debug\ 37 | DEBUG;TRACE 38 | full 39 | x86 40 | prompt 41 | MinimumRecommendedRules.ruleset 42 | true 43 | 44 | 45 | bin\x86\Release\ 46 | TRACE 47 | true 48 | pdbonly 49 | x86 50 | prompt 51 | MinimumRecommendedRules.ruleset 52 | true 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 79 | -------------------------------------------------------------------------------- /RtspStreamLibTest/RtspStreamerLib.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace RtspStreamLibTest 8 | { 9 | static class RtspStreamerLib 10 | { 11 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 12 | public static extern IntPtr CreateRtspStreamerLib(); 13 | 14 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 15 | public static extern void DestroyRtspStreamerLib(IntPtr lib); 16 | 17 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 18 | public static extern Int32 StartStreamLib(IntPtr lib, byte[] streamName, byte[] mediaPath, Int32 portNumber); 19 | 20 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 21 | public static extern void StopStreamLib(IntPtr lib); 22 | 23 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 24 | public static extern bool GetStreamStatusLib(IntPtr lib); 25 | 26 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 27 | public static extern Int32 GetStreamRateLib(IntPtr lib); 28 | 29 | [DllImport("RtspStreamerLib.dll", CallingConvention = CallingConvention.Cdecl)] 30 | public static extern IntPtr GetVlcVersionLib(IntPtr lib); 31 | 32 | public static string GetVlcVersion(IntPtr lib) 33 | { 34 | byte[] retPtr = new byte[64]; 35 | System.Runtime.InteropServices.Marshal.Copy(RtspStreamerLib.GetVlcVersionLib(lib), retPtr, 0, 64); 36 | return Encoding.UTF8.GetString(retPtr); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /RtspStreamerLib/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : RtspStreamerLib Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this RtspStreamerLib DLL for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your RtspStreamerLib application. 9 | 10 | 11 | RtspStreamerLib.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | RtspStreamerLib.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | RtspStreamerLib.cpp 25 | This is the main DLL source file. 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | Other standard files: 29 | 30 | StdAfx.h, StdAfx.cpp 31 | These files are used to build a precompiled header (PCH) file 32 | named RtspStreamerLib.pch and a precompiled types file named StdAfx.obj. 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | Other notes: 36 | 37 | AppWizard uses "TODO:" comments to indicate parts of the source code you 38 | should add to or customize. 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | -------------------------------------------------------------------------------- /RtspStreamerLib/RtspStreamerLib.cpp: -------------------------------------------------------------------------------- 1 | // RtspStreamerLib.cpp : Defines the exported functions for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "RtspStreamerLib.h" 6 | 7 | RTSPSTREAMERLIB_API void* CreateRtspStreamerLib(void) 8 | { 9 | return new CRtspStreamerLib(); 10 | } 11 | 12 | RTSPSTREAMERLIB_API void DestroyRtspStreamerLib(void* pLib) 13 | { 14 | if (pLib != NULL) 15 | { 16 | CRtspStreamerLib *lib = (CRtspStreamerLib*)pLib; 17 | delete lib; 18 | } 19 | } 20 | 21 | RTSPSTREAMERLIB_API int StartStreamLib(void* pLib, char* streamName, char* mediaPath, int portNumber) 22 | { 23 | if (pLib != NULL) 24 | { 25 | CRtspStreamerLib *lib = (CRtspStreamerLib*)pLib; 26 | return lib->StartStream(streamName, mediaPath, portNumber); 27 | } 28 | return RET_FAILED; 29 | } 30 | 31 | RTSPSTREAMERLIB_API void StopStreamLib(void* pLib) 32 | { 33 | if (pLib != NULL) 34 | { 35 | CRtspStreamerLib *lib = (CRtspStreamerLib*)pLib; 36 | lib->StopStream(); 37 | } 38 | } 39 | 40 | RTSPSTREAMERLIB_API BOOL GetStreamStatusLib(void* pLib) 41 | { 42 | if (pLib != NULL) 43 | { 44 | CRtspStreamerLib *lib = (CRtspStreamerLib*)pLib; 45 | return lib->_IsStreaming; 46 | } 47 | return false; 48 | } 49 | 50 | RTSPSTREAMERLIB_API int GetStreamRateLib(void* pLib) 51 | { 52 | if (pLib != NULL) 53 | { 54 | CRtspStreamerLib *lib = (CRtspStreamerLib*)pLib; 55 | return lib->GetStreamRate(); 56 | } 57 | return RET_FAILED; 58 | } 59 | 60 | RTSPSTREAMERLIB_API char* GetVlcVersionLib(void* pLib) 61 | { 62 | if (pLib != NULL) 63 | { 64 | CRtspStreamerLib *lib = (CRtspStreamerLib*)pLib; 65 | return lib->GetVlcVersion(); 66 | } 67 | return NULL; 68 | } 69 | 70 | // --------------------------------------------------------------------- 71 | 72 | // This is the constructor of a class that has been exported. 73 | // see RtspStreamerLib.h for the class definition 74 | CRtspStreamerLib::CRtspStreamerLib() 75 | { 76 | return; 77 | } 78 | 79 | CRtspStreamerLib::~CRtspStreamerLib() 80 | { 81 | CloseInstance(); 82 | } 83 | 84 | void CRtspStreamerLib::CloseInstance() 85 | { 86 | if (_IsStreaming) 87 | { 88 | StopStream(); 89 | } 90 | } 91 | 92 | int CRtspStreamerLib::StartStream(char* streamName, char* mediaPath, int portNumber) 93 | { 94 | if (mediaPath != NULL) 95 | { 96 | //DWORD threadId = 0; 97 | _StreamName = streamName; 98 | _MediaPath = mediaPath; 99 | _Port = portNumber; 100 | InitiateStreaming(); 101 | return RET_SUCCESS; 102 | } 103 | else return RET_FAILED; 104 | } 105 | 106 | void CRtspStreamerLib::StopStream() 107 | { 108 | //libvlc_event_detach(_Event_Mgr, libvlc_VlmMediaInstanceStopped, VlcEvent, this); 109 | libvlc_vlm_stop_media(_VlcInstance, _StreamName.c_str()); 110 | libvlc_vlm_del_media(_VlcInstance, _StreamName.c_str()); 111 | libvlc_vlm_release(_VlcInstance); 112 | _VlcInstance = NULL; 113 | _IsStreaming = FALSE; 114 | } 115 | 116 | void CRtspStreamerLib::InitiateStreaming() 117 | { 118 | char *vlc_argv[6]; 119 | vlc_argv[0] = new char[3]; 120 | strcpy_s(vlc_argv[0], 3, "-I"); 121 | vlc_argv[1] = new char[6]; 122 | strcpy_s(vlc_argv[1], 6, "dummy"); // Don't use any interface 123 | vlc_argv[2] = new char[32]; 124 | strcpy_s(vlc_argv[2], 32, "--ignore-config"); // Don't use VLC's config 125 | vlc_argv[3] = new char[128]; 126 | strcpy_s(vlc_argv[3], 128, "--plugin-path=/plugins"); 127 | vlc_argv[4] = new char[128]; 128 | strcpy_s(vlc_argv[4], 128, "--network-caching=300"); 129 | //vlc_argv[5] = new char[128]; 130 | //strcpy_s(vlc_argv[5], 128, "--input-repeat=-1"); 131 | int vlc_argc = 5; // 6; 132 | 133 | _VlcInstance = libvlc_new(vlc_argc, vlc_argv); 134 | 135 | for (int i = 0; i < vlc_argc; i++) 136 | delete[] vlc_argv[i]; 137 | 138 | std::ostringstream portNumber; 139 | portNumber << _Port; 140 | 141 | string sout = "#transcode{acodec=none}:rtp{sdp=rtsp://:" + portNumber.str() + "/}"; 142 | const char * const options[] = { ":sout-keep", ":sout-no-audio" }; 143 | 144 | libvlc_vlm_add_broadcast(_VlcInstance, _StreamName.c_str(), ("file:///" + _MediaPath).c_str(), 145 | sout.c_str(), 2, options, true, true); 146 | 147 | libvlc_vlm_play_media(_VlcInstance, _StreamName.c_str()); 148 | //_Event_Mgr = libvlc_vlm_get_event_manager(_VlcInstance); 149 | //if (_Event_Mgr != NULL) 150 | //{ 151 | // libvlc_event_attach(_Event_Mgr, libvlc_VlmMediaInstanceStopped, VlcEvent, this); 152 | //} 153 | _IsStreaming = TRUE; 154 | } 155 | 156 | void CRtspStreamerLib::RestartStreaming() 157 | { 158 | if (_VlcInstance != NULL) 159 | { 160 | libvlc_vlm_stop_media(_VlcInstance, _StreamName.c_str()); 161 | libvlc_vlm_play_media(_VlcInstance, _StreamName.c_str()); 162 | } 163 | } 164 | 165 | void CRtspStreamerLib::VlcEvent(const libvlc_event_t* event, void* ptr) 166 | { 167 | CRtspStreamerLib* self = reinterpret_cast(ptr); 168 | if (event->type == libvlc_VlmMediaInstanceStopped) 169 | { 170 | thread th(&CRtspStreamerLib::RestartStreaming, self); 171 | th.detach(); 172 | } 173 | } 174 | 175 | int CRtspStreamerLib::GetStreamRate() 176 | { 177 | if (_VlcInstance != NULL) 178 | { 179 | return libvlc_vlm_get_media_instance_rate(_VlcInstance, _StreamName.c_str(), 0); 180 | } 181 | return RET_FAILED; 182 | } 183 | 184 | char* CRtspStreamerLib::GetVlcVersion() 185 | { 186 | return (char *)libvlc_get_version(); 187 | } 188 | 189 | -------------------------------------------------------------------------------- /RtspStreamerLib/RtspStreamerLib.def: -------------------------------------------------------------------------------- 1 | LIBRARY RtspStreamerLib 2 | EXPORTS 3 | CreateRtspStreamerLib 4 | DestroyRtspStreamerLib 5 | StartStreamLib 6 | StopStreamLib 7 | GetStreamStatusLib 8 | GetStreamRateLib 9 | GetVlcVersionLib 10 | -------------------------------------------------------------------------------- /RtspStreamerLib/RtspStreamerLib.h: -------------------------------------------------------------------------------- 1 | // The following ifdef block is the standard way of creating macros which make exporting 2 | // from a DLL simpler. All files within this DLL are compiled with the RTSPSTREAMERLIB_EXPORTS 3 | // symbol defined on the command line. This symbol should not be defined on any project 4 | // that uses this DLL. This way any other project whose source files include this file see 5 | // RTSPSTREAMERLIB_API functions as being imported from a DLL, whereas this DLL sees symbols 6 | // defined with this macro as being exported. 7 | #ifdef RTSPSTREAMERLIB_EXPORTS 8 | #define RTSPSTREAMERLIB_API __declspec(dllexport) 9 | #else 10 | #define RTSPSTREAMERLIB_API __declspec(dllimport) 11 | #endif 12 | 13 | #include "vlc/vlc.h" 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | using namespace std; 21 | 22 | #define RET_FAILED -1 23 | #define RET_SUCCESS 0 24 | 25 | // This class is exported from the RtspStreamerLib.dll 26 | class CRtspStreamerLib 27 | { 28 | public: 29 | BOOL _IsStreaming = FALSE; 30 | 31 | private: 32 | string _StreamName; 33 | string _MediaPath; 34 | int _Port = 8554; 35 | //HANDLE _StreamThread = NULL; 36 | libvlc_instance_t *_VlcInstance = NULL; 37 | libvlc_event_manager_t *_Event_Mgr = NULL; 38 | 39 | public: 40 | CRtspStreamerLib(void); 41 | ~CRtspStreamerLib(void); 42 | void CloseInstance(void); 43 | int StartStream(char* streamName, char* mediaPath, int portNumber); 44 | void InitiateStreaming(void); 45 | void StopStream(); 46 | int GetStreamRate(void); 47 | void RestartStreaming(void); 48 | char* GetVlcVersion(void); 49 | 50 | private: 51 | static void VlcEvent(const libvlc_event_t* event, void* ptr); 52 | }; 53 | 54 | RTSPSTREAMERLIB_API void* CreateRtspStreamerLib(void); 55 | RTSPSTREAMERLIB_API void DestroyRtspStreamerLib(void* pLib); 56 | RTSPSTREAMERLIB_API int StartStreamLib(void* pLib, char* streamName, char* mediaPath, int portNumber); 57 | RTSPSTREAMERLIB_API void StopStreamLib(void* pLib); 58 | RTSPSTREAMERLIB_API BOOL GetStreamStatusLib(void* pLib); 59 | RTSPSTREAMERLIB_API int GetStreamRateLib(void* pLib); 60 | RTSPSTREAMERLIB_API char* GetVlcVersionLib(void* pLib); 61 | 62 | -------------------------------------------------------------------------------- /RtspStreamerLib/RtspStreamerLib.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {E96BBB68-A0D6-484D-87A3-E0844E9CD72C} 15 | Win32Proj 16 | RtspStreamerLib 17 | 18 | 19 | 20 | DynamicLibrary 21 | true 22 | v142 23 | Unicode 24 | 25 | 26 | DynamicLibrary 27 | false 28 | v142 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | C:\Program Files (x86)\Visual Leak Detector\include;D:\SDK\libvlc-sdk\include;$(IncludePath) 45 | C:\Program Files (x86)\Visual Leak Detector\lib\Win32;D:\SDK\libvlc-sdk\lib\v119_x86;$(LibraryPath) 46 | 47 | 48 | false 49 | C:\Program Files (x86)\Visual Leak Detector\include;D:\SDK\libvlc-sdk\include;$(IncludePath) 50 | C:\Program Files (x86)\Visual Leak Detector\lib\Win32;D:\SDK\libvlc-sdk\lib\v119_x86;$(LibraryPath) 51 | 52 | 53 | 54 | Use 55 | Level3 56 | Disabled 57 | WIN32;_DEBUG;_WINDOWS;_USRDLL;RTSPSTREAMERLIB_EXPORTS;%(PreprocessorDefinitions) 58 | true 59 | 60 | 61 | Windows 62 | true 63 | libvlccore.lib;libvlc.lib;%(AdditionalDependencies) 64 | RtspStreamerLib.def 65 | 66 | 67 | 68 | 69 | Level3 70 | Use 71 | MaxSpeed 72 | true 73 | true 74 | WIN32;NDEBUG;_WINDOWS;_USRDLL;RTSPSTREAMERLIB_EXPORTS;%(PreprocessorDefinitions) 75 | true 76 | 77 | 78 | Windows 79 | true 80 | true 81 | true 82 | RtspStreamerLib.def 83 | libvlccore.lib;libvlc.lib;vld.lib;%(AdditionalDependencies) 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | false 97 | 98 | 99 | false 100 | 101 | 102 | 103 | 104 | 105 | Create 106 | Create 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /RtspStreamerLib/RtspStreamerLib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | 43 | 44 | Source Files 45 | 46 | 47 | -------------------------------------------------------------------------------- /RtspStreamerLib/RtspStreamerLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | D:\Test\IpCameraEmulator\IpCameraEmulatorStd\bin\x86\Debug\IpCameraEmulatorStd.exe 5 | D:\Test\IpCameraEmulator\Debug 6 | WindowsLocalDebugger 7 | 8 | -------------------------------------------------------------------------------- /RtspStreamerLib/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /RtspStreamerLib/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // RtspStreamerLib.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /RtspStreamerLib/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /RtspStreamerLib/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | --------------------------------------------------------------------------------