Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / mojo / services / html_viewer / webmediaplayer_factory.h
bloba7050096d0f2279834ff4fc48d5dced0cb91e19c
1 // Copyright 2014 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.
5 #ifndef MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_
6 #define MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread.h"
12 #include "media/audio/fake_audio_log_factory.h"
13 #include "media/base/audio_hardware_config.h"
15 namespace base {
16 class SingleThreadTaskRunner;
19 namespace blink {
20 class WebMediaPlayer;
21 class WebLocalFrame;
22 class WebURL;
23 class WebMediaPlayerClient;
26 namespace media {
27 class AudioManager;
28 class AudioRendererSink;
31 namespace mojo {
33 class Shell;
35 // Helper class used to create blink::WebMediaPlayer objects.
36 // This class stores the "global state" shared across all WebMediaPlayer
37 // instances.
38 class WebMediaPlayerFactory {
39 public:
40 explicit WebMediaPlayerFactory(const scoped_refptr<
41 base::SingleThreadTaskRunner>& compositor_task_runner,
42 bool enable_mojo_media_renderer);
43 ~WebMediaPlayerFactory();
45 blink::WebMediaPlayer* CreateMediaPlayer(
46 blink::WebLocalFrame* frame,
47 const blink::WebURL& url,
48 blink::WebMediaPlayerClient* client,
49 Shell* shell);
51 private:
52 const media::AudioHardwareConfig& GetAudioHardwareConfig();
53 scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink();
54 scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner();
56 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
57 const bool enable_mojo_media_renderer_;
58 base::Thread media_thread_;
59 media::FakeAudioLogFactory fake_audio_log_factory_;
60 scoped_ptr<media::AudioManager> audio_manager_;
61 media::AudioHardwareConfig audio_hardware_config_;
63 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerFactory);
66 } // namespace mojo
68 #endif // MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_