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

Side by Side Diff: content/renderer/pepper/pepper_video_decoder_host.cc

Issue 1751323002: Allow multiple texture ids per picture buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 "content/renderer/pepper/pepper_video_decoder_host.h" 5 #include "content/renderer/pepper/pepper_video_decoder_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 return PP_ERROR_BADARGUMENT; 272 return PP_ERROR_BADARGUMENT;
273 } 273 }
274 new_textures.insert( 274 new_textures.insert(
275 std::make_pair(texture_ids[i], PictureBufferState::ASSIGNED)); 275 std::make_pair(texture_ids[i], PictureBufferState::ASSIGNED));
276 } 276 }
277 277
278 picture_buffer_map_.insert(new_textures.begin(), new_textures.end()); 278 picture_buffer_map_.insert(new_textures.begin(), new_textures.end());
279 279
280 std::vector<media::PictureBuffer> picture_buffers; 280 std::vector<media::PictureBuffer> picture_buffers;
281 for (uint32_t i = 0; i < texture_ids.size(); i++) { 281 for (uint32_t i = 0; i < texture_ids.size(); i++) {
282 media::PictureBuffer::TextureIds ids;
283 ids.push_back(texture_ids[i]);
282 media::PictureBuffer buffer( 284 media::PictureBuffer buffer(
283 texture_ids[i], // Use the texture_id to identify the buffer. 285 texture_ids[i], // Use the texture_id to identify the buffer.
284 gfx::Size(size.width, size.height), 286 gfx::Size(size.width, size.height), ids);
285 texture_ids[i]);
286 picture_buffers.push_back(buffer); 287 picture_buffers.push_back(buffer);
287 } 288 }
288 decoder_->AssignPictureBuffers(picture_buffers); 289 decoder_->AssignPictureBuffers(picture_buffers);
289 return PP_OK; 290 return PP_OK;
290 } 291 }
291 292
292 int32_t PepperVideoDecoderHost::OnHostMsgRecyclePicture( 293 int32_t PepperVideoDecoderHost::OnHostMsgRecyclePicture(
293 ppapi::host::HostMessageContext* context, 294 ppapi::host::HostMessageContext* context,
294 uint32_t texture_id) { 295 uint32_t texture_id) {
295 if (!initialized_) 296 if (!initialized_)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 return PP_ERROR_FAILED; 345 return PP_ERROR_FAILED;
345 346
346 reset_reply_context_ = context->MakeReplyMessageContext(); 347 reset_reply_context_ = context->MakeReplyMessageContext();
347 decoder_->Reset(); 348 decoder_->Reset();
348 349
349 return PP_OK_COMPLETIONPENDING; 350 return PP_OK_COMPLETIONPENDING;
350 } 351 }
351 352
352 void PepperVideoDecoderHost::ProvidePictureBuffers( 353 void PepperVideoDecoderHost::ProvidePictureBuffers(
353 uint32_t requested_num_of_buffers, 354 uint32_t requested_num_of_buffers,
355 uint32_t textures_per_buffer,
354 const gfx::Size& dimensions, 356 const gfx::Size& dimensions,
355 uint32_t texture_target) { 357 uint32_t texture_target) {
358 DCHECK_EQ(1u, textures_per_buffer);
356 RequestTextures(std::max(min_picture_count_, requested_num_of_buffers), 359 RequestTextures(std::max(min_picture_count_, requested_num_of_buffers),
357 dimensions, 360 dimensions,
358 texture_target, 361 texture_target,
359 std::vector<gpu::Mailbox>()); 362 std::vector<gpu::Mailbox>());
360 } 363 }
361 364
362 void PepperVideoDecoderHost::PictureReady(const media::Picture& picture) { 365 void PepperVideoDecoderHost::PictureReady(const media::Picture& picture) {
363 PictureBufferMap::iterator it = 366 PictureBufferMap::iterator it =
364 picture_buffer_map_.find(picture.picture_buffer_id()); 367 picture_buffer_map_.find(picture.picture_buffer_id());
365 DCHECK(it != picture_buffer_map_.end()); 368 DCHECK(it != picture_buffer_map_.end());
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 532
530 PepperVideoDecoderHost::PendingDecodeList::iterator 533 PepperVideoDecoderHost::PendingDecodeList::iterator
531 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) { 534 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) {
532 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(), 535 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(),
533 [decode_id](const PendingDecode& item) { 536 [decode_id](const PendingDecode& item) {
534 return item.decode_id == decode_id; 537 return item.decode_id == decode_id;
535 }); 538 });
536 } 539 }
537 540
538 } // namespace content 541 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_video_decoder_host.h ('k') | content/renderer/pepper/ppb_video_decoder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698