Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Side by Side Diff: media/base/mediaplayer_observer.h

Issue 2204673004: WIP - WebMediaPlayer switch media renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698