Struct ArRecordingConfig
A recording configuration struct that contains the configuration for session recording. See StartRecording(ArRecordingConfig).
Inherited Members
Namespace: UnityEngine.XR.ARCore
Syntax
public struct ArRecordingConfig : IEquatable<ArRecordingConfig>, IDisposable
Remarks
A ArRecordingConfig represents a native object that must be disposed (by calling
Dispose()) to prevent memory leaks. Consider using a using
statement for
convenience:
void RecordExample(ARCoreSessionSubsystem subsystem, string mp4Path)
{
var session = subsystem.session;
using (var config = new ArRecordingConfig(session))
{
config.SetMp4DatasetFilePath(session, mp4Path);
config.SetRecordingRotation(session, 90);
config.SetAutoStopOnPause(session, false);
var status = subsystem.StartRecording(config);
Debug.Log($"StartRecording to {config.GetMp4DatasetFilePath(session)} => {status}");
}
}
This is a C# wrapper for ARCore's native ArRecordingConfig
Constructors
ArRecordingConfig(ArSession)
Creates a dataset recording config object. This object must be disposed with Dispose().
Declaration
public ArRecordingConfig(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Methods
AsIntPtr()
Gets the underlying native pointer for this ArRecordingConfig.
Declaration
public IntPtr AsIntPtr()
Returns
Type | Description |
---|---|
IntPtr | Returns the underlying native pointer for this ArRecordingConfig. |
Dispose()
Releases memory used by this recording config object.
Declaration
public void Dispose()
Implements
Equals(Object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | An Object to compare against. |
Returns
Type | Description |
---|---|
Boolean | Returns |
Overrides
Equals(ArRecordingConfig)
Tests for equality.
Declaration
public bool Equals(ArRecordingConfig other)
Parameters
Type | Name | Description |
---|---|---|
ArRecordingConfig | other | The ArRecordingConfig to compare against. |
Returns
Type | Description |
---|---|
Boolean | Returns |
Implements
Remarks
Two ArRecordingConfigs are considered equal if their underlying pointers are equal.
FromIntPtr(IntPtr)
Create a ArRecordingConfig from an existing native pointer. The native pointer must point to an existing ArRecordingConfig.
Declaration
public static ArRecordingConfig FromIntPtr(IntPtr value)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | value | A pointer to an existing native ArRecordingConfig. |
Returns
Type | Description |
---|---|
ArRecordingConfig | Returns an ArRecordingConfig whose underlying native pointer is
|
GetAutoStopOnPause(ArSession)
Gets the setting that indicates whether this recording should stop automatically when the ARCore session is paused.
Declaration
public bool GetAutoStopOnPause(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
Boolean | Returns |
GetHashCode()
Generates a hash code suitable for use with a HashSet
or Dictionary
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Returns a hash code for this ArRecordingConfig. |
Overrides
GetMp4DatasetFilePath(ArSession)
Gets the file path to save an MP4 dataset file for this recording.
Declaration
public string GetMp4DatasetFilePath(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
String | Returns the path to the MP4 dataset file to which the recording should be saved. |
GetRecordingRotation(ArSession)
Gets the clockwise rotation in degrees that should be applied to the recorded image.
Declaration
public int GetRecordingRotation(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
Int32 | Returns the rotation in degrees that will be applied to the recorded image. Possible values are 0, 90, 180, 270, or -1 if unspecified. |
SetAutoStopOnPause(ArSession, Boolean)
Sets whether this recording should stop automatically when the ARCore session is paused.
Declaration
public void SetAutoStopOnPause(ArSession session, bool value)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Boolean | value | If |
SetMp4DatasetFilePath(ArSession, String)
Sets the file path to save an MP4 dataset file for the recording.
Declaration
public void SetMp4DatasetFilePath(ArSession session, string path)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
String | path | The file path to which an MP4 dataset should be written. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
SetRecordingRotation(ArSession, Int32)
Specifies the clockwise rotation in degrees that should be applied to the recorded image.
Declaration
public void SetRecordingRotation(ArSession session, int value)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Int32 | value | The clockwise rotation in degrees (0, 90, 180, or 270). |
Operators
Equality(Nullable<ArRecordingConfig>, Nullable<ArRecordingConfig>)
Tests for equality.
Declaration
public static bool operator ==(ArRecordingConfig? lhs, ArRecordingConfig? rhs)
Parameters
Type | Name | Description |
---|---|---|
Nullable<ArRecordingConfig> | lhs | The nullable ArRecordingConfig to compare with |
Nullable<ArRecordingConfig> | rhs | The nullable ArRecordingConfig to compare with |
Returns
Type | Description |
---|---|
Boolean | Returns true if any of these conditions are met:
Returns false otherwise. |
Remarks
This equality operator lets you to compare an ArRecordingConfig with null
to determine whether its
underlying pointer is null. This allows for a more natural comparison with the native ARCore object:
bool TestForNull(ArRecordingConfig obj)
{
if (obj == null)
{
// obj.AsIntPtr() is IntPtr.Zero
}
}
Equality(ArRecordingConfig, ArRecordingConfig)
Tests for equality. Same as Equals(ArRecordingConfig).
Declaration
public static bool operator ==(ArRecordingConfig lhs, ArRecordingConfig rhs)
Parameters
Type | Name | Description |
---|---|---|
ArRecordingConfig | lhs | The ArRecordingConfig to compare with |
ArRecordingConfig | rhs | The ArRecordingConfig to compare with |
Returns
Type | Description |
---|---|
Boolean | Returns |
Explicit(ArRecordingConfig to IntPtr)
Casts an ArRecordingConfig to its underlying native pointer.
Declaration
public static explicit operator IntPtr(ArRecordingConfig config)
Parameters
Type | Name | Description |
---|---|---|
ArRecordingConfig | config | The ArRecordingConfig to cast. |
Returns
Type | Description |
---|---|
IntPtr | Returns the underlying native pointer for |
Inequality(Nullable<ArRecordingConfig>, Nullable<ArRecordingConfig>)
Tests for inequality.
Declaration
public static bool operator !=(ArRecordingConfig? lhs, ArRecordingConfig? rhs)
Parameters
Type | Name | Description |
---|---|---|
Nullable<ArRecordingConfig> | lhs | The native object to compare with |
Nullable<ArRecordingConfig> | rhs | The native object to compare with |
Returns
Type | Description |
---|---|
Boolean | Returns false if any of these conditions are met:
Returns true otherwise. |
Remarks
This inequality operator lets you to compare an ArRecordingConfig with null
to determine whether its
underlying pointer is null. This allows for a more natural comparison with the native ARCore object:
bool TestForNull(ArRecordingConfig obj)
{
if (obj != null)
{
// obj.AsIntPtr() is not IntPtr.Zero
}
}
Inequality(ArRecordingConfig, ArRecordingConfig)
Tests for inequality. Same as the negation of Equals(ArRecordingConfig).
Declaration
public static bool operator !=(ArRecordingConfig lhs, ArRecordingConfig rhs)
Parameters
Type | Name | Description |
---|---|---|
ArRecordingConfig | lhs | The ArRecordingConfig to compare with |
ArRecordingConfig | rhs | The ArRecordingConfig to compare with |
Returns
Type | Description |
---|---|
Boolean | Returns |