Differential D6342 Diff 20011 extern/draco/dracoenc/src/draco/compression/point_cloud/point_cloud_decoder.cc
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/dracoenc/src/draco/compression/point_cloud/point_cloud_decoder.cc
| Context not available. | |||||
| if (!buffer->Decode(out_header->draco_string, 5)) | if (!buffer->Decode(out_header->draco_string, 5)) | ||||
| return Status(Status::IO_ERROR, kIoErrorMsg); | return Status(Status::IO_ERROR, kIoErrorMsg); | ||||
| if (memcmp(out_header->draco_string, "DRACO", 5) != 0) | if (memcmp(out_header->draco_string, "DRACO", 5) != 0) | ||||
| return Status(Status::ERROR, "Not a Draco file."); | return Status(Status::DRACO_ERROR, "Not a Draco file."); | ||||
| if (!buffer->Decode(&(out_header->version_major))) | if (!buffer->Decode(&(out_header->version_major))) | ||||
| return Status(Status::IO_ERROR, kIoErrorMsg); | return Status(Status::IO_ERROR, kIoErrorMsg); | ||||
| if (!buffer->Decode(&(out_header->version_minor))) | if (!buffer->Decode(&(out_header->version_minor))) | ||||
| Context not available. | |||||
| std::unique_ptr<GeometryMetadata>(new GeometryMetadata()); | std::unique_ptr<GeometryMetadata>(new GeometryMetadata()); | ||||
| MetadataDecoder metadata_decoder; | MetadataDecoder metadata_decoder; | ||||
| if (!metadata_decoder.DecodeGeometryMetadata(buffer_, metadata.get())) | if (!metadata_decoder.DecodeGeometryMetadata(buffer_, metadata.get())) | ||||
| return Status(Status::ERROR, "Failed to decode metadata."); | return Status(Status::DRACO_ERROR, "Failed to decode metadata."); | ||||
| point_cloud_->AddMetadata(std::move(metadata)); | point_cloud_->AddMetadata(std::move(metadata)); | ||||
| return OkStatus(); | return OkStatus(); | ||||
| } | } | ||||
| Context not available. | |||||
| // Sanity check that we are really using the right decoder (mostly for cases | // Sanity check that we are really using the right decoder (mostly for cases | ||||
| // where the Decode method was called manually outside of our main API. | // where the Decode method was called manually outside of our main API. | ||||
| if (header.encoder_type != GetGeometryType()) | if (header.encoder_type != GetGeometryType()) | ||||
| return Status(Status::ERROR, | return Status(Status::DRACO_ERROR, | ||||
| "Using incompatible decoder for the input geometry."); | "Using incompatible decoder for the input geometry."); | ||||
| // TODO(ostava): We should check the method as well, but currently decoders | // TODO(ostava): We should check the method as well, but currently decoders | ||||
| // don't expose the decoding method id. | // don't expose the decoding method id. | ||||
| Context not available. | |||||
| DRACO_RETURN_IF_ERROR(DecodeMetadata()) | DRACO_RETURN_IF_ERROR(DecodeMetadata()) | ||||
| } | } | ||||
| if (!InitializeDecoder()) | if (!InitializeDecoder()) | ||||
| return Status(Status::ERROR, "Failed to initialize the decoder."); | return Status(Status::DRACO_ERROR, "Failed to initialize the decoder."); | ||||
| if (!DecodeGeometryData()) | if (!DecodeGeometryData()) | ||||
| return Status(Status::ERROR, "Failed to decode geometry data."); | return Status(Status::DRACO_ERROR, "Failed to decode geometry data."); | ||||
| if (!DecodePointAttributes()) | if (!DecodePointAttributes()) | ||||
| return Status(Status::ERROR, "Failed to decode point attributes."); | return Status(Status::DRACO_ERROR, "Failed to decode point attributes."); | ||||
| return OkStatus(); | return OkStatus(); | ||||
| } | } | ||||
| Context not available. | |||||