chromium/remoting/codec/webrtc_video_encoder_av1.cc

// Copyright 2022 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 "remoting/codec/webrtc_video_encoder_av1.h"

#include <algorithm>

#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/system/sys_info.h"
#include "remoting/base/cpu_utils.h"
#include "remoting/base/util.h"
#include "remoting/codec/utils.h"
#include "third_party/libaom/source/libaom/aom/aom_image.h"
#include "third_party/libaom/source/libaom/aom/aomcx.h"
#include "third_party/libyuv/include/libyuv/convert_from_argb.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_region.h"

namespace remoting {

namespace {

void DestroyAomCodecContext(aom_codec_ctx_t* codec_ctx) {}

// Minimum target bitrate per megapixel.
// TODO(joedow): Perform some additional testing to see if this needs tweaking.
constexpr int kAv1MinimumTargetBitrateKbpsPerMegapixel =;

// Use the highest possible encoder speed as it produces frames faster than the
// lower settings, requires fewer CPU resources, and still has low bitrates.
constexpr int kAv1DefaultEncoderSpeed =;

}  // namespace

WebrtcVideoEncoderAV1::WebrtcVideoEncoderAV1()
    :{}
WebrtcVideoEncoderAV1::~WebrtcVideoEncoderAV1() = default;

void WebrtcVideoEncoderAV1::SetLosslessColor(bool want_lossless) {}

void WebrtcVideoEncoderAV1::SetEncoderSpeed(int encoder_speed) {}

void WebrtcVideoEncoderAV1::SetUseActiveMap(bool use_active_map) {}

bool WebrtcVideoEncoderAV1::InitializeCodec(const webrtc::DesktopSize& size) {}

void WebrtcVideoEncoderAV1::PrepareImage(
    const webrtc::DesktopFrame* frame,
    webrtc::DesktopRegion& updated_region) {}

void WebrtcVideoEncoderAV1::ConfigureCodecParams() {}

void WebrtcVideoEncoderAV1::UpdateConfig(const FrameParams& params) {}

void WebrtcVideoEncoderAV1::Encode(std::unique_ptr<webrtc::DesktopFrame> frame,
                                   const FrameParams& params,
                                   EncodeCallback done) {}

}  // namespace remoting