Items with no label
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
3340 Discussions

How to generate a streamprofile from inline code c#

PBoos
Beginner
3,273 Views

Instead of filtering profiles i'd like to know how to create a streamprofile from inline code using C#

 

 

To create some function alike

//todo or create a ProfileBuilder function.

 

public new StreamProfile CreateProfile(....various arguments to set various parameters)

{

StreamProfile sp = new StreamProfile();

return sp;

}

0 Kudos
5 Replies
MartyG
Honored Contributor III
1,939 Views

I would recommend checking the documentation sources below.

Inline profile functions

https://unanancyowen.github.io/librealsense2_apireference/classrs2_1_1pipeline__profile.html Intel® RealSense™ Cross Platform API: rs2::pipeline_profile Class Reference

Inline stream functions

https://unanancyowen.github.io/librealsense2_apireference/classrs2_1_1config.html Intel® RealSense™ Cross Platform API: rs2::config Class Reference

The Resolve() instruction at the very bottom of this page looks promising in terms of filtering profiles, as it resolve the configuration filters to find a matching device and streams profiles.

0 Kudos
PBoos
Beginner
1,939 Views

Not exactly getting it, i just like to say (in psuedo code):

streamprofile sp = new streamprofile

 

(

this.width =480;

this.height =600;

this.Depthmode=true;

this.LedPatternEnbled=false

etc.

)

Not based on a filter of existing profiles.

0 Kudos
MartyG
Honored Contributor III
1,939 Views

Could you explain some more please about what you are trying to achieve? Thank you!

0 Kudos
PBoos
Beginner
1,939 Views

Currently the way to create a stream profile goes like this

streamProfile = depthSensor.VideoStreamProfiles

.Where(p => p.Stream == Stream.Depth)

.OrderByDescending(p => p.Framerate)

.Where(p => p.Width == width && p.Height == height)

.First();

 

I rather just Create a new stream profile and use it on the fly.

 

Instead of choosing based upon linq statements.

 

I assume their just some object properties to be set.
0 Kudos
MartyG
Honored Contributor III
1,939 Views

I will refer the question to stream programming expert jb455 to see if JB can contribute any ideas about it, since stream profiles is a subject that is not covered by my knowledge.

0 Kudos
Reply