Esempio n. 1
0
        static void RawToPGM(string extra, long stamp, VideoCaptureFormat format, byte[] buffer, bool save)
        {
            if (!save)
            {
                return;
            }
            int        w = (int)format.Width, h = (int)format.Height;
            string     name   = stamp.ToString("000000000000") + extra + ".pgm";
            FileStream fs     = File.Open(name, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
            string     header = "P5 " + w + " " + h + " 65535 ";

            byte[] bh = Encoding.ASCII.GetBytes(header);
            fs.Write(bh, 0, bh.Length);
            fs.Write(buffer, 0, buffer.Length);
            fs.Close();
        }
Esempio n. 2
0
        static byte[] Init(Adapter adapter, out VideoCaptureFormat format)
        {
            format = new VideoCaptureFormat()
            {
                Field         = Video4Linux.Analog.Kernel.v4l2_field.Any
                , Width       = 358, Height = 288
                , PixelFormat = Video4Linux.Analog.Kernel.v4l2_pix_format_id.GREY
            };
            adapter.SetFormat(format);
            //adapter.GetFormat(format);
            int count = (int)(format.Width * format.Height * 2);

            byte[] buffer = new byte[count];
            //WL("Method "+adapter.CaptureMethod+" "+format.Width+" "+format.Height+" "+format.PixelFormat+" "+format.Field+" "+format.BytesPerLine+" "+count);
            return(buffer);
        }
 public void SetPreferredVideoCaptureFormat(VideoCaptureFormat format)
 {
     Task.Run(async() => {
         await Context.WithContextAction(ctx => { ctx.SetPreferredVideoCaptureFormat(format); });
     }).Wait();
 }
Esempio n. 4
0
 public void SetPreferredVideoCaptureFormat(VideoCaptureFormat format)
 {
     _voipContext.SetPreferredVideoCaptureFormat(format);
 }
Esempio n. 5
0
 public IAsyncAction SetPreferredVideoCaptureFormatAsync(VideoCaptureFormat format)
 {
     return(InvokeHubChannelAsync <IMediaSettingsChannel>(format).AsTask().AsAsyncAction());
 }
Esempio n. 6
0
 public void SetPreferredVideoCaptureFormat(VideoCaptureFormat format)
 {
     InvokeHubChannel <IMediaSettingsChannel>(format);
 }