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

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

Issue 2061823003: media: Drop "media::" in media/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: work around clang format by adding an empty line Created 4 years, 6 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/vaapi_video_encode_accelerator.cc ('k') | media/gpu/vaapi_wrapper.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 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 MEDIA_GPU_VAAPI_WRAPPER_H_ 10 #ifndef MEDIA_GPU_VAAPI_WRAPPER_H_
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 CodecMode mode, 70 CodecMode mode,
71 VAProfile va_profile, 71 VAProfile va_profile,
72 const base::Closure& report_error_to_uma_cb); 72 const base::Closure& report_error_to_uma_cb);
73 73
74 // Create VaapiWrapper for VideoCodecProfile. It maps VideoCodecProfile 74 // Create VaapiWrapper for VideoCodecProfile. It maps VideoCodecProfile
75 // |profile| to VAProfile. 75 // |profile| to VAProfile.
76 // |report_error_to_uma_cb| will be called independently from reporting 76 // |report_error_to_uma_cb| will be called independently from reporting
77 // errors to clients via method return values. 77 // errors to clients via method return values.
78 static scoped_refptr<VaapiWrapper> CreateForVideoCodec( 78 static scoped_refptr<VaapiWrapper> CreateForVideoCodec(
79 CodecMode mode, 79 CodecMode mode,
80 media::VideoCodecProfile profile, 80 VideoCodecProfile profile,
81 const base::Closure& report_error_to_uma_cb); 81 const base::Closure& report_error_to_uma_cb);
82 82
83 // Return the supported video encode profiles. 83 // Return the supported video encode profiles.
84 static media::VideoEncodeAccelerator::SupportedProfiles 84 static VideoEncodeAccelerator::SupportedProfiles GetSupportedEncodeProfiles();
85 GetSupportedEncodeProfiles();
86 85
87 // Return the supported video decode profiles. 86 // Return the supported video decode profiles.
88 static media::VideoDecodeAccelerator::SupportedProfiles 87 static VideoDecodeAccelerator::SupportedProfiles GetSupportedDecodeProfiles();
89 GetSupportedDecodeProfiles();
90 88
91 // Return true when JPEG decode is supported. 89 // Return true when JPEG decode is supported.
92 static bool IsJpegDecodeSupported(); 90 static bool IsJpegDecodeSupported();
93 91
94 // Create |num_surfaces| backing surfaces in driver for VASurfaces of 92 // Create |num_surfaces| backing surfaces in driver for VASurfaces of
95 // |va_format|, each of size |size|. Returns true when successful, with the 93 // |va_format|, each of size |size|. Returns true when successful, with the
96 // created IDs in |va_surfaces| to be managed and later wrapped in 94 // created IDs in |va_surfaces| to be managed and later wrapped in
97 // VASurfaces. 95 // VASurfaces.
98 // The client must DestroySurfaces() each time before calling this method 96 // The client must DestroySurfaces() each time before calling this method
99 // again to free the allocated surfaces first, but is not required to do so 97 // again to free the allocated surfaces first, but is not required to do so
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 VAImageFormat* format, 180 VAImageFormat* format,
183 const gfx::Size& size, 181 const gfx::Size& size,
184 VAImage* image, 182 VAImage* image,
185 void** mem); 183 void** mem);
186 184
187 // Release the VAImage (and the associated memory mapping) obtained from 185 // Release the VAImage (and the associated memory mapping) obtained from
188 // GetVaImage() or GetDerivedVaImage(). 186 // GetVaImage() or GetDerivedVaImage().
189 void ReturnVaImage(VAImage* image); 187 void ReturnVaImage(VAImage* image);
190 188
191 // Upload contents of |frame| into |va_surface_id| for encode. 189 // Upload contents of |frame| into |va_surface_id| for encode.
192 bool UploadVideoFrameToSurface(const scoped_refptr<media::VideoFrame>& frame, 190 bool UploadVideoFrameToSurface(const scoped_refptr<VideoFrame>& frame,
193 VASurfaceID va_surface_id); 191 VASurfaceID va_surface_id);
194 192
195 // Create a buffer of |size| bytes to be used as encode output. 193 // Create a buffer of |size| bytes to be used as encode output.
196 bool CreateCodedBuffer(size_t size, VABufferID* buffer_id); 194 bool CreateCodedBuffer(size_t size, VABufferID* buffer_id);
197 195
198 // Download the contents of the buffer with given |buffer_id| into a buffer of 196 // Download the contents of the buffer with given |buffer_id| into a buffer of
199 // size |target_size|, pointed to by |target_ptr|. The number of bytes 197 // size |target_size|, pointed to by |target_ptr|. The number of bytes
200 // downloaded will be returned in |coded_data_size|. |sync_surface_id| will 198 // downloaded will be returned in |coded_data_size|. |sync_surface_id| will
201 // be used as a sync point, i.e. it will have to become idle before starting 199 // be used as a sync point, i.e. it will have to become idle before starting
202 // the download. |sync_surface_id| should be the source surface passed 200 // the download. |sync_surface_id| should be the source surface passed
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 std::vector<ProfileInfo> GetSupportedProfileInfosForCodecModeInternal( 335 std::vector<ProfileInfo> GetSupportedProfileInfosForCodecModeInternal(
338 CodecMode mode); 336 CodecMode mode);
339 337
340 // Lazily initialize static data after sandbox is enabled. Return false on 338 // Lazily initialize static data after sandbox is enabled. Return false on
341 // init failure. 339 // init failure.
342 static bool PostSandboxInitialization(); 340 static bool PostSandboxInitialization();
343 341
344 // Map VideoCodecProfile enum values to VaProfile values. This function 342 // Map VideoCodecProfile enum values to VaProfile values. This function
345 // includes a workaround for crbug.com/345569. If va_profile is h264 baseline 343 // includes a workaround for crbug.com/345569. If va_profile is h264 baseline
346 // and it is not supported, we try constrained baseline. 344 // and it is not supported, we try constrained baseline.
347 static VAProfile ProfileToVAProfile(media::VideoCodecProfile profile, 345 static VAProfile ProfileToVAProfile(VideoCodecProfile profile,
348 CodecMode mode); 346 CodecMode mode);
349 347
350 // Pointer to VADisplayState's member |va_lock_|. Guaranteed to be valid for 348 // Pointer to VADisplayState's member |va_lock_|. Guaranteed to be valid for
351 // the lifetime of VaapiWrapper. 349 // the lifetime of VaapiWrapper.
352 base::Lock* va_lock_; 350 base::Lock* va_lock_;
353 351
354 // Allocated ids for VASurfaces. 352 // Allocated ids for VASurfaces.
355 std::vector<VASurfaceID> va_surface_ids_; 353 std::vector<VASurfaceID> va_surface_ids_;
356 354
357 // VA format of surfaces with va_surface_ids_. 355 // VA format of surfaces with va_surface_ids_.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // Singleton variable to store supported profile information for encode and 387 // Singleton variable to store supported profile information for encode and
390 // decode. 388 // decode.
391 static base::LazyInstance<LazyProfileInfos> profile_infos_; 389 static base::LazyInstance<LazyProfileInfos> profile_infos_;
392 390
393 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper); 391 DISALLOW_COPY_AND_ASSIGN(VaapiWrapper);
394 }; 392 };
395 393
396 } // namespace media 394 } // namespace media
397 395
398 #endif // MEDIA_GPU_VAAPI_WRAPPER_H_ 396 #endif // MEDIA_GPU_VAAPI_WRAPPER_H_
OLDNEW
« no previous file with comments | « media/gpu/vaapi_video_encode_accelerator.cc ('k') | media/gpu/vaapi_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698