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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 gpu::MailboxHolder(pb.texture_mailbox(), decoder_texture_target_, | 403 gpu::MailboxHolder(pb.texture_mailbox(), decoder_texture_target_, |
404 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, picture.allow_overlay(), |
409 picture.allow_overlay())); | 409 true /* has_alpha */)); |
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(), |
415 pb.texture_id())).second; | 415 pb.texture_id())).second; |
416 DCHECK(inserted); | 416 DCHECK(inserted); |
417 | 417 |
418 DeliverFrame(frame); | 418 DeliverFrame(frame); |
419 } | 419 } |
(...skipping 164 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 |