Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Unified Diff: remoting/client/plugin/pepper_video_renderer_3d.h

Issue 2096643003: Rework PerformanceTracker to make it usable with WebRTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address feedback Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/client/plugin/pepper_video_renderer_3d.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..04fb123cbf5ba6687039e2d3e3c2e4f959251e67 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().
@@ -105,19 +107,29 @@ class PepperVideoRenderer3D : public PepperVideoRenderer,
bool get_picture_pending_ = false;
bool paint_pending_ = false;
- // Queue of packets that that have been received, but haven't been passed to
- // the decoder yet.
- std::deque<PendingPacket*> pending_packets_;
+ // Frames that have been received, but haven't been passed to the decoder yet.
+ 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_;
+ // 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;
« no previous file with comments | « no previous file | remoting/client/plugin/pepper_video_renderer_3d.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698