• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_RENDERER_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_RENDERER_FACTORY_H_
7 
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h"
11 #include "content/renderer/media/media_stream_audio_renderer.h"
12 #include "content/renderer/media/video_frame_provider.h"
13 #include "url/gurl.h"
14 
15 namespace content {
16 
17 // MediaStreamRendererFactory is used by WebMediaPlayerMS to create audio and
18 // video feeds from a MediaStream provided an URL.
19 // The factory methods are virtual in order for blink layouttests to be able to
20 // override them.
21 class CONTENT_EXPORT MediaStreamRendererFactory {
22  public:
23   MediaStreamRendererFactory();
24   virtual ~MediaStreamRendererFactory();
25 
26   virtual scoped_refptr<VideoFrameProvider> GetVideoFrameProvider(
27       const GURL& url,
28       const base::Closure& error_cb,
29       const VideoFrameProvider::RepaintCB& repaint_cb);
30 
31   virtual scoped_refptr<MediaStreamAudioRenderer> GetAudioRenderer(
32       const GURL& url,
33       int render_view_id,
34       int render_frame_id);
35 
36  private:
37   DISALLOW_COPY_AND_ASSIGN(MediaStreamRendererFactory);
38 };
39 
40 }  // namespace content
41 
42 #endif  // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_RENDERER_FACTORY_H_
43