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

Side by Side Diff: media/gpu/rendering_helper.cc

Issue 2039943005: clang-tidy WaitableEvent refactor (Windows side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/rendering_helper.h" 5 #include "media/gpu/rendering_helper.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 #endif 318 #endif
319 #endif 319 #endif
320 window_ = gfx::kNullAcceleratedWidget; 320 window_ = gfx::kNullAcceleratedWidget;
321 } 321 }
322 322
323 void RenderingHelper::Initialize(const RenderingHelperParams& params, 323 void RenderingHelper::Initialize(const RenderingHelperParams& params,
324 base::WaitableEvent* done) { 324 base::WaitableEvent* done) {
325 // Use videos_.size() != 0 as a proxy for the class having already been 325 // Use videos_.size() != 0 as a proxy for the class having already been
326 // Initialize()'d, and UnInitialize() before continuing. 326 // Initialize()'d, and UnInitialize() before continuing.
327 if (videos_.size()) { 327 if (videos_.size()) {
328 base::WaitableEvent done(false, false); 328 base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC,
329 base::WaitableEvent::InitialState::NOT_SIGNALED);
329 UnInitialize(&done); 330 UnInitialize(&done);
330 done.Wait(); 331 done.Wait();
331 } 332 }
332 333
333 render_task_.Reset( 334 render_task_.Reset(
334 base::Bind(&RenderingHelper::RenderContent, base::Unretained(this))); 335 base::Bind(&RenderingHelper::RenderContent, base::Unretained(this)));
335 336
336 frame_duration_ = params.rendering_fps > 0 337 frame_duration_ = params.rendering_fps > 0
337 ? base::TimeDelta::FromSeconds(1) / params.rendering_fps 338 ? base::TimeDelta::FromSeconds(1) / params.rendering_fps
338 : base::TimeDelta(); 339 : base::TimeDelta();
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 // When the rendering falls behind, drops frames. 873 // When the rendering falls behind, drops frames.
873 while (scheduled_render_time_ < target) { 874 while (scheduled_render_time_ < target) {
874 scheduled_render_time_ += frame_duration_; 875 scheduled_render_time_ += frame_duration_;
875 DropOneFrameForAllVideos(); 876 DropOneFrameForAllVideos();
876 } 877 }
877 878
878 message_loop_->PostDelayedTask(FROM_HERE, render_task_.callback(), 879 message_loop_->PostDelayedTask(FROM_HERE, render_task_.callback(),
879 target - now); 880 target - now);
880 } 881 }
881 } // namespace media 882 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/win/video_capture_device_mf_win.cc ('k') | media/gpu/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698