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

Side by Side Diff: chrome/gpu/gpu_video_decoder.cc

Issue 4113006: Rename UploadToVideoFrame to ConvertToVideoFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « chrome/gpu/gpu_video_decoder.h ('k') | chrome/gpu/gpu_video_decoder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/gpu/gpu_video_decoder.h" 5 #include "chrome/gpu/gpu_video_decoder.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/child_thread.h" 8 #include "chrome/common/child_thread.h"
9 #include "chrome/common/gpu_messages.h" 9 #include "chrome/common/gpu_messages.h"
10 #include "chrome/gpu/gpu_channel.h" 10 #include "chrome/gpu/gpu_channel.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 DCHECK(ret) << "Failed to switch context"; 192 DCHECK(ret) << "Failed to switch context";
193 193
194 for (VideoFrameMap::iterator i = video_frame_map_.begin(); 194 for (VideoFrameMap::iterator i = video_frame_map_.begin();
195 i != video_frame_map_.end(); ++i) { 195 i != video_frame_map_.end(); ++i) {
196 video_device_->ReleaseVideoFrame(i->second); 196 video_device_->ReleaseVideoFrame(i->second);
197 } 197 }
198 video_frame_map_.clear(); 198 video_frame_map_.clear();
199 SendReleaseAllVideoFrames(); 199 SendReleaseAllVideoFrames();
200 } 200 }
201 201
202 void GpuVideoDecoder::UploadToVideoFrame(void* buffer, 202 void GpuVideoDecoder::ConvertToVideoFrame(
203 scoped_refptr<media::VideoFrame> frame, 203 void* buffer,
204 Task* task) { 204 scoped_refptr<media::VideoFrame> frame,
205 Task* task) {
205 // This method is called by VideoDecodeEngine to upload a buffer to a 206 // This method is called by VideoDecodeEngine to upload a buffer to a
206 // VideoFrame. We should just delegate this to GpuVideoDevice which contains 207 // VideoFrame. We should just delegate this to GpuVideoDevice which contains
207 // the actual implementation. 208 // the actual implementation.
208 bool ret = gles2_decoder_->MakeCurrent(); 209 bool ret = gles2_decoder_->MakeCurrent();
209 DCHECK(ret) << "Failed to switch context"; 210 DCHECK(ret) << "Failed to switch context";
210 211
211 // Actually doing the upload on the main thread. 212 // Actually doing the upload on the main thread.
212 ret = video_device_->UploadToVideoFrame(buffer, frame); 213 ret = video_device_->ConvertToVideoFrame(buffer, frame);
213 DCHECK(ret) << "Failed to upload video content to a VideoFrame."; 214 DCHECK(ret) << "Failed to upload video content to a VideoFrame.";
214 task->Run(); 215 task->Run();
215 delete task; 216 delete task;
216 } 217 }
217 218
218 void GpuVideoDecoder::Destroy(Task* task) { 219 void GpuVideoDecoder::Destroy(Task* task) {
219 // TODO(hclam): I still need to think what I should do here. 220 // TODO(hclam): I still need to think what I should do here.
220 } 221 }
221 222
222 void GpuVideoDecoder::SetVideoDecodeEngine(media::VideoDecodeEngine* engine) { 223 void GpuVideoDecoder::SetVideoDecodeEngine(media::VideoDecodeEngine* engine) {
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 } 405 }
405 } 406 }
406 407
407 void GpuVideoDecoder::SendReleaseAllVideoFrames() { 408 void GpuVideoDecoder::SendReleaseAllVideoFrames() {
408 if (!sender_->Send( 409 if (!sender_->Send(
409 new GpuVideoDecoderHostMsg_ReleaseAllVideoFrames( 410 new GpuVideoDecoderHostMsg_ReleaseAllVideoFrames(
410 decoder_host_id()))) { 411 decoder_host_id()))) {
411 LOG(ERROR) << "GpuVideoDecoderMsg_ReleaseAllVideoFrames failed"; 412 LOG(ERROR) << "GpuVideoDecoderMsg_ReleaseAllVideoFrames failed";
412 } 413 }
413 } 414 }
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_video_decoder.h ('k') | chrome/gpu/gpu_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698