Class stream_profile

Inheritance Relationships

Derived Types

Class Documentation

class stream_profile

Subclassed by rs2::motion_stream_profile, rs2::pose_stream_profile, rs2::video_stream_profile

Public Functions

inline stream_profile()

Class to store the profile of stream

inline int stream_index() const

Return the specific stream index

Returns:

int - stream index

inline rs2_stream stream_type() const

Return the stream type

Returns:

rs2_stream - stream type

inline rs2_format format() const

Return the stream format

Returns:

rs2_format - stream format

inline int fps() const

Return the stream frame per second

Returns:

int - frame rate

inline int unique_id() const

Return the assigned unique index when the stream was created

Returns:

int - unique id

inline stream_profile clone(rs2_stream type, int index, rs2_format format) const

Clone the current profile and change the type, index and format to input parameters

Parameters:
  • type[in] - will change the stream type from the cloned profile.

  • index[in] - will change the stream index from the cloned profile.

  • format[in] - will change the stream format from the cloned profile.

Returns:

stream_profile - return the cloned stream profile.

inline bool operator==(const stream_profile &rhs)

Comparison operator, compare if two stream profiles are the same

Parameters:

rhs[in] - stream profile to compare with.

Returns:

bool - true or false.

template<class T>
inline bool is() const

Template function, checking if the instance belongs to specific class type

Returns:

bool - true or false.

template<class T>
inline T as() const

Template function, casting the instance as another class type

Returns:

class instance - pointer or null.

inline std::string stream_name() const

Return the string of stream name

Returns:

string - stream name.

inline bool is_default() const

Checks if stream profile is marked/assigned as default, meaning that the profile will be selected when the user requests stream configuration using wildcards (RS2_DEPTH, -1,-1,…

Returns:

bool - true or false.

inline operator bool() const

Checks if the profile is valid

Returns:

bool - true or false.

inline const rs2_stream_profile *get() const

Get back the internal stream profile instance

Returns:

rs2_stream_profile* - internal implementation of the profile class

inline rs2_extrinsics get_extrinsics_to(const stream_profile &to) const

Operator implement, return the internal stream profile instance.

Parameters:

stream_profile – to - the stream profile (another sensor) to be based to return the extrinsic

Returns:

rs2_stream_profile* - internal instance to communicate with real implementation. Get the extrinsic transformation between two profiles (representing physical sensors)

Returns:

rs2_stream_profile* - internal instance to communicate with real implementation.

inline void register_extrinsics_to(const stream_profile &to, rs2_extrinsics extrinsics)

Assign extrinsic transformation parameters to a specific profile (sensor). The extrinsic information is generally available as part of the camera calibration, and librealsense is responsible for retrieving and assigning these parameters where appropriate. This specific function is intended for synthetic/mock-up (software) devices for which the parameters are produced and injected by the user.

Parameters:
  • stream_profile – to - which stream profile to be registered with the extrinsic.

  • rs2_extrinsics – extrinsics - the extrinsics to be registered.

inline bool is_cloned()
inline explicit stream_profile(const rs2_stream_profile *profile)
inline operator const rs2_stream_profile*()
inline explicit operator std::shared_ptr<rs2_stream_profile>()

Protected Attributes

const rs2_stream_profile *_profile
std::shared_ptr<rs2_stream_profile> _clone
int _index = 0
int _uid = 0
int _framerate = 0
rs2_format _format = RS2_FORMAT_ANY
rs2_stream _type = RS2_STREAM_ANY
bool _default = false

Friends

friend class rs2::sensor
friend class rs2::frame
friend class rs2::pipeline_profile
friend class rs2::video_stream_profile