Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# and Unity wrappers #2559

Closed
wants to merge 3 commits into from
Closed

Conversation

ogoshen
Copy link
Contributor

@ogoshen ogoshen commented Oct 18, 2018

C#

Object pooling for frames and profiles
Fixed a bug where PlaybackDevice disposed the underlying device
Removed custom FrameSet marshaler
Add ICompositeDisposable interface to FrameReleaser and FrameSet
Processing blocks callbacks are marshalled through native user-data pointers, avoiding closure allocation
Added missing Format.Disparity32
Added Option interfaces (IOption, IOptions, IOptionsContainer)
Added IEnumerable to Pipeline

UNITY

Downgrade project version to 2017.4 LTS
VideoFrame to Texture2D uses FrameQueue and uploads data straight to GPU
Fixed stream configuration being reset when recording
Multi device support (via RsFrameProvider)
Processing blocks are now asset based, their options are persistent and they have a dedicated inspector UI.

* Object pooling for frames and profiles
* Fixed a bug where PlaybackDevice disposed the underlying device
* Removed custom FrameSet marshaler
* Add ICompositeDisposable interface to FrameReleaser and FrameSet
* Processing blocks callbacks are marshalled through native user-data pointers, avoiding closure allocation
* Added missing Format.Disparity32
* Added Option interfaces (IOption, IOptions, IOptionsContainer)
* Added IEnumerable<Frame> to Pipeline
* Downgrade project version to 2017.4 LTS
* VideoFrame to Texture2D uses FrameQueue and uploads data straight to GPU
* Fixed stream configuration being reset when recording
* Multi device support (via RsFrameProvider)
* Processing blocks are now asset based, their options are persistent and they have a dedicated inspector UI.
@matkatz matkatz requested a review from dorodnic October 18, 2018 13:17
@matkatz matkatz mentioned this pull request Oct 18, 2018
@@ -77,8 +77,8 @@ public override void OnInspectorGUI()

EditorGUILayout.Space();
EditorGUILayout.PropertyField(config.FindPropertyRelative("Profiles"), true);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(serializedObject.FindProperty("_processingPipe"), false);
// EditorGUILayout.Space();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

}

public override List<Stream> Requirments()
void Update()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't you use setters instead of Update?

{
if (a == this)
continue;
// Debug.Log(a, a);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


private Colorizer _pb;

public VisualPreset visualPreset = VisualPreset.Dynamic;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing tooltips

[ProcessingBlockData(typeof(DepthCutoff))]
public class DepthCutoff : RsProcessingBlock
{
public ushort Distance = 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing tooltips

@@ -31,40 +35,57 @@ public class RsTemporalFilter : RsProcessingBlock
[Range(0, 8)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing tooltips

/// </summary>
public enum ProcessMode
{
Multithread,
UnityThread,
}

public static RsDevice Instance { get; private set; }
// public static RsDevice Instance { get; private set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

}
}

// using (var p = frame.Profile)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

{
object error;
m_instance = new HandleRef(this, NativeMethods.rs2_create_frame_queue(capacity, out error));
}

public bool PollForFrame(out Frame frame, FramesReleaser releaser = null)
public bool PollForFrame(out Frame frame)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Obsolete overload

@@ -98,6 +98,10 @@ internal static class NativeMethods
[DllImport(dllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr rs2_create_processing_block_fptr([MarshalAs(UnmanagedType.FunctionPtr)] frame_processor_callback on_frame, IntPtr user, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Helpers.ErrorMarshaler))] out object error);

internal static void rs2_get_video_stream_resolution(IntPtr ptr, out object width, out object height, out object error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for?

@matkatz
Copy link
Contributor

matkatz commented Oct 22, 2018

I think that we can merge this one together with #2561 which fix a crash in the SW device example, update the documentation and fix few issues in the processing blocks in the unity project

This was referenced Oct 24, 2018
@dorodnic dorodnic closed this Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants