private void Start_btn_Click(object sender, EventArgs e)
        {
            string[] list =
            {
                @"M:\TEST_VIDEOS\!1080p 60fpsOri and the Will of the Wisps.mp4",        @"M:\TEST_VIDEOS\!audi_a7_borussia_vfl.mp4",
                @"M:\TEST_VIDEOS\!LG Jazz 1080-30p.mp4",
                @"M:\TEST_VIDEOS\!NoAudio1080p 60fpsOri and the Will of the Wisps.mp4",
                @"M:\TEST_VIDEOS\!PATAGONIA 1080p.mp4",
                @"M:\TEST_VIDEOS\Adele.mp4",
                @"M:\TEST_VIDEOS\Avengers_2_1080p_6Ch_48kHz-HDTN.mp4"
            };
            int period = 1000;

            (m_objMFile as IMPreview).PreviewWindowSet("", panelPr.Handle.ToInt32());
            (m_objMFile as IMPreview).PreviewEnable("", 1, 1);


            Thread.Sleep(period);
            int index = -1;

            for (int i = 0; i < list.Length; i++)
            {
                m_objMFile.PreviewFullScreen("", 0, 0);
                //m_objMFile.PlaylistAdd(null, list[i], "", ref index, out MItem item);
                //m_objMFile.PlaylistPosSet(0, 0, 0);
                //m_objMPlaylist.PlaylistGetCount(out int nFiles, out double dblDuration);
                //m_objMPlaylist.PlaylistGetByIndex(nFiles, out double dblPos, out string strPathOrCommand, out MItem pItem);
                m_objMFile.FileNameSet(list[i], "");
                m_objMFile.FilePlayStart();
                Thread.Sleep(period * 2);
                m_objMFile.PreviewFullScreen("", 1, 0);
                Thread.Sleep(period);
            }
            m_objMFile.PreviewFullScreen("", 0, 0);
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (listBox1.GetSelected(0) || listBox1.GetSelected(1))
            {
                m_objMPFile.FileNameSet(listBox1.SelectedItem.ToString(), "");
            }
            else
            {
                m_objMPFile.FileNameSet(textBox1.Text.ToString(), "");
            }
            //m_objMPFile.FileNameSet(@"D:\Firefox\NUEVO Conejos con huron.mp4", "");
            m_objMPFile.FilePlayStart();
            m_objMPFile.FilePlayPause(0);

            M_VID_PROPS props;
            int         index;
            string      name;

            m_objMPFile.FormatVideoGet(eMFormatType.eMFT_Output, out props, out index, out name);

            double inTime;
            double outTime;
            double durTime;

            m_objMPFile.FileInOutGet(out inTime, out outTime, out durTime);

            double pos = 0.0;
            double curPos;
            double step = 60.0;

            bool ok = true;

            while (pos < durTime)
            {
                try
                {
                    m_objMPFile.FilePosSet(pos, 0);
                    Thread.Sleep(500);
                    m_objMPFile.FilePosGet(out curPos);

                    if (pos - curPos > step)
                    {
                        MessageBox.Show("Broken File");
                        ok = false;
                        break;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString() + "Broken File");
                }
                pos += step;
            }
            if (ok)
            {
                MessageBox.Show("File is Ok");
            }
        }
Exemple #3
0
        void StartMFile()
        {
            m_objFile = new MFileClass();

            m_objFile.PreviewWindowSet("", panel1.Handle.ToInt32());
            m_objFile.PreviewEnable("", 0, 1);

            m_objFile.FileNameSet(@"\\MLDiskStation\MLFiles\MediaTest\MP4\!1080p 60fpsOri and the Will of the Wisps.mp4", "");
            m_objFile.FilePlayStart();
        }
Exemple #4
0
        private void openFile_btn_Click(object sender, EventArgs e)
        {
            OpenFileDialog a = new OpenFileDialog();

            if (a.ShowDialog() == DialogResult.OK)
            {
                m_objFile.FileNameSet(a.FileName.ToString(), "");
                m_objFile.FilePlayStart();
            }
        }
Exemple #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            string test_file = @"M:\MEDIA_TEST\!1080p 60fpsOri and the Will of the Wisps.mp4";

            m_objFile.FileNameSet(test_file, "");
            m_objFile.PreviewWindowSet("", panel1.Handle.ToInt64());
            m_objFile.PreviewEnable("", 1, 1);
            m_objFile.OnEventSafe += File_OnEventSafe;
            m_objFile.FilePlayStart();

            m_objFile.PropsSet("preview.type", "dx9");
        }
Exemple #6
0
        private void OpenFile_btn_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK && openFileDialog1.FileNames.Length != 0)
            {
                filePath = openFileDialog1.FileNames[0].ToString();
                m_objMFile.FileNameSet(filePath, "loop=true");

                m_objMFile.PreviewWindowSet("", panelPreview.Handle.ToInt32());
                m_objMFile.PreviewEnable("", 1, 1);
                m_objMFile.FilePlayStart();
                path_txb.Text = filePath;
            }
        }
Exemple #7
0
        private void OpenFile_btn_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK && openFileDialog1.FileNames.Length != 0)
            {
                m_objFile.FileNameSet(openFileDialog1.FileNames.ToString(), "");
                m_objFile.FilePlayStart();
                string path = openFileDialog1.FileName;

                StartWrite(path, m_objFile);

                System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objFile);
                GC.Collect();
            }
        }
Exemple #8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objMPWriter = new MWriterClass();
            m_objMPFile   = new MFileClass();
            m_objFile     = new MFileClass();

            m_objMPFile.PreviewWindowSet("", panel1.Handle.ToInt32());
            m_objMPFile.PreviewEnable("", 0, 1);

            m_objMPFile.FileNameSet(@"M:\MEDIA_TEST\!PATAGONIA 1080p.mp4", "");

            m_objMPFile.FilePlayStart();

            m_objMPWriter.WriterNameSet(pathA, "");
            m_objMPWriter.ObjectStart(m_objMPFile);
        }
Exemple #9
0
 private void buttonPlay_Click(object sender, EventArgs e)
 {
     try
     {
         string filePath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\this.sdp";
         m_objFile.FileNameSet(filePath, "");
         m_objFile.FilePlayStart();
         m_arrBufferMinMax[0] = GetDblProps(m_objFile, "file::network.buffer_min");
         m_arrBufferMinMax[1] = GetDblProps(m_objFile, "file::network.buffer_max");
         timerStat.Enabled    = true;
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Exemple #10
0
        void Restart(string quality)
        {
            m_objMPFile.ObjectClose();
            Marshal.ReleaseComObject(m_objMPFile);
            Thread.Sleep(500);
            test = test == "false" ? "true" : "false";

            m_objMPFile = new MFileClass();

            (m_objMPFile as IMProps).PropsSet("preview.downscale", quality);
            (m_objMPFile as IMProps).PropsSet("preview.overlay_waveform", "true");

            m_objMPFile.PreviewWindowSet("", panel1.Handle.ToInt32());
            m_objMPFile.PreviewEnable("", 1, 1);

            m_objMPFile.FileNameSet(textBox1.Text, "");
            m_objMPFile.FilePlayStart();
        }
Exemple #11
0
        void TurnOnGPU_Pipeline()
        {
            if (!gpu_p)
            {
                m_objMFFactory = new MFFactoryClass();
                m_objMFFactory.PropsSet("gpu_pipeline", "true");

                gpu_p = true;
                GpuPipilineOn_btn.Text      = "GPU PIPELINE = ON";
                GpuPipilineOn_btn.BackColor = Color.Green;

                Reset_btn.Enabled            = true;
                PredifinedMatrix_txb.Enabled = true;
                ColorLevel_cmb.Enabled       = true;
                Red_trb.Enabled             = true;
                Green_trb.Enabled           = true;
                Blue_trb.Enabled            = true;
                Constant_trb.Enabled        = true;
                RedChannel_txb.Enabled      = true;
                GreenChannel_txb.Enabled    = true;
                BlueChannel_txb.Enabled     = true;
                ConstantChannel_txb.Enabled = true;

                //When we turn on the gpu_pipeline we need to recreate objects.
                //To continue playback from same position we take current and save it
                m_objMFile.FilePosGet(out double position);
                m_objMFile.FilePlayStop(0);

                Marshal.ReleaseComObject(m_objMFile);

                m_objMFile = new MFileClass();

                m_objMFile.PreviewWindowSet("", panelPreview.Handle.ToInt32());
                m_objMFile.PreviewEnable("", 1, 1);

                if (filePath.Length > 1)
                {
                    m_objMFile.FileNameSet(filePath, "loop=true");
                    m_objMFile.FilePosSet(position, 0);
                    m_objMFile.FilePlayStart();
                }
                PredifinedMatrix_txb.SelectedIndex = 0;
            }
        }
Exemple #12
0
        private void OpenFileMFile_btn_Click(object sender, EventArgs e)
        {
            MarshalAll();
            m_objMFile = new MFileClass();
            if (openFileDialog1.ShowDialog() == DialogResult.OK && openFileDialog1.FileNames.Length != 0)
            {
                filePath = openFileDialog1.FileNames[0].ToString();

                SendMes("StatMFile");
                startTime = DateTime.Now;
                m_objMFile.FileNameSet(filePath, addParams.Text);
                endTime = DateTime.Now;
                CalcTimeSpan();
                SendMes("MFile takes: " + duration.TotalMilliseconds.ToString() + " TotalMilliseconds");
                SendMes("With this Params : " + addParams.Text);

                ReInitPr("MFile");
                m_objMFile.FilePlayStart();
            }
        }
Exemple #13
0
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objMFile    = new MFileClass();
            m_objPlaylist = new MPlaylistClass();

            m_objMFile.PreviewWindowSet("", panelPr.Handle.ToInt32());
            m_objMFile.PreviewEnable("", 0, 1);

            m_objMFile.FileNameSet(@"\\192.168.0.100\MLFiles\Trash\Roman\WorkFiles\FilesFromCostumer\2019.03.06Etere31735\MEM001M-20190306Z143546.mp4", "loop=true");

            m_objMFile.FilePlayStart();

            m_objPlaylist.PreviewWindowSet("", panelPrPl.Handle.ToInt32());
            m_objPlaylist.PreviewEnable("", 0, 1);

            int index = -1;

            m_objPlaylist.PlaylistAdd(null, @"\\192.168.0.100\MLFiles\Trash\Roman\WorkFiles\FilesFromCostumer\2019.03.06Etere31735\MEM001M-20190306Z143546.mp4", "loop=true", index, out item);
            m_objPlaylist.FilePlayStart();
        }
Exemple #14
0
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objFile     = new MFileClass();
            m_objPlaylist = new MPlaylistClass();

            m_objFile.PreviewWindowSet("", panelPrFile.Handle.ToInt32());
            m_objFile.PreviewEnable("", 1, 1);

            m_objPlaylist.PreviewWindowSet("", panelPrPlaylist.Handle.ToInt32());
            m_objPlaylist.PreviewEnable("", 1, 1);



            int index = -1;


            m_objPlaylist.PlaylistAdd(null, path, "", ref index, out item);
            m_objPlaylist.FilePlayStart();

            m_objFile.FileNameSet(path, "");
            m_objFile.FilePlayStart();
        }
Exemple #15
0
        private void Start_btn_Click(object sender, EventArgs e)
        {
            //int nIndex = -1;
            //MItem pFile;
            //m_objPlaylist.PropsSet("loop", "false");
            //m_objPlaylist.PropsSet("active_frc", "false");
            //m_objPlaylist.PropsSet("preview.drop_frames", "true");
            //m_objPlaylist.PlaylistAdd(null, openFile_txb.Text, "external_process=false experimental.mfcodecs=true experimental.out_video_packets=true", ref nIndex, out pFile); //
            //m_objPlaylist.FilePlayStart();

            int         index;
            string      name;
            M_AUD_PROPS propsA;

            m_objFile.FormatAudioGet(eMFormatType.eMFT_Input, out propsA, out index, out name);

            propsA.nChannels = 8;

            m_objFile.PropsSet("active_frc", "false");
            m_objFile.PropsSet("preview.drop_frames", "true");
            m_objFile.FileNameSet(openFile_txb.Text, "");//"external_process=false experimental.mfcodecs=true experimental.out_video_packets=true");
            //m_objFile.FileNameSet(openFile_txb.Text, "");
            //(m_objFile as IMProps).PropsSet("object::audio_channels", "0,1,2,3,4,5,6,7");

            m_objFile.FormatAudioSet(eMFormatType.eMFT_Convert, ref propsA);
            m_objFile.FilePlayStart();

            m_objWriter.PropsSet("external_process", "false");
            m_objWriter.PropsSet("rate_control", "true");
            m_objWriter.PropsSet("pull_mode", "false");


            m_objWriter.FormatAudioSet(eMFormatType.eMFT_Convert, ref propsA);
            //m_objWriter.WriterNameSet(savePath_txb.Text, "format='mp4' video::codec='packets' audio::codec='audio_packets'");
            m_objWriter.WriterNameSet(savePath_txb.Text, "format='mp4' video::codec='n264' audio::codec='aac'");
            m_objWriter.ObjectStart(m_objFile);
        }
        private void Start_btn_Click(object sender, EventArgs e)
        {
            //m_objFile.PropsSet("active_frc", "false");
            //m_objFile.PropsSet("preview.drop_frames", "true");
            //m_objFile.FileNameSet(openFile_txb.Text, "external_process=false experimental.mfcodecs=true experimental.out_video_packets=true");
            m_objFile.FileNameSet(tempPath, "");
            m_objFile.FilePlayStart();

            //m_objWriter.PropsSet("external_process", "false");
            //m_objWriter.PropsSet("rate_control", "true");
            //m_objWriter.PropsSet("pull_mode", "false");

            if (savePath_txb != null)
            {
                //m_objWriter.WriterNameSet(savePath_txb.Text, "format='mp4' video::codec='packets' audio::codec='audio_packets'");
                m_objWriter.WriterNameSet(savePath_txb.Text, "format='mp4' video::codec='n264' audio::codec='aac'");
            }
            else
            {
                m_objWriter.WriterNameSet(destination, " format='mpegts' protocol='udp://' video::codec='packets' audio::codec='audio_packets'");
            }

            m_objWriter.ObjectStart(m_objFile);
        }
        private void InitSource(int index)
        {
            listBox1.SelectedIndex = index % sources.Count;

            m_objMFile1.FileNameSet(sources[index % sources.Count], "network.open_async=true open_url.max_wait=0");
            m_objMFile1.FilePlayStart();

            listBox2.SelectedIndex = (index + 1) % sources.Count;

            m_objMFile2.FileNameSet(sources[(index + 1) % sources.Count], "network.open_async=true open_url.max_wait=0");
            m_objMFile2.FilePlayStart();

            listBox3.SelectedIndex = (index + 2) % sources.Count;

            m_objMFile3.FileNameSet(sources[(index + 2) % sources.Count], "network.open_async=true open_url.max_wait=0");
            m_objMFile3.FilePlayStart();

            listBox4.SelectedIndex = (index + 3) % sources.Count;

            m_objMFile4.FileNameSet(sources[(index + 3) % sources.Count], "network.open_async=true open_url.max_wait=0");
            m_objMFile4.FilePlayStart();

            turn++;
        }
Exemple #18
0
 private void Play_btn_Click(object sender, EventArgs e)
 {
     m_objMPFile.FileNameSet(textBox1.Text, "");
     m_objMPFile.FilePlayStart();
 }
Exemple #19
0
 private void button4_Click(object sender, EventArgs e)
 {
     m_objFile.FileNameSet(streamPath_txb.Text, "");
     m_objFile.FilePlayStart();
 }
Exemple #20
0
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                if (Properties.Settings.Default.UrlHistory != null)
                {
                    object[] strHistory = NetworkPlaybackSample.Properties.Settings.Default.UrlHistory.ToArray();
                }
                m_objFile = new MFileClass();
                m_objFile.PreviewWindowSet("", panelPreview.Handle.ToInt32());
                m_objFile.PreviewEnable("", 1, 1);
                m_objRenderer = new MRendererClass();
                FillVideoFormats();
                FillAudioFormats();
                comboBoxVF.SelectedIndex = startVideoFormat;
                comboBoxAF.SelectedIndex = startAudioFormat;
                FillRenderers();
                UpdateDelay();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Application.Exit();
            }
            string JSON = "{ \"Number of Input Ports\": \"1\", \"Device List\": [";

            for (int i = 0; i < comboBoxRenderer.Items.Count; i++)
            {
                if (i != comboBoxRenderer.Items.Count - 1)
                {
                    JSON += "\"" + comboBoxRenderer.Items[i] + "\",";
                }
                else
                {
                    JSON += "\"" + comboBoxRenderer.Items[i] + "\"]}";
                }
            }
            var    client        = new HttpClient();
            string serverIP      = textBox1.Text;
            string serverPort    = textBox2.Text;
            var    stringContent = new StringContent(JSON);

            client.PostAsync("http://" + serverIP + ":" + serverPort + "/device_list", stringContent);
            var    data       = GetIP(serverIP, serverPort).Result;
            var    sdpContent = GetSDP(serverIP, serverPort).Result;
            string sdp        = sdpContent.Replace("\\n", Environment.NewLine);

            sdp = sdp.Replace("\"", "");
            string[] lines  = Regex.Split(sdp, "\r\n|\r|\n");
            string   result = "";

            foreach (string line in lines)
            {
                result += line.Trim() + Environment.NewLine;
            }
            if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\stream.sdp"))
            {
                File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\stream.sdp");
            }
            System.IO.File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\stream.sdp", result);
            try
            {
                string filePath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\stream.sdp";
                m_objFile.FileNameSet(filePath, "");
                m_objFile.FilePlayStart();
                m_arrBufferMinMax[0] = GetDblProps(m_objFile, "file::network.buffer_min");
                m_arrBufferMinMax[1] = GetDblProps(m_objFile, "file::network.buffer_max");
                timerStat.Enabled    = true;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\settings.json"))
            {
                string numberPorts = System.IO.File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\settings.json");
                textBox3.Text = numberPorts;
            }
        }
Exemple #21
0
        private void Start_btn_Click(object sender, EventArgs e)
        {
            //string name;
            //string xml;
            //m_objLive11.DeviceGetByIndex(0, "video", 5, out name, out xml);

            //m_objLive1.DeviceSet("video", name, "");
            //m_objLive1.ObjectStart(null);

            //m_objLive2.DeviceSet("video", name, "");
            //m_objLive2.ObjectStart(null);

            //m_objLive3.DeviceSet("video", name, "");
            //m_objLive3.ObjectStart(null);

            //m_objLive4.DeviceSet("video", name, "");
            //m_objLive4.ObjectStart(null);

            //m_objLive5.DeviceSet("video", name, "");
            //m_objLive5.ObjectStart(null);

            //m_objLive6.DeviceSet("video", name, "");
            //m_objLive6.ObjectStart(null);

            //m_objLive7.DeviceSet("video", name, "");
            //m_objLive7.ObjectStart(null);

            //m_objLive8.DeviceSet("video", name, "");
            //m_objLive8.ObjectStart(null);

            //m_objLive9.DeviceSet("video", name, "");
            //m_objLive9.ObjectStart(null);

            //m_objLive10.DeviceSet("video", name, "");
            //m_objLive10.ObjectStart(null);


            //m_objLive11.DeviceSet("video", name, "");
            //m_objLive11.ObjectStart(null);


            string path = @"M:\TempVideo\10\Adele.mp4";

            m_objLive1.FileNameSet(path, "");
            m_objLive1.FilePlayStart();
            m_objLive2.FileNameSet(path, "");
            m_objLive2.FilePlayStart();
            m_objLive3.FileNameSet(path, "");
            m_objLive3.FilePlayStart();
            m_objLive4.FileNameSet(path, "");
            m_objLive4.FilePlayStart();
            m_objLive5.FileNameSet(path, "");
            m_objLive5.FilePlayStart();
            m_objLive6.FileNameSet(path, "");
            m_objLive6.FilePlayStart();
            m_objLive7.FileNameSet(path, "");
            m_objLive7.FilePlayStart();
            m_objLive8.FileNameSet(path, "");
            m_objLive8.FilePlayStart();
            m_objLive9.FileNameSet(path, "");
            m_objLive9.FilePlayStart();
            m_objLive10.FileNameSet(path, "");
            m_objLive10.FilePlayStart();
            m_objLive11.FileNameSet(path, "");
            m_objLive11.FilePlayStart();
        }
Exemple #22
0
 private void file_btn_Click(object sender, EventArgs e)
 {
     m_objMFile.FileNameSet(file_txb.Text, "network.reconnect = true");
     m_objMFile.FilePlayStart();
 }
Exemple #23
0
 private void Button1_Click(object sender, EventArgs e)
 {
     m_objFile.FileNameSet("https://www.youtube.com/watch?v=RVeVtBxoImI", "");
     m_objFile.FilePlayStart();
 }
Exemple #24
0
 void GetMP()
 {
     m_objFile.FileNameSet(ListOffAllMPlinks_cmb.SelectedItem.ToString(), "");
     m_objFile.FilePlayStart();
 }
Exemple #25
0
 void Start()
 {
     m_objMPFile.FileNameSet(textBox1.Text, "");
     m_objMPFile.FilePlayStart();
 }