| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 case PIXEL_FORMAT_MT21: | 376 case PIXEL_FORMAT_MT21: |
| 377 case PIXEL_FORMAT_YUV420P9: | 377 case PIXEL_FORMAT_YUV420P9: |
| 378 case PIXEL_FORMAT_YUV422P9: | 378 case PIXEL_FORMAT_YUV422P9: |
| 379 case PIXEL_FORMAT_YUV444P9: | 379 case PIXEL_FORMAT_YUV444P9: |
| 380 case PIXEL_FORMAT_YUV420P10: | 380 case PIXEL_FORMAT_YUV420P10: |
| 381 case PIXEL_FORMAT_YUV422P10: | 381 case PIXEL_FORMAT_YUV422P10: |
| 382 case PIXEL_FORMAT_YUV444P10: | 382 case PIXEL_FORMAT_YUV444P10: |
| 383 case PIXEL_FORMAT_YUV420P12: | 383 case PIXEL_FORMAT_YUV420P12: |
| 384 case PIXEL_FORMAT_YUV422P12: | 384 case PIXEL_FORMAT_YUV422P12: |
| 385 case PIXEL_FORMAT_YUV444P12: | 385 case PIXEL_FORMAT_YUV444P12: |
| 386 case PIXEL_FORMAT_Y8: |
| 387 case PIXEL_FORMAT_Y16: |
| 386 case PIXEL_FORMAT_UNKNOWN: | 388 case PIXEL_FORMAT_UNKNOWN: |
| 387 frame_ready_cb.Run(video_frame); | 389 frame_ready_cb.Run(video_frame); |
| 388 return; | 390 return; |
| 389 } | 391 } |
| 390 | 392 |
| 391 const gfx::Size coded_size = CodedSize(video_frame, output_format_); | 393 const gfx::Size coded_size = CodedSize(video_frame, output_format_); |
| 392 // Acquire resources. Incompatible ones will be dropped from the pool. | 394 // Acquire resources. Incompatible ones will be dropped from the pool. |
| 393 FrameResources* frame_resources = | 395 FrameResources* frame_resources = |
| 394 GetOrCreateFrameResources(coded_size, output_format_); | 396 GetOrCreateFrameResources(coded_size, output_format_); |
| 395 if (!frame_resources) { | 397 if (!frame_resources) { |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 } | 770 } |
| 769 | 771 |
| 770 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( | 772 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( |
| 771 const scoped_refptr<VideoFrame>& video_frame, | 773 const scoped_refptr<VideoFrame>& video_frame, |
| 772 const FrameReadyCB& frame_ready_cb) { | 774 const FrameReadyCB& frame_ready_cb) { |
| 773 DCHECK(video_frame); | 775 DCHECK(video_frame); |
| 774 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); | 776 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); |
| 775 } | 777 } |
| 776 | 778 |
| 777 } // namespace media | 779 } // namespace media |
| OLD | NEW |