chromium/components/viz/service/frame_sinks/video_detector.cc

// Copyright 2017 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 "components/viz/service/frame_sinks/video_detector.h"

#include <memory>
#include <utility>
#include <vector>

#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "components/viz/common/features.h"
#include "components/viz/common/quads/compositor_frame.h"
#include "components/viz/common/quads/draw_quad.h"
#include "components/viz/common/quads/texture_draw_quad.h"
#include "components/viz/service/surfaces/surface.h"
#include "components/viz/service/surfaces/surface_manager.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"

namespace viz {

constexpr base::TimeDelta VideoDetector::kMaxVideoTimeout;
constexpr base::TimeDelta VideoDetector::kMinVideoTimeout;
constexpr base::TimeDelta VideoDetector::kMinVideoDuration;

// Stores information about updates to a client and determines whether it's
// likely that a video is playing in it.
class VideoDetector::ClientInfo {};

VideoDetector::VideoDetector(
    const std::vector<FrameSinkId>& registered_frame_sink_ids,
    SurfaceManager* surface_manager,
    const base::TickClock* tick_clock,
    scoped_refptr<base::SequencedTaskRunner> task_runner)
    :{}

VideoDetector::~VideoDetector() {}

void VideoDetector::OnVideoActivityEnded() {}

void VideoDetector::AddObserver(
    mojo::PendingRemote<mojom::VideoDetectorObserver> pending_observer) {}

void VideoDetector::OnFrameSinkIdRegistered(const FrameSinkId& frame_sink_id) {}

void VideoDetector::OnFrameSinkIdInvalidated(const FrameSinkId& frame_sink_id) {}

bool VideoDetector::OnSurfaceDamaged(const SurfaceId& surface_id,
                                     const BeginFrameAck& ack,
                                     HandleInteraction handle_interaction) {}

// |surface| is scheduled to be drawn. See if it has a new frame since the
// last time it was drawn and record the damage.
void VideoDetector::OnSurfaceWillBeDrawn(Surface* surface) {}

}  // namespace viz