コード例 #1
0
        private void bitrateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormMuxBitrate streamBitrateForm = new FormMuxBitrate();

            streamBitrateForm.SetStreamBitrateList(this.muxBitrateList);
            streamBitrateForm.Show();
        }
コード例 #2
0
        private void playoutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (0 == tsPacketSize)
            {
                //It looks like we have opened one invalid
                MessageBox.Show(null, "Invalid transport stream.",
                                "Error!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                FormMuxBitrate formMuxBitrate = new FormMuxBitrate();
                formMuxBitrate.ForceEnterBitrate(); //Force the user to select a bitrate.
                formMuxBitrate.SetStreamBitrateList(this.muxBitrateList);

                //Show a message so that the user can be aware of what will happen.
                MessageBox.Show(null, "Please select a bitrate or enter a new bitrate in the next dialog.",
                                "Identify a bitrate!", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //Reuse StreamBitrateForm as the user's choice.
                if (DialogResult.OK == formMuxBitrate.ShowDialog())
                {
                    //A ts media gateway.
                    FormGateway recordForm = new FormGateway();
                    recordForm.MdiParent   = (Form)this.Parent.Parent;
                    recordForm.WindowState = FormWindowState.Normal;
                    recordForm.SetFileInput(formMuxBitrate.GetSelectedBitrate(), streamFile, tsPacketSize);
                    recordForm.Show();
                }
            }
        }
コード例 #3
0
        private void buttonSelect_Click(object sender, EventArgs e)
        {
            FormMuxBitrate formMuxBitrate = new FormMuxBitrate();

            formMuxBitrate.ForceEnterBitrate(); //Force the user to select a bitrate.
            formMuxBitrate.SetStreamBitrateList(this.MuxBitrateList);

            if (DialogResult.OK == formMuxBitrate.ShowDialog())
            {
                maskedTextBoxBitrate.Text = formMuxBitrate.GetSelectedBitrate().ToString();
            }
        }
コード例 #4
0
        private void streamBitrateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormMuxBitrate formMuxBitrate = new FormMuxBitrate();

            formMuxBitrate.ForceEnterBitrate(); //Force the user to select a bitrate.
            formMuxBitrate.SetStreamBitrateList(this.muxBitrateList);

            //Show a message so that the user can be aware of what will happen.
            MessageBox.Show(null, "Please select a bitrate or enter a new bitrate in the next dialog.",
                            "Identify a bitrate!", MessageBoxButtons.OK, MessageBoxIcon.Information);

            //Reuse StreamBitrateForm as the user's choice.
            if (DialogResult.OK == formMuxBitrate.ShowDialog())
            {
                //Create the file stream parser and control it with requested bitrate.
                WorkerFilePidBitrate workerPidBitrate = new WorkerFilePidBitrate(this, ProcessWorkerMessage);

                //On stream start. Initialize the environment.
                OnStreamStart();

                //Pass the bitrate to the file stream parser.
                workerPidBitrate.SetStreamBitrate(formMuxBitrate.GetSelectedBitrate());

                Result result = workerPidBitrate.StartParse(streamFile);

                if (result.Fine)
                {
                    realtimeBitrateForm.ResetData();
                    realtimeBitrateForm.ShowDialog();
                }
                else
                {
                    //On stream stop. Finalize the environment.
                    OnStreamStop();
                }
            }
        }//streamBitrateToolStripMenuItem_Click