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

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

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 #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 <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 const scoped_refptr<VideoFrame>& frame); 112 const scoped_refptr<VideoFrame>& frame);
113 113
114 // Indicate the picturebuffer can be reused by the decoder. 114 // Indicate the picturebuffer can be reused by the decoder.
115 void ReusePictureBuffer(int64 picture_buffer_id); 115 void ReusePictureBuffer(int64 picture_buffer_id);
116 116
117 void RecordBufferTimeData( 117 void RecordBufferTimeData(
118 const BitstreamBuffer& bitstream_buffer, const Buffer& buffer); 118 const BitstreamBuffer& bitstream_buffer, const Buffer& buffer);
119 void GetBufferTimeData( 119 void GetBufferTimeData(
120 int32 id, base::TimeDelta* timestamp, base::TimeDelta* duration); 120 int32 id, base::TimeDelta* timestamp, base::TimeDelta* duration);
121 121
122 // Set |vda_| and |weak_vda_| on the VDA thread (in practice the render
123 // thread).
124 void SetVDA(VideoDecodeAccelerator* vda);
125
122 // A shared memory segment and its allocated size. 126 // A shared memory segment and its allocated size.
123 struct SHMBuffer { 127 struct SHMBuffer {
124 SHMBuffer(base::SharedMemory* m, size_t s); 128 SHMBuffer(base::SharedMemory* m, size_t s);
125 ~SHMBuffer(); 129 ~SHMBuffer();
126 base::SharedMemory* shm; 130 base::SharedMemory* shm;
127 size_t size; 131 size_t size;
128 }; 132 };
129 133
130 // Request a shared-memory segment of at least |min_size| bytes. Will 134 // Request a shared-memory segment of at least |min_size| bytes. Will
131 // allocate as necessary. Caller does not own returned pointer. 135 // allocate as necessary. Caller does not own returned pointer.
(...skipping 19 matching lines...) Expand all
151 // if they arrive on other loops. 155 // if they arrive on other loops.
152 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_; 156 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_;
153 157
154 // Message loop on which to makes all calls to vda_. (beware this loop may be 158 // Message loop on which to makes all calls to vda_. (beware this loop may be
155 // paused during the Pause/Flush/Stop dance PipelineImpl::Stop() goes 159 // paused during the Pause/Flush/Stop dance PipelineImpl::Stop() goes
156 // through). 160 // through).
157 scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_; 161 scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_;
158 162
159 scoped_refptr<Factories> factories_; 163 scoped_refptr<Factories> factories_;
160 164
161 // Populated during Initialize() (on success) and unchanged thereafter. 165 // Populated during Initialize() via SetVDA() (on success) and unchanged
162 scoped_refptr<VideoDecodeAccelerator> vda_; 166 // until an error occurs
167 scoped_ptr<VideoDecodeAccelerator> vda_;
168 // Used to post tasks from the GVD thread to the VDA thread safely.
169 base::WeakPtr<VideoDecodeAccelerator> weak_vda_;
163 170
164 // Callbacks that are !is_null() only during their respective operation being 171 // Callbacks that are !is_null() only during their respective operation being
165 // asynchronously executed. 172 // asynchronously executed.
166 ReadCB pending_read_cb_; 173 ReadCB pending_read_cb_;
167 base::Closure pending_reset_cb_; 174 base::Closure pending_reset_cb_;
168 175
169 State state_; 176 State state_;
170 177
171 // Is a demuxer read in flight? 178 // Is a demuxer read in flight?
172 bool demuxer_read_in_progress_; 179 bool demuxer_read_in_progress_;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 217
211 // Indicates decoding error occurred. 218 // Indicates decoding error occurred.
212 bool error_occured_; 219 bool error_occured_;
213 220
214 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); 221 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
215 }; 222 };
216 223
217 } // namespace media 224 } // namespace media
218 225
219 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 226 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698