OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_BASE_MEDIAPLAYER_OBSERVER_H_ | |
6 #define MEDIA_BASE_MEDIAPLAYER_OBSERVER_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "media/base/audio_decoder_config.h" | |
10 #include "media/base/cdm_context.h" | |
11 #include "media/base/video_decoder_config.h" | |
12 | |
13 namespace media { | |
14 | |
15 // This class is an observer of a media player and can trigger a pipeline | |
16 // restart (suspend/resume) to switch renderer if the callback is set. | |
17 class MediaPlayerObserver { | |
18 public: | |
19 MediaPlayerObserver(); | |
20 virtual ~MediaPlayerObserver(); | |
21 | |
22 // Called when the media element or its ancestor is entered/exited fullscreen. | |
23 virtual void OnEnteredFullscreen() = 0; | |
24 virtual void OnExitedFullscreen() = 0; | |
25 | |
26 // Called when CDM is attached to a media element. | |
27 virtual void OnSetCdm(CdmContext* cdm_context) = 0; | |
28 | |
29 // Set video/audio config after demuxer is initialized. | |
30 virtual void OnDecoderConfigChanged( | |
31 const AudioDecoderConfig& audio_config, | |
32 const VideoDecoderConfig& video_config) = 0; | |
33 | |
34 // Set the callback to schedule restart of pipeline to switch renderer. | |
35 using SwitchRendererCallback = base::Callback<void()>; | |
36 virtual void SetSwitchRenderCallback(const SwitchRendererCallback& cb) = 0; | |
miu
2016/09/30 08:12:10
Hmm...Everything except this looks like an "observ
xjz
2016/10/01 00:28:41
Done.
| |
37 | |
38 private: | |
39 DISALLOW_COPY_AND_ASSIGN(MediaPlayerObserver); | |
miu
2016/09/30 08:12:10
This doesn't belong in a pure virtual interface, s
xjz
2016/10/01 00:28:41
Removed.
| |
40 }; | |
41 | |
42 } // namespace media | |
43 | |
44 #endif // MEDIA_BASE_MEDIAPLAYER_OBSERVER_H_ | |
OLD | NEW |