| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |