| 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 VideoFrame::Columns(i, output_format_, coded_size.width()); | 567 VideoFrame::Columns(i, output_format_, coded_size.width()); |
| 568 const size_t height = | 568 const size_t height = |
| 569 VideoFrame::Rows(i, output_format_, coded_size.height()); | 569 VideoFrame::Rows(i, output_format_, coded_size.height()); |
| 570 plane_resource.image_id = gles2->CreateImageCHROMIUM( | 570 plane_resource.image_id = gles2->CreateImageCHROMIUM( |
| 571 plane_resource.gpu_memory_buffer->AsClientBuffer(), width, height, | 571 plane_resource.gpu_memory_buffer->AsClientBuffer(), width, height, |
| 572 ImageInternalFormat(output_format_, i)); | 572 ImageInternalFormat(output_format_, i)); |
| 573 } else if (plane_resource.image_id) { | 573 } else if (plane_resource.image_id) { |
| 574 gles2->ReleaseTexImage2DCHROMIUM(texture_target, plane_resource.image_id); | 574 gles2->ReleaseTexImage2DCHROMIUM(texture_target, plane_resource.image_id); |
| 575 } | 575 } |
| 576 if (plane_resource.image_id) | 576 if (plane_resource.image_id) |
| 577 gles2->BindTexImage2DCHROMIUM(texture_target, plane_resource.image_id); | 577 gles2->BindTexImage2DCHROMIUM(texture_target, plane_resource.image_id, 0); |
| 578 mailbox_holders[i] = gpu::MailboxHolder(plane_resource.mailbox, | 578 mailbox_holders[i] = gpu::MailboxHolder(plane_resource.mailbox, |
| 579 gpu::SyncToken(), texture_target); | 579 gpu::SyncToken(), texture_target); |
| 580 } | 580 } |
| 581 | 581 |
| 582 // Insert a sync_token, this is needed to make sure that the textures the | 582 // Insert a sync_token, this is needed to make sure that the textures the |
| 583 // mailboxes refer to will be used only after all the previous commands posted | 583 // mailboxes refer to will be used only after all the previous commands posted |
| 584 // in the command buffer have been processed. | 584 // in the command buffer have been processed. |
| 585 const GLuint64 fence_sync = gles2->InsertFenceSyncCHROMIUM(); | 585 const GLuint64 fence_sync = gles2->InsertFenceSyncCHROMIUM(); |
| 586 gles2->OrderingBarrierCHROMIUM(); | 586 gles2->OrderingBarrierCHROMIUM(); |
| 587 | 587 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 } | 770 } |
| 771 | 771 |
| 772 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( | 772 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( |
| 773 const scoped_refptr<VideoFrame>& video_frame, | 773 const scoped_refptr<VideoFrame>& video_frame, |
| 774 const FrameReadyCB& frame_ready_cb) { | 774 const FrameReadyCB& frame_ready_cb) { |
| 775 DCHECK(video_frame); | 775 DCHECK(video_frame); |
| 776 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); | 776 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); |
| 777 } | 777 } |
| 778 | 778 |
| 779 } // namespace media | 779 } // namespace media |
| OLD | NEW |