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