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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 base::WaitableEvent* event) { | 392 base::WaitableEvent* event) { |
393 factories->ReadPixels(texture_id, visible_rect, pixels); | 393 factories->ReadPixels(texture_id, visible_rect, pixels); |
394 event->Signal(); | 394 event->Signal(); |
395 } | 395 } |
396 | 396 |
397 static void ReadPixelsSync( | 397 static void ReadPixelsSync( |
398 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 398 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
399 uint32 texture_id, | 399 uint32 texture_id, |
400 const gfx::Rect& visible_rect, | 400 const gfx::Rect& visible_rect, |
401 const SkBitmap& pixels) { | 401 const SkBitmap& pixels) { |
| 402 #if defined(OS_MACOSX) |
| 403 // For Mac OS X, just return black. http://crbug.com/425708. |
| 404 pixels.eraseARGB(255, 0, 255, 0); |
| 405 return; |
| 406 #endif |
| 407 |
402 base::WaitableEvent event(true, false); | 408 base::WaitableEvent event(true, false); |
403 if (!factories->GetTaskRunner()->PostTask(FROM_HERE, | 409 if (!factories->GetTaskRunner()->PostTask(FROM_HERE, |
404 base::Bind(&ReadPixelsSyncInner, | 410 base::Bind(&ReadPixelsSyncInner, |
405 factories, | 411 factories, |
406 texture_id, | 412 texture_id, |
407 visible_rect, | 413 visible_rect, |
408 pixels, | 414 pixels, |
409 &event))) | 415 &event))) |
410 return; | 416 return; |
411 event.Wait(); | 417 event.Wait(); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 DLOG(ERROR) << "VDA Error: " << error; | 626 DLOG(ERROR) << "VDA Error: " << error; |
621 DestroyVDA(); | 627 DestroyVDA(); |
622 } | 628 } |
623 | 629 |
624 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 630 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
625 const { | 631 const { |
626 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 632 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
627 } | 633 } |
628 | 634 |
629 } // namespace media | 635 } // namespace media |
OLD | NEW |