chromium/media/gpu/vaapi/vaapi_utils.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "media/gpu/vaapi/vaapi_utils.h"

#include <algorithm>
#include <type_traits>
#include <utility>

#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/synchronization/lock.h"
#include "build/chromeos_buildflags.h"
#include "media/gpu/vaapi/vaapi_common.h"
#include "media/gpu/vaapi/vaapi_wrapper.h"
#include "media/gpu/vp8_picture.h"
#include "media/gpu/vp8_reference_frame_vector.h"
#include "third_party/libva_protected_content/va_protected_content.h"

namespace media {

namespace {

template <typename To, typename From>
void CheckedMemcpy(To& to, From& from) {}

}  // namespace

// static
std::unique_ptr<ScopedVABufferMapping> ScopedVABufferMapping::Create(
    const base::Lock* lock,
    VADisplay va_display,
    VABufferID buffer_id) {}

ScopedVABufferMapping::ScopedVABufferMapping(const base::Lock* lock,
                                             VADisplay va_display,
                                             VABufferID buffer_id,
                                             void* va_buffer_data)
    :{}

ScopedVABufferMapping::~ScopedVABufferMapping() {}

// static
std::unique_ptr<ScopedVABuffer> ScopedVABuffer::Create(
    base::Lock* lock,
    VADisplay va_display,
    VAContextID va_context_id,
    VABufferType va_buffer_type,
    size_t size) {}

// static
std::unique_ptr<ScopedVABuffer> ScopedVABuffer::CreateForTesting(
    VABufferID va_buffer_id,
    VABufferType va_buffer_type,
    size_t size) {}

ScopedVABuffer::ScopedVABuffer(base::Lock* lock,
                               VADisplay va_display,
                               VABufferID va_buffer_id,
                               VABufferType va_buffer_type,
                               size_t size)
    :{}

ScopedVABuffer::~ScopedVABuffer() {}

// static
std::unique_ptr<ScopedVAImage> ScopedVAImage::Create(
    base::Lock* lock,
    VADisplay va_display,
    VASurfaceID va_surface_id,
    const VAImageFormat& format,
    const gfx::Size& size) {}

ScopedVAImage::ScopedVAImage(base::Lock* lock,
                             VADisplay va_display,
                             const VAImage& image,
                             std::unique_ptr<ScopedVABufferMapping> va_buffer)
    :{}

ScopedVAImage::~ScopedVAImage() {}

ScopedVASurface::ScopedVASurface(scoped_refptr<VaapiWrapper> vaapi_wrapper,
                                 VASurfaceID va_surface_id,
                                 const gfx::Size& size,
                                 unsigned int va_rt_format)
    :{}

ScopedVASurface::~ScopedVASurface() {}

bool ScopedVASurface::IsValid() const {}

void FillVP8DataStructures(const Vp8FrameHeader& frame_header,
                           const Vp8ReferenceFrameVector& reference_frames,
                           VAIQMatrixBufferVP8* iq_matrix_buf,
                           VAProbabilityDataBufferVP8* prob_buf,
                           VAPictureParameterBufferVP8* pic_param,
                           VASliceParameterBufferVP8* slice_param) {}

bool IsValidVABufferType(VABufferType type) {}

}  // namespace media