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

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

Issue 2690943005: Updating OnPictureReady() method name per CR feedback (Closed)
Patch Set: Created 3 years, 10 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 | « remoting/client/plugin/pepper_video_renderer_3d.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_video_renderer_3d.cc
diff --git a/remoting/client/plugin/pepper_video_renderer_3d.cc b/remoting/client/plugin/pepper_video_renderer_3d.cc
index 4cd976def4596936c55bcbe7a14fa0a884169358..214ab4ab15500803872b1869ee196447fe17e58a 100644
--- a/remoting/client/plugin/pepper_video_renderer_3d.cc
+++ b/remoting/client/plugin/pepper_video_renderer_3d.cc
@@ -23,12 +23,14 @@
namespace remoting {
+namespace {
// The implementation here requires that the decoder allocates at least 3
// pictures. PPB_VideoDecoder didn't support this parameter prior to
// 1.1, so we have to pass 0 for backwards compatibility with older versions of
// the browser. Currently all API implementations allocate more than 3 buffers
// by default.
const uint32_t kMinimumPictureCount = 3;
+} // namespace
joedow 2017/02/14 00:24:47 This felt like it should be in an anonymous namesp
class PepperVideoRenderer3D::FrameTracker {
public:
@@ -329,10 +331,10 @@ void PepperVideoRenderer3D::OnDecodeDone(int32_t result) {
pending_frames_.begin());
DecodeNextPacket();
- GetNextPicture();
+ GetNextPictureIfReady();
}
-void PepperVideoRenderer3D::GetNextPicture() {
+void PepperVideoRenderer3D::GetNextPictureIfReady() {
joedow 2017/02/14 00:24:47 Wez's comment about only needing the |decoded_fram
Wez 2017/02/14 00:33:00 The alternative would be to DCHECK(!decoded_frames
joedow 2017/02/14 16:01:34 The unit test is a fair point (as was the suggeste
// Return early if |decoded_frames_| is empty or the decoder is already
// preparing a picture. If we call GetPicture() before a new frame has been
// prepared (i.e. |decoded_frames_| is populated), the OnPictureReady callback
@@ -385,7 +387,7 @@ void PepperVideoRenderer3D::OnPictureReady(int32_t result,
next_picture_.reset(new Picture(&video_decoder_, picture));
PaintIfNeeded();
- GetNextPicture();
+ GetNextPictureIfReady();
}
void PepperVideoRenderer3D::PaintIfNeeded() {
« no previous file with comments | « remoting/client/plugin/pepper_video_renderer_3d.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698