Function rs2_pipeline_poll_for_frames

Function Documentation

int rs2_pipeline_poll_for_frames(rs2_pipeline *pipe, rs2_frame **output_frame, rs2_error **error)

Check if a new set of frames is available and retrieve the latest undelivered set. The frames set includes time-synchronized frames of each enabled stream in the pipeline. The method returns without blocking the calling thread, with status of new frames available or not. If available, it fetches the latest frames set. Device frames, which were produced while the function wasn’t called, are dropped. To avoid frame drops, this method should be called as fast as the device frame rate. The application can maintain the frames handles to defer processing. However, if the application maintains too long history, the device may lack memory resources to produce new frames, and the following calls to this method shall return no new frames, until resources are retained.

Parameters:
  • pipe[in] the pipeline

  • output_frame[out] frame handle to be released using rs2_release_frame

  • error[out] if non-null, receives any error that occurs during this call, otherwise, errors are ignored

Returns:

true if new frame was stored to output_frame