MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / init

Method init

Source/Node/VideoNode.cpp:373–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373bool VideoNode::init() {
374 if (!Sprite::init()) return false;
375
376 auto videoData = std::make_shared<VideoData>();
377 _videoData = videoData;
378 videoData->looped = _looped;
379 if (!videoData->init(_filename)) {
380 return false;
381 }
382
383 setSize({s_cast<float>(videoData->videoWidth),
384 s_cast<float>(videoData->videoHeight)});
385
386 _thread = New<Async>();
387 _thread->run([videoData]() {
388 while (!videoData->stoped) {
389 videoData->readFileChunk();
390 }
391 });
392
393 scheduleUpdate();
394 return true;
395}
396
397void VideoNode::cleanup() {
398 cleanupResources();

Callers

nothing calls this directly

Calls 4

setSizeFunction · 0.85
readFileChunkMethod · 0.80
runMethod · 0.65
initFunction · 0.50

Tested by

no test coverage detected