コード例 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objMPFile = new MFileClass();

            m_objMPFile.PreviewWindowSet("", panel1.Handle.ToInt32());
            m_objMPFile.PreviewEnable("", 1, 1);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
 private void Form1_Load(object sender, EventArgs e)
 {
     m_objPlaylist = new MPlaylistClass();
     m_objWriter   = new MWriterClass();
     m_objFile     = new MFileClass();
     m_objFile.PreviewWindowSet("", panelPrev.Handle.ToInt32());
     m_objFile.PreviewEnable("", 0, 1);
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        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();
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objMPlaylist = new MPlaylistClass();
            m_objMFile     = new MFileClass();

            m_objMPlaylist.PreviewWindowSet("", PlaylistPrev.Handle.ToInt32());
            m_objMPlaylist.PreviewEnable("", 1, 1);

            m_objMFile.PreviewWindowSet("", FilePrev.Handle.ToInt32());
            m_objMFile.PreviewEnable("", 1, 1);
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objWriter   = new MWriterClass();
            m_objLive     = new MLiveClass();
            m_objFile     = new MFileClass();
            m_objPlaylist = new MPlaylistClass();

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

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

            m_objLive.PreviewWindowSet("", livePanel.Handle.ToInt32());
            m_objLive.PreviewEnable("", 0, 1);

            m_objLive.OnFrameSafe     += M_objLive_OnFrameSafe;
            m_objFile.OnEventSafe     += M_objFile_OnEventSafe;
            m_objPlaylist.OnFrameSafe += M_objPlaylist_OnFrameSafe;

            m_objWriter.PropsSet("embed_scte35", "true");
            m_objFile.PropsSet("object::on_event.sync", "true");
            m_objPlaylist.PropsSet("object::on_frame.sync", "true");
            m_objLive.PropsSet("object::on_event.sync", "true");

            int count = 0;

            m_objLive.DeviceGetCount(0, "video", out count);

            string[] arr = new string[count];

            string name;
            string xml;

            for (int i = 0; i < count; i++)
            {
                m_objLive.DeviceGetByIndex(0, "video", i, out name, out xml);
                arr[i] = name;
            }

            m_objLive.DeviceSet("video", arr[5], "");

            m_objLive.ObjectStart(null);

            MItem item;

            //m_objPlaylist.PlaylistBackgroundSet(m_objLive, "live", "live", out item);

            //m_objPlaylist.FilePlayStart();

            m_objWriter.WriterNameSet(streamPath_txb.Text, " format='mpegts' protocol='udp://' video::codec='mpeg2video' video::b='5M' audio::codec='mp2'");

            m_objWriter.ObjectStart(m_objLive);
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objWriter   = new MWriterClass();
            m_objPlaylist = new MPlaylistClass();
            m_objFile     = new MFileClass();
            m_objFile.PreviewWindowSet("", panelPreview_pnl.Handle.ToInt32());
            m_objFile.PreviewEnable("", 1, 1);


            int    a = -60 * (6 - -100);
            string b = "";
        }
コード例 #7
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objMPFile = new MFileClass();
            //m_objMPFile.OnFrameSafe += M_objMPFile_OnFrameSafe;

            //di = new DriveInfo(@"M:\");



            m_objMPFile.PreviewWindowSet("", panel1.Handle.ToInt32());
            m_objMPFile.PreviewEnable("", 1, 1);
        }
コード例 #8
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");
        }
コード例 #9
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;
            }
        }
コード例 #10
0
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objFile = new MFileClass();

            m_objRenderer = new MRendererClass();

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



            FileRenList();
            FileFormats();
        }
コード例 #11
0
        private void Form1_Load(object sender, EventArgs e)
        {
            m_objLive1  = new MFileClass();
            m_objLive2  = new MFileClass();
            m_objLive3  = new MFileClass();
            m_objLive4  = new MFileClass();
            m_objLive5  = new MFileClass();
            m_objLive6  = new MFileClass();
            m_objLive7  = new MFileClass();
            m_objLive8  = new MFileClass();
            m_objLive9  = new MFileClass();
            m_objLive10 = new MFileClass();

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

            m_objLive2.PreviewWindowSet("", panel2.Handle.ToInt32());
            m_objLive2.PreviewEnable("", 0, 1);

            m_objLive3.PreviewWindowSet("", panel3.Handle.ToInt32());
            m_objLive3.PreviewEnable("", 0, 1);

            m_objLive4.PreviewWindowSet("", panel4.Handle.ToInt32());
            m_objLive4.PreviewEnable("", 0, 1);

            m_objLive5.PreviewWindowSet("", panel5.Handle.ToInt32());
            m_objLive5.PreviewEnable("", 0, 1);

            m_objLive6.PreviewWindowSet("", panel6.Handle.ToInt32());
            m_objLive6.PreviewEnable("", 0, 1);

            m_objLive7.PreviewWindowSet("", panel7.Handle.ToInt32());
            m_objLive7.PreviewEnable("", 0, 1);

            m_objLive8.PreviewWindowSet("", panel8.Handle.ToInt32());
            m_objLive8.PreviewEnable("", 0, 1);

            m_objLive9.PreviewWindowSet("", panel9.Handle.ToInt32());
            m_objLive9.PreviewEnable("", 0, 1);

            m_objLive10.PreviewWindowSet("", panel10.Handle.ToInt32());
            m_objLive10.PreviewEnable("", 0, 1);

            m_objLive11 = new MFileClass();

            m_objLive11.PreviewWindowSet("", panel11.Handle.ToInt32());
            m_objLive11.PreviewEnable("", 1, 1);
        }
コード例 #12
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        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);
        }
コード例 #13
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        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();
        }
コード例 #14
0
 private void ReInitPr(string objectName)
 {
     if (objectName == "MFile")
     {
         m_objMFile.PreviewWindowSet("", panelpr.Handle.ToInt32());
         m_objMFile.PreviewEnable("", 0, 1);
     }
     else if (objectName == "MPlaylist")
     {
         m_objMPlaylist.PreviewWindowSet("", panelpr.Handle.ToInt32());
         m_objMPlaylist.PreviewEnable("", 0, 1);
     }
     else if (objectName == "MMixer")
     {
         m_objMixer.PreviewWindowSet("", panelpr.Handle.ToInt32());
         m_objMixer.PreviewEnable("", 0, 1);
     }
 }
コード例 #15
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;
            }
        }
コード例 #16
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();
        }
コード例 #17
0
ファイル: Form1.cs プロジェクト: tararonis/CustomSamples
        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();
        }
コード例 #18
0
ファイル: Form1.cs プロジェクト: bilaloguz/sdi_server
        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;
            }
        }