| 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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 if (textures_to_dismiss_.find(texture_id) != textures_to_dismiss_.end()) { | 961 if (textures_to_dismiss_.find(texture_id) != textures_to_dismiss_.end()) { |
| 962 DismissTexture(texture_id); | 962 DismissTexture(texture_id); |
| 963 } else if (texture_id_map_.find(texture_id) != texture_id_map_.end()) { | 963 } else if (texture_id_map_.find(texture_id) != texture_id_map_.end()) { |
| 964 available_textures_.insert(texture_id); | 964 available_textures_.insert(texture_id); |
| 965 SendPictures(); | 965 SendPictures(); |
| 966 } else { | 966 } else { |
| 967 NOTREACHED(); | 967 NOTREACHED(); |
| 968 } | 968 } |
| 969 } | 969 } |
| 970 | 970 |
| 971 void VideoDecoderShim::Flush() { | 971 void VideoDecoderShim::Flush(bool return_buffers) { |
| 972 DCHECK(RenderThreadImpl::current()); | 972 DCHECK(RenderThreadImpl::current()); |
| 973 DCHECK_EQ(state_, DECODING); | 973 DCHECK_EQ(state_, DECODING); |
| 974 state_ = FLUSHING; | 974 state_ = FLUSHING; |
| 975 } | 975 } |
| 976 | 976 |
| 977 void VideoDecoderShim::Reset() { | 977 void VideoDecoderShim::Reset() { |
| 978 DCHECK(RenderThreadImpl::current()); | 978 DCHECK(RenderThreadImpl::current()); |
| 979 DCHECK_EQ(state_, DECODING); | 979 DCHECK_EQ(state_, DECODING); |
| 980 state_ = RESETTING; | 980 state_ = RESETTING; |
| 981 media_task_runner_->PostTask( | 981 media_task_runner_->PostTask( |
| (...skipping 138 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 |