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

Side by Side Diff: media/gpu/fake_video_decode_accelerator.cc

Issue 2382113002: Use clearer names for the PictureBuffer texture id members (Closed)
Patch Set: Added comments Created 4 years, 2 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
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 "media/gpu/fake_video_decode_accelerator.h" 5 #include "media/gpu/fake_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 std::unique_ptr<uint8_t[]> black_data( 96 std::unique_ptr<uint8_t[]> black_data(
97 new uint8_t[frame_buffer_size_.width() * frame_buffer_size_.height() * 97 new uint8_t[frame_buffer_size_.width() * frame_buffer_size_.height() *
98 4]); 98 4]);
99 memset(black_data.get(), 0, 99 memset(black_data.get(), 0,
100 frame_buffer_size_.width() * frame_buffer_size_.height() * 4); 100 frame_buffer_size_.width() * frame_buffer_size_.height() * 4);
101 if (!make_context_current_cb_.Run()) { 101 if (!make_context_current_cb_.Run()) {
102 LOG(ERROR) << "ReusePictureBuffer(): could not make context current"; 102 LOG(ERROR) << "ReusePictureBuffer(): could not make context current";
103 return; 103 return;
104 } 104 }
105 for (size_t index = 0; index < buffers.size(); ++index) { 105 for (size_t index = 0; index < buffers.size(); ++index) {
106 DCHECK_LE(1u, buffers[index].texture_ids().size()); 106 DCHECK_LE(1u, buffers[index].service_texture_ids().size());
107 glBindTexture(GL_TEXTURE_2D, buffers[index].texture_ids()[0]); 107 glBindTexture(GL_TEXTURE_2D, buffers[index].service_texture_ids()[0]);
108 // Every other frame white and the rest black. 108 // Every other frame white and the rest black.
109 uint8_t* data = index % 2 ? white_data.get() : black_data.get(); 109 uint8_t* data = index % 2 ? white_data.get() : black_data.get();
110 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, frame_buffer_size_.width(), 110 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, frame_buffer_size_.width(),
111 frame_buffer_size_.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 111 frame_buffer_size_.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE,
112 data); 112 data);
113 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 113 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
114 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 114 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
115 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 115 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
116 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 116 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
117 glBindTexture(GL_TEXTURE_2D, 0); 117 glBindTexture(GL_TEXTURE_2D, 0);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Bitstream no longer needed. 175 // Bitstream no longer needed.
176 client_->NotifyEndOfBitstreamBuffer(bitstream_id); 176 client_->NotifyEndOfBitstreamBuffer(bitstream_id);
177 if (flushing_ && queued_bitstream_ids_.empty()) { 177 if (flushing_ && queued_bitstream_ids_.empty()) {
178 flushing_ = false; 178 flushing_ = false;
179 client_->NotifyFlushDone(); 179 client_->NotifyFlushDone();
180 } 180 }
181 } 181 }
182 } 182 }
183 183
184 } // namespace media 184 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/dxva_video_decode_accelerator_win.cc ('k') | media/gpu/ipc/client/gpu_video_decode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698