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 | 10 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 : state_(UNINITIALIZED), | 295 : state_(UNINITIALIZED), |
296 host_(host), | 296 host_(host), |
297 media_message_loop_( | 297 media_message_loop_( |
298 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy()), | 298 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy()), |
299 context_provider_( | 299 context_provider_( |
300 RenderThreadImpl::current()->SharedMainThreadContextProvider()), | 300 RenderThreadImpl::current()->SharedMainThreadContextProvider()), |
301 texture_pool_size_(0), | 301 texture_pool_size_(0), |
302 num_pending_decodes_(0), | 302 num_pending_decodes_(0), |
303 weak_ptr_factory_(this) { | 303 weak_ptr_factory_(this) { |
304 DCHECK(host_); | 304 DCHECK(host_); |
305 DCHECK(media_message_loop_); | 305 DCHECK(media_message_loop_.get()); |
306 DCHECK(context_provider_); | 306 DCHECK(context_provider_.get()); |
307 decoder_impl_.reset(new DecoderImpl(weak_ptr_factory_.GetWeakPtr())); | 307 decoder_impl_.reset(new DecoderImpl(weak_ptr_factory_.GetWeakPtr())); |
308 } | 308 } |
309 | 309 |
310 VideoDecoderShim::~VideoDecoderShim() { | 310 VideoDecoderShim::~VideoDecoderShim() { |
311 DCHECK(RenderThreadImpl::current()); | 311 DCHECK(RenderThreadImpl::current()); |
312 // Delete any remaining textures. | 312 // Delete any remaining textures. |
313 TextureIdMap::iterator it = texture_id_map_.begin(); | 313 TextureIdMap::iterator it = texture_id_map_.begin(); |
314 for (; it != texture_id_map_.end(); ++it) | 314 for (; it != texture_id_map_.end(); ++it) |
315 DeleteTexture(it->second); | 315 DeleteTexture(it->second); |
316 texture_id_map_.clear(); | 316 texture_id_map_.clear(); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { | 587 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { |
588 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); | 588 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); |
589 gles2->DeleteTextures(1, &texture_id); | 589 gles2->DeleteTextures(1, &texture_id); |
590 } | 590 } |
591 | 591 |
592 void VideoDecoderShim::FlushCommandBuffer() { | 592 void VideoDecoderShim::FlushCommandBuffer() { |
593 context_provider_->ContextGL()->Flush(); | 593 context_provider_->ContextGL()->Flush(); |
594 } | 594 } |
595 | 595 |
596 } // namespace content | 596 } // namespace content |
OLD | NEW |