12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef COMMON_VIDEO_VIDEO_RENDER_FRAMES_H_
- #define COMMON_VIDEO_VIDEO_RENDER_FRAMES_H_
- #include <stddef.h>
- #include <stdint.h>
- #include <list>
- #include "absl/types/optional.h"
- #include "api/video/video_frame.h"
- namespace webrtc {
- class VideoRenderFrames {
- public:
- explicit VideoRenderFrames(uint32_t render_delay_ms);
- VideoRenderFrames(const VideoRenderFrames&) = delete;
- ~VideoRenderFrames();
-
- int32_t AddFrame(VideoFrame&& new_frame);
-
- absl::optional<VideoFrame> FrameToRender();
-
- uint32_t TimeToNextFrameRelease();
- bool HasPendingFrames() const;
- private:
-
- std::list<VideoFrame> incoming_frames_;
-
- const uint32_t render_delay_ms_;
- int64_t last_render_time_ms_ = 0;
- size_t frames_dropped_ = 0;
- };
- }
- #endif
|