Пример #1
0
        public void BuildGraph()
        {
            int hr = 0;

            graphBuilder = (IFilterGraph2) new FilterGraph();
            vmr          = (IBaseFilter) new VideoMixingRenderer();

            hr = (vmr as IVMRFilterConfig).SetNumberOfStreams(4);
            DsError.ThrowExceptionForHR(hr);

            vmrMixerControl = (IVMRMixerControl)vmr;

            hr = graphBuilder.AddFilter(vmr, "VMR");
            DsError.ThrowExceptionForHR(hr);
        }
            /// <summary>
            /// Erzeugt eine neue Beschreibung.
            /// </summary>
            /// <param name="value">Der aktuelle Wert.</param>
            /// <param name="control">Die zugehörige Steuereinheit.</param>
            /// <param name="property">Die gewünschte Einstellung.</param>
            internal ParameterSet(float value, IVMRMixerControl control, VMRProcAmpControlFlags property)
            {
                // Create helper
                var range = VMRProcAmpControlRange.Create(property);

                // Read
                control.GetProcAmpControlRange(0, ref range);

                // Load all
                Default = range.DefaultValue;
                Minimum = range.MinValue;
                Maximum = range.MaxValue;
                Step    = range.StepSize;
                Value   = value;
            }
Пример #3
0
            /// <summary>
            /// Erzeugt eine neue Beschreibung.
            /// </summary>
            /// <param name="value">Der aktuelle Wert.</param>
            /// <param name="control">Die zugehörige Steuereinheit.</param>
            /// <param name="property">Die gewünschte Einstellung.</param>
            internal ParameterSet( float value, IVMRMixerControl control, VMRProcAmpControlFlags property )
            {
                // Create helper
                var range = VMRProcAmpControlRange.Create( property );

                // Read
                control.GetProcAmpControlRange( 0, ref range );

                // Load all
                Default = range.DefaultValue;
                Minimum = range.MinValue;
                Maximum = range.MaxValue;
                Step = range.StepSize;
                Value = value;
            }
        public void BuildGraph()
        {
            int hr = 0;

            graphBuilder = (IFilterGraph2) new FilterGraph();

            rot = new DsROTEntry(graphBuilder);

            vmr = (IBaseFilter) new VideoMixingRenderer();

            IVMRFilterConfig filterConfig = (IVMRFilterConfig)vmr;

            hr = filterConfig.SetNumberOfStreams(2);
            DsError.ThrowExceptionForHR(hr);

            // Set the custom compositor
            hr = filterConfig.SetImageCompositor(this);
            DsError.ThrowExceptionForHR(hr);

            IVMRMixerControl mixerControl = (IVMRMixerControl)vmr;

            // In COLORREF, colors are coded in ABGR format
            hr = mixerControl.SetBackgroundClr(backgroundColorABGR);
            DsError.ThrowExceptionForHR(hr);

            hr = graphBuilder.AddFilter(vmr, "VMR");
            DsError.ThrowExceptionForHR(hr);

            // The 2 VMR pins must be connected...
            hr = graphBuilder.RenderFile(@"..\..\..\Resources\foo.avi", null);
            DsError.ThrowExceptionForHR(hr);

            hr = graphBuilder.RenderFile(@"..\..\..\Resources\foo.avi", null);
            DsError.ThrowExceptionForHR(hr);

            hr = (graphBuilder as IMediaControl).Run();
            DsError.ThrowExceptionForHR(hr);
        }