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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 const PictureBuffer& pb = it->second; | 411 const PictureBuffer& pb = it->second; |
412 | 412 |
413 // Update frame's timestamp. | 413 // Update frame's timestamp. |
414 base::TimeDelta timestamp; | 414 base::TimeDelta timestamp; |
415 gfx::Size natural_size; | 415 gfx::Size natural_size; |
416 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &natural_size); | 416 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &natural_size); |
417 DCHECK(decoder_texture_target_); | 417 DCHECK(decoder_texture_target_); |
418 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( | 418 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( |
419 pb.texture_id(), decoder_texture_target_, pb.size(), natural_size, | 419 pb.texture_id(), decoder_texture_target_, pb.size(), natural_size, |
420 timestamp, | 420 timestamp, |
| 421 base::Bind(&Factories::ReadPixels, factories_, pb.texture_id(), |
| 422 decoder_texture_target_, pb.size()), |
421 base::Bind(&GpuVideoDecoder::ReusePictureBuffer, this, | 423 base::Bind(&GpuVideoDecoder::ReusePictureBuffer, this, |
422 picture.picture_buffer_id()))); | 424 picture.picture_buffer_id()))); |
423 | 425 |
424 EnqueueFrameAndTriggerFrameDelivery(frame); | 426 EnqueueFrameAndTriggerFrameDelivery(frame); |
425 } | 427 } |
426 | 428 |
427 void GpuVideoDecoder::EnqueueFrameAndTriggerFrameDelivery( | 429 void GpuVideoDecoder::EnqueueFrameAndTriggerFrameDelivery( |
428 const scoped_refptr<VideoFrame>& frame) { | 430 const scoped_refptr<VideoFrame>& frame) { |
429 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); | 431 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); |
430 | 432 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 585 |
584 error_occured_ = true; | 586 error_occured_ = true; |
585 | 587 |
586 if (!pending_read_cb_.is_null()) { | 588 if (!pending_read_cb_.is_null()) { |
587 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); | 589 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); |
588 return; | 590 return; |
589 } | 591 } |
590 } | 592 } |
591 | 593 |
592 } // namespace media | 594 } // namespace media |
OLD | NEW |