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

Side by Side Diff: media/filters/gpu_video_decoder.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/filters/gpu_video_decoder.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 (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 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void PutSHM(SHMBuffer* shm_buffer); 123 void PutSHM(SHMBuffer* shm_buffer);
124 124
125 // Destroy all PictureBuffers in |buffers|, and delete their textures. 125 // Destroy all PictureBuffers in |buffers|, and delete their textures.
126 void DestroyPictureBuffers(PictureBufferMap* buffers); 126 void DestroyPictureBuffers(PictureBufferMap* buffers);
127 127
128 // Assert the contract that this class is operated on the right thread. 128 // Assert the contract that this class is operated on the right thread.
129 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; 129 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const;
130 130
131 bool needs_bitstream_conversion_; 131 bool needs_bitstream_conversion_;
132 132
133 // Bound to factories_->GetMessageLoop().
134 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_;
135 base::WeakPtr<GpuVideoDecoder> weak_this_;
136
137 scoped_refptr<GpuVideoAcceleratorFactories> factories_; 133 scoped_refptr<GpuVideoAcceleratorFactories> factories_;
138 134
139 // Populated during Initialize() (on success) and unchanged until an error 135 // Populated during Initialize() (on success) and unchanged until an error
140 // occurs. 136 // occurs.
141 scoped_ptr<VideoDecodeAccelerator> vda_; 137 scoped_ptr<VideoDecodeAccelerator> vda_;
142 138
143 // Callbacks that are !is_null() only during their respective operation being 139 // Callbacks that are !is_null() only during their respective operation being
144 // asynchronously executed. 140 // asynchronously executed.
145 DecodeCB pending_decode_cb_; 141 DecodeCB pending_decode_cb_;
146 base::Closure pending_reset_cb_; 142 base::Closure pending_reset_cb_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // picture_buffer_id and the frame wrapping the corresponding Picture, for 177 // picture_buffer_id and the frame wrapping the corresponding Picture, for
182 // frames that have been decoded but haven't been requested by a Decode() yet. 178 // frames that have been decoded but haven't been requested by a Decode() yet.
183 std::list<scoped_refptr<VideoFrame> > ready_video_frames_; 179 std::list<scoped_refptr<VideoFrame> > ready_video_frames_;
184 int32 next_picture_buffer_id_; 180 int32 next_picture_buffer_id_;
185 int32 next_bitstream_buffer_id_; 181 int32 next_bitstream_buffer_id_;
186 182
187 // Set during ProvidePictureBuffers(), used for checking and implementing 183 // Set during ProvidePictureBuffers(), used for checking and implementing
188 // HasAvailableOutputFrames(). 184 // HasAvailableOutputFrames().
189 int available_pictures_; 185 int available_pictures_;
190 186
187 // Bound to factories_->GetMessageLoop().
188 // NOTE: Weak pointers must be invalidated before all other member variables.
189 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_;
190
191 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); 191 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
192 }; 192 };
193 193
194 } // namespace media 194 } // namespace media
195 195
196 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 196 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698