예제 #1
0
        static void Main(string[] args)
        {
            lc = new Object();
            System.Console.WriteLine("Hello World");
            //byte[] img_data = read_byte_array_file(@"C:\Users\Peter A. Zientara\Documents\Projects\CAPIStream\Csharp\CAPIStream\CAPIStreamTest\test_gabor_input.dat");
            //System.Console.WriteLine("{0}", img_data.Length);
            client = new ConnectionControllerClient();
            client.configureConnection(ConnectionType.TCP, "localhost", 2275); //PORT CAPI SPELLED IN PHONE DIALER
            SocketData recData = client.receiveDataPacket(); //recieve header packet
            if (recData == null)
            {
                System.Console.WriteLine("good!");
            }

            #region do the main work
            //InitVideoCapture();

            //run();

            #endregion
            System.Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            // stream = new FileStream("C:\\video.264", FileMode.Create);
            //writ = new BinaryWriter(stream);
            initFrameConverter(width, height);
            models_names = new string[4];
            models_names[0] = @"intel_cpu";
            models_names[1] = @"asus_mobo";
            models_names[2] = @"nvidia_gpu";
            models_names[3] = @"cpu_fan";

            ServerController server = new ServerController();
            //for every delegate you want to function
            server.registerDelegate(CAPIStreamCommon.PacketType.VIDEO_FRAME, new ImageWork(processFrame));
            server.registerDelegate(CAPIStreamCommon.PacketType.GESTURE_DOWN, new ImageWork(handleGesture));
            offload_client.registerDelegate(CAPIStreamCommon.PacketType.REGISTER_TASK_REPLY, new PacketProcess(configureOffload));
            offload_client = new ConnectionControllerClient(ConnectionType.TCP, "192.168.82.9", 2275);

            /* register for task with offload server */
            if (offload_client.isConfigured())
            {
                String s = "intel_demo_task:raw:tcp";
                //send register task
                offload_client.sendDataPacket(new SocketData(PacketType.REGISTER_TASK, 1280, 720, 0, Encoding.ASCII.GetBytes(s)));
                offload_client.recieveDataPacketAsync();
            }

            //Begin accepting connections
            server.startServer(ConnectionType.TCP);
        }