OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/proxy/video_decoder_resource.h" | 5 #include "ppapi/proxy/video_decoder_resource.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
10 #include "gpu/command_buffer/common/mailbox.h" | 10 #include "gpu/command_buffer/common/mailbox.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 get_picture_0_1_(NULL), | 66 get_picture_0_1_(NULL), |
67 gles2_impl_(NULL), | 67 gles2_impl_(NULL), |
68 initialized_(false), | 68 initialized_(false), |
69 testing_(false), | 69 testing_(false), |
70 // Set |decoder_last_error_| to PP_OK after successful initialization. | 70 // Set |decoder_last_error_| to PP_OK after successful initialization. |
71 // This makes error checking a little more concise, since we can check | 71 // This makes error checking a little more concise, since we can check |
72 // that the decoder has been initialized and hasn't returned an error by | 72 // that the decoder has been initialized and hasn't returned an error by |
73 // just testing |decoder_last_error_|. | 73 // just testing |decoder_last_error_|. |
74 decoder_last_error_(PP_ERROR_FAILED) { | 74 decoder_last_error_(PP_ERROR_FAILED) { |
75 // Clear the decode_ids_ array. | 75 // Clear the decode_ids_ array. |
76 memset(decode_ids_, 0, arraysize(decode_ids_)); | 76 memset(decode_ids_, 0, sizeof(decode_ids_)); |
77 SendCreate(RENDERER, PpapiHostMsg_VideoDecoder_Create()); | 77 SendCreate(RENDERER, PpapiHostMsg_VideoDecoder_Create()); |
78 } | 78 } |
79 | 79 |
80 VideoDecoderResource::~VideoDecoderResource() { | 80 VideoDecoderResource::~VideoDecoderResource() { |
81 // Destroy any textures which haven't been dismissed. | 81 // Destroy any textures which haven't been dismissed. |
82 TextureMap::iterator it = textures_.begin(); | 82 TextureMap::iterator it = textures_.begin(); |
83 for (; it != textures_.end(); ++it) | 83 for (; it != textures_.end(); ++it) |
84 DeleteGLTexture(it->first); | 84 DeleteGLTexture(it->first); |
85 } | 85 } |
86 | 86 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 get_picture_0_1_->texture_target = texture_target; | 554 get_picture_0_1_->texture_target = texture_target; |
555 get_picture_0_1_->texture_size = texture_size; | 555 get_picture_0_1_->texture_size = texture_size; |
556 get_picture_0_1_ = NULL; | 556 get_picture_0_1_ = NULL; |
557 } | 557 } |
558 | 558 |
559 received_pictures_.pop(); | 559 received_pictures_.pop(); |
560 } | 560 } |
561 | 561 |
562 } // namespace proxy | 562 } // namespace proxy |
563 } // namespace ppapi | 563 } // namespace ppapi |
OLD | NEW |