naiveproxy/media/mojo/interfaces/media_metrics_provider.mojom

61 lines
2.1 KiB
Plaintext
Raw Normal View History

2018-12-10 05:59:24 +03:00
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module media.mojom;
import "media/mojo/interfaces/media_types.mojom";
import "media/mojo/interfaces/video_decode_stats_recorder.mojom";
import "media/mojo/interfaces/watch_time_recorder.mojom";
import "mojo/public/mojom/base/time.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom";
// Used for reporting to UMA and UKM. Represents the URL scheme of the src URL
// given to an <audio> or <video> tag. Always add new entries to the end.
enum MediaURLScheme {
kUnknown = 0,
kMissing,
kHttp,
kHttps,
kFtp,
kChromeExtension,
kJavascript,
kFile,
kBlob,
kData,
kFileSystem,
kChrome,
kContent,
kContentId,
};
// Provider interface used to avoid having one time setters on each interface.
// Each recorder will be stamped with an ID which can be used for linking UKM.
interface MediaMetricsProvider {
// Assigns a playback ID and sets up this provider instance with information
// needed to make UKM reports. No other methods may be called until after
// Initialize() has been called. |url_scheme| is only used if |!is_mse|.
Initialize(bool is_mse, MediaURLScheme url_scheme);
// Called when a playback ends in error. The status is reported to UKM when
// the provider is destructed.
OnError(PipelineStatus status);
// Setters for various one-time lazily generated metrics or properties.
SetIsEME();
SetTimeToMetadata(mojo_base.mojom.TimeDelta elapsed);
SetTimeToFirstFrame(mojo_base.mojom.TimeDelta elapsed);
SetTimeToPlayReady(mojo_base.mojom.TimeDelta elapsed);
// For src= playbacks, this is the container (".mp4", ".webm", etc).
SetContainerName(MediaContainerName container_name);
// Creates a WatchTimeRecorder instance using |properties|. If any of those
// properties changes, a new recorder should be requested.
AcquireWatchTimeRecorder(PlaybackProperties properties,
WatchTimeRecorder& recorder);
// Creates a VideoDecodeStatsRecorder instance.
AcquireVideoDecodeStatsRecorder(VideoDecodeStatsRecorder& recorder);
};