Chromium Code Reviews| Index: remoting/client/plugin/pepper_video_renderer_3d.h |
| diff --git a/remoting/client/plugin/pepper_video_renderer_3d.h b/remoting/client/plugin/pepper_video_renderer_3d.h |
| index e2471ff889e9d59aeaa9798731e4e8a8bf355d38..cc21895846f54e04f0c02d47c11c7cb18b88a6bb 100644 |
| --- a/remoting/client/plugin/pepper_video_renderer_3d.h |
| +++ b/remoting/client/plugin/pepper_video_renderer_3d.h |
| @@ -7,7 +7,7 @@ |
| #include <stdint.h> |
| -#include <deque> |
| +#include <list> |
| #include <memory> |
| #include <string> |
| @@ -51,13 +51,15 @@ class PepperVideoRenderer3D : public PepperVideoRenderer, |
| const base::Closure& done) override; |
| private: |
| - class PendingPacket; |
| + // Class responsible for tracking state of a frame until it's rendered. |
| + class FrameTracker; |
| + |
| class Picture; |
| // Callback for pp::VideoDecoder::Initialize(). |
| void OnInitialized(int32_t result); |
| - // Passes one picture from |pending_packets_| to the |video_decoder_|. |
| + // Passes one picture from |pending_frames_| to the |video_decoder_|. |
| void DecodeNextPacket(); |
| // Callback for pp::VideoDecoder::Decode(). |
| @@ -107,17 +109,28 @@ class PepperVideoRenderer3D : public PepperVideoRenderer, |
| // Queue of packets that that have been received, but haven't been passed to |
|
Jamie
2016/06/24 23:53:21
s/Queue/List/ (or just remove "List of" from this
Sergey Ulanov
2016/06/25 05:34:03
Done.
|
| // the decoder yet. |
| - std::deque<PendingPacket*> pending_packets_; |
| + std::list<std::unique_ptr<FrameTracker>> pending_frames_; |
| - // The current picture shown on the screen or being rendered. Must be deleted |
| - // before |video_decoder_|. |
| - std::unique_ptr<Picture> current_picture_; |
| + // List of frames that have been decoded but for which we haven't received the |
| + // pictures yet. |
| + std::list<std::unique_ptr<FrameTracker>> decoded_frames_; |
| // The next picture to be rendered. PaintIfNeeded() will copy it to |
| // |current_picture_| and render it after that. Must be deleted |
| // before |video_decoder_|. |
| std::unique_ptr<Picture> next_picture_; |
| + // FrameTracker instances in |next_picture_|. |
| + std::list<std::unique_ptr<FrameTracker>> next_picture_frames_; |
| + |
| + // The current picture shown on the screen or being rendered. Must be deleted |
| + // before |video_decoder_|. |
| + std::unique_ptr<Picture> current_picture_; |
| + |
| + // FrameTrackers for frames in |current_picture_|. The queue is emptied once |
| + // the |current_picture_| is rendered. |
| + std::list<std::unique_ptr<FrameTracker>> current_picture_frames_; |
| + |
| // Set to true if the screen has been resized and needs to be repainted. |
| bool force_repaint_ = false; |