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

Side by Side Diff: media/renderers/video_renderer_impl.cc

Issue 1915443003: Replace scoped_ptr with std::unique_ptr in //media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptr-media-base
Patch Set: scopedptr-media: rebase Created 4 years, 7 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
« no previous file with comments | « media/renderers/video_renderer_impl.h ('k') | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderers/video_renderer_impl.h" 5 #include "media/renderers/video_renderer_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 state_ = kFlushed; 270 state_ = kFlushed;
271 271
272 algorithm_.reset(new VideoRendererAlgorithm(wall_clock_time_cb_)); 272 algorithm_.reset(new VideoRendererAlgorithm(wall_clock_time_cb_));
273 if (!drop_frames_) 273 if (!drop_frames_)
274 algorithm_->disable_frame_dropping(); 274 algorithm_->disable_frame_dropping();
275 275
276 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); 276 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK);
277 } 277 }
278 278
279 void VideoRendererImpl::SetTickClockForTesting( 279 void VideoRendererImpl::SetTickClockForTesting(
280 scoped_ptr<base::TickClock> tick_clock) { 280 std::unique_ptr<base::TickClock> tick_clock) {
281 tick_clock_.swap(tick_clock); 281 tick_clock_.swap(tick_clock);
282 } 282 }
283 283
284 void VideoRendererImpl::SetGpuMemoryBufferVideoForTesting( 284 void VideoRendererImpl::SetGpuMemoryBufferVideoForTesting(
285 scoped_ptr<GpuMemoryBufferVideoFramePool> gpu_memory_buffer_pool) { 285 std::unique_ptr<GpuMemoryBufferVideoFramePool> gpu_memory_buffer_pool) {
286 gpu_memory_buffer_pool_.swap(gpu_memory_buffer_pool); 286 gpu_memory_buffer_pool_.swap(gpu_memory_buffer_pool);
287 } 287 }
288 288
289 void VideoRendererImpl::OnTimeStateChanged(bool time_progressing) { 289 void VideoRendererImpl::OnTimeStateChanged(bool time_progressing) {
290 DCHECK(task_runner_->BelongsToCurrentThread()); 290 DCHECK(task_runner_->BelongsToCurrentThread());
291 time_progressing_ = time_progressing; 291 time_progressing_ = time_progressing;
292 292
293 // WARNING: Do not attempt to use |lock_| here as this may be a reentrant call 293 // WARNING: Do not attempt to use |lock_| here as this may be a reentrant call
294 // in response to callbacks firing above. 294 // in response to callbacks firing above.
295 295
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 // the entire queue. Note: this may cause slight inaccuracies in the number 656 // the entire queue. Note: this may cause slight inaccuracies in the number
657 // of dropped frames since the frame may have been rendered before. 657 // of dropped frames since the frame may have been rendered before.
658 if (!sink_started_ && !algorithm_->effective_frames_queued()) { 658 if (!sink_started_ && !algorithm_->effective_frames_queued()) {
659 frames_dropped_ += algorithm_->frames_queued(); 659 frames_dropped_ += algorithm_->frames_queued();
660 algorithm_->Reset( 660 algorithm_->Reset(
661 VideoRendererAlgorithm::ResetFlag::kPreserveNextFrameEstimates); 661 VideoRendererAlgorithm::ResetFlag::kPreserveNextFrameEstimates);
662 } 662 }
663 } 663 }
664 664
665 } // namespace media 665 } // namespace media
OLDNEW
« no previous file with comments | « media/renderers/video_renderer_impl.h ('k') | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698