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 "media/filters/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 &GpuVideoDecoder::PrepareForShutdownHack, this)); | 309 &GpuVideoDecoder::PrepareForShutdownHack, this)); |
310 return; | 310 return; |
311 } | 311 } |
312 shutting_down_ = true; | 312 shutting_down_ = true; |
313 } | 313 } |
314 | 314 |
315 void GpuVideoDecoder::NotifyInitializeDone() { | 315 void GpuVideoDecoder::NotifyInitializeDone() { |
316 NOTREACHED() << "GpuVideoDecodeAcceleratorHost::Initialize is synchronous!"; | 316 NOTREACHED() << "GpuVideoDecodeAcceleratorHost::Initialize is synchronous!"; |
317 } | 317 } |
318 | 318 |
319 void GpuVideoDecoder::ProvidePictureBuffers(uint32 count, | 319 void GpuVideoDecoder::ProvidePictureBuffers( |
320 const gfx::Size& size) { | 320 uint32 count, |
321 const gfx::Size& size, | |
322 media::VideoDecodeAccelerator::TextureTarget texture_target) { | |
321 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { | 323 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { |
322 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 324 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
323 &GpuVideoDecoder::ProvidePictureBuffers, this, count, size)); | 325 &GpuVideoDecoder::ProvidePictureBuffers, this, count, size, |
326 texture_target)); | |
324 return; | 327 return; |
325 } | 328 } |
326 | 329 |
330 // TODO(sail) : Add support for ARB texture targets. | |
Ami GONE FROM CHROMIUM
2012/05/23 23:42:33
I think it's important to do these TODOs before th
sail
2012/05/29 18:58:09
Done.
| |
331 CHECK_EQ(media::VideoDecodeAccelerator::TEXTURE_TARGET_2D, texture_target); | |
332 | |
327 std::vector<uint32> texture_ids; | 333 std::vector<uint32> texture_ids; |
328 if (!factories_->CreateTextures( | 334 if (!factories_->CreateTextures( |
329 count, size, &texture_ids, &decoder_texture_target_)) { | 335 count, size, &texture_ids, &decoder_texture_target_)) { |
Ami GONE FROM CHROMIUM
2012/05/23 23:42:33
Here CreateTextures() expects to be able to proscr
sail
2012/05/29 18:58:09
Done.
| |
330 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); | 336 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); |
331 return; | 337 return; |
332 } | 338 } |
333 | 339 |
334 if (!vda_) | 340 if (!vda_) |
335 return; | 341 return; |
336 | 342 |
337 std::vector<PictureBuffer> picture_buffers; | 343 std::vector<PictureBuffer> picture_buffers; |
338 for (size_t i = 0; i < texture_ids.size(); ++i) { | 344 for (size_t i = 0; i < texture_ids.size(); ++i) { |
339 picture_buffers.push_back(PictureBuffer( | 345 picture_buffers.push_back(PictureBuffer( |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 | 540 |
535 error_occured_ = true; | 541 error_occured_ = true; |
536 | 542 |
537 if (!pending_read_cb_.is_null()) { | 543 if (!pending_read_cb_.is_null()) { |
538 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); | 544 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); |
539 return; | 545 return; |
540 } | 546 } |
541 } | 547 } |
542 | 548 |
543 } // namespace media | 549 } // namespace media |
OLD | NEW |