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

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

Issue 1485043002: Passed is_encrypted parameter to the VDA initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted erroneously added files Created 5 years 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
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 weak_this_factory_(this) { 625 weak_this_factory_(this) {
626 weak_ptr_ = weak_this_factory_.GetWeakPtr(); 626 weak_ptr_ = weak_this_factory_.GetWeakPtr();
627 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); 627 memset(&input_stream_info_, 0, sizeof(input_stream_info_));
628 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); 628 memset(&output_stream_info_, 0, sizeof(output_stream_info_));
629 } 629 }
630 630
631 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { 631 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() {
632 client_ = NULL; 632 client_ = NULL;
633 } 633 }
634 634
635 bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, 635 bool DXVAVideoDecodeAccelerator::Initialize(
636 Client* client) { 636 const media::VideoDecodeAccelerator::InitParams& params,
637 Client* client) {
637 client_ = client; 638 client_ = client;
638 639
639 main_thread_task_runner_ = base::MessageLoop::current()->task_runner(); 640 main_thread_task_runner_ = base::MessageLoop::current()->task_runner();
640 641
641 bool profile_supported = false; 642 bool profile_supported = false;
642 for (const auto& supported_profile : kSupportedProfiles) { 643 for (const auto& supported_profile : kSupportedProfiles) {
643 if (profile == supported_profile) { 644 if (params.profile == supported_profile) {
644 profile_supported = true; 645 profile_supported = true;
645 break; 646 break;
646 } 647 }
647 } 648 }
648 if (!profile_supported) { 649 if (!profile_supported) {
649 RETURN_AND_NOTIFY_ON_FAILURE(false, 650 RETURN_AND_NOTIFY_ON_FAILURE(false,
650 "Unsupported h.264, vp8, or vp9 profile", PLATFORM_FAILURE, false); 651 "Unsupported h.264, vp8, or vp9 profile", PLATFORM_FAILURE, false);
651 } 652 }
652 653
653 // Not all versions of Windows 7 and later include Media Foundation DLLs. 654 // Not all versions of Windows 7 and later include Media Foundation DLLs.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 "EGL_ANGLE_surface_d3d_texture_2d_share_handle unavailable", 686 "EGL_ANGLE_surface_d3d_texture_2d_share_handle unavailable",
686 PLATFORM_FAILURE, 687 PLATFORM_FAILURE,
687 false); 688 false);
688 689
689 State state = GetState(); 690 State state = GetState();
690 RETURN_AND_NOTIFY_ON_FAILURE((state == kUninitialized), 691 RETURN_AND_NOTIFY_ON_FAILURE((state == kUninitialized),
691 "Initialize: invalid state: " << state, ILLEGAL_STATE, false); 692 "Initialize: invalid state: " << state, ILLEGAL_STATE, false);
692 693
693 media::InitializeMediaFoundation(); 694 media::InitializeMediaFoundation();
694 695
695 RETURN_AND_NOTIFY_ON_FAILURE(InitDecoder(profile), 696 RETURN_AND_NOTIFY_ON_FAILURE(InitDecoder(params.profile),
696 "Failed to initialize decoder", PLATFORM_FAILURE, false); 697 "Failed to initialize decoder", PLATFORM_FAILURE, false);
697 698
698 RETURN_AND_NOTIFY_ON_FAILURE(GetStreamsInfoAndBufferReqs(), 699 RETURN_AND_NOTIFY_ON_FAILURE(GetStreamsInfoAndBufferReqs(),
699 "Failed to get input/output stream info.", PLATFORM_FAILURE, false); 700 "Failed to get input/output stream info.", PLATFORM_FAILURE, false);
700 701
701 RETURN_AND_NOTIFY_ON_FAILURE( 702 RETURN_AND_NOTIFY_ON_FAILURE(
702 SendMFTMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, 0), 703 SendMFTMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, 0),
703 "Send MFT_MESSAGE_NOTIFY_BEGIN_STREAMING notification failed", 704 "Send MFT_MESSAGE_NOTIFY_BEGIN_STREAMING notification failed",
704 PLATFORM_FAILURE, false); 705 PLATFORM_FAILURE, false);
705 706
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 D3DSURFACE_DESC surface_desc; 2285 D3DSURFACE_DESC surface_desc;
2285 hr = surface->GetDesc(&surface_desc); 2286 hr = surface->GetDesc(&surface_desc);
2286 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); 2287 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false);
2287 *width = surface_desc.Width; 2288 *width = surface_desc.Width;
2288 *height = surface_desc.Height; 2289 *height = surface_desc.Height;
2289 } 2290 }
2290 return true; 2291 return true;
2291 } 2292 }
2292 2293
2293 } // namespace content 2294 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698