Beispiel #1
0
        private void ConfigureWMScreenEncoder()
        {
            //
            // Set Private Data
            //
            IWMCodecPrivateData iPD = (IWMCodecPrivateData)compressor;

            iPD.SetPartialOutputType(ref cMT);

            uint cbData = 0;

            iPD.GetPrivateData(IntPtr.Zero, ref cbData);

            if (cbData != 0)
            {
                int vihSize = Marshal.SizeOf(cVI);

                // Allocate space for video info header + private data
                IntPtr vipd = Marshal.AllocCoTaskMem(vihSize + (int)cbData);

                // Copy vih into place
                Marshal.StructureToPtr(cVI, vipd, false);

                // Fill in private data
                iPD.GetPrivateData(new IntPtr(vipd.ToInt32() + vihSize), ref cbData);

                // Clean up current media type
                MediaType.Free(ref cMT);

                // Reset it
                cMT.pbFormat = vipd;
                cMT.cbFormat = (uint)vihSize + cbData;
            }
        }
Beispiel #2
0
        private void ConfigureWMScreenEncoder()
        {
            //
            // Note: Configure compressor before setting private data
            //
            //            IPropertyBag iPB = (IPropertyBag)compressor;
            //            object o = 1; // 1 == Live, can be obtained from IWMCodecProps.GetCodecProp(WM9PropList.g_wszWMVCComplexityExLive)
            //            iPB.Write(WM9PropList.g_wszWMVCComplexityEx, ref o);
            //
            //            // More configuration possibilities
            //            o = 0;
            //            iPB.Write(WM9PropList.g_wszWMVCComplexityMode, ref o);
            //
            //            o = 0;
            //            iPB.Write(WM9PropList.g_wszWMVCCrisp, ref o);
            //
            //            o = "MP";
            //            iPB.Write(WM9PropList.g_wszWMVCDecoderComplexityRequested, ref o);
            //
            //            o = 10000;
            //            iPB.Write(WM9PropList.g_wszWMVCVideoWindow, ref o);
            //
            //            o = true;
            //            iPB.Write(WM9PropList.g_wszWMVCVBREnabled, ref o);


            //
            // Set Private Data
            //
            IWMCodecPrivateData iPD = (IWMCodecPrivateData)compressor;

            iPD.SetPartialOutputType(ref cMT);

            uint cbData = 0;

            iPD.GetPrivateData(IntPtr.Zero, ref cbData);

            if (cbData != 0)
            {
                int vihSize = Marshal.SizeOf(cVI);

                // Allocate space for video info header + private data
                IntPtr vipd = Marshal.AllocCoTaskMem(vihSize + (int)cbData);

                // Copy vih into place
                Marshal.StructureToPtr(cVI, vipd, false);

                // Fill in private data
                iPD.GetPrivateData(new IntPtr(vipd.ToInt32() + vihSize), ref cbData);

                // Clean up current media type
                MediaType.Free(ref cMT);

                // Reset it
                cMT.pbFormat = vipd;
                cMT.cbFormat = (uint)vihSize + cbData;
            }
        }