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

Side by Side Diff: media/filters/vpx_video_decoder.cc

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/filters/vpx_video_decoder.h" 5 #include "media/filters/vpx_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 void VpxVideoDecoder::MemoryPool::OnVideoFrameDestroyed( 199 void VpxVideoDecoder::MemoryPool::OnVideoFrameDestroyed(
200 VP9FrameBuffer* frame_buffer) { 200 VP9FrameBuffer* frame_buffer) {
201 --frame_buffer->ref_cnt; 201 --frame_buffer->ref_cnt;
202 } 202 }
203 203
204 VpxVideoDecoder::VpxVideoDecoder( 204 VpxVideoDecoder::VpxVideoDecoder(
205 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) 205 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
206 : task_runner_(task_runner), 206 : task_runner_(task_runner),
207 weak_factory_(this),
208 state_(kUninitialized), 207 state_(kUninitialized),
209 vpx_codec_(NULL), 208 vpx_codec_(NULL),
210 vpx_codec_alpha_(NULL) { 209 vpx_codec_alpha_(NULL),
211 } 210 weak_factory_(this) {}
212 211
213 VpxVideoDecoder::~VpxVideoDecoder() { 212 VpxVideoDecoder::~VpxVideoDecoder() {
214 DCHECK_EQ(kUninitialized, state_); 213 DCHECK_EQ(kUninitialized, state_);
215 CloseDecoder(); 214 CloseDecoder();
216 } 215 }
217 216
218 void VpxVideoDecoder::Initialize(const VideoDecoderConfig& config, 217 void VpxVideoDecoder::Initialize(const VideoDecoderConfig& config,
219 const PipelineStatusCB& status_cb) { 218 const PipelineStatusCB& status_cb) {
220 DCHECK(task_runner_->BelongsToCurrentThread()); 219 DCHECK(task_runner_->BelongsToCurrentThread());
221 DCHECK(config.IsValidConfig()); 220 DCHECK(config.IsValidConfig());
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); 526 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get());
528 return; 527 return;
529 } 528 }
530 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], 529 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y],
531 vpx_image->stride[VPX_PLANE_Y], 530 vpx_image->stride[VPX_PLANE_Y],
532 vpx_image->d_h, 531 vpx_image->d_h,
533 video_frame->get()); 532 video_frame->get());
534 } 533 }
535 534
536 } // namespace media 535 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698