Commit 2f3934ac authored by Jeffrey Kardatzke's avatar Jeffrey Kardatzke Committed by Chromium LUCI CQ

vaapi: Fix DCHECK for protected buffer type

Oversight, forgot to change this in the utils as well.

BUG=b:153111783
TEST=DCHECK passes w/ protected content

Change-Id: Id84b31888833ef9d8eff4d6e599cb651767c2dfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575517
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Auto-Submit: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833963}
parent 5e542c8e
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "media/gpu/vaapi/vaapi_wrapper.h" #include "media/gpu/vaapi/vaapi_wrapper.h"
#include "media/gpu/vp8_picture.h" #include "media/gpu/vp8_picture.h"
#include "media/gpu/vp8_reference_frame_vector.h" #include "media/gpu/vp8_reference_frame_vector.h"
#include "third_party/libva_protected_content/va_protected_content.h"
namespace media { namespace media {
...@@ -79,7 +80,7 @@ std::unique_ptr<ScopedVABuffer> ScopedVABuffer::Create( ...@@ -79,7 +80,7 @@ std::unique_ptr<ScopedVABuffer> ScopedVABuffer::Create(
DCHECK(lock); DCHECK(lock);
DCHECK(va_display); DCHECK(va_display);
DCHECK_NE(va_context_id, VA_INVALID_ID); DCHECK_NE(va_context_id, VA_INVALID_ID);
DCHECK_LT(va_buffer_type, VABufferTypeMax); DCHECK(IsValidVABufferType(va_buffer_type));
DCHECK_NE(size, 0u); DCHECK_NE(size, 0u);
lock->AssertAcquired(); lock->AssertAcquired();
unsigned int va_buffer_size; unsigned int va_buffer_size;
...@@ -347,4 +348,10 @@ void FillVP8DataStructures(const Vp8FrameHeader& frame_header, ...@@ -347,4 +348,10 @@ void FillVP8DataStructures(const Vp8FrameHeader& frame_header,
for (size_t i = 0; i < frame_header.num_of_dct_partitions; ++i) for (size_t i = 0; i < frame_header.num_of_dct_partitions; ++i)
slice_param->partition_size[i + 1] = frame_header.dct_partition_sizes[i]; slice_param->partition_size[i + 1] = frame_header.dct_partition_sizes[i];
} }
bool IsValidVABufferType(VABufferType type) {
return type < VABufferTypeMax || type == VAEncryptionParameterBufferType ||
type == VACencStatusParameterBufferType;
}
} // namespace media } // namespace media
...@@ -181,6 +181,9 @@ void FillVP8DataStructures(const Vp8FrameHeader& frame_header, ...@@ -181,6 +181,9 @@ void FillVP8DataStructures(const Vp8FrameHeader& frame_header,
VAProbabilityDataBufferVP8* prob_buf, VAProbabilityDataBufferVP8* prob_buf,
VAPictureParameterBufferVP8* pic_param, VAPictureParameterBufferVP8* pic_param,
VASliceParameterBufferVP8* slice_param); VASliceParameterBufferVP8* slice_param);
bool IsValidVABufferType(VABufferType type);
} // namespace media } // namespace media
#endif // MEDIA_GPU_VAAPI_VAAPI_UTILS_H_ #endif // MEDIA_GPU_VAAPI_VAAPI_UTILS_H_
...@@ -484,11 +484,6 @@ bool IsBlockedDriver(VaapiWrapper::CodecMode mode, VAProfile va_profile) { ...@@ -484,11 +484,6 @@ bool IsBlockedDriver(VaapiWrapper::CodecMode mode, VAProfile va_profile) {
return false; return false;
} }
bool IsValidVABufferType(VABufferType type) {
return type < VABufferTypeMax || type == VAEncryptionParameterBufferType ||
type == VACencStatusParameterBufferType;
}
// This class is a wrapper around its |va_display_| (and its associated // This class is a wrapper around its |va_display_| (and its associated
// |va_lock_|) to guarantee mutual exclusion and singleton behaviour. // |va_lock_|) to guarantee mutual exclusion and singleton behaviour.
class VADisplayState { class VADisplayState {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment