Index: media/base/renderer_controller.h |
diff --git a/media/base/renderer_controller.h b/media/base/renderer_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..120f9d383d5b7db337e0618df5170340cc27dc49 |
--- /dev/null |
+++ b/media/base/renderer_controller.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2016 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. |
+ |
+#ifndef MEDIA_BASE_RENDERER_CONTROLLER_H_ |
+#define MEDIA_BASE_RENDERER_CONTROLLER_H_ |
+ |
+#include "base/callback.h" |
+#include "media/base/audio_decoder_config.h" |
+#include "media/base/cdm_context.h" |
+#include "media/base/video_decoder_config.h" |
+ |
+namespace media { |
+ |
+// This class is an observer of media::WebMediaPlayerImpl and can trigger a |
miu
2016/09/28 01:33:31
Don't mention WebMediaPlayerImpl in the comments b
xjz
2016/09/29 22:54:21
Done.
|
+// pipeline restart (suspend/resume) to switch renderer. |
+class RendererController { |
miu
2016/09/28 01:33:31
naming: Now that I've seen the code, I think this
xjz
2016/09/29 22:54:21
Renamed it as MediaPlayerObserver, since it could
|
+ public: |
+ RendererController(); |
+ virtual ~RendererController(); |
+ |
+ // Called when the media element or its ancestor is entered/exited fullscreen. |
+ virtual void OnEnteredFullscreen() = 0; |
+ virtual void OnExitedFullscreen() = 0; |
+ |
+ // Called when CDM is attached to a media element. |
+ virtual void OnSetCdm(CdmContext* cdm_context) = 0; |
+ |
+ // Set video/audio config after demuxer is initialized. |
+ virtual void OnSetDecoderConfig(const AudioDecoderConfig& audio_config, |
+ const VideoDecoderConfig& video_config) = 0; |
+ |
+ // Set the callback to schedule restart of pipeline to switch renderer. |
+ using SwitchRendererCallback = base::Callback<void()>; |
+ virtual void SetSwitchRenderCallback(const SwitchRendererCallback& cb) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(RendererController); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_BASE_RENDERER_CONTROLLER_H_ |