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

Method GetFrameCountAndRate

src/rendering/PAGDecoder.cpp:65–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65std::pair<int, float> PAGDecoder::GetFrameCountAndRate(
66 std::shared_ptr<PAGComposition> pagComposition, float maxFrameRate) {
67 auto composition = GetSingleComposition(pagComposition);
68 auto compositionFrameRate =
69 composition != nullptr ? composition->frameRate : pagComposition->frameRate();
70 auto frameRate = std::min(maxFrameRate, compositionFrameRate);
71 auto duration = pagComposition->duration();
72 auto numFrames = static_cast<int>(round(static_cast<double>(duration) * frameRate / 1000000.0));
73 return {numFrames, frameRate};
74}
75
76std::vector<TimeRange> PAGDecoder::GetStaticTimeRange(std::shared_ptr<PAGComposition> composition,
77 int numFrames) {

Callers

nothing calls this directly

Calls 2

frameRateMethod · 0.45
durationMethod · 0.45

Tested by

no test coverage detected