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

Side by Side Diff: content/renderer/media/gpu/rtc_video_decoder.h

Issue 2832863002: Merge 59: Handle multiple textures per buffer in RTCVideoDecoder (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | content/renderer/media/gpu/rtc_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 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 #ifndef CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_DECODER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_DECODER_H_
6 #define CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_DECODER_H_ 6 #define CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_DECODER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 const media::PictureBuffer& pb, 149 const media::PictureBuffer& pb,
150 uint32_t timestamp, 150 uint32_t timestamp,
151 const gfx::Rect& visible_rect, 151 const gfx::Rect& visible_rect,
152 media::VideoPixelFormat pixel_format); 152 media::VideoPixelFormat pixel_format);
153 153
154 // Resets VDA. 154 // Resets VDA.
155 void Reset_Locked(); 155 void Reset_Locked();
156 void ResetInternal(); 156 void ResetInternal();
157 157
158 // Static method is to allow it to run even after RVD is deleted. 158 // Static method is to allow it to run even after RVD is deleted.
159 static void ReleaseMailbox(base::WeakPtr<RTCVideoDecoder> decoder, 159 static void ReleaseMailbox(
160 media::GpuVideoAcceleratorFactories* factories, 160 base::WeakPtr<RTCVideoDecoder> decoder,
161 int64_t picture_buffer_id, 161 media::GpuVideoAcceleratorFactories* factories,
162 uint32_t texture_id, 162 int64_t picture_buffer_id,
163 const gpu::SyncToken& release_sync_token); 163 const media::PictureBuffer::TextureIds& texture_ids,
164 const gpu::SyncToken& release_sync_token);
164 // Tells VDA that a picture buffer can be recycled. 165 // Tells VDA that a picture buffer can be recycled.
165 void ReusePictureBuffer(int64_t picture_buffer_id); 166 void ReusePictureBuffer(int64_t picture_buffer_id);
166 167
167 // Creates |vda_| on the media thread. 168 // Creates |vda_| on the media thread.
168 void CreateVDA(media::VideoCodecProfile profile, base::WaitableEvent* waiter); 169 void CreateVDA(media::VideoCodecProfile profile, base::WaitableEvent* waiter);
169 170
170 void DestroyTextures(); 171 void DestroyTextures();
171 void DestroyVDA(); 172 void DestroyVDA();
172 173
173 // Gets a shared-memory segment of at least |min_size| bytes from 174 // Gets a shared-memory segment of at least |min_size| bytes from
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // processed by VDA. 243 // processed by VDA.
243 std::map<int32_t, std::unique_ptr<base::SharedMemory>> 244 std::map<int32_t, std::unique_ptr<base::SharedMemory>>
244 bitstream_buffers_in_decoder_; 245 bitstream_buffers_in_decoder_;
245 246
246 // A map from picture buffer IDs to texture-backed picture buffers. 247 // A map from picture buffer IDs to texture-backed picture buffers.
247 std::map<int32_t, media::PictureBuffer> assigned_picture_buffers_; 248 std::map<int32_t, media::PictureBuffer> assigned_picture_buffers_;
248 249
249 // PictureBuffers given to us by VDA via PictureReady, which we sent forward 250 // PictureBuffers given to us by VDA via PictureReady, which we sent forward
250 // as VideoFrames to be rendered via read_cb_, and which will be returned 251 // as VideoFrames to be rendered via read_cb_, and which will be returned
251 // to us via ReusePictureBuffer. 252 // to us via ReusePictureBuffer.
252 typedef std::map<int32_t /* picture_buffer_id */, uint32_t /* texture_id */> 253 typedef std::map<int32_t /* picture_buffer_id */,
254 media::PictureBuffer::TextureIds /* texture ids */>
253 PictureBufferTextureMap; 255 PictureBufferTextureMap;
254 PictureBufferTextureMap picture_buffers_at_display_; 256 PictureBufferTextureMap picture_buffers_at_display_;
255 257
256 // The id that will be given to the next picture buffer. 258 // The id that will be given to the next picture buffer.
257 int32_t next_picture_buffer_id_; 259 int32_t next_picture_buffer_id_;
258 260
259 // Protects |state_|, |decode_complete_callback_| , |num_shm_buffers_|, 261 // Protects |state_|, |decode_complete_callback_| , |num_shm_buffers_|,
260 // |available_shm_segments_|, |pending_buffers_|, |decode_buffers_|, 262 // |available_shm_segments_|, |pending_buffers_|, |decode_buffers_|,
261 // |next_bitstream_buffer_id_|, |reset_bitstream_buffer_id_| and 263 // |next_bitstream_buffer_id_|, |reset_bitstream_buffer_id_| and
262 // |vda_error_counter_|. 264 // |vda_error_counter_|.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // Must be destroyed, or invalidated, on the media thread. 301 // Must be destroyed, or invalidated, on the media thread.
300 // NOTE: Weak pointers must be invalidated before all other member variables. 302 // NOTE: Weak pointers must be invalidated before all other member variables.
301 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; 303 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_;
302 304
303 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); 305 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder);
304 }; 306 };
305 307
306 } // namespace content 308 } // namespace content
307 309
308 #endif // CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_DECODER_H_ 310 #endif // CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/gpu/rtc_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698