Example #1
0
 public DispatchQueueScheduler(MonoTouch.CoreFoundation.DispatchQueue queue)
 {
     if (queue == null)
     {
         throw new ArgumentNullException("queue");
     }
     _queue = queue;
 }
Example #2
0
 public DispatchQueueScheduler()
 {
     _queue   = MonoTouch.CoreFoundation.DispatchQueue.MainQueue;
     _runLoop = MonoTouch.Foundation.NSRunLoop.Main;
 }
Example #3
0
 public DispatchQueueScheduler(MonoTouch.CoreFoundation.DispatchQueue queue)
 {
     if (queue == null)
         throw new ArgumentNullException ("queue");
     _queue = queue;
 }
        //Protected
        protected AVCaptureSession MaybeInitializeSession()
        {
            //Create the capture session
            var session = new AVCaptureSession()
            {
                SessionPreset = AVCaptureSession.PresetMedium
            };

            //Setup the video capture
            var captureDevice = AVCaptureDevice.DefaultDeviceWithMediaType(AVMediaType.Video);
            if (captureDevice == null)
            {
                Failure.Alert("No captureDevice - this won't work on the simulator, try a physical device");
                return null;
            }
            var input = AVCaptureDeviceInput.FromDevice(captureDevice);
            if (input == null)
            {
                Failure.Alert("No input - this won't work on the simulator, try a physical device");
                return null;
            }
            session.AddInput(input);

            // create a VideoDataOutput and add it to the sesion
            var output = new AVCaptureVideoDataOutput()
            {
                VideoSettings = new AVVideoSettings(CVPixelFormatType.CV32BGRA),
            };

            // configure the output
            var queue = new MonoTouch.CoreFoundation.DispatchQueue("myQueue");
            output.SetSampleBufferDelegate(this, queue);
            session.AddOutput(output);

            return session;
        }
Example #5
0
 public DispatchQueueScheduler()
 {
     _queue = MonoTouch.CoreFoundation.DispatchQueue.MainQueue;
     _runLoop = MonoTouch.Foundation.NSRunLoop.Main;
 }