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

Side by Side Diff: media/video/gpu_memory_buffer_video_frame_pool.cc

Issue 2169913003: Video: Plumb media::VideoFrame color space to cc and GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/video/gpu_memory_buffer_video_frame_pool.h" 5 #include "media/video/gpu_memory_buffer_video_frame_pool.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 } 432 }
433 return true; 433 return true;
434 } 434 }
435 435
436 void GpuMemoryBufferVideoFramePool::PoolImpl::OnCopiesDone( 436 void GpuMemoryBufferVideoFramePool::PoolImpl::OnCopiesDone(
437 const scoped_refptr<VideoFrame>& video_frame, 437 const scoped_refptr<VideoFrame>& video_frame,
438 FrameResources* frame_resources, 438 FrameResources* frame_resources,
439 const FrameReadyCB& frame_ready_cb) { 439 const FrameReadyCB& frame_ready_cb) {
440 for (const auto& plane_resource : frame_resources->plane_resources) { 440 for (const auto& plane_resource : frame_resources->plane_resources) {
441 if (plane_resource.gpu_memory_buffer) 441 if (plane_resource.gpu_memory_buffer) {
442 plane_resource.gpu_memory_buffer->Unmap(); 442 plane_resource.gpu_memory_buffer->Unmap();
443 plane_resource.gpu_memory_buffer->SetColorSpaceForScanout(
444 video_frame->ColorSpace());
445 }
443 } 446 }
444 447
445 media_task_runner_->PostTask( 448 media_task_runner_->PostTask(
446 FROM_HERE, 449 FROM_HERE,
447 base::Bind(&PoolImpl::BindAndCreateMailboxesHardwareFrameResources, this, 450 base::Bind(&PoolImpl::BindAndCreateMailboxesHardwareFrameResources, this,
448 video_frame, frame_resources, frame_ready_cb)); 451 video_frame, frame_resources, frame_ready_cb));
449 } 452 }
450 453
451 // Copies |video_frame| into |frame_resources| asynchronously, posting n tasks 454 // Copies |video_frame| into |frame_resources| asynchronously, posting n tasks
452 // that will be synchronized by a barrier. 455 // that will be synchronized by a barrier.
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 } 761 }
759 762
760 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( 763 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame(
761 const scoped_refptr<VideoFrame>& video_frame, 764 const scoped_refptr<VideoFrame>& video_frame,
762 const FrameReadyCB& frame_ready_cb) { 765 const FrameReadyCB& frame_ready_cb) {
763 DCHECK(video_frame); 766 DCHECK(video_frame);
764 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); 767 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb);
765 } 768 }
766 769
767 } // namespace media 770 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698