Пример #1
0
        public async Task Upload(IEnumerable<IRandomAccessStream> frames)
        {
            var frameId = 1;
            foreach (var stream in frames)
            {
                using (var socket = new StreamSocket())
                {
                    await socket.ConnectAsync(_host, _port);
                    var formatter = new CameraFrameFormatter();
                    var writer = new DataWriter(socket.OutputStream);
                    await formatter.Write(writer, await CameraFrame.Create(_cameraId, frameId++, stream));
                    await writer.StoreAsync();
                }
            }

            UploadComplete();
        }
Пример #2
0
        public async Task Upload(IEnumerable <IRandomAccessStream> frames)
        {
            var frameId = 1;

            foreach (var stream in frames)
            {
                using (var socket = new StreamSocket())
                {
                    await socket.ConnectAsync(_host, _port);

                    var formatter = new CameraFrameFormatter();
                    var writer    = new DataWriter(socket.OutputStream);
                    await formatter.Write(writer, await CameraFrame.Create(_cameraId, frameId++, stream));

                    await writer.StoreAsync();
                }
            }

            UploadComplete();
        }