Chromium Code Reviews| 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 "content/common/gpu/media/dxva_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
| 8 #error This file should only be built on Windows. | 8 #error This file should only be built on Windows. |
| 9 #endif // !defined(OS_WIN) | 9 #endif // !defined(OS_WIN) |
| 10 | 10 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 | 507 |
| 508 state_ = kNormal; | 508 state_ = kNormal; |
| 509 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( | 509 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( |
| 510 &DXVAVideoDecodeAccelerator::NotifyInitializeDone, | 510 &DXVAVideoDecodeAccelerator::NotifyInitializeDone, |
| 511 base::AsWeakPtr(this))); | 511 base::AsWeakPtr(this))); |
| 512 return true; | 512 return true; |
| 513 } | 513 } |
| 514 | 514 |
| 515 void DXVAVideoDecodeAccelerator::Decode( | 515 void DXVAVideoDecodeAccelerator::Decode( |
| 516 const media::BitstreamBuffer& bitstream_buffer) { | 516 const media::BitstreamBuffer& bitstream_buffer) { |
| 517 if (!child_message_loop_->BelongsToCurrentThread) { | |
|
piman
2013/08/27 04:01:20
You're missing the () to BelongsToCurrentThread().
wuchengli
2013/08/27 12:32:24
Embarrassing... This part is reverted because of C
| |
| 518 child_message_loop_->PostTask( | |
| 519 FROM_HERE, | |
| 520 base::Bind(&DXVAVideoDecodeAccelerator::Decode, | |
| 521 base::AsWeakPtr(this), | |
| 522 bitstream_buffer)); | |
| 523 return; | |
| 524 } | |
| 525 | |
| 517 DCHECK(CalledOnValidThread()); | 526 DCHECK(CalledOnValidThread()); |
| 518 | 527 |
| 519 RETURN_AND_NOTIFY_ON_FAILURE((state_ == kNormal || state_ == kStopped || | 528 RETURN_AND_NOTIFY_ON_FAILURE((state_ == kNormal || state_ == kStopped || |
| 520 state_ == kFlushing), | 529 state_ == kFlushing), |
| 521 "Invalid state: " << state_, ILLEGAL_STATE,); | 530 "Invalid state: " << state_, ILLEGAL_STATE,); |
| 522 | 531 |
| 523 base::win::ScopedComPtr<IMFSample> sample; | 532 base::win::ScopedComPtr<IMFSample> sample; |
| 524 sample.Attach(CreateSampleFromInputBuffer(bitstream_buffer, | 533 sample.Attach(CreateSampleFromInputBuffer(bitstream_buffer, |
| 525 input_stream_info_.cbSize, | 534 input_stream_info_.cbSize, |
| 526 input_stream_info_.cbAlignment)); | 535 input_stream_info_.cbAlignment)); |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1165 | 1174 |
| 1166 for (index = picture_buffers.begin(); | 1175 for (index = picture_buffers.begin(); |
| 1167 index != picture_buffers.end(); | 1176 index != picture_buffers.end(); |
| 1168 ++index) { | 1177 ++index) { |
| 1169 DVLOG(1) << "Dismissing picture id: " << index->second->id(); | 1178 DVLOG(1) << "Dismissing picture id: " << index->second->id(); |
| 1170 client_->DismissPictureBuffer(index->second->id()); | 1179 client_->DismissPictureBuffer(index->second->id()); |
| 1171 } | 1180 } |
| 1172 } | 1181 } |
| 1173 | 1182 |
| 1174 } // namespace content | 1183 } // namespace content |
| OLD | NEW |