MCPcopy Create free account
hub / github.com/Tencent/libpag / getTargetFrameByID

Method getTargetFrameByID

src/platform/web/VideoInfoManager.cpp:123–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123int VideoInfoManager::getTargetFrameByID(ID id) {
124 auto iter = videoInfoMap.find(id);
125
126 if (iter != videoInfoMap.end()) {
127 for (auto pagComposition : iter->second.pagCompositions) {
128 if (pagComposition == nullptr || pagComposition->parent() == nullptr ||
129 iter->second.preLayer == nullptr) {
130 continue;
131 }
132 if (pagComposition->parent()->contentFrame < 0) {
133 continue;
134 }
135 Frame targetFrame = getTargetFrame(pagComposition, iter->second.preLayer);
136 if (IsFrameInStaticRange(targetFrame, iter->second.videoSequence->staticTimeRanges)) {
137 continue;
138 }
139 if (iter->second.lastFrame == targetFrame) {
140 continue;
141 }
142 iter->second.lastFrame = targetFrame;
143 return static_cast<int>(targetFrame);
144 }
145 }
146 return -1;
147}
148
149float VideoInfoManager::getPlaybackRateByID(ID id) {
150 float playbackRate = 1;

Callers

nothing calls this directly

Calls 3

IsFrameInStaticRangeFunction · 0.85
findMethod · 0.80
parentMethod · 0.45

Tested by

no test coverage detected