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

Side by Side Diff: content/common/gpu/media/vaapi_wrapper.h

Issue 1137483002: VAAPI Wrapper: refactor management of drm file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // This file contains an implementation of VaapiWrapper, used by 5 // This file contains an implementation of VaapiWrapper, used by
6 // VaapiVideoDecodeAccelerator and VaapiH264Decoder for decode, 6 // VaapiVideoDecodeAccelerator and VaapiH264Decoder for decode,
7 // and VaapiVideoEncodeAccelerator for encode, to interface 7 // and VaapiVideoEncodeAccelerator for encode, to interface
8 // with libva (VA-API library for hardware video codec). 8 // with libva (VA-API library for hardware video codec).
9 9
10 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ 10 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 void DestroyCodedBuffers(); 184 void DestroyCodedBuffers();
185 185
186 // Blits a VASurface |va_surface_id_src| into another VASurface 186 // Blits a VASurface |va_surface_id_src| into another VASurface
187 // |va_surface_id_dest| applying pixel format conversion and scaling 187 // |va_surface_id_dest| applying pixel format conversion and scaling
188 // if needed. 188 // if needed.
189 bool BlitSurface(VASurfaceID va_surface_id_src, 189 bool BlitSurface(VASurfaceID va_surface_id_src,
190 const gfx::Size& src_size, 190 const gfx::Size& src_size,
191 VASurfaceID va_surface_id_dest, 191 VASurfaceID va_surface_id_dest,
192 const gfx::Size& dest_size); 192 const gfx::Size& dest_size);
193 193
194 // Initialize static data before sandbox is enabled.
195 static void PreSandboxInitialization();
196
194 private: 197 private:
195 struct ProfileInfo { 198 struct ProfileInfo {
196 VAProfile va_profile; 199 VAProfile va_profile;
197 gfx::Size max_resolution; 200 gfx::Size max_resolution;
198 }; 201 };
199 202
200 class LazyProfileInfos { 203 class LazyProfileInfos {
201 public: 204 public:
202 LazyProfileInfos(); 205 LazyProfileInfos();
203 ~LazyProfileInfos(); 206 ~LazyProfileInfos();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 base::Closure report_error_to_uma_cb_; 305 base::Closure report_error_to_uma_cb_;
303 306
304 // VPP (Video Post Processing) context, this is used to convert 307 // VPP (Video Post Processing) context, this is used to convert
305 // pictures used by the decoder to RGBA pictures usable by GL or the 308 // pictures used by the decoder to RGBA pictures usable by GL or the
306 // display hardware. 309 // display hardware.
307 VAConfigID va_vpp_config_id_; 310 VAConfigID va_vpp_config_id_;
308 VAContextID va_vpp_context_id_; 311 VAContextID va_vpp_context_id_;
309 VABufferID va_vpp_buffer_id_; 312 VABufferID va_vpp_buffer_id_;
310 313
311 #if defined(USE_OZONE) 314 #if defined(USE_OZONE)
312 // Drm file used to obtain access to the driver interface by VA. 315 // Singleton variable to store drm file used to obtain access to the driver
313 base::File drm_file_; 316 // interface by VA.
317 static base::LazyInstance<base::File> drm_file_;
dnicoara 2015/05/07 21:17:10 You use base::ScopedFD rather than base::File for
hshi1 2015/05/07 21:50:17 Done.
314 #endif // USE_OZONE 318 #endif // USE_OZONE
315 319
316 // Singleton variable to store supported profile information for encode and 320 // Singleton variable to store supported profile information for encode and
317 // decode. 321 // decode.
318 static base::LazyInstance<LazyProfileInfos> profile_infos_; 322 static base::LazyInstance<LazyProfileInfos> profile_infos_;
319 323
320 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); 324 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper);
321 }; 325 };
322 326
323 } // namespace content 327 } // namespace content
324 328
325 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_ 329 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/vaapi_wrapper.cc » ('j') | content/common/gpu/media/vaapi_wrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698