| 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 fa3a60070629f3a0d630141133440fed1f5b61ce..19e1c0820dd1b4d7c741e30935cee9de30f7de28 100644
|
| --- a/content/common/gpu/media/vaapi_video_encode_accelerator.cc
|
| +++ b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
|
| @@ -113,7 +113,8 @@
|
| return profiles;
|
|
|
| std::vector<media::VideoCodecProfile> hw_profiles =
|
| - VaapiWrapper::GetSupportedEncodeProfiles(base::Bind(&base::DoNothing));
|
| + VaapiWrapper::GetSupportedEncodeProfiles(
|
| + x_display_, base::Bind(&base::DoNothing));
|
|
|
| media::VideoEncodeAccelerator::SupportedProfile profile;
|
| profile.max_resolution.SetSize(1920, 1088);
|
| @@ -138,11 +139,12 @@
|
| return log;
|
| }
|
|
|
| -VaapiVideoEncodeAccelerator::VaapiVideoEncodeAccelerator()
|
| +VaapiVideoEncodeAccelerator::VaapiVideoEncodeAccelerator(Display* x_display)
|
| : 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),
|
| @@ -215,8 +217,9 @@
|
|
|
| vaapi_wrapper_ = VaapiWrapper::Create(VaapiWrapper::kEncode,
|
| output_profile,
|
| + x_display_,
|
| base::Bind(&ReportToUMA, VAAPI_ERROR));
|
| - if (!vaapi_wrapper_.get()) {
|
| + if (!vaapi_wrapper_) {
|
| LOG(ERROR) << "Failed initializing VAAPI";
|
| return false;
|
| }
|
| @@ -601,12 +604,12 @@
|
| return false;
|
| }
|
|
|
| - current_encode_job_->input_surface = new VASurface(
|
| - available_va_surface_ids_.back(), coded_size_, va_surface_release_cb_);
|
| + current_encode_job_->input_surface =
|
| + new VASurface(available_va_surface_ids_.back(), va_surface_release_cb_);
|
| available_va_surface_ids_.pop_back();
|
|
|
| - current_encode_job_->recon_surface = new VASurface(
|
| - available_va_surface_ids_.back(), coded_size_, va_surface_release_cb_);
|
| + current_encode_job_->recon_surface =
|
| + new VASurface(available_va_surface_ids_.back(), va_surface_release_cb_);
|
| available_va_surface_ids_.pop_back();
|
|
|
| // Reference surfaces are needed until the job is done, but they get
|
|
|