Beispiel #1
0
        public static CMVRMultiSinkFactoryLoader getInstance()
        {
            if (mInstance == null)
            {
                mInstance = new CMVRMultiSinkFactoryLoader();
            }

            return(mInstance);
        }
Beispiel #2
0
            public bool createOutputNodes(IntPtr aHandle, object aPtrUnkSharedResource, uint aOutputNodeAmount, out List <object> aTopologyOutputNodesList)
            {
                bool lresult = false;

                aTopologyOutputNodesList = new List <object>();

                do
                {
                    try
                    {
                        IntPtr lOutputNodes = IntPtr.Zero;

                        int lhresult = CMVRMultiSinkFactoryLoader.createOutputNodes(
                            aHandle,
                            Marshal.GetIUnknownForObject(aPtrUnkSharedResource),
                            aOutputNodeAmount,
                            out lOutputNodes);

                        IntPtr[] lOutputNodesArray = new IntPtr[aOutputNodeAmount];

                        Marshal.Copy(lOutputNodes, lOutputNodesArray, 0, (int)aOutputNodeAmount);

                        for (int i = 0; i < aOutputNodeAmount; i++)
                        {
                            aTopologyOutputNodesList.Add(Marshal.GetObjectForIUnknown(lOutputNodesArray[i]));

                            Marshal.Release(lOutputNodesArray[i]);
                        }

                        Marshal.FreeCoTaskMem(lOutputNodes);

                        lresult = true;
                    }
                    catch (Exception exc)
                    {
                    }
                } while (false);

                return(lresult);
            }