#include "third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.h"
#include <memory>
#include <utility>
#include "base/trace_event/trace_event.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_video_frame_callback_metadata.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/scripted_animation_controller.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/timing/performance.h"
#include "third_party/blink/renderer/core/timing/time_clamper.h"
#include "third_party/blink/renderer/modules/video_rvfc/video_frame_request_callback_collection.h"
#include "third_party/blink/renderer/modules/xr/xr_frame_provider.h"
#include "third_party/blink/renderer/modules/xr/xr_session.h"
#include "third_party/blink/renderer/modules/xr/xr_system.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
static bool IsFrameRateRelativelyHigh(base::TimeDelta rendering_interval,
base::TimeDelta average_frame_duration) { … }
}
VideoFrameCallbackRequesterImpl::VideoFrameCallbackRequesterImpl(
HTMLVideoElement& element)
: … { … }
VideoFrameCallbackRequesterImpl::~VideoFrameCallbackRequesterImpl() = default;
VideoFrameCallbackRequesterImpl& VideoFrameCallbackRequesterImpl::From(
HTMLVideoElement& element) { … }
int VideoFrameCallbackRequesterImpl::requestVideoFrameCallback(
HTMLVideoElement& element,
V8VideoFrameRequestCallback* callback) { … }
void VideoFrameCallbackRequesterImpl::cancelVideoFrameCallback(
HTMLVideoElement& element,
int callback_id) { … }
void VideoFrameCallbackRequesterImpl::OnWebMediaPlayerCreated() { … }
void VideoFrameCallbackRequesterImpl::OnWebMediaPlayerCleared() { … }
void VideoFrameCallbackRequesterImpl::ScheduleWindowRaf() { … }
void VideoFrameCallbackRequesterImpl::ScheduleExecution() { … }
void VideoFrameCallbackRequesterImpl::OnImmersiveSessionStart() { … }
void VideoFrameCallbackRequesterImpl::OnImmersiveSessionEnd() { … }
void VideoFrameCallbackRequesterImpl::OnImmersiveFrame() { … }
XRFrameProvider* VideoFrameCallbackRequesterImpl::GetXRFrameProvider() { … }
bool VideoFrameCallbackRequesterImpl::TryScheduleImmersiveXRSessionRaf() { … }
void VideoFrameCallbackRequesterImpl::OnRequestVideoFrameCallback() { … }
void VideoFrameCallbackRequesterImpl::ExecuteVideoFrameCallbacks(
double high_res_now_ms,
std::unique_ptr<WebMediaPlayer::VideoFramePresentationMetadata>
frame_metadata) { … }
void VideoFrameCallbackRequesterImpl::OnExecution(double high_res_now_ms) { … }
double VideoFrameCallbackRequesterImpl::GetClampedTimeInMillis(
base::TimeDelta time,
bool cross_origin_isolated_capability) { … }
double VideoFrameCallbackRequesterImpl::GetCoarseClampedTimeInSeconds(
base::TimeDelta time) { … }
int VideoFrameCallbackRequesterImpl::requestVideoFrameCallback(
V8VideoFrameRequestCallback* callback) { … }
void VideoFrameCallbackRequesterImpl::RegisterCallbackForTest(
VideoFrameRequestCallbackCollection::VideoFrameCallback* callback) { … }
void VideoFrameCallbackRequesterImpl::cancelVideoFrameCallback(int id) { … }
void VideoFrameCallbackRequesterImpl::Trace(Visitor* visitor) const { … }
}