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

Side by Side Diff: media/gpu/media_foundation_video_encode_accelerator_win.cc

Issue 2864523002: Rename ScopedComPtr::QueryInterface to ScopedComPtr::CopyTo (Closed)
Patch Set: Created 3 years, 7 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 | « media/gpu/dxva_video_decode_accelerator_win.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/gpu/media_foundation_video_encode_accelerator_win.h" 5 #include "media/gpu/media_foundation_video_encode_accelerator_win.h"
6 6
7 #pragma warning(push) 7 #pragma warning(push)
8 #pragma warning(disable : 4800) // Disable warning for added padding. 8 #pragma warning(disable : 4800) // Disable warning for added padding.
9 9
10 #include <codecapi.h> 10 #include <codecapi.h>
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 RETURN_ON_HR_FAILURE(hr, "Couldn't set input media type", false); 437 RETURN_ON_HR_FAILURE(hr, "Couldn't set input media type", false);
438 438
439 return SUCCEEDED(hr); 439 return SUCCEEDED(hr);
440 } 440 }
441 441
442 bool MediaFoundationVideoEncodeAccelerator::SetEncoderModes() { 442 bool MediaFoundationVideoEncodeAccelerator::SetEncoderModes() {
443 DCHECK(main_client_task_runner_->BelongsToCurrentThread()); 443 DCHECK(main_client_task_runner_->BelongsToCurrentThread());
444 RETURN_ON_FAILURE((encoder_.Get() != nullptr), 444 RETURN_ON_FAILURE((encoder_.Get() != nullptr),
445 "No HW encoder instance created", false); 445 "No HW encoder instance created", false);
446 446
447 HRESULT hr = encoder_.QueryInterface(codec_api_.Receive()); 447 HRESULT hr = encoder_.CopyTo(codec_api_.Receive());
448 RETURN_ON_HR_FAILURE(hr, "Couldn't get ICodecAPI", false); 448 RETURN_ON_HR_FAILURE(hr, "Couldn't get ICodecAPI", false);
449 VARIANT var; 449 VARIANT var;
450 var.vt = VT_UI4; 450 var.vt = VT_UI4;
451 var.ulVal = eAVEncCommonRateControlMode_CBR; 451 var.ulVal = eAVEncCommonRateControlMode_CBR;
452 hr = codec_api_->SetValue(&CODECAPI_AVEncCommonRateControlMode, &var); 452 hr = codec_api_->SetValue(&CODECAPI_AVEncCommonRateControlMode, &var);
453 RETURN_ON_HR_FAILURE(hr, "Couldn't set CommonRateControlMode", false); 453 RETURN_ON_HR_FAILURE(hr, "Couldn't set CommonRateControlMode", false);
454 var.ulVal = target_bitrate_; 454 var.ulVal = target_bitrate_;
455 hr = codec_api_->SetValue(&CODECAPI_AVEncCommonMeanBitRate, &var); 455 hr = codec_api_->SetValue(&CODECAPI_AVEncCommonMeanBitRate, &var);
456 RETURN_ON_HR_FAILURE(hr, "Couldn't set bitrate", false); 456 RETURN_ON_HR_FAILURE(hr, "Couldn't set bitrate", false);
457 var.ulVal = eAVEncAdaptiveMode_Resolution; 457 var.ulVal = eAVEncAdaptiveMode_Resolution;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 void MediaFoundationVideoEncodeAccelerator::ReleaseEncoderResources() { 696 void MediaFoundationVideoEncodeAccelerator::ReleaseEncoderResources() {
697 encoder_.Reset(); 697 encoder_.Reset();
698 codec_api_.Reset(); 698 codec_api_.Reset();
699 imf_input_media_type_.Reset(); 699 imf_input_media_type_.Reset();
700 imf_output_media_type_.Reset(); 700 imf_output_media_type_.Reset();
701 input_sample_.Reset(); 701 input_sample_.Reset();
702 output_sample_.Reset(); 702 output_sample_.Reset();
703 } 703 }
704 704
705 } // namespace content 705 } // namespace content
OLDNEW
« no previous file with comments | « media/gpu/dxva_video_decode_accelerator_win.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698