VideoStreamInformation.parse constructor

VideoStreamInformation.parse(
  1. ByteData data_
)

Implementation

factory VideoStreamInformation.parse(ByteData data_) {
  if (data_.lengthInBytes < VideoStreamInformation.mavlinkEncodedLength) {
    var len =
        VideoStreamInformation.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var framerate = data_.getFloat32(0, Endian.little);
  var bitrate = data_.getUint32(4, Endian.little);
  var flags = data_.getUint16(8, Endian.little);
  var resolutionH = data_.getUint16(10, Endian.little);
  var resolutionV = data_.getUint16(12, Endian.little);
  var rotation = data_.getUint16(14, Endian.little);
  var hfov = data_.getUint16(16, Endian.little);
  var streamId = data_.getUint8(18);
  var count = data_.getUint8(19);
  var type = data_.getUint8(20);
  var name = MavlinkMessage.asInt8List(data_, 21, 32);
  var uri = MavlinkMessage.asInt8List(data_, 53, 160);

  return VideoStreamInformation(
      framerate: framerate,
      bitrate: bitrate,
      flags: flags,
      resolutionH: resolutionH,
      resolutionV: resolutionV,
      rotation: rotation,
      hfov: hfov,
      streamId: streamId,
      count: count,
      type: type,
      name: name,
      uri: uri);
}