chromium/third_party/blink/renderer/modules/webcodecs/video_frame_rect_util.cc

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

#include "third_party/blink/renderer/modules/webcodecs/video_frame_init_util.h"

#include <stdint.h>
#include <cmath>
#include <limits>

#include "media/base/limits.h"
#include "media/base/video_frame.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_dom_rect_init.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace blink {

namespace {

// Safely converts a double to a non-negative int, as required for gfx::Rect.
int32_t ToInt31(double value,
                const char* object_name,
                const char* property_name,
                ExceptionState& exception_state) {}

}  // namespace

gfx::Rect ToGfxRect(const DOMRectInit* rect,
                    const char* rect_name,
                    const gfx::Size& coded_size,
                    ExceptionState& exception_state) {}

bool ValidateOffsetAlignment(media::VideoPixelFormat format,
                             const gfx::Rect& rect,
                             const char* rect_name,
                             ExceptionState& exception_state) {}

int PlaneSize(int frame_size, int sample_size) {}

gfx::Rect PlaneRect(gfx::Rect frame_rect, gfx::Size sample_size) {}

}  // namespace blink