22 {
23 public:
24 enum {
25 kSizeRGB8 = 3,
26 };
27
28
29
30 VideoImpl(size_t pixelsPerFrame, float fpsVideo,
31 size_t frameHistoryCount = 0);
32 ~VideoImpl();
33
34 void begin(fl::FileHandlePtr h);
35 void beginStream(fl::ByteStreamPtr s);
36 void setFade(fl::u32 fadeInTime, fl::u32 fadeOutTime);
39 bool rewind();
40
41 bool draw(fl::u32 now, Frame *frame);
42 bool full() const;
44 float timeScale()
const {
return mTimeScale; }
45 size_t pixelsPerFrame() const { return mPixelsPerFrame; }
46 void pause(fl::u32 now);
47 void resume(fl::u32 now);
48 bool needsFrame(fl::u32 now) const;
49 int32_t durationMicros() const;
50
51 private:
52 bool updateBufferIfNecessary(fl::u32 prev, fl::u32 now);
53 bool updateBufferFromFile(fl::u32 now,
bool forward);
54 bool updateBufferFromStream(fl::u32 now);
55 fl::u32 mPixelsPerFrame = 0;
56 PixelStreamPtr mStream;
57 fl::u32 mPrevNow = 0;
58 FrameInterpolatorPtr mFrameInterpolator;
59 TimeWarpPtr mTime;
60 fl::u32 mFadeInTime = 1000;
61 fl::u32 mFadeOutTime = 1000;
62 float mTimeScale = 1.0f;
63};
TimeWarp timeScale(0, 1.0f)
constexpr T * begin(T(&array)[N]) noexcept
constexpr T * end(T(&array)[N]) noexcept
constexpr T && forward(typename remove_reference< T >::type &t) noexcept
Representation of an RGB pixel (Red, Green, Blue)