Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1744)

Side by Side Diff: content/common/gpu/media/dxva_video_decode_accelerator.cc

Issue 890603004: Support low latency mode decoding in the H/W video decoder on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/common/gpu/media/dxva_video_decode_accelerator.h" 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
6 6
7 #if !defined(OS_WIN) 7 #if !defined(OS_WIN)
8 #error This file should only be built on Windows. 8 #error This file should only be built on Windows.
9 #endif // !defined(OS_WIN) 9 #endif // !defined(OS_WIN)
10 10
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 877
878 UINT32 dxva = 0; 878 UINT32 dxva = 0;
879 hr = attributes->GetUINT32(MF_SA_D3D_AWARE, &dxva); 879 hr = attributes->GetUINT32(MF_SA_D3D_AWARE, &dxva);
880 RETURN_ON_HR_FAILURE(hr, "Failed to check if decoder supports DXVA", false); 880 RETURN_ON_HR_FAILURE(hr, "Failed to check if decoder supports DXVA", false);
881 881
882 if (codec_ == media::kCodecH264) { 882 if (codec_ == media::kCodecH264) {
883 hr = attributes->SetUINT32(CODECAPI_AVDecVideoAcceleration_H264, TRUE); 883 hr = attributes->SetUINT32(CODECAPI_AVDecVideoAcceleration_H264, TRUE);
884 RETURN_ON_HR_FAILURE(hr, "Failed to enable DXVA H/W decoding", false); 884 RETURN_ON_HR_FAILURE(hr, "Failed to enable DXVA H/W decoding", false);
885 } 885 }
886 886
887 hr = attributes->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
888 if (SUCCEEDED(hr)) {
889 DVLOG(1) << "Successfully set Low latency mode on decoder.";
890 } else {
891 DVLOG(1) << "Failed to set Low latency mode on decoder. Error: " << hr;
892 }
887 return true; 893 return true;
888 } 894 }
889 895
890 bool DXVAVideoDecodeAccelerator::SetDecoderMediaTypes() { 896 bool DXVAVideoDecodeAccelerator::SetDecoderMediaTypes() {
891 RETURN_ON_FAILURE(SetDecoderInputMediaType(), 897 RETURN_ON_FAILURE(SetDecoderInputMediaType(),
892 "Failed to set decoder input media type", false); 898 "Failed to set decoder input media type", false);
893 return SetDecoderOutputMediaType(MFVideoFormat_NV12); 899 return SetDecoderOutputMediaType(MFVideoFormat_NV12);
894 } 900 }
895 901
896 bool DXVAVideoDecodeAccelerator::SetDecoderInputMediaType() { 902 bool DXVAVideoDecodeAccelerator::SetDecoderInputMediaType() {
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 FROM_HERE, 1625 FROM_HERE,
1620 base::Bind(&DXVAVideoDecodeAccelerator::CopySurfaceComplete, 1626 base::Bind(&DXVAVideoDecodeAccelerator::CopySurfaceComplete,
1621 weak_this_factory_.GetWeakPtr(), 1627 weak_this_factory_.GetWeakPtr(),
1622 src_surface, 1628 src_surface,
1623 dest_surface, 1629 dest_surface,
1624 picture_buffer_id, 1630 picture_buffer_id,
1625 input_buffer_id)); 1631 input_buffer_id));
1626 } 1632 }
1627 1633
1628 } // namespace content 1634 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698