OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/video/mft_h264_decode_engine.h" | 5 #include "media/video/mft_h264_decode_engine.h" |
6 | 6 |
7 #include <d3d9.h> | 7 #include <d3d9.h> |
8 #include <dxva2api.h> | 8 #include <dxva2api.h> |
9 #include <initguid.h> | 9 #include <initguid.h> |
10 #include <mfapi.h> | 10 #include <mfapi.h> |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 hr = MFGetService(output_buffer, MR_BUFFER_SERVICE, | 643 hr = MFGetService(output_buffer, MR_BUFFER_SERVICE, |
644 IID_PPV_ARGS(surface.Receive())); | 644 IID_PPV_ARGS(surface.Receive())); |
645 if (FAILED(hr)) { | 645 if (FAILED(hr)) { |
646 LOG(ERROR) << "Failed to get surface from buffer"; | 646 LOG(ERROR) << "Failed to get surface from buffer"; |
647 return true; | 647 return true; |
648 } | 648 } |
649 // Since we only allocated 1 frame from context. | 649 // Since we only allocated 1 frame from context. |
650 // TODO(imcheng): Detect error. | 650 // TODO(imcheng): Detect error. |
651 output_frames_[0]->SetTimestamp(TimeDelta::FromMicroseconds(timestamp)); | 651 output_frames_[0]->SetTimestamp(TimeDelta::FromMicroseconds(timestamp)); |
652 output_frames_[0]->SetDuration(TimeDelta::FromMicroseconds(duration)); | 652 output_frames_[0]->SetDuration(TimeDelta::FromMicroseconds(duration)); |
653 context_->UploadToVideoFrame( | 653 context_->ConvertToVideoFrame( |
654 surface.get(), output_frames_[0], | 654 surface.get(), output_frames_[0], |
655 NewRunnableMethod(this, &MftH264DecodeEngine::OnUploadVideoFrameDone, | 655 NewRunnableMethod(this, &MftH264DecodeEngine::OnUploadVideoFrameDone, |
656 surface, output_frames_[0])); | 656 surface, output_frames_[0])); |
657 return true; | 657 return true; |
658 } | 658 } |
659 // TODO(hclam): Remove this branch. | 659 // TODO(hclam): Remove this branch. |
660 // Not DXVA. | 660 // Not DXVA. |
661 VideoFrame::CreateFrame(info_.stream_info.surface_format, | 661 VideoFrame::CreateFrame(info_.stream_info.surface_format, |
662 info_.stream_info.surface_width, | 662 info_.stream_info.surface_width, |
663 info_.stream_info.surface_height, | 663 info_.stream_info.surface_height, |
(...skipping 21 matching lines...) Expand all Loading... |
685 void MftH264DecodeEngine::OnUploadVideoFrameDone( | 685 void MftH264DecodeEngine::OnUploadVideoFrameDone( |
686 ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface, | 686 ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface, |
687 scoped_refptr<media::VideoFrame> frame) { | 687 scoped_refptr<media::VideoFrame> frame) { |
688 // After this method is exited the reference to surface is released. | 688 // After this method is exited the reference to surface is released. |
689 event_handler_->ConsumeVideoFrame(frame); | 689 event_handler_->ConsumeVideoFrame(frame); |
690 } | 690 } |
691 | 691 |
692 } // namespace media | 692 } // namespace media |
693 | 693 |
694 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::MftH264DecodeEngine); | 694 DISABLE_RUNNABLE_METHOD_REFCOUNT(media::MftH264DecodeEngine); |
OLD | NEW |