You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<summary>Manages the camera capture, motion processing, and image analysis necessary to create a mixed-reality experience.</summary>
4
+
<remarks>
5
+
<para>An <seecref="T:ARKit.ARSession" /> object represents the system resources required for a mixed-reality experience. The <seecref="M:ARKit.ARSession.Run(ARKit.ARConfiguration,ARKit.ARSessionRunOptions)" /> method must be passed an <formattype="text/html"><ahref="https://docs.microsoft.com/en-us/search/index?search=ARKit%20ARSession%20Configuration&scope=Xamarin"title="T:ARKit.ARSessionConfiguration">T:ARKit.ARSessionConfiguration</a></format> object that controls specific ebhaviors. </para>
6
+
<para>Developers who use the <seecref="T:ARKit.ARSCNView" /> to present their AR imagery do not need to instantiate their own <seecref="T:ARKit.ARSession" /> object but instead should call <seecref="M:ARKit.ARSession.Run(ARKit.ARConfiguration,ARKit.ARSessionRunOptions)" /> on the <seecref="P:ARKit.ARSCNView.Session" /> property. For example:</para>
7
+
<example>
8
+
<codelang="csharp lang-csharp"><![CDATA[
9
+
var arView = new ARSCNView();
10
+
var arConfig = new ARWorldTrackingSessionConfiguration { PlaneDetection = ARPlaneDetection.Horizontal };
<summary>Base class for timed video and audio.</summary>
4
+
<remarks>
5
+
<para>An <seecref="T:AVFoundation.AVAsset" /> represents one or more media assets. These are held in its <seecref="P:AVFoundation.AVAsset.Tracks" /> property. Additionally, <seecref="T:AVFoundation.AVAsset" />s include metadata, track grouping, and preferences about the media.</para>
6
+
<para>Because media assets such as movies are large, instantiating an <seecref="T:AVFoundation.AVAsset" /> will not automatically load the file. Properties are loaded when they are queried or via explicit calls to <seecref="M:AVFoundation.AVAsset.LoadValuesTaskAsync(System.String[])" /> or <seecref="M:AVFoundation.AVAsset.LoadValuesAsynchronously(System.String[],System.Action)" />.</para>
7
+
<para>During playback, the current presentation state of an <seecref="T:AVFoundation.AVAsset" /> is represented by an <seecref="T:AVFoundation.AVPlayerItem" /> object, and the playback is controlled by a <seecref="T:AVFoundation.AVPlayer" />:</para>
8
+
<para>
9
+
<imghref="~/AVFoundation/_images/AVFoundation.AssetPlayerItemPlayer.png"alt="UML Class Diagram illustrating classes relating to AVAsset" />
10
+
</para>
11
+
</remarks>
12
+
<relatedtype="externalDocumentation"href="https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAsset_Class/index.html">Apple documentation for <c>AVAsset</c></related>
<summary>Enumerates attenuation models used by <seecref="T:AVFoundation.AVAudioEnvironmentDistanceAttenuationParameters" />.</summary>
4
+
<remarks>
5
+
<para>Graph of <c>Gain</c> as Distance ranges from 0 to 10 with: <c>ReferenceDistance = 5</c>, <c>RolloffFactor = 0.5</c>, and <c>MaximumDistance = 20</c></para>
To create instances of this class use the factory method <formattype="text/html"><ahref="https://docs.microsoft.com/en-us/search/index?search=AVFoundation%20AVRecorder%20To%20Url(%20Foundation%20NSUrl%20, %20AVFoundation%20AVAudio%20Recorder%20Settings%20,Foundation%20NSError%20)&scope=Xamarin"title="M:AVFoundation.AVRecorder.ToUrl(Foundation.NSUrl, AVFoundation.AVAudioRecorderSettings,Foundation.NSError)">M:AVFoundation.AVRecorder.ToUrl(Foundation.NSUrl, AVFoundation.AVAudioRecorderSettings,Foundation.NSError)</a></format></para>
7
+
<example>
8
+
<codelang="csharp lang-csharp"><![CDATA[
9
+
var settings = new AVAudioRecorderSettings () {
10
+
AudioFormat = AudioFormatType.LinearPCM,
11
+
AudioQuality = AVAudioQuality.High,
12
+
SampleRate = 44100f,
13
+
NumberChannels = 1
14
+
};
15
+
var recorder = AVAudioRecorder.ToUrl (url, settings, out error);
<relatedtype="externalDocumentation"href="https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/index.html">Apple documentation for <c>AVAudioRecorder</c></related>
<summary>Coordinates an audio playback or capture session.</summary>
4
+
<remarks>
5
+
<para> Application developers should use the singleton object
6
+
retrieved by <seecref="M:AVFoundation.AVAudioSession.SharedInstance" />.
7
+
</para>
8
+
<para>
9
+
Because the audio hardware of an iOS device is shared
10
+
between all apps, audio settings can only be "preferred" (see
11
+
<c>SetPreferred*</c> methods) and the application developer
12
+
must account for use-cases where these preferences are
13
+
overridden.
14
+
</para>
15
+
<para>
16
+
The interaction of an app with other apps and system
17
+
services is determined by your audio category. You can use the <seecref="M:AVFoundation.AVAudioSession.SetCategory(System.String,System.String,AVFoundation.AVAudioSessionRouteSharingPolicy,AVFoundation.AVAudioSessionCategoryOptions,Foundation.NSError@)" /> method to set this
18
+
</para>
19
+
<para>
20
+
You should also control the Mode (using <seecref="M:AVFoundation.AVAudioSession.SetMode(Foundation.NSString,Foundation.NSError@)" /> to
21
+
describe how your application will use audio.
22
+
23
+
</para>
24
+
<para>
25
+
As is common in AV Foundation, many methods in <seecref="T:AVFoundation.AVAudioSession" /> are
26
+
asynchronous and properties may take some time to reflect
27
+
their final status. Application developers should be familiar
28
+
with asynchronous programming techniques.
29
+
</para>
30
+
<para>
31
+
The <seecref="T:AVFoundation.AVAudioSession" />,
32
+
like the <seecref="T:AVFoundation.AVCaptureSession" /> and <seecref="T:AVFoundation.AVAssetExportSession" /> is a
33
+
coordinating object between some number of <seecref="P:AVFoundation.AVAudioSession.InputDataSources" />
34
+
and <seecref="P:AVFoundation.AVAudioSession.OutputDataSources" />.
35
+
</para>
36
+
<para>
37
+
You can register to a few notifications that are posted by the audio system, by using the convenience methods in <seecref="T:AVFoundation.AVAudioSession.Notifications" />.
38
+
39
+
</para>
40
+
<example>
41
+
<codelang="csharp lang-csharp"><![CDATA[
42
+
void Setup ()
43
+
{
44
+
AVAudioSession.SharedInstance ().Init ();
45
+
NSError error;
46
+
if (!AVAudioSession.SharedInstance ().SetCategory (AVAudioSessionCategory.Playback, out error)) {
<relatedtype="externalDocumentation"href="https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/index.html">Apple documentation for <c>AVAudioSession</c></related>
<summary>The link between capture input and capture output objects during a capture session.</summary>
4
+
<remarks>
5
+
<para>A <seecref="T:AVFoundation.AVCaptureConnection" /> encapsulates the link between an <seecref="T:AVFoundation.AVCaptureInput" /> (more specifically, between an individual <seecref="T:AVFoundation.AVCaptureInputPort" /> in the <seecref="P:AVFoundation.AVCaptureInput.Ports" /> property of the <seecref="T:AVFoundation.AVCaptureInput" /> and the <seecref="T:AVFoundation.AVCaptureOutput" />).</para>
6
+
<para>
7
+
<seecref="T:AVFoundation.AVCaptureConnection" />s are formed automatically when inputs and outputs are added via <seecref="M:AVFoundation.AVCaptureSession.AddInput(AVFoundation.AVCaptureInput)" /> and <seecref="M:AVFoundation.AVCaptureSession.AddOutput(AVFoundation.AVCaptureOutput)" />.</para>
8
+
</remarks>
9
+
<relatedtype="externalDocumentation"href="https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureConnection_Class/index.html">Apple documentation for <c>AVCaptureConnection</c></related>
<summary>Coordinates a recording session.</summary>
4
+
<remarks>
5
+
<para>
6
+
The AVCaptureSession object coordinates the recording of video
7
+
or audio input and passing the recorded information to one or
8
+
more output objects. As the iOS line has advanced, different devices have gained multiple capture devices (in particular, gained multiple cameras). Application developers can use <seecref="M:AVFoundation.AVCaptureDevice.DefaultDeviceWithMediaType(System.String)" /> or <seecref="M:AVFoundation.AVCaptureDevice.DevicesWithMediaType(System.String)" />, passing in the constants defined in <seecref="T:AVFoundation.AVMediaType" />.
9
+
</para>
10
+
<para>
11
+
Configuring capture consists of setting the <seecref="P:AVFoundation.AVCaptureSession.Inputs" /> and <seecref="P:AVFoundation.AVCaptureSession.Outputs" /> properties of the <seecref="T:AVFoundation.AVCaptureSession" />. Notice that multiple <seecref="T:AVFoundation.AVCaptureInput" />s and <seecref="T:AVFoundation.AVCaptureOutput" />s are possible. For instance, to capture both audio and video, one would use two capture inputs:</para>
12
+
<example>
13
+
<codelang="csharp lang-csharp"><![CDATA[
14
+
var session = new AVCaptureSession();
15
+
16
+
var camera = AVCaptureDevice.DefaultDeviceWithMediaType(AVMediaType.Video);
17
+
var mic = AVCaptureDevice.DefaultDeviceWithMediaType(AVMediaType.Audio);
18
+
if(camera == null || mic == null){
19
+
throw new Exception("Can't find devices");
20
+
}
21
+
22
+
var cameraInput = AVCaptureDeviceInput.FromDevice (camera);
var micInput = AVCaptureDeviceInput.FromDevice (mic);
25
+
26
+
if(session.CanAddInput(cameraInput)){
27
+
session.AddInput(cameraInput);
28
+
}
29
+
if(session.CanAddInput(micInput)){
30
+
session.AddInput(micInput);
31
+
}
32
+
]]></code>
33
+
</example>
34
+
<para>Note that permission to access the microphone (and in some regions, the camera) must be given by the user, requiring the developer to add the <c>NSMicrophoneUsageDescription</c> to the application's info.plist file.</para>
35
+
<para>Video can be captured directly to file with <seecref="T:AVFoundation.AVCaptureMovieFileOutput" />. However, this class has no display-able data and cannot be used simultaneously with <seecref="T:AVFoundation.AVCaptureVideoDataOutput" />. Instead, application developers can use it in combination with a <seecref="T:AVFoundation.AVCaptureVideoPreviewLayer" />, as shown in the following example:</para>
36
+
<example>
37
+
<codelang="csharp lang-csharp"><![CDATA[
38
+
var layer = new AVCaptureVideoPreviewLayer (session);
<para>Application developers should note that the function <seecref="M:AVFoundation.AVCaptureFileOutput.StopRecording" /> is asynchronous; developers should wait until the <seecref="M:AVFoundation.AVCaptureFileOutputRecordingDelegate.FinishedRecording(AVFoundation.AVCaptureFileOutput,Foundation.NSUrl,Foundation.NSObject[],Foundation.NSError)" /> delegate method before manipulating the file (for instance, before saving it to the Photos album with <seecref="M:UIKit.UIVideo.SaveToPhotosAlbum(System.String,UIKit.UIVideo.SaveStatus)" /> or <seecref="M:AssetsLibrary.ALAssetsLibrary.WriteVideoToSavedPhotosAlbumAsync(Foundation.NSUrl)" />).</para>
55
+
<example>
56
+
<codelang="csharp lang-csharp"><![CDATA[
57
+
public class MyRecordingDelegate : AVCaptureFileOutputRecordingDelegate
using (var pixelBuffer = sampleBuffer.GetImageBuffer () as CVPixelBuffer){
161
+
// Lock the base address
162
+
pixelBuffer.Lock (0);
163
+
// Get the number of bytes per row for the pixel buffer
164
+
var baseAddress = pixelBuffer.BaseAddress;
165
+
int bytesPerRow = pixelBuffer.BytesPerRow;
166
+
int width = pixelBuffer.Width;
167
+
int height = pixelBuffer.Height;
168
+
var flags = CGBitmapFlags.PremultipliedFirst | CGBitmapFlags.ByteOrder32Little;
169
+
// Create a CGImage on the RGB colorspace from the configured parameter above
170
+
using (var cs = CGColorSpace.CreateDeviceRGB ())
171
+
using (var context = new CGBitmapContext (baseAddress,width, height, 8, bytesPerRow, cs, (CGImageAlphaInfo) flags))
172
+
using (var cgImage = context.ToImage ()){
173
+
pixelBuffer.Unlock (0);
174
+
return UIImage.FromImage (cgImage);
175
+
}
176
+
}
177
+
}
178
+
}
179
+
180
+
]]></code>
181
+
</example>
182
+
</remarks>
183
+
<relatedtype="externalDocumentation"href="https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureSession_Class/index.html">Apple documentation for <c>AVCaptureSession</c></related>
0 commit comments