| 2259 | |
| 2260 | |
| 2261 | void parseVideo(Scene& scene, const Element& element, Allocator& allocator) |
| 2262 | { |
| 2263 | if (!element.first_property) return; |
| 2264 | if (!element.first_property->next) return; |
| 2265 | if (element.first_property->next->getType() != IElementProperty::STRING) return; |
| 2266 | |
| 2267 | const Element* content_element = findChild(element, "Content"); |
| 2268 | |
| 2269 | bool is_base64 = false; |
| 2270 | if (!content_element) return; |
| 2271 | if (!content_element->first_property) return; |
| 2272 | const Property* content_property = content_element->first_property; |
| 2273 | if (content_element->first_property->getType() != IElementProperty::BINARY) { |
| 2274 | is_base64 = true; |
| 2275 | } |
| 2276 | |
| 2277 | const Element* filename_element = findChild(element, "Filename"); |
| 2278 | if (!filename_element) return; |
| 2279 | if (!filename_element->first_property) return; |
| 2280 | if (filename_element->first_property->getType() != IElementProperty::STRING) return; |
| 2281 | |
| 2282 | Video video; |
| 2283 | video.is_base_64 = is_base64; |
| 2284 | video.base64_property = is_base64 ? content_element->first_property->next : nullptr; |
| 2285 | video.content = is_base64 ? DataView{} : content_element->first_property->value; |
| 2286 | video.filename = filename_element->first_property->value; |
| 2287 | video.media = element.first_property->next->value; |
| 2288 | scene.m_videos.push_back(video); |
| 2289 | } |
| 2290 | |
| 2291 | static bool parseGeometryMaterials(GeometryDataImpl& geom, const Element& element, std::vector<ParseDataJob> &jobs) |
| 2292 | { |
no test coverage detected