| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/video_decoder_shim.h" | 5 #include "content/renderer/pepper/video_decoder_shim.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 <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 TextureIdSet::iterator it = available_textures_.begin(); | 1060 TextureIdSet::iterator it = available_textures_.begin(); |
| 1061 uint32_t texture_id = *it; | 1061 uint32_t texture_id = *it; |
| 1062 available_textures_.erase(it); | 1062 available_textures_.erase(it); |
| 1063 | 1063 |
| 1064 uint32_t local_texture_id = texture_id_map_[texture_id]; | 1064 uint32_t local_texture_id = texture_id_map_[texture_id]; |
| 1065 | 1065 |
| 1066 yuv_converter_->Convert(frame->video_frame, local_texture_id); | 1066 yuv_converter_->Convert(frame->video_frame, local_texture_id); |
| 1067 | 1067 |
| 1068 host_->PictureReady(media::Picture(texture_id, frame->decode_id, | 1068 host_->PictureReady(media::Picture(texture_id, frame->decode_id, |
| 1069 frame->video_frame->visible_rect(), | 1069 frame->video_frame->visible_rect(), |
| 1070 false)); | 1070 false, false)); |
| 1071 pending_frames_.pop(); | 1071 pending_frames_.pop(); |
| 1072 } | 1072 } |
| 1073 | 1073 |
| 1074 FlushCommandBuffer(); | 1074 FlushCommandBuffer(); |
| 1075 | 1075 |
| 1076 if (pending_frames_.empty()) { | 1076 if (pending_frames_.empty()) { |
| 1077 // If frames aren't backing up, notify the host of any completed decodes so | 1077 // If frames aren't backing up, notify the host of any completed decodes so |
| 1078 // it can send more buffers. | 1078 // it can send more buffers. |
| 1079 NotifyCompletedDecodes(); | 1079 NotifyCompletedDecodes(); |
| 1080 | 1080 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { | 1120 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { |
| 1121 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); | 1121 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); |
| 1122 gles2->DeleteTextures(1, &texture_id); | 1122 gles2->DeleteTextures(1, &texture_id); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 void VideoDecoderShim::FlushCommandBuffer() { | 1125 void VideoDecoderShim::FlushCommandBuffer() { |
| 1126 context_provider_->ContextGL()->Flush(); | 1126 context_provider_->ContextGL()->Flush(); |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 } // namespace content | 1129 } // namespace content |
| OLD | NEW |