chromium/media/gpu/av1_decoder.cc

// Copyright 2020 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/av1_decoder.h"

#include <bitset>
#include <utility>

#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/ranges/algorithm.h"
#include "media/base/limits.h"
#include "media/base/media_switches.h"
#include "media/gpu/av1_picture.h"
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
#include "third_party/libgav1/src/src/decoder_state.h"
#include "third_party/libgav1/src/src/gav1/status_code.h"
#include "third_party/libgav1/src/src/utils/constants.h"
#include "ui/gfx/hdr_metadata.h"

namespace media {
namespace {
// (Section 6.4.1):
//
// - "An operating point specifies which spatial and temporal layers should be
//   decoded."
//
// - "The order of operating points indicates the preferred order for producing
//   an output: a decoder should select the earliest operating point in the list
//   that meets its decoding capabilities as expressed by the level associated
//   with each operating point."
//
// For simplicity, we always select operating point 0 and will validate that it
// doesn't have scalability information.
constexpr unsigned int kDefaultOperatingPoint =;

// Conversion function from libgav1 profiles to media::VideoCodecProfile.
VideoCodecProfile AV1ProfileToVideoCodecProfile(
    libgav1::BitstreamProfile profile) {}

// Returns true iff the current decode sequence has multiple spatial layers.
bool IsSpatialLayerDecoding(int operating_point_idc) {}

bool IsValidBitDepth(uint8_t bit_depth, VideoCodecProfile profile) {}

VideoChromaSampling GetAV1ChromaSampling(
    const libgav1::ColorConfig& color_config) {}

gfx::HdrMetadataSmpteSt2086 ToGfxSmpteSt2086(
    const libgav1::ObuMetadataHdrMdcv& mdcv) {}

gfx::HdrMetadataCta861_3 ToGfxCta861_3(const libgav1::ObuMetadataHdrCll& cll) {}
}  // namespace

scoped_refptr<AV1Picture> AV1Decoder::AV1Accelerator::CreateAV1PictureSecure(
    bool apply_grain,
    uint64_t secure_handle) {}

AV1Decoder::AV1Accelerator::Status AV1Decoder::AV1Accelerator::SetStream(
    base::span<const uint8_t> stream,
    const DecryptConfig* decrypt_config) {}

AV1Decoder::AV1Decoder(std::unique_ptr<AV1Accelerator> accelerator,
                       VideoCodecProfile profile,
                       const VideoColorSpace& container_color_space)
    :{}

AV1Decoder::~AV1Decoder() {}

bool AV1Decoder::Flush() {}

void AV1Decoder::Reset() {}

void AV1Decoder::SetStream(int32_t id, const DecoderBuffer& decoder_buffer) {}

void AV1Decoder::ClearCurrentFrame() {}

AcceleratedVideoDecoder::DecodeResult AV1Decoder::Decode() {}

AcceleratedVideoDecoder::DecodeResult AV1Decoder::DecodeInternal() {}

void AV1Decoder::UpdateReferenceFrames(scoped_refptr<AV1Picture> pic) {}

void AV1Decoder::ClearReferenceFrames() {}

bool AV1Decoder::CheckAndCleanUpReferenceFrames() {}

AV1Decoder::AV1Accelerator::Status AV1Decoder::DecodeAndOutputPicture(
    scoped_refptr<AV1Picture> pic,
    const libgav1::Vector<libgav1::TileBuffer>& tile_buffers) {}

std::optional<gfx::HDRMetadata> AV1Decoder::GetHDRMetadata() const {}

gfx::Size AV1Decoder::GetPicSize() const {}

gfx::Rect AV1Decoder::GetVisibleRect() const {}

VideoCodecProfile AV1Decoder::GetProfile() const {}

uint8_t AV1Decoder::GetBitDepth() const {}

VideoChromaSampling AV1Decoder::GetChromaSampling() const {}

VideoColorSpace AV1Decoder::GetVideoColorSpace() const {}

size_t AV1Decoder::GetRequiredNumOfPictures() const {}

size_t AV1Decoder::GetNumReferenceFrames() const {}
}  // namespace media