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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // Some of the VDAs don't support and thus don't provide us with visible | 393 // Some of the VDAs don't support and thus don't provide us with visible |
394 // size in picture.size, passing coded size instead, so always drop it and | 394 // size in picture.size, passing coded size instead, so always drop it and |
395 // use config information instead. | 395 // use config information instead. |
396 gfx::Rect visible_rect; | 396 gfx::Rect visible_rect; |
397 gfx::Size natural_size; | 397 gfx::Size natural_size; |
398 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &visible_rect, | 398 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &visible_rect, |
399 &natural_size); | 399 &natural_size); |
400 DCHECK(decoder_texture_target_); | 400 DCHECK(decoder_texture_target_); |
401 | 401 |
402 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( | 402 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( |
403 make_scoped_ptr(new gpu::MailboxHolder( | 403 gpu::MailboxHolder(pb.texture_mailbox(), decoder_texture_target_, |
404 pb.texture_mailbox(), decoder_texture_target_, 0 /* sync_point */)), | 404 0 /* sync_point */), |
405 BindToCurrentLoop(base::Bind( | 405 BindToCurrentLoop(base::Bind( |
406 &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), | 406 &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), |
407 factories_, picture.picture_buffer_id(), pb.texture_id())), | 407 factories_, picture.picture_buffer_id(), pb.texture_id())), |
408 pb.size(), visible_rect, natural_size, timestamp, | 408 pb.size(), visible_rect, natural_size, timestamp, |
409 picture.allow_overlay())); | 409 picture.allow_overlay())); |
410 CHECK_GT(available_pictures_, 0); | 410 CHECK_GT(available_pictures_, 0); |
411 --available_pictures_; | 411 --available_pictures_; |
412 bool inserted = | 412 bool inserted = |
413 picture_buffers_at_display_.insert(std::make_pair( | 413 picture_buffers_at_display_.insert(std::make_pair( |
414 picture.picture_buffer_id(), | 414 picture.picture_buffer_id(), |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 584 } |
585 return false; | 585 return false; |
586 } | 586 } |
587 | 587 |
588 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 588 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
589 const { | 589 const { |
590 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 590 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
591 } | 591 } |
592 | 592 |
593 } // namespace media | 593 } // namespace media |
OLD | NEW |