handleData method

void handleData(
  1. VideoData data
)

Handles a new incoming VideoData packet

Implementation

void handleData(VideoData data) {
  if (data.details.name != cameraName) {
    return;
  }
  details = data.details;
  status.value = data.details.status;
  id = data.id;

		// Some [VideoData] packets are just representing metadata, not an empty video frame.
		// If this is one such packet (doesn't have a frame but status == enabled), don't save.
  if (data.hasFrame() && data.details.status == CameraStatus.CAMERA_ENABLED) {
    frameCache = data.frame;
    _receivedFrames++;
  } else if (!data.hasFrame() && data.details.status != CameraStatus.CAMERA_ENABLED) {
    frameCache = null;
  }
}