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

Side by Side Diff: content/common/gpu/media/vaapi_h264_decoder.cc

Issue 11092054: Teach BindToLoop to create callbacks that accept scoped parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: xhwang CR Created 8 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 | Annotate | Revision Log
OLDNEW
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 <dlfcn.h> 5 #include <dlfcn.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 // Find the surface associated with the picture to be decoded. 1055 // Find the surface associated with the picture to be decoded.
1056 DecodeSurface* dec_surface = 1056 DecodeSurface* dec_surface =
1057 poc_to_decode_surfaces_[curr_pic_->pic_order_cnt]; 1057 poc_to_decode_surfaces_[curr_pic_->pic_order_cnt];
1058 DVLOG(4) << "Decoding POC " << curr_pic_->pic_order_cnt 1058 DVLOG(4) << "Decoding POC " << curr_pic_->pic_order_cnt
1059 << " into surface " << dec_surface->va_surface_id(); 1059 << " into surface " << dec_surface->va_surface_id();
1060 1060
1061 DVLOG(4) << "Pending VA bufs to commit: " << pending_va_bufs_.size(); 1061 DVLOG(4) << "Pending VA bufs to commit: " << pending_va_bufs_.size();
1062 DVLOG(4) << "Pending slice bufs to commit: " << pending_slice_bufs_.size(); 1062 DVLOG(4) << "Pending slice bufs to commit: " << pending_slice_bufs_.size();
1063 1063
1064 DCHECK(pending_slice_bufs_.size()); 1064 DCHECK(pending_slice_bufs_.size());
1065 std::queue<VABufferID>* va_bufs = new std::queue<VABufferID>(); 1065 scoped_ptr<std::queue<VABufferID> > va_bufs(new std::queue<VABufferID>());
1066 std::swap(*va_bufs, pending_va_bufs_); 1066 std::swap(*va_bufs, pending_va_bufs_);
1067 std::queue<VABufferID>* slice_bufs = new std::queue<VABufferID>(); 1067 scoped_ptr<std::queue<VABufferID> > slice_bufs(new std::queue<VABufferID>());
1068 std::swap(*slice_bufs, pending_slice_bufs_); 1068 std::swap(*slice_bufs, pending_slice_bufs_);
1069 1069
1070 // Fire up a parallel job on the GPU on the ChildThread to decode and put 1070 // Fire up a parallel job on the GPU on the ChildThread to decode and put
1071 // the decoded/converted/scaled picture into the pixmap. 1071 // the decoded/converted/scaled picture into the pixmap.
1072 // Callee will take care of freeing the buffer queues. 1072 // Callee will take care of freeing the buffer queues.
1073 submit_decode_cb_.Run(dec_surface->picture_buffer_id(), va_bufs, slice_bufs); 1073 submit_decode_cb_.Run(
1074 dec_surface->picture_buffer_id(), va_bufs.Pass(), slice_bufs.Pass());
1074 1075
1075 // Used to notify clients that we had sufficient data to start decoding 1076 // Used to notify clients that we had sufficient data to start decoding
1076 // a new frame. 1077 // a new frame.
1077 frame_ready_at_hw_ = true; 1078 frame_ready_at_hw_ = true;
1078 1079
1079 return true; 1080 return true;
1080 } 1081 }
1081 1082
1082 void VaapiH264Decoder::DestroyBuffers(size_t num_va_buffers, 1083 void VaapiH264Decoder::DestroyBuffers(size_t num_va_buffers,
1083 const VABufferID* va_buffers) { 1084 const VABufferID* va_buffers) {
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 VAAPI_SyncSurface && 2356 VAAPI_SyncSurface &&
2356 VAAPI_BeginPicture && 2357 VAAPI_BeginPicture &&
2357 VAAPI_RenderPicture && 2358 VAAPI_RenderPicture &&
2358 VAAPI_EndPicture && 2359 VAAPI_EndPicture &&
2359 VAAPI_CreateBuffer && 2360 VAAPI_CreateBuffer &&
2360 VAAPI_DestroyBuffer && 2361 VAAPI_DestroyBuffer &&
2361 VAAPI_ErrorStr; 2362 VAAPI_ErrorStr;
2362 } 2363 }
2363 2364
2364 } // namespace content 2365 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_h264_decoder.h ('k') | content/common/gpu/media/vaapi_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698