[M120 Migration][MM] Framerate calculation
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / playback_events_recorder.mojom
1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 module media.mojom;
6
7 import "media/mojo/mojom/media_types.mojom";
8 import "ui/gfx/geometry/mojom/geometry.mojom";
9
10 // PlaybackEventsRecorder allows to observe and record events occurring in the
11 // media pipeline. The interface is called by the renderer process (in
12 // blink::WebMediaPlayerImpl), while the implementation normally runs in the
13 // browser.
14 interface PlaybackEventsRecorder {
15   // Called when player has been started or resumed.
16   OnPlaying();
17
18   // Called when player has been paused.
19   OnPaused();
20
21   // Called when player position is being changed.
22   OnSeeking();
23
24   // Called when the player has reached the end of the current file.
25   OnEnded();
26
27   // Called when playback has failed due to the specified error.
28   OnError(PipelineStatus status);
29
30   // Called when playback has been suspended while buffering the media.
31   OnBuffering();
32
33   // Called after media buffering has completed. The player is in buffering
34   // state after the following events until this method is called:
35   //  1. Player initialized (i.e. after PlaybackEventsRecorder is created).
36   //  2. Seek operation, see OnSeeking().
37   //  3. Buffering started, see OnBuffering().
38   OnBufferingComplete();
39
40   // Called when video playback starts and every time video resolution changes.
41   OnNaturalSizeChanged(gfx.mojom.Size size);
42
43   // Called periodically (e.g. every second) while playback is active.
44   OnPipelineStatistics(PipelineStatistics stats);
45 };