예제 #1
0
        private void comboBoxVF_SelectedIndexChanged(object sender, EventArgs e)
        {
            M_VID_PROPS vidProps;
            string      strName;

            m_objLive.FormatVideoGetByIndex(eMFormatType.eMFT_Input, comboBoxVF.SelectedIndex, out vidProps, out strName);
            m_objLive.FormatVideoSet(eMFormatType.eMFT_Input, vidProps);
        }
예제 #2
0
        private void thread_DoWork(CancellationToken token)
        {
            while (!token.IsCancellationRequested)
            {
                if (encode || live)
                {
                    MFFrame    frameLive = null;
                    MFFrame    frameFile = null;
                    M_AV_PROPS props     = new M_AV_PROPS();
                    if (live)
                    {
                        M_VID_PROPS vidProps = new M_VID_PROPS();
                        vidProps.eVideoFormat = eMVideoFormat.eMVF_HD1080_5994i;
                        m_objLive.FormatVideoSet(eMFormatType.eMFT_Input, ref vidProps);
                        props.vidProps.eVideoFormat = eMVideoFormat.eMVF_Custom;
                        m_objLive.SourceFrameConvertedGet(ref props, -1, out frameLive, "");
                    }
                    if (encode)
                    {
                        props.vidProps.eVideoFormat = eMVideoFormat.eMVF_HD1080_5994i;

                        m_objReader.SourceFrameConvertedGet(ref props, -1, out frameFile, "");
                        if (frameLive != null)
                        {
                            frameLive.MFOverlay(frameFile, null, 0, 0, 0, "audio_gain=0", "ch1");
                        }
                    }

                    if (frameLive != null)
                    {
                        m_objPreview.ReceiverFramePut(frameLive, -1, "");
                    }
                    else
                    {
                        m_objPreview.ReceiverFramePut(frameFile, -1, "");
                    }

                    if (frameLive != null)
                    {
                        Marshal.FinalReleaseComObject(frameLive);
                    }
                    if (frameFile != null)
                    {
                        Marshal.FinalReleaseComObject(frameFile);
                    }
                }
            }
        }
예제 #3
0
        private void InitLive()
        {
            try
            {
                mLive.DeviceSet(eMFDeviceType.eMFDT_Video, comboBoxDevices.SelectedIndex, "");
                M_VID_PROPS vidProps;
                string      name;
                mLive.FormatVideoGetByIndex(eMFormatType.eMFT_Input, 0, out vidProps, out name);
                mLive.FormatVideoSet(eMFormatType.eMFT_Input, vidProps);
            }
            catch (Exception e)
            {
                MessageBox.Show("Could not set a device: " + e.ToString());
            }

            isWorking = true;
        }