Example #1
0
            void Setup()
            {
                if (graph.architecture != StreamArchitecture.ThreeLevelBasic)
                {
                    throw new ArgumentException(message: "Only StreamArchitecture.ThreeLevelBasic is currently supported.");
                }

                camStreamManagers = new CamStreamManager[graph.nThreadsPerLayer[0]];
                for (int j = 0; j < graph.nThreadsPerLayer[0]; j++)
                {
                    camStreamManagers[j] = new CamStreamManager(messageQueue: messageQueues[0][j], sessionPath: sessionPaths[j], setupStyle: CamStreamManager.CamStreamManagerSetup.BasicStream);
                }

                SingleStreamManager.Output[] _singleStreamOutputs = new SingleStreamManager.Output[graph.nThreadsPerLayer[1]];
                singleStreamManagers = new SingleStreamManager[graph.nThreadsPerLayer[1]];
                for (int j = 0; j < graph.nThreadsPerLayer[1]; j++)
                {
                    CamStreamManager.Output _camOutput = camStreamManagers[j].output;
                    singleStreamManagers[j] = new SingleStreamManager(camOutputManager: _camOutput,
                                                                      messageQueue: messageQueues[1][j], sessionPath: sessionPaths[j], setupStyle: SingleStreamManager.SingleStreamManangerSetup.BasicStream);

                    _singleStreamOutputs[j] = singleStreamManagers[j].output;
                }

                mergeStreamsManager = new MergeStreamsManager(singleStreamOutputManagers: _singleStreamOutputs,
                                                              messageQueue: messageQueues[2][0], sessionPath: sessionPaths[0], setupStyle: MergeStreamsManager.MergeStreamManangerSetup.BasicStream);
            }
Example #2
0
        void SetupThreads()
        {
            threads = new Thread[streamGraph.nThreadLayers][];
            for (int i = 0; i < streamGraph.nThreadLayers; i++)
            {
                threads[i] = new Thread[streamGraph.nThreadsPerLayer[i]];
                for (int j = 0; j < streamGraph.nThreadsPerLayer[i]; j++)
                {
                    int _i = i;
                    int _j = j;

                    if (streamGraph.graph[i][j] == ThreadType.Camera)
                    {
                        CamStreamManager _manager = managerBundle.camStreamManagers[_j];
                        threads[i][j] = new Thread(() => new OryxCamera(camNumber: _j, managedCamera: managedCameras[_j],
                                                                        manager: _manager, setupInfo: oryxSetups[_j]));
                    }
                    else if (streamGraph.graph[i][j] == ThreadType.SingleCameraStream)
                    {
                        SingleStreamManager _manager = managerBundle.singleStreamManagers[_j];
                        threads[i][j] = new Thread(() => BasicStreamThreadSetups.SingleStreamThreadInit(idx: _j, manager: _manager));
                    }
                    else if (streamGraph.graph[i][j] == ThreadType.MergeStreams)
                    {
                        MergeStreamsManager _manager = managerBundle.mergeStreamsManager;
                        threads[i][j] = new Thread(() => BasicStreamThreadSetups.MergeStreamsThreadInit(manager: _manager));
                    }
                }
            }
        }
Example #3
0
        public OryxCamera(int camNumber, IManagedCamera managedCamera, CamStreamManager manager, Util.OryxSetupInfo setupInfo)
        {
            this.camNumber     = camNumber;
            this.managedCamera = managedCamera;
            this.manager       = manager;
            this.setupInfo     = setupInfo;
            messageQueue       = this.manager.messageQueue;
            sessionPath        = this.manager.sessionPath;

            GetNodeMapsAndInitialize();
            LoadCameraSettings();

            StreamController.BasicStreamController controller = new StreamController.BasicStreamController(oryxCamera: this);
            Console.WriteLine("BasicStreamController set to Run");
            controller.Run();
        }