Skip to content

Commit

Permalink
proof-of-concept for multi-frame textured point cloud streaming
Browse files Browse the repository at this point in the history
- bump NHVD (multi-frame depth unprojection)
- update NHVD wrapper
- modify point cloud example for multi-frame aproach

Related to #15
  • Loading branch information
bmegli committed Apr 18, 2020
1 parent ca4e017 commit 6d86d13
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Assets/NHVD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public struct nhvd_point_cloud
#else
[DllImport ("nhvd")]
#endif
public static extern System.IntPtr nhvd_init(ref nhvd_net_config net_config, ref nhvd_hw_config hw_config, ref nhvd_depth_config depth_config) ;
public static extern System.IntPtr nhvd_init(ref nhvd_net_config net_config, [In]nhvd_hw_config[] hw_configs, int hw_size, ref nhvd_depth_config depth_config);

///Return Type: nhvd*
///net_config: nhvd_net_config*
Expand All @@ -99,11 +99,11 @@ public struct nhvd_point_cloud
#else
[DllImport ("nhvd")]
#endif
private static extern System.IntPtr nhvd_init(ref nhvd_net_config net_config, ref nhvd_hw_config hw_config, System. IntPtr depth_config) ;
private static extern System.IntPtr nhvd_init(ref nhvd_net_config net_config, ref nhvd_hw_config hw_config, int hw_size, System.IntPtr depth_config) ;

public static System.IntPtr nhvd_init(ref nhvd_net_config net_config, ref nhvd_hw_config hw_config)
{
return nhvd_init(ref net_config, ref hw_config, System.IntPtr.Zero);
return nhvd_init(ref net_config, ref hw_config, 1, System.IntPtr.Zero);
}

/// Return Type: void
Expand Down
13 changes: 8 additions & 5 deletions Assets/PointCloudRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ public class PointCloudRenderer : MonoBehaviour
void Awake()
{
NHVD.nhvd_net_config net_config = new NHVD.nhvd_net_config{ip=this.ip, port=this.port, timeout_ms=500 };
NHVD.nhvd_hw_config hw_config = new NHVD.nhvd_hw_config{hardware="vaapi", codec="hevc", device=this.device, pixel_format="p010le", width=848, height=480, profile=2};
NHVD.nhvd_depth_config depth_config = new NHVD.nhvd_depth_config{ppx = 421.353f, ppy=240.93f, fx=426.768f, fy=426.768f, depth_unit = 0.0001f};
//NHVD.nhvd_depth_config depth_config = new NHVD.nhvd_depth_config{ppx = 421.353f, ppy=240.93f, fx=426.768f, fy=426.768f, depth_unit = 0.00003125f};

nhvd=NHVD.nhvd_init (ref net_config, ref hw_config, ref depth_config);
NHVD.nhvd_hw_config[] hw_config = new NHVD.nhvd_hw_config[]{
new NHVD.nhvd_hw_config{hardware="vaapi", codec="hevc", device=this.device, pixel_format="p010le", width=848, height=480, profile=2},
new NHVD.nhvd_hw_config{hardware="vaapi", codec="hevc", device=this.device, pixel_format="rgb0", width=848, height=480, profile=1}
};
//NHVD.nhvd_depth_config depth_config = new NHVD.nhvd_depth_config{ppx = 421.353f, ppy=240.93f, fx=426.768f, fy=426.768f, depth_unit = 0.0001f};
NHVD.nhvd_depth_config depth_config = new NHVD.nhvd_depth_config{ppx = 421.353f, ppy=240.93f, fx=426.768f, fy=426.768f, depth_unit = 0.00003125f};

nhvd=NHVD.nhvd_init (ref net_config, hw_config, hw_config.Length, ref depth_config);

if (nhvd == IntPtr.Zero)
{
Expand Down
6 changes: 3 additions & 3 deletions Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &785509538
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -715,7 +715,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 12effc58cbb744b51ba7e080578fcc88, type: 3}
m_Name:
m_EditorClassIdentifier:
device: /dev/dri/renderD129
device: /dev/dri/renderD128
ip:
port: 9767
--- !u!1 &1469442498
Expand All @@ -733,7 +733,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1469442499
RectTransform:
m_ObjectHideFlags: 0
Expand Down

0 comments on commit 6d86d13

Please sign in to comment.