Пример #1
0
        /// <summary>
        /// Fires when the control needs to have it's library directory assigned to it.
        /// Navigates to where the directories should be, and sets them, or asks the user to find the directory if it's not there.
        /// </summary>
        /// <param name="sender">Automatically generated by Visual Studio.</param>
        /// <param name="e">Automatically generated by Visual Studio.</param>
        private void OnVlcControlNeedLibDirectory(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly = Assembly.GetEntryAssembly();                                                             // Get the currently running project

            if (AssemblyName.GetAssemblyName(currentAssembly.Location).ProcessorArchitecture == ProcessorArchitecture.X86) // If the computer is running an x86 architecture, use the x86 folder.
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(AppDataPath.Path, @"VlcLibs\vlcx86\"));
            }
            else        // otherwise use the x64 folder.
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(AppDataPath.Path, @"VlcLibs\vlcx64\"));
            }

            if (!e.VlcLibDirectory.Exists)                           // If a folder is missing
            {
                var folderBrowserDialog = new FolderBrowserDialog(); // Raise a browser window and let the user find it.
                folderBrowserDialog.Description         = selectFolderString;
                folderBrowserDialog.RootFolder          = Environment.SpecialFolder.Desktop;
                folderBrowserDialog.ShowNewFolderButton = true;
                if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    e.VlcLibDirectory = new DirectoryInfo(folderBrowserDialog.SelectedPath);
                }
            }
        }
Пример #2
0
        private void vlcControl1_VlcLibDirectoryNeeded_1(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly  = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;

            if (currentDirectory == null)
            {
                return;
            }
            if (AssemblyName.GetAssemblyName(currentAssembly.Location).ProcessorArchitecture == ProcessorArchitecture.X86)
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"lib\x86\"));
            }
            else
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"lib\x64\"));
            }

            if (!e.VlcLibDirectory.Exists)
            {
                var folderBrowserDialog = new FolderBrowserDialog();
                folderBrowserDialog.Description         = "Select Vlc libraries folder.";
                folderBrowserDialog.RootFolder          = Environment.SpecialFolder.Desktop;
                folderBrowserDialog.ShowNewFolderButton = true;
                if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    e.VlcLibDirectory = new DirectoryInfo(folderBrowserDialog.SelectedPath);
                }
            }
        }
Пример #3
0
        private void OnVlcControlNeedLibDirectory(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly  = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;

            if (currentDirectory == null)
            {
                return;
            }
            if (IntPtr.Size == 4)
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x86\"));
            }
            else
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x64\"));
            }

            if (!e.VlcLibDirectory.Exists)
            {
                var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
                folderBrowserDialog.Description         = "Select Vlc libraries folder.";
                folderBrowserDialog.RootFolder          = Environment.SpecialFolder.Desktop;
                folderBrowserDialog.ShowNewFolderButton = true;
                if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    e.VlcLibDirectory = new DirectoryInfo(folderBrowserDialog.SelectedPath);
                }
            }
        }
Пример #4
0
        private static void OnVLCLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly  = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
            // Default installation path of VideoLAN.LibVLC.Windows
            var libPath = Path.Combine(currentDirectory, "libvlc");

            e.VlcLibDirectory = new DirectoryInfo(libPath);
        }
Пример #5
0
 private void vlcControl1_VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
 {
     if (IntPtr.Size == 4)
     {
         e.VlcLibDirectory = new DirectoryInfo(@"..\..\..\lib\x86\");
     }
     else
     {
         e.VlcLibDirectory = new DirectoryInfo(@"..\..\..\lib\x64\");
     }
 }
Пример #6
0
        /// <summary>
        ///     When the Vlc control needs to find the location of the libvlc.dll.
        ///     You could have set the VlcLibDirectory in the designer, but for this sample, we are in AnyCPU mode, and we don't
        ///     know the process bitness.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void VlcLibDirectoryNeededHandler(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly = Assembly.GetEntryAssembly();

            if (currentAssembly != null)
            {
                var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
                // Default installation path of VideoLAN.LibVLC.Windows
                if (currentDirectory != null)
                {
                    e.VlcLibDirectory =
                        new DirectoryInfo(Path.Combine(currentDirectory, "libvlc",
                                                       IntPtr.Size == 4 ? "win-x86" : "win-x64"));
                }
            }
        }
        private void vlcControl1_VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly  = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;

            if (currentDirectory == null)
            {
                return;
            }
            if (IntPtr.Size == 4)
            {
                e.VlcLibDirectory = new DirectoryInfo(@"..\..\..\lib\x86\");
            }
            else
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x64\"));
            }
        }
Пример #8
0
        private void OnVlcControlNeedsLibDirectory(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly  = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;

            if (currentDirectory == null)
            {
                return;
            }
            if (AssemblyName.GetAssemblyName(currentAssembly.Location).ProcessorArchitecture == ProcessorArchitecture.X86)
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\Vlc\x86\Rincewind\"));
            }
            else
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\Vlc\x64\Rincewind\"));
            }
        }
Пример #9
0
        private void recorder_VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly  = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;

            // Default installation path of VideoLAN.LibVLC.Windows
            e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));

            if (!e.VlcLibDirectory.Exists)
            {
                var folderBrowserDialog = new FolderBrowserDialog();
                folderBrowserDialog.Description         = "Select Vlc libraries folder.";
                folderBrowserDialog.RootFolder          = Environment.SpecialFolder.Desktop;
                folderBrowserDialog.ShowNewFolderButton = true;
                if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    e.VlcLibDirectory = new DirectoryInfo(folderBrowserDialog.SelectedPath);
                }
            }
        }
Пример #10
0
        private void OnVlcControlNeedsLibDirectory(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var    currentAssembly = Assembly.GetEntryAssembly();
            string curpath         = System.Windows.Forms.Application.StartupPath;

            if (curpath.EndsWith("\\"))
            {
                curpath = curpath.Substring(0, curpath.Length - 1);
            }
            if (AssemblyName.GetAssemblyName(Assembly.GetEntryAssembly().Location).ProcessorArchitecture == ProcessorArchitecture.X86)
            {
                curpath += @"\VlcLib\x86";
            }
            else
            {
                curpath += @"\VlcLib\x64";
            }

            e.VlcLibDirectory = new DirectoryInfo(curpath);
        }
Пример #11
0
        private void OnVlcControlNeedLibDirectory(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
            if (currentDirectory == null)
                return;
            if (AssemblyName.GetAssemblyName(currentAssembly.Location).ProcessorArchitecture == ProcessorArchitecture.X86)
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x86\"));
            else
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x64\"));

            if (!e.VlcLibDirectory.Exists)
            {
                var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
                folderBrowserDialog.Description = "Select Vlc libraries folder.";
                folderBrowserDialog.RootFolder = Environment.SpecialFolder.Desktop;
                folderBrowserDialog.ShowNewFolderButton = true;
                if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    e.VlcLibDirectory = new DirectoryInfo(folderBrowserDialog.SelectedPath);
                }
            }
        }
Пример #12
0
 private void vlcPlayer_VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
 {
     e.VlcLibDirectory = new DirectoryInfo(@"lib\vlc\");
 }
Пример #13
0
 private void VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
 {
     e.VlcLibDirectory = new DirectoryInfo(".");
 }
Пример #14
0
        private void myVlcControl_VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var projectFolder = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName;

            e.VlcLibDirectory = new DirectoryInfo(Path.Combine(projectFolder, @"libvlc\\x86"));
        }
Пример #15
0
        private void OnVlcControlNeedLibDirectory(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly  = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;

            if (currentDirectory == null)
            {
                return;
            }
            if (IntPtr.Size == 4)
            {
                e.VlcLibDirectory = new DirectoryInfo(@"..\..\..\lib\x86\");
            }
            else
            {
                e.VlcLibDirectory = new DirectoryInfo(Path.Combine(currentDirectory, @"..\..\..\lib\x64\"));
            }

            //var mediaOptions = new String[] { ":http-user-agent=1234" };
            //example
            //"--video-filter=croppadd{paddtop=100}"
            //"--video-filter=croppadd{cropleft=100}"

            //myVlcControl.VlcMediaplayerOptions = new string[] { "--video-filter=croppadd{paddtop=100, cropleft=100}" };

            ////myVlcControl.VlcMediaplayerOptions = new string[] { "--video-filter=transform", "--transform-type=hflip" }; // "90", "180", "270", "hflip", "vflip", "transpose", "antitranspose"
            ////myVlcControl.VlcMediaplayerOptions = new string[] {"--quiet", "--video-filter=transform", "--transform-type=180" };
            ////myVlcControl.VlcMediaplayerOptions = new string[] { "--sub-source=marq{marquee=Hello,timeout=5000,position=8}" };
            ////myVlcControl.VlcMediaplayerOptions = new string[] { "--file-logging", "-vvv", "--logfile=Logs.log" };
            ////myVlcControl.VlcMediaplayerOptions = new string[] {  ":sout=#file{dst="+Path.Combine(Environment.CurrentDirectory, "output.mov")+"}", ":sout-keep"};
            ////myVlcControl.VlcMediaplayerOptions = new string[] { "--no-video-title", "--video-title-show", "--video-title-timeout=4000", "--osd" };

            ////myVlcControl.VlcMediaplayerOptions = new string[] { "--video-filter=magnify" };
            //if (Disable_Vis.Checked)
            //{

            //}
            //if (Scope_Vis.Checked)
            //{
            //    myVlcControl.VlcMediaplayerOptions = new string[] { "--audio-visual=visual", "--effect-list=scope" };
            //}
            //if (Spectrum_Vis.Checked)
            //{
            //    myVlcControl.VlcMediaplayerOptions = new string[] { "--audio-visual=visual", "--effect-list=spectrum" };
            //}
            //if (Spectrometer_Vis.Checked)
            //{
            //    myVlcControl.VlcMediaplayerOptions = new string[] { "--audio-visual=visual", "--effect-list=spectrometer" };
            //}


            //this.myVlcControl.VlcMediaplayerOptions = new string[] { "--deinterlace=on", "--video-filter=deinterlace", "--deinterlace-mode=linear" };


            //myVlcControl.EndInit();

            //if (myVlcControl.VlcMediaplayerOptions == null)
            //{
            //    myVlcMediaPlayer = new VlcMediaPlayer(myVlcControl.VlcLibDirectory);
            //}
            //else
            //{
            //    myVlcMediaPlayer = new VlcMediaPlayer(myVlcControl.VlcLibDirectory, myVlcControl.VlcMediaplayerOptions);
            //}
            ////myVlcControl.VlcMediaplayerOptions = new string[] { "--no-ts-pcr-offsetfix" };

            //FOR STREAMING...
            //myVlcControl.VlcMediaplayerOptions = new string[] { "--network-caching=150" + "--sout-mux-caching=150" };


            //myVlcControl.VlcMediaplayerOptions = new string[] { "--file-caching=5500" };
            //myVlcControl.VlcMediaplayerOptions = new string[] { "--network-caching=300" };


            //myVlcControl.VlcMediaplayerOptions = new string[] { ":network-caching=300" };
            //myVlcControl.VlcMediaplayerOptions = new string[] { ":sout=#duplicate{dst=display,dst=std {access=udp,mux=ts,dst=224.100.0.1:1234}}" };
            //myVlcControl.VlcMediaplayerOptions = new string[] { ":sout=#transcode{vcodec=h264,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:udp{mux=ts,dst=224.100.0.1:1234}" };
            //myVlcControl.VlcMediaplayerOptions = new string[] { ":sout=#duplicate{dst=display,dst=std {access=udp,mux=ts,dst=224.100.0.1:1234}}" };
            //myVlcControl.VlcMediaplayerOptions = new string[] { ":sout=#duplicate{dst=udp{dst=224.100.0.1:1234},dst=display}" };


            //myVlcControl.VlcMediaplayerOptions = new string[] { ":sout=#duplicate{dst=rtp{sdp=rtsp://127.0.0.1:1000/},dst=display}",
            //    ":sout-all",
            //    ":sout-keep" };



            myVlcControl.VlcMediaplayerOptions = new string[] { "dshow:// :dshow-vdev=screen-capture-recorder", ":dshow-adev=virtual-audio-capturer" };



            if (!e.VlcLibDirectory.Exists)
            {
                var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
                folderBrowserDialog.Description         = "Select Vlc libraries folder.";
                folderBrowserDialog.RootFolder          = Environment.SpecialFolder.Desktop;
                folderBrowserDialog.ShowNewFolderButton = true;
                if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    e.VlcLibDirectory = new DirectoryInfo(folderBrowserDialog.SelectedPath);
                }
            }
        }
Пример #16
0
        private void VlcPlayer_VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            var vlcLibDirectory = new DirectoryInfo(System.IO.Path.Combine("libvlc", "win-x86"));//Environment.Is64BitProcess ? "win-x64" : "win-x86"

            e.VlcLibDirectory = vlcLibDirectory;
        }
Пример #17
0
        /// <summary>Direct LibVLC to the directory containing libvlc.dll</summary>
        /// <param name="sender">The object that triggered the event</param>
        /// <param name="e">The event arguments</param>
        private void VlcControl_VlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
        {
            TvCore.LogDebug("[.NET] VlcControl_VlcLibDirectoryNeeded()");

            e.VlcLibDirectory = new DirectoryInfo(TvCore.LibraryPath);
        }
Пример #18
0
 /// <summary>
 ///   Handles the VlcLibDirectoryNeeded event of the VlcControl control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="VlcLibDirectoryNeededEventArgs" /> instance containing the event data.</param>
 private void VlcControlVlcLibDirectoryNeeded(object sender, VlcLibDirectoryNeededEventArgs e)
 {
     e.VlcLibDirectory = GetVlcLibDirectory();
 }
Пример #19
0
 public void OnVlcControlNeedLibDirectory(object sender, VlcLibDirectoryNeededEventArgs e)
 {
     e.VlcLibDirectory = new DirectoryInfo("C:\\Users\\prouser\\Documents\\Vlc.DotNet-master\\Vlc.DotNet-master\\lib\\x86\\");
 }