@@ -72,6 +72,53 @@ impl OBStreamProfile {
7272
7373 Ok ( OBCameraIntrinsic :: from ( intrinsics) )
7474 }
75+
76+ /// Get stream profile format
77+ pub fn get_format ( & self ) -> Result < OBFormat , OBError > {
78+ let mut err_ptr = std:: ptr:: null_mut ( ) ;
79+
80+ let format = unsafe { orb:: ob_stream_profile_get_format ( self . inner , & mut err_ptr) } ;
81+
82+ OBError :: consume ( err_ptr) ?;
83+
84+ Ok ( format. into ( ) )
85+ }
86+
87+ /// Get the frame rate of the video stream.
88+ /// Returns error if the profile is not a video stream profile.
89+ pub fn get_video_fps ( & self ) -> Result < u32 , OBError > {
90+ let mut err_ptr = std:: ptr:: null_mut ( ) ;
91+
92+ let fps = unsafe { orb:: ob_video_stream_profile_get_fps ( self . inner , & mut err_ptr) } ;
93+
94+ OBError :: consume ( err_ptr) ?;
95+
96+ Ok ( fps)
97+ }
98+
99+ /// Get the width of the video stream.
100+ /// Returns error if the profile is not a video stream profile.
101+ pub fn get_video_width ( & self ) -> Result < u32 , OBError > {
102+ let mut err_ptr = std:: ptr:: null_mut ( ) ;
103+
104+ let width = unsafe { orb:: ob_video_stream_profile_get_width ( self . inner , & mut err_ptr) } ;
105+
106+ OBError :: consume ( err_ptr) ?;
107+
108+ Ok ( width)
109+ }
110+
111+ /// Get the height of the video stream.
112+ /// Returns error if the profile is not a video stream profile.
113+ pub fn get_video_height ( & self ) -> Result < u32 , OBError > {
114+ let mut err_ptr = std:: ptr:: null_mut ( ) ;
115+
116+ let height = unsafe { orb:: ob_video_stream_profile_get_height ( self . inner , & mut err_ptr) } ;
117+
118+ OBError :: consume ( err_ptr) ?;
119+
120+ Ok ( height)
121+ }
75122}
76123
77124/// List of video stream profiles
0 commit comments