mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 11:03:03 +08:00
dnn: both protobuf readers have similar behavior
- ReadProtoFromTextFile - ReadProtoFromTextBuffer
This commit is contained in:
parent
e8ff5cac1d
commit
f3e9eb3371
@ -1137,7 +1137,12 @@ bool ReadProtoFromBinaryFile(const char* filename, Message* proto) {
|
||||
|
||||
bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) {
|
||||
ArrayInputStream input(data, len);
|
||||
return google::protobuf::TextFormat::Parse(&input, proto);
|
||||
#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF
|
||||
return google::protobuf::TextFormat::Parser(true).Parse(&input, proto);
|
||||
#else
|
||||
return google::protobuf::TextFormat::Parser().Parse(&input, proto);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user