1
<Type Name="AVCaptureSession" FullName="MonoMac.AVFoundation.AVCaptureSession">
2
<TypeSignature Language="C#" Value="public class AVCaptureSession : MonoMac.Foundation.NSObject" />
3
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit AVCaptureSession extends MonoMac.Foundation.NSObject" />
5
<AssemblyName>MonoMac</AssemblyName>
6
<AssemblyVersion>0.0.0.0</AssemblyVersion>
9
<BaseTypeName>MonoMac.Foundation.NSObject</BaseTypeName>
14
<AttributeName>MonoMac.Foundation.Register("AVCaptureSession", true)</AttributeName>
18
<summary>Coordinates a recording session.</summary>
22
The AVCaptureSession object coordinates the recording of video
23
or audio input and passing the recorded information to one or
24
more output objects. An iPhone 3 for example will have two
25
input devices, one for the camera and one for the microphone.
26
An iPhone 4 would have three input devices, one for the
27
microphone, one for the back camera and one for the front
33
To record, you must create instances of the <see cref="T:MonoMac.AVFoundation.AVCaptureInput" /> class, usually by creating instances of the concrete <see cref="T:MonoMac.AVFoundation.AVCaptureDeviceInput" />.
37
You can the configure one or more output ports for the
38
captured data, and these can be still frames, video frames
39
with timing information, audio samples, quicktime movie files
40
or you can render it directly to a CoreAnimation layer.
45
Once you have configured the input and output components of
46
your session, you start the actual processing by calling the
47
<see cref="M:MonoMac.AVFoundation.AVCaptureSession.StartRunning()" />
55
/ configure the capture session for low resolution, change this if your code
56
// can cope with more data or volume
57
session = new AVCaptureSession () {
58
SessionPreset = AVCaptureSession.PresetMedium
61
// create a device input and attach it to the session
62
var captureDevice = AVCaptureDevice.DefaultDeviceWithMediaType (AVMediaType.Video);
63
var input = AVCaptureDeviceInput.FromDevice (captureDevice);
65
Console.WriteLine ("No video input device");
68
session.AddInput (input);
70
// create a VideoDataOutput and add it to the sesion
71
var output = new AVCaptureVideoDataOutput () {
72
VideoSettings = new AVVideoSettings (CVPixelFormatType.CV32BGRA),
74
// If you want to cap the frame rate at a given speed, in this sample: 15 frames per second
75
MinFrameDuration = new CMTime (1, 15)
78
// configure the output
79
queue = new MonoMac.CoreFoundation.DispatchQueue ("myQueue");
80
outputRecorder = new OutputRecorder ();
81
output.SetSampleBufferDelegateAndQueue (outputRecorder, queue);
82
session.AddOutput (output);
84
session.StartRunning ();
87
public class OutputRecorder : AVCaptureVideoDataOutputSampleBufferDelegate {
88
public override void DidOutputSampleBuffer (AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
91
var image = ImageFromSampleBuffer (sampleBuffer);
93
// Do something with the image, we just stuff it in our main view.
94
AppDelegate.ImageView.BeginInvokeOnMainThread (delegate {
95
AppDelegate.ImageView.Image = image;
99
// Although this looks innocent "Oh, he is just optimizing this case away"
100
// this is incredibly important to call on this callback, because the AVFoundation
101
// has a fixed number of buffers and if it runs out of free buffers, it will stop
102
// delivering frames.
104
sampleBuffer.Dispose ();
105
} catch (Exception e){
106
Console.WriteLine (e);
110
UIImage ImageFromSampleBuffer (CMSampleBuffer sampleBuffer)
112
// Get the CoreVideo image
113
using (var pixelBuffer = sampleBuffer.GetImageBuffer () as CVPixelBuffer){
114
// Lock the base address
115
pixelBuffer.Lock (0);
116
// Get the number of bytes per row for the pixel buffer
117
var baseAddress = pixelBuffer.BaseAddress;
118
int bytesPerRow = pixelBuffer.BytesPerRow;
119
int width = pixelBuffer.Width;
120
int height = pixelBuffer.Height;
121
var flags = CGBitmapFlags.PremultipliedFirst | CGBitmapFlags.ByteOrder32Little;
122
// Create a CGImage on the RGB colorspace from the configured parameter above
123
using (var cs = CGColorSpace.CreateDeviceRGB ())
124
using (var context = new CGBitmapContext (baseAddress,width, height, 8, bytesPerRow, cs, (CGImageAlphaInfo) flags))
125
using (var cgImage = context.ToImage ()){
126
pixelBuffer.Unlock (0);
127
return UIImage.FromImage (cgImage);
136
<related type="sample" href="http://samples.xamarin.com/Samples/ByGuid?guid=9fa28988-64fe-4365-b2b7-95542daf4f9b">avcaptureframes</related>
139
<Member MemberName=".ctor">
140
<MemberSignature Language="C#" Value="public AVCaptureSession ();" />
141
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
142
<MemberType>Constructor</MemberType>
144
<AssemblyVersion>0.0.0.0</AssemblyVersion>
148
<AttributeName>MonoMac.Foundation.Export("init")</AttributeName>
151
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
156
<summary>Default constructor that initializes a new instance of this class with no parameters.</summary>
161
<Member MemberName=".ctor">
162
<MemberSignature Language="C#" Value="public AVCaptureSession (MonoMac.Foundation.NSCoder coder);" />
163
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class MonoMac.Foundation.NSCoder coder) cil managed" />
164
<MemberType>Constructor</MemberType>
166
<AssemblyVersion>0.0.0.0</AssemblyVersion>
170
<AttributeName>MonoMac.Foundation.Export("initWithCoder:")</AttributeName>
173
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
177
<Parameter Name="coder" Type="MonoMac.Foundation.NSCoder" />
180
<param name="coder">The unarchiver object.</param>
181
<summary>A constructor that initializes the object from the data stored in the unarchiver object.</summary>
182
<remarks>This constructor is provided to allow the class to be initialized from an unarchiver (for example, during NIB deserialization).</remarks>
185
<Member MemberName=".ctor">
186
<MemberSignature Language="C#" Value="public AVCaptureSession (MonoMac.Foundation.NSObjectFlag t);" />
187
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class MonoMac.Foundation.NSObjectFlag t) cil managed" />
188
<MemberType>Constructor</MemberType>
190
<AssemblyVersion>0.0.0.0</AssemblyVersion>
194
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
198
<Parameter Name="t" Type="MonoMac.Foundation.NSObjectFlag" />
201
<param name="t">Unused sentinel value, pass NSObjectFlag.Empty.</param>
202
<summary>Constructor to call on derived classes when the derived class has an [Export] constructor.</summary>
204
<para>This constructor should be called by derived classes when they are initialized using an [Export] attribute. The argument value is ignore, typically the chaining would look like this:</para>
207
public class MyClass : BaseClass {
208
[Export ("initWithFoo:")]
209
public MyClass (string foo) : base (NSObjectFlag.Empty)
218
<Member MemberName=".ctor">
219
<MemberSignature Language="C#" Value="public AVCaptureSession (IntPtr handle);" />
220
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle) cil managed" />
221
<MemberType>Constructor</MemberType>
223
<AssemblyVersion>0.0.0.0</AssemblyVersion>
227
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
231
<Parameter Name="handle" Type="System.IntPtr" />
234
<param name="handle">Pointer (handle) to the unmanaged object.</param>
235
<summary>A constructor used when creating managed representations of unmanaged objects; Called by the runtime.</summary>
237
<para>This constructor is invoked by the runtime infrastructure (<see cref="M:MonoMac.ObjCRuntime.GetNSObject (System.IntPtr)" />) to create a new managed representation for a pointer to an unmanaged Objective-C object. You should not invoke this method directly, instead you should call the GetNSObject method as it will prevent two instances of a managed object to point to the same native object.</para>
241
<Member MemberName="AddInput">
242
<MemberSignature Language="C#" Value="public virtual void AddInput (MonoMac.AVFoundation.AVCaptureInput input);" />
243
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddInput(class MonoMac.AVFoundation.AVCaptureInput input) cil managed" />
244
<MemberType>Method</MemberType>
246
<AssemblyVersion>0.0.0.0</AssemblyVersion>
250
<AttributeName>MonoMac.Foundation.Export("addInput:")</AttributeName>
254
<ReturnType>System.Void</ReturnType>
257
<Parameter Name="input" Type="MonoMac.AVFoundation.AVCaptureInput" />
260
<param name="input">The AVCaptureInput to add to the session</param>
261
<summary>Adds an input to the Capture Session</summary>
262
<remarks>To be added.</remarks>
265
<Member MemberName="AddOutput">
266
<MemberSignature Language="C#" Value="public virtual void AddOutput (MonoMac.AVFoundation.AVCaptureOutput output);" />
267
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddOutput(class MonoMac.AVFoundation.AVCaptureOutput output) cil managed" />
268
<MemberType>Method</MemberType>
270
<AssemblyVersion>0.0.0.0</AssemblyVersion>
274
<AttributeName>MonoMac.Foundation.Export("addOutput:")</AttributeName>
278
<ReturnType>System.Void</ReturnType>
281
<Parameter Name="output" Type="MonoMac.AVFoundation.AVCaptureOutput" />
284
<param name="output">To be added.</param>
285
<summary>Adds an output to the capture session.</summary>
286
<remarks>To be added.</remarks>
289
<Member MemberName="BeginConfiguration">
290
<MemberSignature Language="C#" Value="public virtual void BeginConfiguration ();" />
291
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void BeginConfiguration() cil managed" />
292
<MemberType>Method</MemberType>
294
<AssemblyVersion>0.0.0.0</AssemblyVersion>
298
<AttributeName>MonoMac.Foundation.Export("beginConfiguration")</AttributeName>
302
<ReturnType>System.Void</ReturnType>
306
<summary>Initiates a transaction to change the configuration of the Capture Session.</summary>
307
<remarks>To be added.</remarks>
310
<Member MemberName="CanAddInput">
311
<MemberSignature Language="C#" Value="public virtual bool CanAddInput (MonoMac.AVFoundation.AVCaptureInput input);" />
312
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool CanAddInput(class MonoMac.AVFoundation.AVCaptureInput input) cil managed" />
313
<MemberType>Method</MemberType>
315
<AssemblyVersion>0.0.0.0</AssemblyVersion>
319
<AttributeName>MonoMac.Foundation.Export("canAddInput:")</AttributeName>
323
<ReturnType>System.Boolean</ReturnType>
326
<Parameter Name="input" Type="MonoMac.AVFoundation.AVCaptureInput" />
329
<param name="input">To be added.</param>
330
<summary>Returns whether the given input can be added to the session.</summary>
331
<returns>To be added.</returns>
332
<remarks>To be added.</remarks>
335
<Member MemberName="CanAddOutput">
336
<MemberSignature Language="C#" Value="public virtual bool CanAddOutput (MonoMac.AVFoundation.AVCaptureOutput output);" />
337
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool CanAddOutput(class MonoMac.AVFoundation.AVCaptureOutput output) cil managed" />
338
<MemberType>Method</MemberType>
340
<AssemblyVersion>0.0.0.0</AssemblyVersion>
344
<AttributeName>MonoMac.Foundation.Export("canAddOutput:")</AttributeName>
348
<ReturnType>System.Boolean</ReturnType>
351
<Parameter Name="output" Type="MonoMac.AVFoundation.AVCaptureOutput" />
354
<param name="output">To be added.</param>
355
<summary>Returns whether the given input can be added to the session.</summary>
356
<returns>To be added.</returns>
357
<remarks>To be added.</remarks>
360
<Member MemberName="CanSetSessionPreset">
361
<MemberSignature Language="C#" Value="public virtual bool CanSetSessionPreset (MonoMac.Foundation.NSString preset);" />
362
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool CanSetSessionPreset(class MonoMac.Foundation.NSString preset) cil managed" />
363
<MemberType>Method</MemberType>
365
<AssemblyVersion>0.0.0.0</AssemblyVersion>
369
<AttributeName>MonoMac.Foundation.Export("canSetSessionPreset:")</AttributeName>
373
<ReturnType>System.Boolean</ReturnType>
376
<Parameter Name="preset" Type="MonoMac.Foundation.NSString" />
379
<param name="preset">To be added.</param>
380
<summary>To be added.</summary>
381
<returns>To be added.</returns>
382
<remarks>To be added.</remarks>
385
<Member MemberName="ClassHandle">
386
<MemberSignature Language="C#" Value="public override IntPtr ClassHandle { get; }" />
387
<MemberSignature Language="ILAsm" Value=".property instance native int ClassHandle" />
388
<MemberType>Property</MemberType>
390
<AssemblyVersion>0.0.0.0</AssemblyVersion>
393
<ReturnType>System.IntPtr</ReturnType>
396
<summary>The handle for this class.</summary>
397
<value>The pointer to the Objective-C class.</value>
398
<remarks>Each MonoMac class mirrors an unmanaged Objective-C class. This value contains the pointer to the Objective-C class, it is similar to calling objc_getClass with the object name.</remarks>
401
<Member MemberName="CommitConfiguration">
402
<MemberSignature Language="C#" Value="public virtual void CommitConfiguration ();" />
403
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void CommitConfiguration() cil managed" />
404
<MemberType>Method</MemberType>
406
<AssemblyVersion>0.0.0.0</AssemblyVersion>
410
<AttributeName>MonoMac.Foundation.Export("commitConfiguration")</AttributeName>
414
<ReturnType>System.Void</ReturnType>
418
<summary>Applies atomically all the configuration changes that were made to the Capture Session since BeginConfiguration.</summary>
419
<remarks>To be added.</remarks>
422
<Member MemberName="DidStartRunningNotification">
423
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString DidStartRunningNotification { get; }" />
424
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString DidStartRunningNotification" />
425
<MemberType>Property</MemberType>
427
<AssemblyVersion>0.0.0.0</AssemblyVersion>
430
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
433
<summary>Notification constant for DidStartRunning</summary>
434
<value>NSString constant, should be used as a token to NSNotificationCenter.</value>
436
<para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification. This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content. The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
437
<para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:AVCaptureSession+Notifications" />.<see cref="M:AVCaptureSession+Notifications.ObserveDidStartRunning" /> method which offers strongly typed access to the parameters of the notification.</para>
438
<para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
446
notification = AVCaptureSession.Notifications.ObserveDidStartRunning ((sender, args) => {
447
/* Access strongly typed args */
448
Console.WriteLine ("Notification: {0}", args.Notification);
451
// To stop listening:
452
notification.Dispose ();
457
NSObject notification;
458
void Callback (object sender, DidStartRunning args)
460
// Access strongly typed args
461
Console.WriteLine ("Notification: {0}", args.Notification);
466
notification = AVCaptureSession.Notifications.ObserveDidStartRunning (Callback);
471
notification.Dispose ();
474
<para>The following example shows how to use the notification with the DefaultCenter API:</para>
478
NSNotificationCenter.DefaultCenter.AddObserver (
479
AVCaptureSession.DidStartRunningNotification, (notification) => {Console.WriteLine ("Received the notification AVCaptureSession", notification); }
483
void Callback (NSNotification notification)
485
Console.WriteLine ("Received a notification AVCaptureSession", notification);
490
NSNotificationCenter.DefaultCenter.AddObserver (AVCaptureSession.DidStartRunningNotification, Callback);
497
<Member MemberName="DidStopRunningNotification">
498
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString DidStopRunningNotification { get; }" />
499
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString DidStopRunningNotification" />
500
<MemberType>Property</MemberType>
502
<AssemblyVersion>0.0.0.0</AssemblyVersion>
505
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
508
<summary>Notification constant for DidStopRunning</summary>
509
<value>NSString constant, should be used as a token to NSNotificationCenter.</value>
511
<para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification. This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content. The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
512
<para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:AVCaptureSession+Notifications" />.<see cref="M:AVCaptureSession+Notifications.ObserveDidStopRunning" /> method which offers strongly typed access to the parameters of the notification.</para>
513
<para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
521
notification = AVCaptureSession.Notifications.ObserveDidStopRunning ((sender, args) => {
522
/* Access strongly typed args */
523
Console.WriteLine ("Notification: {0}", args.Notification);
526
// To stop listening:
527
notification.Dispose ();
532
NSObject notification;
533
void Callback (object sender, DidStopRunning args)
535
// Access strongly typed args
536
Console.WriteLine ("Notification: {0}", args.Notification);
541
notification = AVCaptureSession.Notifications.ObserveDidStopRunning (Callback);
546
notification.Dispose ();
549
<para>The following example shows how to use the notification with the DefaultCenter API:</para>
553
NSNotificationCenter.DefaultCenter.AddObserver (
554
AVCaptureSession.DidStopRunningNotification, (notification) => {Console.WriteLine ("Received the notification AVCaptureSession", notification); }
558
void Callback (NSNotification notification)
560
Console.WriteLine ("Received a notification AVCaptureSession", notification);
565
NSNotificationCenter.DefaultCenter.AddObserver (AVCaptureSession.DidStopRunningNotification, Callback);
572
<Member MemberName="Dispose">
573
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
574
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
575
<MemberType>Method</MemberType>
577
<AssemblyVersion>0.0.0.0</AssemblyVersion>
580
<ReturnType>System.Void</ReturnType>
583
<Parameter Name="disposing" Type="System.Boolean" />
586
<param name="disposing">
587
<para>If set to <see langword="true" />, the method is invoked directly and will dispose manage and unmanaged resources; If set to <see langword="false" /> the method is being called by the garbage collector finalizer and should only release unmanaged resources.</para>
589
<summary>Releases the resources used by the AVCaptureSession object.</summary>
591
<para>This Dispose method releases the resources used by the AVCaptureSession class.</para>
592
<para>This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposting <paramref name="disposing" /> is set to <see langword="true" /> and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to <see langword="false" />. </para>
593
<para>Calling the Dispose method when you are finished using the AVCaptureSession ensures that all external resources used by this managed object are released as soon as possible. Once you have invoked the Dispose method, the object is no longer useful and you should no longer make any calls to it.</para>
594
<para> For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx</para>
598
<Member MemberName="ErrorKey">
599
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString ErrorKey { get; }" />
600
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString ErrorKey" />
601
<MemberType>Property</MemberType>
603
<AssemblyVersion>0.0.0.0</AssemblyVersion>
606
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
609
<summary>Represents the value associated with the constant AVCaptureSessionErrorKey</summary>
612
<remarks>To be added.</remarks>
615
<Member MemberName="Inputs">
616
<MemberSignature Language="C#" Value="public virtual MonoMac.AVFoundation.AVCaptureInput[] Inputs { get; }" />
617
<MemberSignature Language="ILAsm" Value=".property instance class MonoMac.AVFoundation.AVCaptureInput[] Inputs" />
618
<MemberType>Property</MemberType>
620
<AssemblyVersion>0.0.0.0</AssemblyVersion>
624
<AttributeName>get: MonoMac.Foundation.Export("inputs")</AttributeName>
628
<ReturnType>MonoMac.AVFoundation.AVCaptureInput[]</ReturnType>
631
<summary>Inputs to the capture session.</summary>
632
<value>To be added.</value>
633
<remarks>To be added.</remarks>
636
<Member MemberName="Interrupted">
637
<MemberSignature Language="C#" Value="public virtual bool Interrupted { get; }" />
638
<MemberSignature Language="ILAsm" Value=".property instance bool Interrupted" />
639
<MemberType>Property</MemberType>
641
<AssemblyVersion>0.0.0.0</AssemblyVersion>
645
<AttributeName>get: MonoMac.Foundation.Export("isInterrupted")</AttributeName>
649
<ReturnType>System.Boolean</ReturnType>
652
<summary>Whether the session has been interrupted.</summary>
653
<value>To be added.</value>
654
<remarks>To be added.</remarks>
657
<Member MemberName="InterruptionEndedNotification">
658
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString InterruptionEndedNotification { get; }" />
659
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString InterruptionEndedNotification" />
660
<MemberType>Property</MemberType>
662
<AssemblyVersion>0.0.0.0</AssemblyVersion>
665
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
668
<summary>Notification constant for InterruptionEnded</summary>
669
<value>NSString constant, should be used as a token to NSNotificationCenter.</value>
671
<para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification. This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content. The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
672
<para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:AVCaptureSession+Notifications" />.<see cref="M:AVCaptureSession+Notifications.ObserveInterruptionEnded" /> method which offers strongly typed access to the parameters of the notification.</para>
673
<para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
681
notification = AVCaptureSession.Notifications.ObserveInterruptionEnded ((sender, args) => {
682
/* Access strongly typed args */
683
Console.WriteLine ("Notification: {0}", args.Notification);
686
// To stop listening:
687
notification.Dispose ();
692
NSObject notification;
693
void Callback (object sender, InterruptionEnded args)
695
// Access strongly typed args
696
Console.WriteLine ("Notification: {0}", args.Notification);
701
notification = AVCaptureSession.Notifications.ObserveInterruptionEnded (Callback);
706
notification.Dispose ();
709
<para>The following example shows how to use the notification with the DefaultCenter API:</para>
713
NSNotificationCenter.DefaultCenter.AddObserver (
714
AVCaptureSession.InterruptionEndedNotification, (notification) => {Console.WriteLine ("Received the notification AVCaptureSession", notification); }
718
void Callback (NSNotification notification)
720
Console.WriteLine ("Received a notification AVCaptureSession", notification);
725
NSNotificationCenter.DefaultCenter.AddObserver (AVCaptureSession.InterruptionEndedNotification, Callback);
732
<Member MemberName="Outputs">
733
<MemberSignature Language="C#" Value="public virtual MonoMac.AVFoundation.AVCaptureOutput[] Outputs { get; }" />
734
<MemberSignature Language="ILAsm" Value=".property instance class MonoMac.AVFoundation.AVCaptureOutput[] Outputs" />
735
<MemberType>Property</MemberType>
737
<AssemblyVersion>0.0.0.0</AssemblyVersion>
741
<AttributeName>get: MonoMac.Foundation.Export("outputs")</AttributeName>
745
<ReturnType>MonoMac.AVFoundation.AVCaptureOutput[]</ReturnType>
748
<summary>Outputs for the capture session.</summary>
749
<value>To be added.</value>
750
<remarks>To be added.</remarks>
753
<Member MemberName="Preset1280x720">
754
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString Preset1280x720 { get; }" />
755
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString Preset1280x720" />
756
<MemberType>Property</MemberType>
758
<AssemblyVersion>0.0.0.0</AssemblyVersion>
761
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
764
<summary>Represents the value associated with the constant AVCaptureSessionPreset1280x720</summary>
767
<remarks>To be added.</remarks>
770
<Member MemberName="Preset352x288">
771
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString Preset352x288 { get; }" />
772
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString Preset352x288" />
773
<MemberType>Property</MemberType>
775
<AssemblyVersion>0.0.0.0</AssemblyVersion>
778
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
781
<summary>Represents the value associated with the constant AVCaptureSessionPreset352x288</summary>
784
<remarks>To be added.</remarks>
787
<Member MemberName="Preset640x480">
788
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString Preset640x480 { get; }" />
789
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString Preset640x480" />
790
<MemberType>Property</MemberType>
792
<AssemblyVersion>0.0.0.0</AssemblyVersion>
795
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
798
<summary>Represents the value associated with the constant AVCaptureSessionPreset640x480</summary>
801
<remarks>To be added.</remarks>
804
<Member MemberName="PresetHigh">
805
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString PresetHigh { get; }" />
806
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString PresetHigh" />
807
<MemberType>Property</MemberType>
809
<AssemblyVersion>0.0.0.0</AssemblyVersion>
812
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
815
<summary>Represents the value associated with the constant AVCaptureSessionPresetHigh</summary>
818
<remarks>To be added.</remarks>
821
<Member MemberName="PresetiFrame1280x720">
822
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString PresetiFrame1280x720 { get; }" />
823
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString PresetiFrame1280x720" />
824
<MemberType>Property</MemberType>
826
<AssemblyVersion>0.0.0.0</AssemblyVersion>
829
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
832
<summary>Represents the value associated with the constant AVCaptureSessionPresetiFrame1280x720</summary>
835
<remarks>To be added.</remarks>
838
<Member MemberName="PresetiFrame960x540">
839
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString PresetiFrame960x540 { get; }" />
840
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString PresetiFrame960x540" />
841
<MemberType>Property</MemberType>
843
<AssemblyVersion>0.0.0.0</AssemblyVersion>
846
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
849
<summary>Represents the value associated with the constant AVCaptureSessionPresetiFrame960x540</summary>
852
<remarks>To be added.</remarks>
855
<Member MemberName="PresetLow">
856
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString PresetLow { get; }" />
857
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString PresetLow" />
858
<MemberType>Property</MemberType>
860
<AssemblyVersion>0.0.0.0</AssemblyVersion>
863
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
866
<summary>Represents the value associated with the constant AVCaptureSessionPresetLow</summary>
869
<remarks>To be added.</remarks>
872
<Member MemberName="PresetMedium">
873
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString PresetMedium { get; }" />
874
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString PresetMedium" />
875
<MemberType>Property</MemberType>
877
<AssemblyVersion>0.0.0.0</AssemblyVersion>
880
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
883
<summary>Represents the value associated with the constant AVCaptureSessionPresetMedium</summary>
886
<remarks>To be added.</remarks>
889
<Member MemberName="PresetPhoto">
890
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString PresetPhoto { get; }" />
891
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString PresetPhoto" />
892
<MemberType>Property</MemberType>
894
<AssemblyVersion>0.0.0.0</AssemblyVersion>
897
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
900
<summary>Represents the value associated with the constant AVCaptureSessionPresetPhoto</summary>
903
<remarks>To be added.</remarks>
906
<Member MemberName="RemoveInput">
907
<MemberSignature Language="C#" Value="public virtual void RemoveInput (MonoMac.AVFoundation.AVCaptureInput input);" />
908
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void RemoveInput(class MonoMac.AVFoundation.AVCaptureInput input) cil managed" />
909
<MemberType>Method</MemberType>
911
<AssemblyVersion>0.0.0.0</AssemblyVersion>
915
<AttributeName>MonoMac.Foundation.Export("removeInput:")</AttributeName>
919
<ReturnType>System.Void</ReturnType>
922
<Parameter Name="input" Type="MonoMac.AVFoundation.AVCaptureInput" />
925
<param name="input">To be added.</param>
926
<summary>Removes the specified input source.</summary>
927
<remarks>To be added.</remarks>
930
<Member MemberName="RemoveOutput">
931
<MemberSignature Language="C#" Value="public virtual void RemoveOutput (MonoMac.AVFoundation.AVCaptureOutput output);" />
932
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void RemoveOutput(class MonoMac.AVFoundation.AVCaptureOutput output) cil managed" />
933
<MemberType>Method</MemberType>
935
<AssemblyVersion>0.0.0.0</AssemblyVersion>
939
<AttributeName>MonoMac.Foundation.Export("removeOutput:")</AttributeName>
943
<ReturnType>System.Void</ReturnType>
946
<Parameter Name="output" Type="MonoMac.AVFoundation.AVCaptureOutput" />
949
<param name="output">To be added.</param>
950
<summary>Removes the specified output.</summary>
951
<remarks>To be added.</remarks>
954
<Member MemberName="Running">
955
<MemberSignature Language="C#" Value="public virtual bool Running { get; }" />
956
<MemberSignature Language="ILAsm" Value=".property instance bool Running" />
957
<MemberType>Property</MemberType>
959
<AssemblyVersion>0.0.0.0</AssemblyVersion>
963
<AttributeName>get: MonoMac.Foundation.Export("isRunning")</AttributeName>
967
<ReturnType>System.Boolean</ReturnType>
970
<summary>Whether the capture session is currently running.</summary>
971
<value>To be added.</value>
972
<remarks>To be added.</remarks>
975
<Member MemberName="RuntimeErrorNotification">
976
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString RuntimeErrorNotification { get; }" />
977
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString RuntimeErrorNotification" />
978
<MemberType>Property</MemberType>
980
<AssemblyVersion>0.0.0.0</AssemblyVersion>
983
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
986
<summary>Notification constant for RuntimeError</summary>
987
<value>NSString constant, should be used as a token to NSNotificationCenter.</value>
989
<para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification. This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content. The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
990
<para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:AVCaptureSession+Notifications" />.<see cref="M:AVCaptureSession+Notifications.ObserveRuntimeError" /> method which offers strongly typed access to the parameters of the notification.</para>
991
<para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
999
notification = AVCaptureSession.Notifications.ObserveRuntimeError ((sender, args) => {
1000
/* Access strongly typed args */
1001
Console.WriteLine ("Notification: {0}", args.Notification);
1003
Console.WriteLine ("Error", args.Error);
1006
// To stop listening:
1007
notification.Dispose ();
1012
NSObject notification;
1013
void Callback (object sender, RuntimeError args)
1015
// Access strongly typed args
1016
Console.WriteLine ("Notification: {0}", args.Notification);
1018
Console.WriteLine ("Error", args.Error);
1023
notification = AVCaptureSession.Notifications.ObserveRuntimeError (Callback);
1028
notification.Dispose ();
1031
<para>The following example shows how to use the notification with the DefaultCenter API:</para>
1035
NSNotificationCenter.DefaultCenter.AddObserver (
1036
AVCaptureSession.RuntimeErrorNotification, (notification) => {Console.WriteLine ("Received the notification AVCaptureSession", notification); }
1040
void Callback (NSNotification notification)
1042
Console.WriteLine ("Received a notification AVCaptureSession", notification);
1047
NSNotificationCenter.DefaultCenter.AddObserver (AVCaptureSession.RuntimeErrorNotification, Callback);
1054
<Member MemberName="SessionPreset">
1055
<MemberSignature Language="C#" Value="public virtual MonoMac.Foundation.NSString SessionPreset { get; set; }" />
1056
<MemberSignature Language="ILAsm" Value=".property instance class MonoMac.Foundation.NSString SessionPreset" />
1057
<MemberType>Property</MemberType>
1059
<AssemblyVersion>0.0.0.0</AssemblyVersion>
1063
<AttributeName>get: MonoMac.Foundation.Export("sessionPreset")</AttributeName>
1066
<AttributeName>set: MonoMac.Foundation.Export("setSessionPreset:")</AttributeName>
1070
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
1073
<summary>The session preset.</summary>
1074
<value>To be added.</value>
1075
<remarks>To be added.</remarks>
1078
<Member MemberName="StartRunning">
1079
<MemberSignature Language="C#" Value="public virtual void StartRunning ();" />
1080
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void StartRunning() cil managed" />
1081
<MemberType>Method</MemberType>
1083
<AssemblyVersion>0.0.0.0</AssemblyVersion>
1087
<AttributeName>MonoMac.Foundation.Export("startRunning")</AttributeName>
1091
<ReturnType>System.Void</ReturnType>
1095
<summary>Starts the flow of inputs and outputs.</summary>
1096
<remarks>To be added.</remarks>
1099
<Member MemberName="StopRunning">
1100
<MemberSignature Language="C#" Value="public virtual void StopRunning ();" />
1101
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void StopRunning() cil managed" />
1102
<MemberType>Method</MemberType>
1104
<AssemblyVersion>0.0.0.0</AssemblyVersion>
1108
<AttributeName>MonoMac.Foundation.Export("stopRunning")</AttributeName>
1112
<ReturnType>System.Void</ReturnType>
1116
<summary>Stops the flow of inputs and outputs.</summary>
1117
<remarks>To be added.</remarks>
1120
<Member MemberName="WasInterruptedNotification">
1121
<MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSString WasInterruptedNotification { get; }" />
1122
<MemberSignature Language="ILAsm" Value=".property class MonoMac.Foundation.NSString WasInterruptedNotification" />
1123
<MemberType>Property</MemberType>
1125
<AssemblyVersion>0.0.0.0</AssemblyVersion>
1128
<ReturnType>MonoMac.Foundation.NSString</ReturnType>
1131
<summary>Notification constant for WasInterrupted</summary>
1132
<value>NSString constant, should be used as a token to NSNotificationCenter.</value>
1134
<para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification. This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content. The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
1135
<para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:AVCaptureSession+Notifications" />.<see cref="M:AVCaptureSession+Notifications.ObserveWasInterrupted" /> method which offers strongly typed access to the parameters of the notification.</para>
1136
<para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
1144
notification = AVCaptureSession.Notifications.ObserveWasInterrupted ((sender, args) => {
1145
/* Access strongly typed args */
1146
Console.WriteLine ("Notification: {0}", args.Notification);
1149
// To stop listening:
1150
notification.Dispose ();
1155
NSObject notification;
1156
void Callback (object sender, WasInterrupted args)
1158
// Access strongly typed args
1159
Console.WriteLine ("Notification: {0}", args.Notification);
1164
notification = AVCaptureSession.Notifications.ObserveWasInterrupted (Callback);
1169
notification.Dispose ();
1172
<para>The following example shows how to use the notification with the DefaultCenter API:</para>
1176
NSNotificationCenter.DefaultCenter.AddObserver (
1177
AVCaptureSession.WasInterruptedNotification, (notification) => {Console.WriteLine ("Received the notification AVCaptureSession", notification); }
1181
void Callback (NSNotification notification)
1183
Console.WriteLine ("Received a notification AVCaptureSession", notification);
1188
NSNotificationCenter.DefaultCenter.AddObserver (AVCaptureSession.WasInterruptedNotification, Callback);