Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                var OpenFileDialog = new OpenFileDialog();
                OpenFileDialog.CheckFileExists = true;
                OpenFileDialog.Filter = "h264 files|*.h264;*.264|All Files|*.*";
                if (OpenFileDialog.ShowDialog() == DialogResult.OK)
                {
                    args = new string[] { OpenFileDialog.FileName };
                }
                else
                {
                    Console.WriteLine("Usage: H264Player <.h264 raw file>\n");
                    return;
                }
            }

            // TODO Auto-generated method stub
            if (args.Length < 1)
            {
                Console.WriteLine("Usage: H264Player <.h264 raw file>\n");
                return;
            }
            else
            {
                var H264Player = new H264Player();

                H264Player.frame = new Form()
                {
                    Text = "cscodec.h264 Player",
                    FormBorderStyle = FormBorderStyle.FixedDialog,
                    MinimizeBox = false,
                    StartPosition = FormStartPosition.CenterScreen,
                };
                //displayPanel = new PlayerFrame();

                //frame.getContentPane().add(displayPanel, BorderLayout.CENTER);

                // Finish setting up the frame, and show it.
                H264Player.frame.FormClosing += (s, e) =>
                {
                    Environment.Exit(0);
                };

                H264Player.frame.HandleCreated += (s, e) =>
                {
                    new Thread(() =>
                    {
                        H264Player.run(args[0]);
                    }).Start();
                };

                Application.Run(H264Player.frame);

            } // if
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                var OpenFileDialog = new OpenFileDialog();
                OpenFileDialog.CheckFileExists = true;
                OpenFileDialog.Filter          = "h264 files|*.h264;*.264|All Files|*.*";
                if (OpenFileDialog.ShowDialog() == DialogResult.OK)
                {
                    args = new string[] { OpenFileDialog.FileName };
                }
                else
                {
                    Console.WriteLine("Usage: H264Player <.h264 raw file>\n");
                    return;
                }
            }

            // TODO Auto-generated method stub
            if (args.Length < 1)
            {
                Console.WriteLine("Usage: H264Player <.h264 raw file>\n");
                return;
            }
            else
            {
                var H264Player = new H264Player();

                H264Player.frame = new Form()
                {
                    Text            = "cscodec.h264 Player",
                    FormBorderStyle = FormBorderStyle.FixedDialog,
                    MinimizeBox     = false,
                    StartPosition   = FormStartPosition.CenterScreen,
                };
                //displayPanel = new PlayerFrame();

                //frame.getContentPane().add(displayPanel, BorderLayout.CENTER);

                // Finish setting up the frame, and show it.
                H264Player.frame.FormClosing += (s, e) =>
                {
                    Environment.Exit(0);
                };

                H264Player.frame.HandleCreated += (s, e) =>
                {
                    new Thread(() =>
                    {
                        H264Player.run(args[0]);
                    }).Start();
                };

                Application.Run(H264Player.frame);
            }             // if
        }