Function rs2_pipeline_wait_for_frames

Function Documentation

rs2_frame *rs2_pipeline_wait_for_frames(rs2_pipeline *pipe, unsigned int timeout_ms, rs2_error **error)

Wait until a new set of frames becomes available. The frames set includes time-synchronized frames of each enabled stream in the pipeline. The method blocks the calling thread, and fetches the latest unread 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 call to this method shall fail to retrieve new frames, until resources are retained.

Parameters:
  • pipe[in] the pipeline

  • timeout_ms[in] Max time in milliseconds to wait until an exception will be thrown

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

Returns:

Set of coherent frames