Ejemplo n.º 1
0
        private int FindVideoDecoderOutputPin(IAMCrossbar crossbar)
        {
            int rv = -1;

            int outputPinsCount;
            int inputPinsCount;
            int hr = crossbar.get_PinCounts(out outputPinsCount, out inputPinsCount);

            DsError.ThrowExceptionForHR(hr);

            for (int i = 0; i < outputPinsCount; i++)
            {
                int relatedIndex;
                PhysicalConnectorType connectorType;
                hr = crossbar.get_CrossbarPinInfo(false, i, out relatedIndex, out connectorType);
                if (hr == 0)
                {
                    int inputPinIndex;
                    crossbar.get_IsRoutedTo(i, out inputPinIndex);

                    Trace.WriteLine(string.Format("Crossbar Output Pin {0}: '{1}' routed to pin {2}", i, GetPhysicalPinName(connectorType), inputPinIndex));
                    if (connectorType == PhysicalConnectorType.Video_VideoDecoder)
                    {
                        rv = i;
                    }
                }
            }

            return(rv);
        }
Ejemplo n.º 2
0
        private static Camera_NET.VideoInput GetCrossbarInput(IAMCrossbar crossbar)
        {
            int num;
            int num2;

            Camera_NET.VideoInput input = Camera_NET.VideoInput.Default;
            if (crossbar.get_PinCounts(out num2, out num) == 0)
            {
                int num4;
                int num6;
                int outputPinIndex = -1;
                for (int i = 0; i < num2; i++)
                {
                    PhysicalConnectorType type;
                    if ((crossbar.get_CrossbarPinInfo(false, i, out num4, out type) == 0) && (type == PhysicalConnectorType.Video_VideoDecoder))
                    {
                        outputPinIndex = i;
                        break;
                    }
                }
                if ((outputPinIndex != -1) && (crossbar.get_IsRoutedTo(outputPinIndex, out num6) == 0))
                {
                    PhysicalConnectorType type2;
                    crossbar.get_CrossbarPinInfo(true, num6, out num4, out type2);
                    input = new Camera_NET.VideoInput(num6, type2);
                }
            }
            return(input);
        }
Ejemplo n.º 3
0
        // Token: 0x06000044 RID: 68 RVA: 0x00003620 File Offset: 0x00001820
        private VideoInput GetCurrentCrossbarInput(IAMCrossbar crossbar)
        {
            VideoInput result = VideoInput.Default1;
            int        num;
            int        num2;

            if (crossbar.get_PinCounts(out num, out num2) == 0)
            {
                int num3 = -1;
                for (int i = 0; i < num; i++)
                {
                    int num4;
                    PhysicalConnectorType physicalConnectorType;
                    if (crossbar.get_CrossbarPinInfo(false, i, out num4, out physicalConnectorType) == 0 && physicalConnectorType == PhysicalConnectorType.VideoDecoder)
                    {
                        num3 = i;
                        break;
                    }
                }
                int num5;
                if (num3 != -1 && crossbar.get_IsRoutedTo(num3, out num5) == 0)
                {
                    int num4;
                    PhysicalConnectorType type;
                    int num6 = crossbar.get_CrossbarPinInfo(true, num5, out num4, out type);
                    result = new VideoInput(num5, type);
                }
            }
            return(result);
        }
Ejemplo n.º 4
0
        private VideoInput GetCurrentCrossbarInput(IAMCrossbar crossbar)
        {
            VideoInput videoInput = VideoInput.Default;

            int inPinsCount, outPinsCount;


            if (crossbar.get_PinCounts(out outPinsCount, out inPinsCount) == 0)
            {
                int videoOutputPinIndex = -1;
                int pinIndexRelated;
                PhysicalConnectorType type;


                for (int i = 0; i < outPinsCount; i++)
                {
                    if (crossbar.get_CrossbarPinInfo(false, i, out pinIndexRelated, out type) != 0)
                    {
                        continue;
                    }

                    if (type == PhysicalConnectorType.VideoDecoder)
                    {
                        videoOutputPinIndex = i;
                        break;
                    }
                }

                if (videoOutputPinIndex != -1)
                {
                    int videoInputPinIndex;


                    if (crossbar.get_IsRoutedTo(videoOutputPinIndex, out videoInputPinIndex) == 0)
                    {
                        PhysicalConnectorType inputType;

                        crossbar.get_CrossbarPinInfo(true, videoInputPinIndex, out pinIndexRelated, out inputType);

                        videoInput = new VideoInput(videoInputPinIndex, inputType);
                    }
                }
            }

            return(videoInput);
        }
Ejemplo n.º 5
0
        void TestIsRouted()
        {
            int hr;
            int opin, ipin;
            int iIsRouted;

            hr = m_ixbar.get_PinCounts(out opin, out ipin);
            DsError.ThrowExceptionForHR(hr);

            for (int y = 0; y < opin; y++)
            {
                hr = m_ixbar.get_IsRoutedTo(y, out iIsRouted);
                DsError.ThrowExceptionForHR(hr);

                Debug.Assert(iIsRouted < ipin && iIsRouted >= 0, "IsRouted");
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets type of input connected to video output of the crossbar.
        /// </summary>
        /// <param name="crossbar">The crossbar of device.</param>
        /// <returns>Video input of device</returns>
        /// <seealso cref="CrossbarAvailable"/>
        public static VideoInput GetCrossbarInput(IAMCrossbar crossbar)
        {
            VideoInput videoInput = VideoInput.Default;

            int inPinsCount, outPinsCount;

            // gen number of pins in the crossbar
            if (crossbar.get_PinCounts(out outPinsCount, out inPinsCount) == 0)
            {
                int videoOutputPinIndex = -1;
                int pinIndexRelated;
                PhysicalConnectorType type;

                // find index of the video output pin
                for (int i = 0; i < outPinsCount; i++)
                {
                    if (crossbar.get_CrossbarPinInfo(false, i, out pinIndexRelated, out type) != 0)
                    {
                        continue;
                    }

                    if (type == PhysicalConnectorType.Video_VideoDecoder)
                    {
                        videoOutputPinIndex = i;
                        break;
                    }
                }

                if (videoOutputPinIndex != -1)
                {
                    int videoInputPinIndex;

                    // get index of the input pin connected to the output
                    if (crossbar.get_IsRoutedTo(videoOutputPinIndex, out videoInputPinIndex) == 0)
                    {
                        PhysicalConnectorType inputType;

                        crossbar.get_CrossbarPinInfo(true, videoInputPinIndex, out pinIndexRelated, out inputType);

                        videoInput = new VideoInput(videoInputPinIndex, inputType);
                    }
                }
            }

            return(videoInput);
        }
Ejemplo n.º 7
0
        private VideoInput GetCurrentCrossbarInput(IAMCrossbar crossbar)
        {
            VideoInput result = VideoInput.Default;

            if (crossbar.get_PinCounts(out int outputPinCount, out int _) == 0)
            {
                int num = -1;
                int pinIndexRelated;
                for (int i = 0; i < outputPinCount; i++)
                {
                    if (crossbar.get_CrossbarPinInfo(isInputPin: false, i, out pinIndexRelated, out PhysicalConnectorType physicalType) == 0 && physicalType == PhysicalConnectorType.VideoDecoder)
                    {
                        num = i;
                        break;
                    }
                }
                if (num != -1 && crossbar.get_IsRoutedTo(num, out int inputPinIndex) == 0)
                {
                    crossbar.get_CrossbarPinInfo(isInputPin: true, inputPinIndex, out pinIndexRelated, out PhysicalConnectorType physicalType2);
                    result = new VideoInput(inputPinIndex, physicalType2);
                }
            }
            return(result);
        }
        // Get type of input connected to video output of the crossbar
        private VideoInput GetCurrentCrossbarInput( IAMCrossbar crossbar )
        {
            VideoInput videoInput = VideoInput.Default;

            int inPinsCount, outPinsCount;

            // gen number of pins in the crossbar
            if ( crossbar.get_PinCounts( out outPinsCount, out inPinsCount ) == 0 )
            {
                int videoOutputPinIndex = -1;
                int pinIndexRelated;
                PhysicalConnectorType type;

                // find index of the video output pin
                for ( int i = 0; i < outPinsCount; i++ )
                {
                    if ( crossbar.get_CrossbarPinInfo( false, i, out pinIndexRelated, out type ) != 0 )
                        continue;

                    if ( type == PhysicalConnectorType.VideoDecoder )
                    {
                        videoOutputPinIndex = i;
                        break;
                    }
                }

                if ( videoOutputPinIndex != -1 )
                {
                    int videoInputPinIndex;

                    // get index of the input pin connected to the output
                    if ( crossbar.get_IsRoutedTo( videoOutputPinIndex, out videoInputPinIndex ) == 0 )
                    {
                        PhysicalConnectorType inputType;

                        crossbar.get_CrossbarPinInfo( true, videoInputPinIndex, out pinIndexRelated, out inputType );

                        videoInput = new VideoInput( videoInputPinIndex, inputType );
                    }
                }
            }

            return videoInput;
        }
Ejemplo n.º 9
0
        public static string DumpCrossbar(IAMCrossbar iCB)
        {
            string ret = "\r\nCrossbar\r\n";

            if(iCB != null)
            {
                ArrayList pins = GetPins((IBaseFilter)iCB);
                ArrayList inputPins = GetPins(pins, _PinDirection.PINDIR_INPUT);
                ArrayList outputPins = GetPins(pins, _PinDirection.PINDIR_OUTPUT);

                int inPins, outPins;
                iCB.get_PinCounts(out outPins, out inPins);

                ret += "\tInput Pins...\r\n";
                for(int inIndex = 0; inIndex < inPins; inIndex++)
                {
                    int related, type;
                    iCB.get_CrossbarPinInfo(true, inIndex, out related, out type);

                    ret += string.Format(CultureInfo.CurrentCulture, "\t{0}, Related input pin: {1}\r\n", 
                        Pin.Name((IPin)inputPins[inIndex]), related);
                }

                ret += "\r\n\tOutput Pins...";
                for(int outIndex = 0; outIndex < outPins; outIndex++)
                {
                    int related, type, routed;
                    iCB.get_CrossbarPinInfo(false, outIndex, out related, out type);
                    iCB.get_IsRoutedTo(outIndex, out routed);

                    ret += string.Format(CultureInfo.CurrentCulture, 
                        "\r\n\t{0}, Related output pin: {1}, Routed input pin: {2}" + 
                        Environment.NewLine, Pin.Name((IPin)outputPins[outIndex]), related, routed);

                    ret += "\tSwitching Matrix (which input pins this output pin can accept): ";

                    for(int inIndex = 0; inIndex < inPins; inIndex++)
                    {
                        ret += string.Format(CultureInfo.CurrentCulture, "{0}-{1}", inIndex, 
                            (iCB.CanRoute(outIndex, inIndex) == 0) ? "Yes " : "No ");
                    }
                }
            }

            return ret;
        }
        private static int FindVideoDecoderOutputPin(IAMCrossbar crossbar)
        {
            int rv = -1;

            int outputPinsCount;
            int inputPinsCount;
            int hr = crossbar.get_PinCounts(out outputPinsCount, out inputPinsCount);
            DsError.ThrowExceptionForHR(hr);

            for (int i = 0; i < outputPinsCount; i++)
            {
                int relatedIndex;
                PhysicalConnectorType connectorType;
                hr = crossbar.get_CrossbarPinInfo(false, i, out relatedIndex, out connectorType);
                if (hr == 0)
                {
                    int inputPinIndex;
                    crossbar.get_IsRoutedTo(i, out inputPinIndex);

                    Trace.WriteLine(string.Format("Crossbar Output Pin {0}: '{1}' routed to pin {2}", i, GetPhysicalPinName(connectorType), inputPinIndex));
                    if (connectorType == PhysicalConnectorType.Video_VideoDecoder)
                        rv = i;
                }
            }

            return rv;
        }