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