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

Unified Diff: ppapi/proxy/video_decoder_resource.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/examples/video_decode/video_decode.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/video_decoder_resource.cc
diff --git a/ppapi/proxy/video_decoder_resource.cc b/ppapi/proxy/video_decoder_resource.cc
index acb5f75e3f78b9a0762f9b70a8ace875ba19df80..54ccfe78254a870493826f8301e6b77b30742b43 100644
--- a/ppapi/proxy/video_decoder_resource.cc
+++ b/ppapi/proxy/video_decoder_resource.cc
@@ -260,8 +260,6 @@ int32_t VideoDecoderResource::GetPicture(
void VideoDecoderResource::RecyclePicture(const PP_VideoPicture* picture) {
if (decoder_last_error_)
return;
- if (reset_callback_)
- return;
Post(RENDERER, PpapiHostMsg_VideoDecoder_RecyclePicture(picture->texture_id));
}
@@ -471,9 +469,12 @@ void VideoDecoderResource::OnPluginMsgResetComplete(
const ResourceMessageReplyParams& params) {
// All shm buffers should have been made available by now.
DCHECK_EQ(shm_buffers_.size(), available_shm_buffers_.size());
- // Received pictures are no longer valid.
- while (!received_pictures_.empty())
+ // Recycle any pictures which haven't been passed to the plugin.
+ while (!received_pictures_.empty()) {
+ Post(RENDERER, PpapiHostMsg_VideoDecoder_RecyclePicture(
+ received_pictures_.front().texture_id));
received_pictures_.pop();
+ }
scoped_refptr<TrackedCallback> callback;
callback.swap(reset_callback_);
« no previous file with comments | « ppapi/examples/video_decode/video_decode.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698