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

Unified Diff: content/common/gpu/media/vaapi_video_encode_accelerator.cc

Issue 817023005: Reland: Refactor Vaapi video decoder/encoder in preparation of Freon support (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Remove refcounting on VaapiWrapper Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/vaapi_video_encode_accelerator.h ('k') | content/common/gpu/media/vaapi_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/vaapi_video_encode_accelerator.cc
diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.cc b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
index 19e1c0820dd1b4d7c741e30935cee9de30f7de28..fa3a60070629f3a0d630141133440fed1f5b61ce 100644
--- a/content/common/gpu/media/vaapi_video_encode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
@@ -113,8 +113,7 @@ VaapiVideoEncodeAccelerator::GetSupportedProfiles() {
return profiles;
std::vector<media::VideoCodecProfile> hw_profiles =
- VaapiWrapper::GetSupportedEncodeProfiles(
- x_display_, base::Bind(&base::DoNothing));
+ VaapiWrapper::GetSupportedEncodeProfiles(base::Bind(&base::DoNothing));
media::VideoEncodeAccelerator::SupportedProfile profile;
profile.max_resolution.SetSize(1920, 1088);
@@ -139,12 +138,11 @@ static unsigned int Log2OfPowerOf2(unsigned int x) {
return log;
}
-VaapiVideoEncodeAccelerator::VaapiVideoEncodeAccelerator(Display* x_display)
+VaapiVideoEncodeAccelerator::VaapiVideoEncodeAccelerator()
: profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN),
mb_width_(0),
mb_height_(0),
output_buffer_byte_size_(0),
- x_display_(x_display),
state_(kUninitialized),
frame_num_(0),
last_idr_frame_num_(0),
@@ -217,9 +215,8 @@ bool VaapiVideoEncodeAccelerator::Initialize(
vaapi_wrapper_ = VaapiWrapper::Create(VaapiWrapper::kEncode,
output_profile,
- x_display_,
base::Bind(&ReportToUMA, VAAPI_ERROR));
- if (!vaapi_wrapper_) {
+ if (!vaapi_wrapper_.get()) {
LOG(ERROR) << "Failed initializing VAAPI";
return false;
}
@@ -604,12 +601,12 @@ bool VaapiVideoEncodeAccelerator::PrepareNextJob() {
return false;
}
- current_encode_job_->input_surface =
- new VASurface(available_va_surface_ids_.back(), va_surface_release_cb_);
+ current_encode_job_->input_surface = new VASurface(
+ available_va_surface_ids_.back(), coded_size_, va_surface_release_cb_);
available_va_surface_ids_.pop_back();
- current_encode_job_->recon_surface =
- new VASurface(available_va_surface_ids_.back(), va_surface_release_cb_);
+ current_encode_job_->recon_surface = new VASurface(
+ available_va_surface_ids_.back(), coded_size_, va_surface_release_cb_);
available_va_surface_ids_.pop_back();
// Reference surfaces are needed until the job is done, but they get
« no previous file with comments | « content/common/gpu/media/vaapi_video_encode_accelerator.h ('k') | content/common/gpu/media/vaapi_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698