示例#1
0
        private static void SetVideoFormat(MPlaylistClass mplaylist, string formatName)
        {
            int count = 0;

            mplaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out count);
            int index = -1;

            MPLATFORMLib.M_VID_PROPS vidProps = new MPLATFORMLib.M_VID_PROPS();
            string name;

            for (int i = 0; i < count; i++)
            {
                mplaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out name);
                if (string.Equals(name, formatName, StringComparison.OrdinalIgnoreCase))
                {
                    index = i;
                    break;
                }
            }

            if (index >= 0)
            {
                mplaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);
            }
        }
        /// <summary>
        /// Set new video format
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void comboBoxVF_SelectedIndexChanged(object sender, EventArgs e)
        {
            M_VID_PROPS vidProps = new M_VID_PROPS();
            string      strFormat;

            m_objMixer.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, comboBoxVF.SelectedIndex, out vidProps, out strFormat);
            //Set new video format
            m_objMixer.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);
        }
        private static void SetVideoFormat(MPlaylistClass mplaylist, string formatName)
        {
            int count = 0;

            mplaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out count);
            int index = -1;

            MPLATFORMLib.M_VID_PROPS vidProps = new MPLATFORMLib.M_VID_PROPS();
            string name;

            for (int i = 0; i < count; i++)
            {
                mplaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out name);
                if (string.Equals(name, formatName, StringComparison.OrdinalIgnoreCase))
                {
                    index = i;
                    break;
                }
            }

            if (index >= 0)
            {
                mplaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);
            }

            //MPLATFORMLib.M_VID_PROPS m_VID_PROPS = default(MPLATFORMLib.M_VID_PROPS);

            //m_VID_PROPS.dblRate = info.FPS;
            //m_VID_PROPS.e3DFormat = MPLATFORMLib.eM3DFormat.eM3D_None;
            //m_VID_PROPS.eVideoFormat = info.VideoFormat; // info.VideoFormat.GetMPVideoFormat();
            //m_VID_PROPS.eScaleType = EnumUtils.ToMPScaleType(info.StretchMode);

            ////this._logger.AddLog(ENUM_LogType.INFO, "Video format: " + info.VideoFormat.ToString());
            ////this._logger.AddLog(ENUM_LogType.INFO, "ML Video format: " + m_VID_PROPS.eVideoFormat.ToString());

            //if (info.ExternalKeyMode)
            //{
            //    m_VID_PROPS.fccType = MPLATFORMLib.eMFCC.eMFCC_ARGB32;
            //}

            //if (/*info.VideoFormat.DisplayMode == ENUM_VIDEO_DISPLAY_MODE.PROGRESSIVE*/info.Progressive)
            //{
            //    m_VID_PROPS.eInterlace = MPLATFORMLib.eMInterlace.eMI_Progressive;
            //}
            //else
            //{
            //    m_VID_PROPS.eInterlace = MPLATFORMLib.eMInterlace.eMI_Default;
            //}
            //mplaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref m_VID_PROPS);
        }