OLD | NEW |
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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 frame_format, mailbox_holders, release_mailbox_callback, coded_size, | 598 frame_format, mailbox_holders, release_mailbox_callback, coded_size, |
599 gfx::Rect(visible_size), video_frame->natural_size(), | 599 gfx::Rect(visible_size), video_frame->natural_size(), |
600 video_frame->timestamp()); | 600 video_frame->timestamp()); |
601 | 601 |
602 if (!frame) { | 602 if (!frame) { |
603 release_mailbox_callback.Run(gpu::SyncToken()); | 603 release_mailbox_callback.Run(gpu::SyncToken()); |
604 frame_ready_cb.Run(video_frame); | 604 frame_ready_cb.Run(video_frame); |
605 return; | 605 return; |
606 } | 606 } |
607 | 607 |
| 608 frame->set_color_space(video_frame->ColorSpace()); |
| 609 |
608 bool allow_overlay = false; | 610 bool allow_overlay = false; |
609 switch (output_format_) { | 611 switch (output_format_) { |
610 case PIXEL_FORMAT_I420: | 612 case PIXEL_FORMAT_I420: |
611 allow_overlay = | 613 allow_overlay = |
612 video_frame->metadata()->IsTrue(VideoFrameMetadata::ALLOW_OVERLAY); | 614 video_frame->metadata()->IsTrue(VideoFrameMetadata::ALLOW_OVERLAY); |
613 break; | 615 break; |
614 case PIXEL_FORMAT_NV12: | 616 case PIXEL_FORMAT_NV12: |
615 case PIXEL_FORMAT_UYVY: | 617 case PIXEL_FORMAT_UYVY: |
616 allow_overlay = true; | 618 allow_overlay = true; |
617 break; | 619 break; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 } | 763 } |
762 | 764 |
763 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( | 765 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( |
764 const scoped_refptr<VideoFrame>& video_frame, | 766 const scoped_refptr<VideoFrame>& video_frame, |
765 const FrameReadyCB& frame_ready_cb) { | 767 const FrameReadyCB& frame_ready_cb) { |
766 DCHECK(video_frame); | 768 DCHECK(video_frame); |
767 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); | 769 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); |
768 } | 770 } |
769 | 771 |
770 } // namespace media | 772 } // namespace media |
OLD | NEW |