Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 390213002: Pepper: Change PPB_VideoDecoder::Reset behavior so plugin always manages textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 DCHECK(RenderThreadImpl::current()); 549 DCHECK(RenderThreadImpl::current());
550 DCHECK(host_); 550 DCHECK(host_);
551 551
552 while (!pending_frames_.empty()) 552 while (!pending_frames_.empty())
553 pending_frames_.pop(); 553 pending_frames_.pop();
554 NotifyCompletedDecodes(); 554 NotifyCompletedDecodes();
555 555
556 // Dismiss any old textures now. 556 // Dismiss any old textures now.
557 while (!textures_to_dismiss_.empty()) 557 while (!textures_to_dismiss_.empty())
558 DismissTexture(*textures_to_dismiss_.begin()); 558 DismissTexture(*textures_to_dismiss_.begin());
559 // Make all textures available.
560 for (TextureIdMap::const_iterator it = texture_id_map_.begin();
561 it != texture_id_map_.end();
562 ++it) {
563 available_textures_.insert(it->first);
564 }
565 559
566 state_ = DECODING; 560 state_ = DECODING;
567 host_->NotifyResetDone(); 561 host_->NotifyResetDone();
568 } 562 }
569 563
570 void VideoDecoderShim::NotifyCompletedDecodes() { 564 void VideoDecoderShim::NotifyCompletedDecodes() {
571 while (!completed_decodes_.empty()) { 565 while (!completed_decodes_.empty()) {
572 host_->NotifyEndOfBitstreamBuffer(completed_decodes_.front()); 566 host_->NotifyEndOfBitstreamBuffer(completed_decodes_.front());
573 completed_decodes_.pop(); 567 completed_decodes_.pop();
574 } 568 }
(...skipping 11 matching lines...) Expand all
586 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { 580 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) {
587 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); 581 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
588 gles2->DeleteTextures(1, &texture_id); 582 gles2->DeleteTextures(1, &texture_id);
589 } 583 }
590 584
591 void VideoDecoderShim::FlushCommandBuffer() { 585 void VideoDecoderShim::FlushCommandBuffer() {
592 context_provider_->ContextGL()->Flush(); 586 context_provider_->ContextGL()->Flush();
593 } 587 }
594 588
595 } // namespace content 589 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_video_decoder_host.cc ('k') | native_client_sdk/src/examples/api/video_decode/video_decode.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698